Skip to content

Conversation

@ckyrouac
Copy link
Collaborator

@ckyrouac ckyrouac commented Jul 8, 2025

depends on bootc-dev/bootc#1397.


Adds a mechanism to the rechunker to support mapping individual files to specific layers via the xattr user.component field.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces support for exclusive layers in the rechunker by adding a mechanism to map individual files to specific layers via the xattr user.component field. The changes include modifications to the MappingBuilder struct and associated methods, as well as the addition of a new function get_user_component_xattr to read the user.component xattr from a file path. The code also includes new unit tests to verify the functionality of the changes.

@ckyrouac ckyrouac force-pushed the rechunk-xattr branch 2 times, most recently from 217c33e to 3114e20 Compare July 9, 2025 18:43
@ckyrouac ckyrouac marked this pull request as ready for review July 21, 2025 16:42
@ckyrouac ckyrouac changed the title WIP: rechunker: Support exclusive layers rechunker: Support exclusive layers Jul 21, 2025
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for working on this! Nothing truly blocking from my end but some open questions and nits

echo "Regular system file" > /usr/share/regular/system.conf
# Set component xattrs to identify exclusive layers
RUN setfattr -n user.component -v "webapp" /usr/share/webapp/app.js && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this specific line but just looking at this...I think the 95% case here is that people will want this to operate recursively, right?

A nice way to do this is to make it supported to set user.component on a directory to mean applying to all of its children or so. And here debate whether that's including directory children i.e. recursive or not. If it is recursive we'd probably need an opt-out (setting the xattr to the empty string?)

Hmm and now that I look/think about this slightly more I guess the challenge is that the whole codebase leading up to this is object-based and isn't operating on the directory tree.

But in theory we could (while traversing to build up the object set) add this mapping if we detect the parent directory has it set.


To be clear I'm OK with this as is but I'd probably say we should change the tests and docs to show this via e.g.
find /usr/share/webapp -type -f -o -type l -exec setfattr -n user.component -v webapp {} \; or so?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed this to track: #5443

@ckyrouac ckyrouac marked this pull request as draft July 21, 2025 18:41
@ckyrouac ckyrouac force-pushed the rechunk-xattr branch 3 times, most recently from 547c42e to ae7030a Compare July 29, 2025 19:33
@cgwalters cgwalters self-assigned this Jul 29, 2025
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit otherwise looks sane to me! I only very superficially skimmed the tests

ckyrouac added 2 commits July 30, 2025 09:58
Also react to updated bwrap code, see
gtk-rs/gtk-rs-core@037ae39

Signed-off-by: ckyrouac <[email protected]>
Parse the user.components xattr from the filesystem to create separate
layers for each user specified component. "Exclusive" layers are given
priority over package based layers.

Assited-by: Claude Code

Signed-off-by: ckyrouac <[email protected]>
@ckyrouac ckyrouac marked this pull request as ready for review July 30, 2025 14:02
@openshift-ci
Copy link

openshift-ci bot commented Jul 30, 2025

@ckyrouac: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/fcos-e2e cb06177 link true /test fcos-e2e

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ckyrouac ckyrouac requested a review from cgwalters July 30, 2025 15:46
@cgwalters cgwalters merged commit 7b0ef02 into coreos:main Jul 30, 2025
18 of 20 checks passed
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