-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Build] Reduce pulsar-test-latest-version docker image size #9627
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
[Build] Reduce pulsar-test-latest-version docker image size #9627
Conversation
- smaller image size makes it feasible to build the image once and share
it between the different parallel integration test jobs. This will
help improve the Pulsar CI in the future.
Solution:
- build go-lang examples in a separate temporary layer
- cleanup files as last steps
- requires "-Ddockerfile.build.squash=true" (uses "docker build --squash")
to reduce the final image size. This is not part of this change
since the image size isn't important until images are transferred over
the network. Squashing the image would just add overhead to the current build.
eolivelli
left a comment
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.
+1
zymap
left a comment
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 wonder how to share the docker image between different jobs?
@zymap The high level idea is described in the draft PIP Changes to GitHub Actions based Pulsar CI. It's possible by using the GitHub Actions Cache. There's an action that adds a local HTTP proxy to the cache where you can POST and GET any key from the cache. I've been experimenting with it and it's really great and efficient. I'll share the results on the mailing list asap (next week). docker comes with btw. The challenge with |
|
/pulsarbot run-failure-checks |
1 similar comment
|
/pulsarbot run-failure-checks |
|
@lhotari - great change, and I'm looking forward to seeing the GitHub Actions Cache in practice. That should really speed up the builds. |
### Motivation The chown & chmod operations added in #9627 are causing docker to actually duplicate all the files in the overlay filesystem, increasing the image size by ~2GB. After this change the test image size is ~2.5 GB.
Motivation
Smaller
pulsar-test-latest-versiondocker image size makes it feasible to build the image once and share it between the different parallel integration test build jobs. This will help improve the Pulsar CI in the future since it opens up new possibilities to save build system resources (GitHub Actions Runner VM time).Modifications
Build go-lang examples in a separate temporary layer. This reduces the final size of the image by at least 600MB.
Cleanup files as last steps
-Ddockerfile.build.squash=true(usesdocker build --squash). This is not part of this change since the image size isn't important until images are transferred over the network. Squashing the image would just add overhead to the current build./usr/lib/libpulsar*.a(since no tests use it)