Hotrod Containerized#694
Conversation
pavolloffay
left a comment
There was a problem hiding this comment.
@gbaufake thanks! Just some minor things.
examples/Dockerfile
Outdated
| @@ -0,0 +1,4 @@ | |||
| FROM alpine | |||
There was a problem hiding this comment.
For the consistency could you please:
- use from
scratch COPY collector-linux /go/bin/
There was a problem hiding this comment.
Dockerfile should be in examples/hotrod directory
There was a problem hiding this comment.
@pavolloffay is this collector-linux folder in jaeger project? I didn't find it
examples/Dockerfile
Outdated
| @@ -0,0 +1,4 @@ | |||
| FROM alpine | |||
| EXPOSE 8080 | |||
There was a problem hiding this comment.
I think it should expose more ports
There was a problem hiding this comment.
What ports else do I need to export?
There was a problem hiding this comment.
When you run all it prints all used ports
| @@ -0,0 +1,41 @@ | |||
| # Hot R.O.D. - Rides on Demand - Containerized Version | |||
There was a problem hiding this comment.
Why new directory hotrod-containerized?
it can live in examples/hotrod and just add instructions to the original readme
There was a problem hiding this comment.
+1, I'd prefer all in one directory
There was a problem hiding this comment.
OK. Changing to one hotrod directory
examples/Dockerfile
Outdated
| FROM alpine | ||
| EXPOSE 8080 | ||
| COPY hotrod / | ||
| ENTRYPOINT ./main all |
There was a problem hiding this comment.
This allows using only all command. Maybe it's better to use just CMD with all
There was a problem hiding this comment.
Fwiw I never tested HotRod as individual processes
| - "8081:8081" | ||
| - "8082:8082" | ||
| - "8083:8083" | ||
| links: |
There was a problem hiding this comment.
Do we want compose file for this at all?
If so could you please remove links?
There was a problem hiding this comment.
From the author comments it does look like compose has some issues with ports. I would split it in a separate PR, assuming we even need it.
There was a problem hiding this comment.
@yurishkuro @pavolloffay I used docker-compose as "quick and easy way" to create booth jaegertracing/all-in-one container and jaegertracing/hotrod.
There was a problem hiding this comment.
+1 let's go with dockerfile and then add compose if necessary
|
How will we test that the generated image is operational? |
We could have similar tests to |
0398563 to
4e0bf0a
Compare
|
@pavolloffay and @yurishkuro I moved everything to Hotrod folder and adjusted minor things on Dockerfile. Examples: |
examples/hotrod/README.md
Outdated
|
|
||
| ``` | ||
| chmod +x ./create-image.sh | ||
| ./create-image.sh |
There was a problem hiding this comment.
x flag can be set and recorded in git. If not, the instruction can be sh ./create-image.sh
examples/hotrod/README.md
Outdated
|
|
||
|
|
||
| # HotROD on Containerized Version | ||
| ## Requirements |
There was a problem hiding this comment.
this is a bit confusing - the point is to let people run from published containers, is it not? In which case go is not a requirement. I think the instruction on how to run should be around L34. Basically think about it holistically - if someone who doesn't even know Go but wants to play with hotrod/jaeger, we should have instructions right at the top, and then below "if you want to build from source then ... (L34-39)"
There was a problem hiding this comment.
I would remove everything and just keep two docker run commands :)
examples/hotrod/README.md
Outdated
|
|
||
|
|
||
| [hotrod-tutorial]: https://medium.com/@YuriShkuro/take-opentracing-for-a-hotrod-ride-f6e3141f7941 | ||
| [hotrod-openshift]: https://blog.openshift.com/openshift-commons-briefing-82-distributed-tracing-with-jaeger-prometheus-on-kubernetes |
| make install | ||
| cd $GOPATH/src/github.com/jaegertracing/jaeger/examples/hotrod | ||
| CGO_ENABLED=0 GOOS=linux installsuffix=cgo go build -o collector-linux main.go | ||
| docker build -t jaegertracing/hotrod -f Dockerfile . |
There was a problem hiding this comment.
I think this won't be enough, we need to add this to Travis build and publish to docker hub along with other images.
@pavolloffay how would you like to proceed here? This might be getting a bit more involved for @gbaufake who is new to this repo. We could merge this (without README changes) and then make the build changes.
There was a problem hiding this comment.
agree, We can merge this with dockerfile only. Then I can add publish and test for it.
Rather then this script we could add make rules, otherwise there will be some repetition here and in the main makefile.
examples/hotrod/Dockerfile
Outdated
| @@ -0,0 +1,4 @@ | |||
| FROM scratch | |||
| EXPOSE 8080 | |||
There was a problem hiding this comment.
I think there are still some ports missing, look at logs when you start all
examples/hotrod/Dockerfile
Outdated
| @@ -0,0 +1,4 @@ | |||
| FROM scratch | |||
| EXPOSE 8080 | |||
| COPY . / | |||
There was a problem hiding this comment.
Could you please add only specific files and keed the name hotrod-demo?
examples/hotrod/README.md
Outdated
|
|
||
|
|
||
| # HotROD on Containerized Version | ||
| ## Requirements |
There was a problem hiding this comment.
I would remove everything and just keep two docker run commands :)
Signed-off-by: Guilherme Baufaker Rêgo <gbaufake@redhat.com>
Signed-off-by: Guilherme Baufaker Rêgo <gbaufake@redhat.com>
and some minor adjustments on Dockerfile Signed-off-by: Guilherme Baufaker Rêgo <gbaufake@redhat.com>
c40cb5f to
de53814
Compare
|
@pavolloffay @yurishkuro I have made the modifications that you asked. |
examples/hotrod/create-image.sh
Outdated
| cd $GOPATH/src/github.com/jaegertracing/jaeger | ||
| make install | ||
| cd $GOPATH/src/github.com/jaegertracing/jaeger/examples/hotrod | ||
| CGO_ENABLED=0 GOOS=linux installsuffix=cgo go build -o collector-linux main.go |
There was a problem hiding this comment.
nit: collector-linux => hotrod-linux
examples/hotrod/Dockerfile
Outdated
| FROM scratch | ||
| EXPOSE 8080 8081 8082 8083 | ||
| COPY collector-linux / | ||
| CMD ["./collector-linux", "all"] |
There was a problem hiding this comment.
nit: collector-linux => hotrod-linux
examples/hotrod/README.md
Outdated
|
|
||
|
|
||
|
|
||
| # HotROD on Containerized Version |
There was a problem hiding this comment.
I would prefer if we didn't change the readme at this time. The first docker command won't run since the hotrod image is not actually published.
de53814 to
ab25c02
Compare
- exposing more ports on Dockerfile and copy only binary to Dockerfile Signed-off-by: Guilherme Baufaker Rêgo <gbaufake@redhat.com>
ab25c02 to
d5250a6
Compare
|
@gbaufake thanks |
|
Static files are not present in the image. I am creating a fix for it. |
|
@pavolloffay |
Hello Jaeger,
I took the Hotrod example and tried to containerize it.
The odd behavior that is hard to predict is the random UDP port each time the container spins up
hotrod_1 | 2018-02-10T00:39:34.927Z ERROR log/logger.go:42 write udp 127.0.0.1:49372->127.0.0.1:6831: write: connection refused {"service": "frontend"}hotrod_1 | 2018-02-10T00:41:49.254Z ERROR log/logger.go:42 write udp 127.0.0.1:46555->127.0.0.1:6831: write: connection refused {"service": "frontend"}Is there some way to use one UDP port?
Best Regards,
Guilherme Baufaker Rêgo