Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To start #6

Closed
johnroper100 opened this issue Aug 1, 2017 · 12 comments
Closed

How To start #6

johnroper100 opened this issue Aug 1, 2017 · 12 comments
Labels

Comments

@johnroper100
Copy link

Hi,
I think this project is very cool, but I don't know how to run it.

@SpComb
Copy link
Member

SpComb commented Aug 1, 2017

The recommended way to run the project is using Docker. I haven't pushed pre-built images to the Docker Hub yet, but if you have Docker installed, you can build the images yourself:

$ git clone https://github.com/qmsk/dmx.git qmsk-dmx && cd qmsk-dmx
$ docker build -t qmsk/dmx .
$ docker run --rm --name qmsk-dmx -v $PWD/config:/go/src/github.com/qmsk/dmx/config:ro -e ARTNET_DISCOVERY=2.255.255.255 -p 8000:8000 qmsk/dmx

The -v $PWD/config:/go/src/github.com/qmsk/dmx/config:ro allows loading any modified config from ./config when restarting, and the -p 8000:8000 allows accessing the API/UI at http://localhost:8000. The -e ARTNET_DISCOVERY=2.255.255.255 is a comma-separated list of unicast/broadcast addresses for sending ArtNet discovery/data UDP packets.

The project is still missing a lot of features like configuration reloads that would be essential for general-purpose use, so I figure this is still mainly for those interested in developing DMX controllers using the Go/REST APIs themselves. I'll consider making actual releases once the project is a bit further along, I'm pretty sure I'm still the only one actually using this ATM.

@SpComb SpComb added the question label Aug 1, 2017
@johnroper100
Copy link
Author

Ok, I'll try that. I'd love to use this project.

@johnroper100
Copy link
Author

Ok, I ran the docker build command and got this error/output:

docker build -t qmsk/dmx .
Sending build context to Docker daemon    663kB
Step 1/13 : FROM ubuntu:xenial
 ---> 14f60031763d
Step 2/13 : RUN apt-get update && apt-get install -y   git   golang-go   nodejs nodejs-legacy npm
 ---> Using cache
 ---> b0a081fa933a
Step 3/13 : ENV GOPATH /go
 ---> Using cache
 ---> 0be21d22a4c4
Step 4/13 : ADD . /go/src/github.com/qmsk/dmx
 ---> 1d09e58f108a
Removing intermediate container a61f371fc39f
Step 5/13 : WORKDIR /go/src/github.com/qmsk/dmx/web
 ---> 14fb9a119baf
Removing intermediate container 6451f68fbb33
Step 6/13 : RUN npm install
 ---> Running in 59c4d230d0a5
qmsk-dmx@0.0.1 /go/src/github.com/qmsk/dmx/web
+-- @angular/common@4.0.1
+-- @angular/compiler@4.0.1
+-- @angular/core@4.0.1
+-- @angular/forms@4.0.1
+-- @angular/http@4.0.1
+-- @angular/platform-browser@4.0.1
+-- @angular/platform-browser-dynamic@4.0.1
+-- @angular/router@4.0.1
+-- @types/lodash@4.14.71
+-- @types/node@6.0.85
+-- core-js@2.4.1
+-- lodash@4.17.4
+-- material-design-icons@3.0.1
+-- normalize.css@6.0.0
+-- reflect-metadata@0.1.10
+-- rxjs@5.2.0
| `-- symbol-observable@1.0.4
+-- spinkit@1.2.5
+-- systemjs@0.20.11
+-- typescript@2.4.2
`-- zone.js@0.8.5

 ---> 644e0a91f33d
Removing intermediate container 59c4d230d0a5
Step 7/13 : RUN ./node_modules/typescript/bin/tsc
 ---> Running in db77eabd59c5
node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
      Type 'Observable<T>' is not assignable to type 'Observable<R>'.
        Type 'T' is not assignable to type 'R'.
The command '/bin/sh -c ./node_modules/typescript/bin/tsc' returned a non-zero code: 2

@SpComb
Copy link
Member

SpComb commented Aug 1, 2017

It looks like the web development dependencies are specified too loosely, and they're not included in the npm-shrinkwrap.... I've built it with typescript 2.2 and 2.3, but it looks like the newest typescript 2.4 is not compatible.

You can try fixing the web/package.json -> { "devDependencies": { "typescript": "^2.2.0" } } to pin to a more specific version that does not match the 2.4.2 version that your build failed with... I think either ~2.2.0 or ~2.3.4 should work.

@johnroper100
Copy link
Author

Setting it to ~2.3.4 worked!

@johnroper100
Copy link
Author

I ran the docker image, but I am not able to access it from localhost:8000:

docker run --rm --name qmsk-dmx -v $PWD/config:/go/src/github.com/qmsk/dmx/config:ro -e ARTNET_DISCOVERY=2.255.255.25
5 -p 8000:8000 qmsk/dmx
INFO                                                      artnet.Controller: [::]:6454
INFO                                                      heads:loads path=library/american-dj/megatri60_mode2.toml: *heads.HeadType [american-dj megatri60_mode2]
INFO                                                      heads:loads path=library/generic/dimmer-1ch.toml: *heads.HeadType [generic dimmer-1ch]
INFO                                                      heads:loads path=library/stairville/ledpar56-5ch.toml: *heads.HeadType [stairville ledpar56-5ch]
INFO                                                      heads:loads path=config/colors.toml: *map[heads.ColorID]*heads.Color [colors]
INFO                                                      heads:loads path=config/groups.toml: *map[heads.GroupID]*heads.GroupConfig [groups]
INFO                                                      heads:loads path=config/heads.toml: *map[heads.HeadID]*heads.HeadConfig [heads]
INFO                                                      heads:loads path=config/presets/blackout.toml: *heads.PresetConfig [presets blackout]
INFO                                                      heads:loads path=config/presets/test.toml: *heads.PresetConfig [presets test]
INFO              qmsk.web:                               Serve static / from web/

@SpComb
Copy link
Member

SpComb commented Aug 3, 2017

The issue with typescript 2.4 was fixed in rxjs 5.4.2 (ReactiveX/rxjs#2540), updated both with more specific versions pinned + shrinkwrapped devDependencies.

Not sure about the issues accessing http://localhost:8000 - it seems to work for me with that docker run command. What OS are you using?

@johnroper100
Copy link
Author

I am on Windows. I will try to build again with the new fixes

@johnroper100
Copy link
Author

Still nothing:

 docker run --rm --name qmsk-dm2 -v $PWD/config:/go/src/github.com/qmsk/dmx/config:ro -e ARTNET_DISCOVERY=2.255.255.25
5 -p 8001:8000 qmsk/dmx
INFO                                                      artnet.Controller: [::]:6454
INFO                                                      heads:loads path=library/american-dj/megatri60_mode2.toml: *heads.HeadType [american-dj megatri60_mode2]
INFO                                                      heads:loads path=library/generic/dimmer-1ch.toml: *heads.HeadType [generic dimmer-1ch]
INFO                                                      heads:loads path=library/generic/led-argb.toml: *heads.HeadType [generic led-argb]
INFO                                                      heads:loads path=library/generic/led-rgb.toml: *heads.HeadType [generic led-rgb]
INFO                                                      heads:loads path=library/stairville/ledpar56-5ch.toml: *heads.HeadType [stairville ledpar56-5ch]
INFO                                                      heads:loads path=config/colors.toml: *map[heads.ColorID]*heads.Color [colors]
INFO                                                      heads:loads path=config/groups.toml: *map[heads.GroupID]*heads.GroupConfig [groups]
INFO                                                      heads:loads path=config/heads.toml: *map[heads.HeadID]*heads.HeadConfig [heads]
INFO                                                      heads:loads path=config/presets/blackout.toml: *heads.PresetConfig [presets blackout]
INFO                                                      heads:loads path=config/presets/test.toml: *heads.PresetConfig [presets test]
INFO              qmsk.web:                               Serve static / from web/

@SpComb
Copy link
Member

SpComb commented Aug 4, 2017

The command you pasted uses -p 8001:8000, which would publish on port 8001.... does http://localhost:8001/ then not work?

I'm not familiar enough with how Docker for Windows works... you could also try the container IP directly, check docker inspect -f '{{.NetworkSettings.IPAddress}}' qmsk-dmx and then try the http://172.17.0.X:8000 address directly?

@johnroper100
Copy link
Author

Ok, 8001 does not work either

@SpComb
Copy link
Member

SpComb commented Jun 11, 2019

Closing as unresolved issue with container networking on Windows.

@SpComb SpComb closed this as completed Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants