Skip to content

Improve packing for bootable/large images #16

Closed

Description

@jlebon

E.g. packing a plain FCOS image into 64 layers gives funny results. The initramfs is still part of the catch-all bucket even though I would still expect it to be combined with some other small component.

Activity

  1. added
    enhancement
    on Jan 30, 2026
  2. jlebon commented on Feb 6, 2026

    @jlebon
    MemberAuthor

    OK cool. I dug into this and now with actual data provided by https://github.com/jlebon/chunkah/pull/34, I think the algorithm is correct actually. Having the initramfs in the catch-all bucket can sometimes be the optimal strategy. The initramfs is inherently very unstable ("stability" here basically is the probability that a component will not change in the next update) since it changes with both kernel changes, and various input RPMs. So its theoretical stability is the product of all those inputs, which quickly goes near zero.

    More generally, it's interesting to dig more into the mechanics of the catch-all bucket. First, it's optimal to merge low stability components together (one way to see this is that if you're almost guaranteed two components will change the next update, you might as well put them together in the same layer to avoid contaminating other, more stable, layers). As soon as we merge two unstable components together, that merged group's stability plummets, and it becomes a "black hole" for other low stability components.

    Tweaking the algorithm to artificially clamp how low group stability and backtesting that with FCOS clearly gives worse results. So the "sacrificial bucket" approach definitely is right.

    IOW, put all the unstable stuff together for the sake of the stable stuff surviving.

  3. jlebon commented on Feb 6, 2026

    @jlebon
    MemberAuthor

    Now, in a bootable containers flow where you might be e.g. tweaking just a config file and then rebuilding your image, if that config file ends up in catch-all bucket, it becomes an extremely expensive update.

    What would be the simplest in those flows is likely not to include these files in the splitting operation. I.e. in the buildah flow, you'd do:

    ...
    FROM oci-archive:out.ociarchive
    # do this now so it's extremely cheap to iterate on
    COPY myconfig /etc/myconfig

    etc...

    But I can also imagine having chunkah treat unpackaged /etc files differently. Needs more thought. (Edit: filed that as https://github.com/jlebon/chunkah/issues/37.)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions