← Back to issue list

when packing, the resulting OCI layer from the parts may have content that is already in the Ubuntu base

View original Github issue

Metadata

Project
rockcraft
Number
#363
Type
issue
State
closed
Author
cjdcordeiro
Labels
—
Created
Updated
Closed

Current evaluation

Redundant primed files are now pruned when identical to files in the Ubuntu base. Merged in canonical/rockcraft#417 (623551b5) and released in Rockcraft 1.1.0.

Resolution: closed resolved

Reason: canonical/rockcraft#417 was merged as commit 623551b5. It adds lifecycle pruning for regular files whose content, ownership, and permissions match the Ubuntu base, avoiding redundant content in the final ROCK layer.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description See https://chat.charmhub.io/charmhub/pl/o5wxpb65ffbfzy7bcmi8kzftzy ### To Reproduce See https://chat.charmhub.io/charmhub/pl/o5wxpb65ffbfzy7bcmi8kzftzy ### Environment Nothing in special ### rockcraft.yaml ```shell See https://chat.charmhub.io/charmhub/pl/o5wxpb65ffbfzy7bcmi8kzftzy ``` ### Relevant log output ```shell The build will be fine, but the resulting ROCK will be larger than necessary and fail the efficiency tests. Example: https://github.com/canonical/oci-factory/actions/runs/5940848690/job/16110358625 ``` ---- ## Proposal We should, at some point before packing the ROCK, cross check the primed contents of the parts with what's already inside the base Ubuntu image. When those contents are equal, we simply don't include them in the final squashed layer that is going to be inserted into the ROCK. Here are some possibilities to explore: - using a sort of "phantom layer" that contains the base Ubuntu image, such that the craft lifecycle considers the Ubuntu base when doing the conflict resolution it already does - just before packing the ROCK, add a new function to compare the primed content and the Ubuntu base's content

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Redundant primed files are now pruned when identical to files in the Ubuntu base. Merged in canonical/rockcraft#417 (623551b5) and released in Rockcraft 1.1.0.
stealth/space-bunny-alpha — closed resolved Rockcraft now prunes identical primed files already present in the Ubuntu base layer, reducing redundant content in packed ROCKs. Fixed by PR #417 (commit 623551b5) and released in 1.1.0.
stealth/space-bunny-alpha — closed resolved Fixed by pruning primed part files already present in the Ubuntu base image; merged via canonical/rockcraft#417 (commit 623551b5).
stealth/space-bunny-alpha — closed resolved Rock pruned primed part files identical to those in the Ubuntu base. Implemented as layers.prune_prime_files() called from the lifecycle post_step, shipped via merged PR #417 (commit 623551b5) and released in Rockcraft 1.1.0.
stealth/space-bunny-alpha — closed resolved Fixed by canonical/rockcraft#417 via commit 623551b5, pruning primed part files already present in the base image to avoid duplicate content in packed ROCK layers.
stealth/space-bunny-alpha — closed resolved Fixed in canonical/rockcraft#417 via commit 623551b5, which prunes primed part files already present in the base image, avoiding redundant content in packed ROCK layers.
qwen/qwen3.6-35b-a3b — — Closed. Resolution involves adjusting package handling and dependency cut-offs to exclude files already present in the Ubuntu base image during ROCK packing, preventing unnecessary layer duplication.
qwen/qwen3.6-35b-a3b — — Closed without a fix. Proposed resolution involves tracking base layer packages for craft-parts dependency cut-offs to prevent deb duplication. Chisel slices remain uncovered, and implementation details are under discussion.
qwen/qwen3.6-35b-a3b — — Fixed by adjusting craft-parts dependency cut-offs and tracking base image packages to prevent duplicate content in ROCK OCI layers.
qwen3.6-35b-a3b-mtp-q6 — — Closed without a fix after internal discussion proposed tracking base layer packages and adjusting dependency cut-offs to prevent duplication. The author raised implementation concerns, and the issue was left unresolved.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/rockcraft#417 (confidence 100%)

    PR #417 implemented the base-layer file comparison and was merged as commit 623551b5.

Related issues

Issue Project State Summary Similarity
#228 Conflicting files when packing a ROCK with overlay-packages on an ubuntu base rockcraft closed Usrmerge file collisions between overlay-packages and stage-packages on an Ubuntu base broke `rockcraft pack`. Fixed by merged PR #231 (commit 5ec8b09f), which allows identical files at colliding OCI paths.
74%