-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add s390x support on multiarch docker images #2948
Changes from 2 commits
bae83d3
4c6cabb
c0de24a
d973031
5273aa3
ef2e8a2
edb391d
7974892
a0362fc
2613b6c
119d8e8
321907c
170b373
23ede72
54ba010
027376a
5a6b268
2960e88
ba3e9bc
2acd49f
4e4fcbb
878e983
18aad23
56f3e4f
c492340
a62c82f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,17 @@ MOCKERY=mockery | |
|
||
.DEFAULT_GOAL := test-and-lint | ||
|
||
BASE_IMAGE_MULTIARCH := localhost:5000/baseimg:$(VERSION)-$(shell echo $(ROOT_IMAGE) | tr : -) | ||
PLATFORMS=linux/amd64,linux/s390x | ||
INGESTER_TAG=$(subst JAGERCOMP,ingester,$(IMAGE_TAGS)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to do this for each jaeger component, isn't it the same value after all ? Also where is JAGERCOMP variable populated ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think we need to, since each jaeger component has its unique name, hence the unique tag value.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not a fan of these cross-dependences. If the string that contains Also, Jaeger is spelled with 'e'. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. I've corrected the spelling and moved the related code to the script. |
||
AGENT_TAG=$(subst JAGERCOMP,agent,$(IMAGE_TAGS)) | ||
COLLECTOR_TAG=$(subst JAGERCOMP,collector,$(IMAGE_TAGS)) | ||
QUERY_TAG=$(subst JAGERCOMP,query,$(IMAGE_TAGS)) | ||
ESINDEX_TAG=$(subst JAGERCOMP,es-index-cleaner,$(IMAGE_TAGS)) | ||
ESROLLOVER_TAG=$(subst JAGERCOMP,es-rollover,$(IMAGE_TAGS)) | ||
TRACEGEN_TAG=$(subst JAGERCOMP,tracegen,$(IMAGE_TAGS)) | ||
ANONYMIZER_TAG=$(subst JAGERCOMP,anonymizer,$(IMAGE_TAGS)) | ||
|
||
.PHONY: test-and-lint | ||
test-and-lint: test fmt lint | ||
|
||
|
@@ -298,7 +309,8 @@ build-platform-binaries: build-agent \ | |
build-all-in-one \ | ||
build-examples \ | ||
build-tracegen \ | ||
build-anonymizer | ||
build-anonymizer \ | ||
build-esmapping-generator | ||
|
||
.PHONY: build-all-platforms | ||
build-all-platforms: build-binaries-linux build-binaries-windows build-binaries-darwin build-binaries-s390x build-binaries-arm64 build-binaries-ppc64le | ||
|
@@ -309,9 +321,10 @@ docker-images-cassandra: | |
@echo "Finished building jaeger-cassandra-schema ==============" | ||
|
||
.PHONY: docker-images-elastic | ||
docker-images-elastic: build-esmapping-generator-linux | ||
docker-images-elastic: | ||
GOOS=linux GOARCH=$(GOARCH) $(MAKE) build-esmapping-generator | ||
docker build -t $(DOCKER_NAMESPACE)/jaeger-es-index-cleaner:${DOCKER_TAG} plugin/storage/es | ||
docker build -t $(DOCKER_NAMESPACE)/jaeger-es-rollover:${DOCKER_TAG} plugin/storage/es -f plugin/storage/es/Dockerfile.rollover | ||
docker build -t $(DOCKER_NAMESPACE)/jaeger-es-rollover:${DOCKER_TAG} plugin/storage/es -f plugin/storage/es/Dockerfile.rollover --build-arg TARGETARCH=$(GOARCH) | ||
@echo "Finished building jaeger-es-indices-clean ==============" | ||
|
||
docker-images-jaeger-backend: TARGET = release | ||
|
@@ -348,6 +361,73 @@ docker-images-only: docker-images-cassandra \ | |
docker-images-tracegen \ | ||
docker-images-anonymizer | ||
|
||
.PHONY: multiarch-docker | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't we just move all this code into the script? Why do they need to be in the Makefile? I would restrict Makefile to building the binaries only, and then have all docker packaging etc. be done in the script. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we could. I've moved all code related to building and uploading multi-arch docker images from Makefile to the scripts. |
||
multiarch-docker: build-binaries-linux \ | ||
build-binaries-s390x \ | ||
multiarch-docker-images-only | ||
|
||
.PHONY: multiarch-docker-images-only | ||
multiarch-docker-images-only: docker-images-jaeger-backend-multiarch \ | ||
docker-images-elastic-multiarch \ | ||
docker-images-tracegen-multiarch \ | ||
docker-images-anonymizer-multiarch | ||
|
||
.PHONY: create-baseimage-multiarch | ||
create-baseimage-multiarch: | ||
docker buildx build -t $(BASE_IMAGE_MULTIARCH) --push \ | ||
--build-arg root_image=$(ROOT_IMAGE) \ | ||
--build-arg cert_image=$(CERT_IMAGE) \ | ||
--platform=$(PLATFORMS) \ | ||
docker/base | ||
echo "Finished building multiarch base image ==============" | ||
|
||
.PHONY: docker-images-jaeger-backend-multiarch | ||
docker-images-jaeger-backend-multiarch: create-baseimage-multiarch | ||
for component in agent collector query ingester ; do \ | ||
docker buildx build --output "$(PUSHTAG)" \ | ||
--progress=plain --target release \ | ||
--build-arg base_image=$(BASE_IMAGE_MULTIARCH) \ | ||
--build-arg debug_image=$(GOLANG_IMAGE) \ | ||
--platform=$(PLATFORMS) \ | ||
--file cmd/$$component/Dockerfile \ | ||
$(subst JAGERCOMP,$$component,$(IMAGE_TAGS)) \ | ||
cmd/$$component; \ | ||
echo "Finished building $$component ==============" ; \ | ||
done | ||
|
||
.PHONY: docker-images-elastic-multiarch | ||
docker-images-elastic-multiarch: | ||
docker buildx build --output "$(PUSHTAG)" \ | ||
--progress=plain \ | ||
--platform=$(PLATFORMS) \ | ||
${ESINDEX_TAG} \ | ||
plugin/storage/es | ||
docker buildx build --output "$(PUSHTAG)" \ | ||
--progress=plain \ | ||
--platform=$(PLATFORMS) \ | ||
--file plugin/storage/es/Dockerfile.rollover \ | ||
${ESROLLOVER_TAG} \ | ||
plugin/storage/es | ||
@echo "Finished building multiarch jaeger-es-indices-clean ==============" | ||
|
||
.PHONY: docker-images-tracegen-multiarch | ||
docker-images-tracegen-multiarch: | ||
docker buildx build --output "$(PUSHTAG)" \ | ||
--progress=plain \ | ||
--platform=$(PLATFORMS) \ | ||
${TRACEGEN_TAG} \ | ||
cmd/tracegen/ | ||
@echo "Finished building multiarch jaeger-tracegen ==============" | ||
|
||
.PHONY: docker-images-anonymizer-multiarch | ||
docker-images-anonymizer-multiarch: | ||
docker buildx build --output "$(PUSHTAG)" \ | ||
--progress=plain \ | ||
--platform=$(PLATFORMS) \ | ||
$(ANONYMIZER_TAG) \ | ||
cmd/anonymizer/ | ||
@echo "Finished building multiarch jaeger-anonymizer ==============" | ||
|
||
.PHONY: docker-push | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should delete this target, it's not used from GH Actions, and it probably incorrect given these changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I've deleted this target. |
||
docker-push: | ||
@while [ -z "$$CONFIRM" ]; do \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ ARG base_image | |
ARG debug_image | ||
|
||
FROM $base_image AS release | ||
ARG TARGETARCH=amd64 | ||
ARG TARGETARCH | ||
|
||
# Agent zipkin.thrift compact | ||
EXPOSE 5775/udp | ||
|
@@ -28,6 +28,8 @@ EXPOSE 16686 | |
COPY all-in-one-linux-$TARGETARCH /go/bin/all-in-one-linux | ||
COPY sampling_strategies.json /etc/jaeger/ | ||
|
||
RUN chmod +x /go/bin/all-in-one-linux | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we adding this chmod here. Isn't the binary already executable ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right, the binary is already executable. I've removed this line from Dockerfile. |
||
|
||
VOLUME ["/tmp"] | ||
ENTRYPOINT ["/go/bin/all-in-one-linux"] | ||
CMD ["--sampling.strategies-file=/etc/jaeger/sampling_strategies.json"] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM scratch | ||
ARG TARGETARCH=amd64 | ||
ARG TARGETARCH | ||
|
||
COPY anonymizer-linux-$TARGETARCH /go/bin/anonymizer-linux | ||
ENTRYPOINT ["/go/bin/anonymizer-linux"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM scratch | ||
ARG TARGETARCH=amd64 | ||
ARG TARGETARCH | ||
|
||
COPY tracegen-linux-$TARGETARCH /go/bin/tracegen-linux | ||
ENTRYPOINT ["/go/bin/tracegen-linux"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
FROM python:3-alpine3.11 | ||
ARG TARGETARCH | ||
|
||
# Temporary fix for https://github.com/jaegertracing/jaeger/issues/1494 | ||
RUN pip install urllib3==1.24.3 | ||
|
||
RUN pip install elasticsearch elasticsearch-curator | ||
COPY ./mappings/* /mappings/ | ||
COPY esRollover.py /es-rollover/ | ||
COPY esmapping-generator /usr/bin/ | ||
COPY esmapping-generator-linux-$TARGETARCH /usr/bin/esmapping-generator | ||
|
||
ENTRYPOINT ["python3", "/es-rollover/esRollover.py"] | ||
ENTRYPOINT ["python3", "/es-rollover/esRollover.py"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace removed.