-
Notifications
You must be signed in to change notification settings - Fork 240
feat: use content fetch instead of image pull #7573
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
base: main
Are you sure you want to change the base?
Conversation
7ed67cf to
a66f521
Compare
|
if this work, it will be a game changer: Why would anyone use ctr content fetch?
Pre-fetch blobs |
|
ctr content fetch <ref|descriptor> Downloads raw OCI blobs (manifest, config, layer tarballs) into the content store. ctr images pull Resolves the reference, downloads the same blobs into the content store, and creates the image record. |
1) Fetch (blobs land in content store)ctr content fetch docker.io/library/nginx:latest 2) Identify the manifest digest you fetchedctr content ls | grep manifest e.g. sha256:MANIFEST_DIGEST3) Create the image record (register name → manifest)ctr images create 4) (Optional) Unpack now to avoid first-run penaltyctr images unpack docker.io/library/nginx:latest 5) Runctr run --rm docker.io/library/nginx:latest nginx If you skip step 3, the image won’t show up in ctr images ls, and ctr run won’t find it. |
|
Having a penalty overhead of first time run is expected, but the tradeoff here is caching many more images since we have disk space of 15GB+ vs smaller set right now with unpacked. Did a lot of testing, there is an overall penalty of 5s-7s additional startup time, to unpack and register the image with snapshotter (overlayfs). But this penalty is across all the containers in parallel. with ctr content fetch mcr.microsoft.com/aks/aks-gpu-cuda:580.95.05-20251021155213 time ctr containers create mcr.microsoft.com/aks/aks-gpu-cuda:580.95.05-20251021155213 debug-box real 0m7.905s with time ctr images pull mcr.microsoft.com/aks/aks-gpu-cuda:580.95.05-20251021155213 real 0m16.372s time ctr containers create mcr.microsoft.com/aks/aks-gpu-cuda:580.95.05-20251021155213 debug-box real 0m0.054s |
|
Obviously we can use this option strategically, like use i feel that 5s-7s additional startup time is not much, compared to savings we get in additional areas like disk space, additional caching etc. But open to discuss as a team on pros and cons. |
What this PR does / why we need it:
We should just fetch the contents instead of performing a pull, so the compressed images remain on disk, when a run is performed all it does is unpack and run. The difference is negligible at cost of smaller initial image size.
here is the difference
Before
After
Which issue(s) this PR fixes:
Fixes #
Requirements:
Special notes for your reviewer:
Release note: