Skip to content

Commit

Permalink
Publish hotrod image to docker hub
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay committed Feb 20, 2018
1 parent a631623 commit fc09869
Show file tree
Hide file tree
Showing 13 changed files with 323 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ matrix:
- go: 1.9
env:
- ES_INTEGRATION_TEST=true
- go: 1.9
env:
- HOTROD=true

services:
- docker
Expand Down Expand Up @@ -50,6 +53,7 @@ script:
- if [ "$CROSSDOCK" == true ]; then bash ./scripts/travis/build-crossdock.sh ; else echo 'skipping crossdock'; fi
- if [ "$DOCKER" == true ]; then bash ./scripts/travis/build-docker-images.sh ; else echo 'skipping docker images'; fi
- if [ "$ES_INTEGRATION_TEST" == true ]; then bash ./scripts/travis/es-integration-test.sh ; else echo 'skipping elastic search integration test'; fi
- if [ "$HOTROD" == true ]; then bash ./scripts/travis/hotrod-integration-test.sh ; else echo 'skipping hotrod example'; fi

after_success:
- if [ "$COVERAGE" == true ]; then travis_retry goveralls -coverprofile=cover.out -service=travis-ci || true ; else echo 'skipping coverage'; fi
Expand Down
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,19 @@ install-glide:
install: install-glide
glide install

.PHONY: install-go-bindata
install-go-bindata:
go get github.com/jteeuwen/go-bindata/...
go get github.com/elazarl/go-bindata-assetfs/...

.PHONY: build-examples
build-examples:
go build -o ./examples/hotrod/hotrod-demo ./examples/hotrod/main.go
build-examples: install-go-bindata
cd ./examples/hotrod/services/frontend/ && go-bindata-assetfs -pkg frontend web_assets/... && cd -
CGO_ENABLED=0 GOOS=linux installsuffix=cgo go build -o ./examples/hotrod/hotrod-linux ./examples/hotrod/main.go

.PHONE: docker-hotrod
docker-hotrod: build-examples
docker build -t $(DOCKER_NAMESPACE)/example-hotrod:${DOCKER_TAG} ./examples/hotrod

.PHONY: build_ui
build_ui:
Expand Down Expand Up @@ -177,7 +187,7 @@ docker-push:
if [ $$CONFIRM != "y" ] && [ $$CONFIRM != "Y" ]; then \
echo "Exiting." ; exit 1 ; \
fi
for component in agent cassandra-schema collector query ; do \
for component in agent cassandra-schema collector query example-hotrod; do \
docker push $(DOCKER_NAMESPACE)/jaeger-$$component ; \
done

Expand Down
2 changes: 1 addition & 1 deletion examples/hotrod/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hotrod-demo
hotrod-linux
4 changes: 2 additions & 2 deletions examples/hotrod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM scratch
EXPOSE 8080 8081 8082 8083
COPY hotrod-linux /
CMD ["./hotrod-linux", "all"]
COPY hotrod-linux /go/bin/
CMD ["/go/bin/hotrod-linux", "all"]
14 changes: 10 additions & 4 deletions examples/hotrod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,28 @@ to view the traces. A tutorial / walkthough is available:

An all-in-one Jaeger backend is packaged as a Docker container with in-memory storage.

```
docker run -d -p6831:6831/udp -p16686:16686 jaegertracing/all-in-one:latest
```bash
docker run -d --name jaeger -p6831:6831/udp -p16686:16686 jaegertracing/all-in-one:latest
```

Jaeger UI can be accessed at http://localhost:16686.

### Run HotROD Application
### Run HotROD from source

```
```bash
go get github.com/jaegertracing/jaeger
cd $GOPATH/src/github.com/jaegertracing/jaeger
make install
cd examples/hotrod
go run ./main.go all
```

### Run HotROD from docker
```bash
docker run --rm -it --link jaeger -p8080:8080 jaegertracing/example-hotrod:latest /go/bin/hotrod-linux all --jaeger-agent.host-port=jaeger:6831
```


Then open http://127.0.0.1:8080


Expand Down
5 changes: 0 additions & 5 deletions examples/hotrod/create-image.sh

This file was deleted.

248 changes: 248 additions & 0 deletions examples/hotrod/services/frontend/bindata_assetfs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion examples/hotrod/services/frontend/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ func (s *Server) createServeMux() http.Handler {

func (s *Server) home(w http.ResponseWriter, r *http.Request) {
s.logger.For(r.Context()).Info("HTTP", zap.String("method", r.Method), zap.Stringer("url", r.URL))
http.ServeFile(w, r, "services/frontend/web_assets/index.html")
b, err := assetFS().Asset("web_assets/index.html")
if err != nil {
http.Error(w, "Could not load index page", http.StatusInternalServerError)
s.logger.Bg().Error("Could lot load static assets", zap.Error(err))
}
w.Write(b)
}

func (s *Server) dispatch(w http.ResponseWriter, r *http.Request) {
Expand Down
Loading

0 comments on commit fc09869

Please sign in to comment.