Record the source URI of imported images at /.enroot/source#267
Open
alec-flowers wants to merge 2 commits intoNVIDIA:mainfrom
Open
Record the source URI of imported images at /.enroot/source#267alec-flowers wants to merge 2 commits intoNVIDIA:mainfrom
alec-flowers wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
enroot import docker://... and enroot load now write a small provenance file inside the image rootfs recording the URI and manifest digest. The URI is captured as provided to enroot, with any USER@ credential component stripped. dockerd:// and podman:// imports record the URI only (no registry digest available). The file can be read with unsquashfs -cat image.sqsh .enroot/source or, once the image is unpacked, from inside a running container. No new CLI, no runtime.sh changes: enroot export already strips /.enroot/ which is correct behavior here, since a rootfs modified and re-exported is no longer the image at the original URI. Signed-off-by: Alec Flowers <aflowers@nvidia.com>
Author
|
Superseded by the lighter URI-only revision in This comment described the original version of the PR, which recorded both See the updated PR description for the current end-to-end validation results for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enroot import docker://...andenroot loadnow drop a tiny provenance file inside the imported image at/.enroot/source:This answers the recurring question "where did this
.sqshcome from?" without adding a new command, runtime behavior, or registry lookup.Motivation
For reproducibility work around benchmark pipelines, we want to be able to look at a squashfs on disk and know which registry image produced it.
enroot digesthelps before import, but once imported there is no link back to the source. External sidecar metadata works until the file gets renamed, moved, or handed off.This puts the source URI inside the image itself, so it travels with the
.sqsh.Design notes
uri=.... It intentionally does not fetch or store the manifest digest.docker::_parse_uri, which handles Docker Hub shorthand,docker://REGISTRY#IMAGE, tag refs, digest refs, andUSER@credentials.registry,image, andtag,USER@is not persisted.dockerd://andpodman://imports record the original daemon URI, since there is no registry URI to canonicalize./.enroot/source: uses enroot's existing/.enrootnamespace.enroot exportalready strips/.enroot/, which avoids carrying stale provenance after a rootfs is modified and re-exported.Diff size
Net diff against
main: 32 insertions / 2 deletions acrosssrc/docker.shanddoc/image-format.md.Test plan
bash -n src/docker.shbash -noversrc/*.sh,conf/hooks/*.sh, andenroot.ingit diff --checkLocal helper tests for canonical URI formatting across Docker Hub shorthand, explicit registries,
USER@, enroot#syntax, and digest refsStubbed local smoke test for
docker::importanddocker::loadwiring that verifies0/.enroot/sourceexists with the expected canonical URI before the final image/load stepIsolated source build with
make install prefix=/tmp/... exec_prefix=/tmp/...End-to-end
enroot import -o busybox.sqsh docker://busybox:latest, thenunsquashfs -cat busybox.sqsh .enroot/source:End-to-end
enroot load -n busybox-load-e2e docker://busybox:latest, thencat busybox-load-e2e/.enroot/source:Runtime visibility check with
enroot start busybox-load-e2e cat /.enroot/source: