Giter Club home page Giter Club logo

Comments (16)

jacobgreenleaf avatar jacobgreenleaf commented on August 29, 2024

Can you paste the output of this shell command?

$ docker run --link incusredis:redis jwgur/incus env

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024
$ docker run --link incusredis:redis jwgur/incus env
PATH=/go/bin:/usr/src/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=eb381f10fb02
REDIS_PORT=tcp://172.17.0.9:6379
REDIS_PORT_6379_TCP=tcp://172.17.0.9:6379
REDIS_PORT_6379_TCP_ADDR=172.17.0.9
REDIS_PORT_6379_TCP_PORT=6379
REDIS_PORT_6379_TCP_PROTO=tcp
REDIS_NAME=/clever_jones/redis
REDIS_ENV_REDIS_VERSION=3.0.3
REDIS_ENV_REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-3.0.3.tar.gz
REDIS_ENV_REDIS_DOWNLOAD_SHA1=0e2d7707327986ae652df717059354b358b83358
GOLANG_VERSION=1.4.2
GOPATH=/go
HOME=/root

from incus.

jacobgreenleaf avatar jacobgreenleaf commented on August 29, 2024

It's hard to tell what commands you ran in the gist you sent me. The command to start Incus (under Docker) should be:

$ docker run --env-file=incus.conf -e REDIS_ENABLED=true --link incusredis:redis -p 4000:4000 jwgur/incus

The message you saw (2015/08/25 16:23:51 Redis connect failed: dial tcp 127.0.0.1:6379: connection refused) can only occur when the environment variable REDIS_PORT_6379_TCP_ADDR is not set, as 127.0.0.1 is its default value. --link tells docker to set that environment variable, so try running that exact command as pasted above?

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

I ran the exact commands that are in the readme https://github.com/Imgur/incus#method-1-docker
and hmm some stuff got cut off it seems
Let me do it again from scratch and produce a new gist

hmm but according to the last paste the redis should be @ tcp://172.17.0.9:6379 and not 127.0.01:6379?

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

ok updated the gist https://gist.github.com/AdriVanHoudt/b71c181a00289fbd9fbf

from incus.

jacobgreenleaf avatar jacobgreenleaf commented on August 29, 2024

@AdriVanHoudt Perhaps --env-file is overwriting the link environment variables. Try removing these lines from your incus.conf?

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

that seems to work thanks! any tips on how to start using it? the incusjs module does not work for node

from incus.

jacobgreenleaf avatar jacobgreenleaf commented on August 29, 2024

What's wrong with the incusjs module on node?

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

just doing

var IncusClient = require('incusjs');

var incus = new IncusClient('http://localhost:4000', 'UID', '/page/path');

results in

/Users/adri/Projects/.../incus/node_modules/incusjs/src/incus.js:29
    this.poll = new XMLHttpRequest();
                    ^
ReferenceError: XMLHttpRequest is not defined
    at Incus.longpoll (/Users/adri/Projects/.../incus/node_modules/incusjs/src/incus.js:29:21)
    at Incus.connect (/Users/adri/Projects/.../incus/node_modules/incusjs/src/incus.js:78:10)
    at new Incus (/Users/adri/Projects/.../incus/node_modules/incusjs/src/incus.js:19:10)
    at Object.<anonymous> (/Users/adri/Projects/.../incus/index.js:3:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

from incus.

jacobgreenleaf avatar jacobgreenleaf commented on August 29, 2024

Oh, right. We are gonna be transitioning to use request or something, but for now incusjs is just for the browser.

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

I can probably shim it with https://www.npmjs.com/package/xmlhttprequest
Can I recommend https://www.npmjs.com/package/wreck ? ;)

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

window is not defined...

Can you give a quick guide/tips on how to communicate with the docker/incus? Then I can make it myself for node (will oss it ofc)

Also I will close the issue now since the original question was answered

from incus.

jacobgreenleaf avatar jacobgreenleaf commented on August 29, 2024

@AdriVanHoudt Incus listens on port 4000. You can, for example, curl /lp to long-poll over HTTP:

$ curl -i http://rt.imgur.com/lp?page=/gallery/ADxBC1S\&user=foo
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: keep-alive
Content-Type: application/json
Date: Thu, 27 Aug 2015 09:40:18 GMT
Content-Length: 89

{"event":"imagePoints","data":{"downs":32,"hash":"ADxBC1S","ups":1215},"time":1440668418}

Or you can use the incusjs library in the browser to use websockets.

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

ok cool, looking at the incusjs to see how to talk to injus rest wise
seems a bit weird to do GET that results in sending out a notification but ok ^^
Once I am done I might do a pr with some docs or just make a node module with all the info

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

ok having some troubles setting it up further. I need to publish to the redis, which does not have an open port? So I tried a local redis but Incus won't connect to it
Also tried docker run --env-file incus.conf -d -e REDIS_PORT_6379_TCP_ADDR=dockerhost -e REDIS_PORT_6379_TCP_PORT=6379 --add-host=dockerhost:127.0.0.1 --name incus -e REDIS_ENABLED=true -p 4000:4000 jwgur/incus with no result

from incus.

AdriVanHoudt avatar AdriVanHoudt commented on August 29, 2024

ok so I exposed the redis port like the Incus port and I have found out how docker on mac works and that it needs special care with ip addresses (since docker is ran inside a virtual box), all good now

from incus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.