From de47a9ab211fcec0ef8b04e5c4f007f682268372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 16 Jan 2020 16:06:13 +0100 Subject: [PATCH] Publish tracegen binaries (#2022) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added tracegen container image Signed-off-by: Juraci Paixão Kröhling * Added config from env for tracegen Signed-off-by: Juraci Paixão Kröhling --- .gitignore | 2 ++ Makefile | 15 ++++++++++++--- cmd/tracegen/Dockerfile | 4 ++++ cmd/tracegen/main.go | 11 +++++++++-- scripts/travis/upload-all-docker-images.sh | 2 +- 5 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 cmd/tracegen/Dockerfile diff --git a/.gitignore b/.gitignore index 99f7c3440e8..ba8b563dae7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ cmd/ingester/ingester cmd/ingester/ingester-* cmd/query/query cmd/query/query-* +cmd/tracegen/tracegen +cmd/tracegen/tracegen-* cmd/docs/*.md cmd/docs/*.rst cmd/docs/*.1 diff --git a/Makefile b/Makefile index fc70a2084e4..7173bc0cc22 100644 --- a/Makefile +++ b/Makefile @@ -198,6 +198,10 @@ else CGO_ENABLED=0 installsuffix=cgo go build -o ./examples/hotrod/hotrod-$(GOOS) ./examples/hotrod/main.go endif +.PHONY: build-tracegen +build-tracegen: + CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/tracegen/tracegen-$(GOOS) ./cmd/tracegen/main.go + .PHONE: docker-hotrod docker-hotrod: GOOS=linux $(MAKE) build-examples @@ -277,7 +281,7 @@ build-binaries-s390x: GOOS=linux GOARCH=s390x $(MAKE) build-platform-binaries .PHONY: build-platform-binaries -build-platform-binaries: build-agent build-collector build-query build-ingester build-all-in-one build-examples +build-platform-binaries: build-agent build-collector build-query build-ingester build-all-in-one build-examples build-tracegen .PHONY: build-all-platforms build-all-platforms: build-binaries-linux build-binaries-windows build-binaries-darwin build-binaries-s390x @@ -300,8 +304,13 @@ docker-images-jaeger-backend: echo "Finished building $$component ==============" ; \ done +.PHONY: docker-images-tracegen +docker-images-tracegen: + docker build -t $(DOCKER_NAMESPACE)/jaeger-tracegen:${DOCKER_TAG} cmd/tracegen/ + @echo "Finished building jaeger-tracegen ==============" + .PHONY: docker-images-only -docker-images-only: docker-images-cassandra docker-images-elastic docker-images-jaeger-backend +docker-images-only: docker-images-cassandra docker-images-elastic docker-images-jaeger-backend docker-images-tracegen .PHONY: docker-push docker-push: @@ -311,7 +320,7 @@ docker-push: if [ $$CONFIRM != "y" ] && [ $$CONFIRM != "Y" ]; then \ echo "Exiting." ; exit 1 ; \ fi - for component in agent cassandra-schema es-index-cleaner es-rollover collector query ingester example-hotrod; do \ + for component in agent cassandra-schema es-index-cleaner es-rollover collector query ingester example-hotrod tracegen; do \ docker push $(DOCKER_NAMESPACE)/jaeger-$$component ; \ done diff --git a/cmd/tracegen/Dockerfile b/cmd/tracegen/Dockerfile new file mode 100644 index 00000000000..49d14e42594 --- /dev/null +++ b/cmd/tracegen/Dockerfile @@ -0,0 +1,4 @@ +FROM scratch + +COPY tracegen-linux /go/bin/ +ENTRYPOINT ["/go/bin/tracegen-linux"] diff --git a/cmd/tracegen/main.go b/cmd/tracegen/main.go index 87a3e445171..d615f3364b9 100644 --- a/cmd/tracegen/main.go +++ b/cmd/tracegen/main.go @@ -36,13 +36,20 @@ func main() { flag.Parse() metricsFactory := prometheus.New() - tracer, tCloser, err := jaegerConfig.Configuration{ + traceCfg := &jaegerConfig.Configuration{ ServiceName: "tracegen", Sampler: &jaegerConfig.SamplerConfig{ Type: "const", Param: 1, }, - }.NewTracer( + RPCMetrics: true, + } + traceCfg, err := traceCfg.FromEnv() + if err != nil { + logger.Fatal("failed to read tracer configuration", zap.Error(err)) + } + + tracer, tCloser, err := traceCfg.NewTracer( jaegerConfig.Metrics(metricsFactory), jaegerConfig.Logger(jaegerZap.NewLogger(logger)), ) diff --git a/scripts/travis/upload-all-docker-images.sh b/scripts/travis/upload-all-docker-images.sh index 482a42eb046..eff7d11b36c 100755 --- a/scripts/travis/upload-all-docker-images.sh +++ b/scripts/travis/upload-all-docker-images.sh @@ -20,7 +20,7 @@ else fi export DOCKER_NAMESPACE=jaegertracing -for component in agent cassandra-schema es-index-cleaner es-rollover collector query ingester +for component in agent cassandra-schema es-index-cleaner es-rollover collector query ingester tracegen do export REPO="jaegertracing/jaeger-${component}" bash ./scripts/travis/upload-to-docker.sh