Skip to content

Commit

Permalink
Publish tracegen binaries (#2022)
Browse files Browse the repository at this point in the history
* Added tracegen container image

Signed-off-by: Juraci Paixão Kröhling <[email protected]>

* Added config from env for tracegen

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
  • Loading branch information
jpkrohling authored and yurishkuro committed Jan 16, 2020
1 parent f605a34 commit de47a9a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

Expand Down
4 changes: 4 additions & 0 deletions cmd/tracegen/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch

COPY tracegen-linux /go/bin/
ENTRYPOINT ["/go/bin/tracegen-linux"]
11 changes: 9 additions & 2 deletions cmd/tracegen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/travis/upload-all-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de47a9a

Please sign in to comment.