Oras cache saves the blob, updated the index.json, but fails to retrieve from cache in a second pull attempt #1504
-
Hi, everyone. I am facing a weird behavior with OCI container pulling and would like to start a discussion to have more insights. I am not sure if this is a bug or not hence opening as a discussion instead of a bug to have an initial opinion here. So, to give some context, I have a typescript application that does many things, including acting as a wrapper for some oras commands, i.e., imagine a typescript application that has a Now, to the problem: Recently, I came to know about the oras cache and thought to add so that I can save time from oras pulling OCI images. Initially, I tested locally by setting up the ORAS_CACHE env var and doing some push and pull and I can see it working perfectly. Then, I went ahead, added the ORAS_CACHE as env var for my lambda and tried to pull. The first pull of course took time as the cache had zero entries. Image is pulled by oras and I can see oras honoring the ORAS_CACHE and saving the blobs in the cache: The index.json is populated as well: Then, I would expect the second pull to be blazing fast, but it is not. It seems that oras is not using the previous content saved in the cache which is weird. I came to some questions/conclusions:
So, I am not sure why oras is saving, but refusing to read from cache here. Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
@flavioschuindt can you kind share the version of ORAS CLI you used as well as the |
Beta Was this translation helpful? Give feedback.
-
Hi @flavioschuindt, this does sound strange.
To confirm this, could you collect the debug logs via |
Beta Was this translation helpful? Give feedback.
-
Hi @Wwwsylvia and @qweeah, apologies for the delay here, but would like to give a quick update. Thanks for mentioning the We can close this ticket and thank you once again for the support! |
Beta Was this translation helpful? Give feedback.
Hi @Wwwsylvia and @qweeah, apologies for the delay here, but would like to give a quick update. Thanks for mentioning the
-debug
flag, I was able to enable it inside my TypeScript oras module and I found the root cause: This is not related to oras download at all. Instead, what I learned is that oras does two things: download and extract into the file system. The download part is ok, but what actually takes time is the extraction and this makes sense because my OCI package is a TS application with bunch of node modules backed by NFS. This means that oras is extracting into NFS file by file and this is an expensive operation. There are more than 12k files in the node_modules folder:We ca…