-
Notifications
You must be signed in to change notification settings - Fork 105
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
[feat]Build multi-architecture Docker images for Python agent #297
Conversation
I have simply tried
To delve deeper, I'll be creating a Linux/ARM64 environment. |
Welcome back! Please remember to add a changelog for this feature. |
I cant tell what's wrong from the traceback you posted though. |
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.
I can build locally when I set the VERSION=1.0.0
(make build-image VERSION=1.0.0
) so you might want to update your repo and set the same version.
- We should also verify this in CI:
- Build docker images without pushing to remote registry in PR checks, with
make build-image
. - Build and push images to ghcr.io with
make push-image
, example
- Build docker images without pushing to remote registry in PR checks, with
solved according to this docker/buildx#464 (comment) |
When building a new docker image with CI, would it be better to use the local skywalking-python package instead of the one provided by PyPI? |
Yes sure we should use the local skywalking Python package because that's what we want to verify. |
For now, the version number has to be set inside publish-docker.yaml. |
0c73ead
to
36c5c45
Compare
36c5c45
to
51de7f4
Compare
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push docker image | ||
run: | | ||
make push-image |
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.
I tried to build and push locally and hours passed it is still running, I think we can parallize this by adding make -j 10 push-image
?
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.
I have tried make -j 10 push-image
, but seems that docker buildx
can't run parallel.
Firstly, container skywalking_python_main
can't be shared between parallel building tasks, secondly, even though we create target-specific containers, because this line works at system level, CI still runs into errors.
After some digging, I found that the most time-consuming step is building gRPC related whl packages when building image for arm64 python3.11
. Cuz there is no needed binary whl package off the shelf so far. grpc/grpc#32454
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.
I discovered that with the --builder
option in Docker, we can make multiple targets simultaneously, but not to much(with make -j 10
may run out of disk space).
Compared with non-parallel building, we can save about 10 minutes.
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.
I pushed this PR to a branch in the repo and the workflow is verified to work, @Superskyyy wanna check the images number?
https://github.com/apache/skywalking-python/pkgs/container/skywalking-python%2Fskywalking-python
push-py3.8-slim: BASE_PYTHON_IMAGE = python:3.8-slim | ||
push-py3.9-slim: BASE_PYTHON_IMAGE = python:3.9-slim | ||
push-py3.10-slim: BASE_PYTHON_IMAGE = python:3.10-slim | ||
push-py3.11-slim: BASE_PYTHON_IMAGE = python:3.11-slim |
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.
Do we need to remove this ? You removed 3.11 in the TARGETS
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.
It's okay to remove it. I'm reserving it for future needs.
CHANGELOG.md
.