Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image-rs: fix image layer ordering #404

Merged

Conversation

mkulke
Copy link
Contributor

@mkulke mkulke commented Dec 11, 2023

Fixes #403

When using concurrent pull the resulting order of layers can vary from what's specified in the rootfs.diff_id of the oci image config. Layers might be mounted in the wrong order and containers are not able to run properly (e.g. library/nginx).

The change maintains the order of the provided layer_descs in the resulting Vec<LayerMeta> and thus the layers are mounted in the proper order.

It has been manually tested w/ 50+ coco containers. The provided test here is disabled by default, because we'll run into rate-limits w/ dockerhub and since it's a race condition it's not guaranteed to fail, either.

When using concurrent pull the resulting order of layers can vary from
what's specified in the `rootfs.diff_id` of the oci image config. Layers
might be mounted in the wrong order and containers are not able to run
properly (e.g. `library/nginx`).

Signed-off-by: Magnus Kulke <[email protected]>
Copy link
Member

@Xynnn007 Xynnn007 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@arronwy arronwy left a comment

Choose a reason for hiding this comment

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

Thanks @mkulke nice catch!, LGTM!

@arronwy arronwy merged commit e18e86d into confidential-containers:main Dec 14, 2023
6 checks passed
@mkulke mkulke deleted the mkulke/fix-layer-ordering branch December 14, 2023 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

image-rs: concurrent pulls will mix the layer ordering
4 participants