Skip to content

Allow UPX compression to be skipped in images#2408

Open
skitt wants to merge 1 commit intosubmariner-io:develfrom
skitt:disable-upx-images
Open

Allow UPX compression to be skipped in images#2408
skitt wants to merge 1 commit intosubmariner-io:develfrom
skitt:disable-upx-images

Conversation

@skitt
Copy link
Copy Markdown
Member

@skitt skitt commented Apr 21, 2026

For throw-away images, this saves significant build time whenever images need to be rebuilt. This is enabled for linting jobs: in most cases they don’t involve rebuilding images, but when they do, those images are rebuilt for every linting job, and are then discarded.

Summary by CodeRabbit

  • Chores
    • Made binary compression in container images configurable, allowing builds to skip optimization when needed for debugging or compatibility purposes.
    • Fixed a typo in build documentation.

For throw-away images, this saves significant build time whenever
images need to be rebuilt. This is enabled for linting jobs: in most
cases they don’t involve rebuilding images, but when they do, those
images are rebuilt for every linting job, and are then discarded.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
@submariner-bot
Copy link
Copy Markdown

🤖 Created branch: z_pr2408/skitt/disable-upx-images

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a4152f4e-2e96-40e2-ba89-2bae58f7497e

📥 Commits

Reviewing files that changed from the base of the PR and between 186dd25 and 80eb7ef.

📒 Files selected for processing (5)
  • .github/workflows/linting.yml
  • Makefile.images
  • package/Dockerfile.shipyard-dapper-base
  • package/Dockerfile.shipyard-linting
  • scripts/shared/build_image.sh

Walkthrough

This PR introduces a configurable UPX compression toggle across the build system. It adds an IMAGE_UPX Make variable and corresponding Docker build-argument logic to conditionally enable/disable UPX compression during image builds. When IMAGE_UPX=false, the build pipeline passes UPX_LEVEL=-0 to skip UPX compression in Dockerfiles. The CI linting workflow is updated to disable UPX for these builds.

Changes

Cohort / File(s) Summary
CI Workflow Configuration
.github/workflows/linting.yml
Updated linting workflow run commands to pass IMAGE_UPX=false to all make invocations (gitlint, golangci-lint, markdownlint, packagedoc-lint, shellcheck, govulncheck, yamllint).
Build System Configuration
Makefile.images
Added exported Make variable IMAGE_UPX with default value true under the release-images section to control UPX compression behavior.
Docker Image Builds
package/Dockerfile.shipyard-dapper-base, package/Dockerfile.shipyard-linting
Added UPX_LEVEL build argument (default -5) and replaced unconditional UPX compression with conditional execution (if test ${UPX_LEVEL} != -0; then ...). Fixed typo in comment ("experemintation" → "experimentation"). Changes affect binary compression in /usr/bin, /usr/lib/golang, /usr/libexec, and /go/bin directories.
Build Script
scripts/shared/build_image.sh
Added conditional logic to augment Docker build arguments with UPX_LEVEL=-0 when IMAGE_UPX variable is exactly "false".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • vthapar
  • sridhargaddam
  • tpantelis
  • Oats87
  • mkolesnik
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and clearly summarizes the primary change: allowing UPX compression to be skipped in image builds.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Actionable Comments Resolved ✅ Passed No actionable comments (TODO, FIXME, XXX, HACK) found in modified files or repository structure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants