OCPBUGS-76450: reduce MCO image size#5644
OCPBUGS-76450: reduce MCO image size#5644openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
Conversation
|
@cheesesashimi: This pull request references Jira Issue OCPBUGS-76450, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
/test images |
|
/test images |
2de5fcd to
e7a1728
Compare
|
@cheesesashimi: This pull request references Jira Issue OCPBUGS-76450, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
In lieu of mounting package caches at build-time, we should clear them after package installation. Because the DNF wrapper sets the repo configuration differently in local vs. CI builds, this will only yield a ~44 MB reduction for local builds. However, it will yield a ~1.2 GB reduction for images built by CI.
Early versions of Buildah and/or OpenShift Image Builder presumably did not support path globbing for COPY directives, which required us to create a tarball and copy it into the final image. Although the tarball is deleted immediately after extraction, it still persists as an image layer when building an image locally due to the COPY directive. This unnecessary layer increases overall image size by ~480 MB. This is only the case for local image builds since OpenShift CI is configured to squash the final image layers, which makes this a non-issue for release images.
e7a1728 to
84eedc3
Compare
|
/lgtm |
|
Great work! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheesesashimi, pablintino, umohnani8 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/verified bypass verified by passing ocl test |
|
@umohnani8: The DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
@cheesesashimi: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@cheesesashimi: Jira Issue Verification Checks: Jira Issue OCPBUGS-76450 Jira Issue OCPBUGS-76450 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/cherry-pick release-4.21 |
|
@cheesesashimi: new pull request created: #5657 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
- What I did
This ensures that the DNF package cache is clear after installing packages to reduce overall image size. This also reduces the overall image size when layer squashing is not used by eliminating the tarball extraction in the final image in favor of directly copying the files into place. Building the image locally using Podman, this yields a ~500 MB size reduction with the images output by the CI system being reduced by ~1.5 GB.
- How to verify it
To verify that the image size is reduced, one can build the image before and after this PR and compare the sizes. That said, there should not be any effect upon the MCO behavior itself. Therefore, a clean CI run should suffice for verification.
- Description for the changelog
Reduce MCO image size