Skip to content

Conversation

@Acedus
Copy link
Contributor

@Acedus Acedus commented Dec 25, 2025

What this PR does / why we need it:
Before the transition from rules_docker to rules_oci resulting container image sizes were around 1/3rd what they are now. This is because rules_docker used gzip compression implicitly[1].

This PR explicitly uses gzip compression for all pkg_tar directives in order to restore the resulting images to their original sizes.

[1] https://github.com/bazelbuild/rules_docker/blob/master/docs/container.md#container_image

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Dec 25, 2025
@kubevirt-bot kubevirt-bot requested a review from awels December 25, 2025 15:10
@Acedus Acedus force-pushed the compress-image-binaries branch from f9fd468 to e0ec034 Compare December 25, 2025 15:11
@Acedus
Copy link
Contributor Author

Acedus commented Dec 25, 2025

/cc @akalenyu

@Acedus
Copy link
Contributor Author

Acedus commented Dec 25, 2025

fyi, might need this in kv/kv as well...

@akalenyu
Copy link
Collaborator

really nice find on this one!
apparently it was listed as a breaking change in https://github.com/bazel-contrib/rules_oci/releases/tag/v2.0.0
/cc @dhiller

/approve
/lgtm

@kubevirt-bot kubevirt-bot requested a review from dhiller December 25, 2025 15:21
@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 25, 2025
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akalenyu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 25, 2025
@Acedus
Copy link
Contributor Author

Acedus commented Dec 25, 2025

Failures happen due to the archive repacking.
I suggested this for bazeldnf: rmohr/bazeldnf#170, need to see if it's acceptable, otherwise we'll need to use some hacks or give up compression of the rpm archives.

@Acedus
Copy link
Contributor Author

Acedus commented Dec 25, 2025

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 25, 2025
Before the transition from rules_docker to rules_oci resulting container
image sizes were around 1/4th what they are now. This is because
rules_docker used gzip compression implicitly[1].

This commit explicitly uses gzip compression for all pkg_tar directives
and also compresses the rpm bases generated by bazeldnf to restore the
resulting images to their original sizes.

[1] https://github.com/bazelbuild/rules_docker/blob/master/docs/container.md#container_image

Signed-off-by: Adi Aloni <aaloni@redhat.com>
@Acedus Acedus force-pushed the compress-image-binaries branch from e0ec034 to ee06ce1 Compare January 5, 2026 16:07
@kubevirt-bot kubevirt-bot added size/M and removed lgtm Indicates that a PR is ready to be merged. size/L labels Jan 5, 2026
@Acedus
Copy link
Contributor Author

Acedus commented Jan 5, 2026

Unholding for now, if rmohr/bazeldnf#170 ever makes it in, we'll use it as well for rpm compression.

/unhold

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 5, 2026
@coveralls
Copy link

Coverage Status

coverage: 49.411% (-0.007%) from 49.418%
when pulling ee06ce1 on Acedus:compress-image-binaries
into 22774aa on kubevirt:main.

@akalenyu
Copy link
Collaborator

akalenyu commented Jan 6, 2026

/retest

@akalenyu
Copy link
Collaborator

akalenyu commented Jan 6, 2026

Unholding for now, if rmohr/bazeldnf#170 ever makes it in, we'll use it as well for rpm compression.

/unhold

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 6, 2026
@akalenyu
Copy link
Collaborator

akalenyu commented Jan 6, 2026

/test pull-containerized-data-importer-e2e-nfs
ooms in ci

@kubevirt-bot kubevirt-bot merged commit c5480cc into kubevirt:main Jan 7, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants