-
Notifications
You must be signed in to change notification settings - Fork 71
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
Optimize container build time #579
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
7 tasks
aiven-anton
force-pushed
the
chore/optimize-container-build
branch
from
May 4, 2023 09:17
3e29967
to
493fbd0
Compare
Deploying with Cloudflare Pages
|
aiven-anton
force-pushed
the
chore/optimize-container-build
branch
from
May 4, 2023 09:20
493fbd0
to
0e0ce92
Compare
aiven-anton
force-pushed
the
chore/optimize-container-build
branch
2 times, most recently
from
May 4, 2023 16:33
793e204
to
521bfca
Compare
aiven-anton
force-pushed
the
chore/optimize-container-build
branch
from
May 4, 2023 17:03
521bfca
to
4956b2b
Compare
- Use cache mounts for pip and apt, heavily reducing network requests when cache is warm. - Remove git as a build-time dependency, other than switching to archive endpoints as was done in 39b4f08, this also requires either setting `KARAPACE_VERSION` as container build arg or building karapace/version.py independently. - Add hadolint pre-commit check for linting Dockerfile. - Move to using Python base images for builder and final stage. This allows omitting installation of some build tools. It also allows moving to a more recent Python version, no longer being bound by what's in distro repositories. Wheel availability of some of our Python dependencies prevents us from moving to 3.11 for now. - Change installation approach to construct a virtualenv in the builder step, and copying it unaltered to the final stage, with dependencies and Karapace itself installed in it. This allows having even fewer layers in the final stage, and is simpler. - Introduces a _much_ stricter .dockerignore, ignoring files by default and explicitly including what's required. This makes sure changes in unrelated files does not evict layer cache. For example, a few files that previously erroneously evicted caches, because everything was included: - .git/* - .mypy_cache/* - container/Dockerfile itself - __pycache__/* - .idea/*
aiven-anton
force-pushed
the
chore/optimize-container-build
branch
from
May 4, 2023 17:22
4956b2b
to
39ca83a
Compare
tvainika
approved these changes
May 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About this change - What it does
KARAPACE_VERSION
as container build arg or building karapace/version.py independently..git/*
.mypy_cache/*
container/Dockerfile
itself__pycache__/*
.idea/*
Image size remains the same as previously (the
develop
tag is the new version):References #585.
Why this way