-
Notifications
You must be signed in to change notification settings - Fork 102
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
Push/Pull file example #341
Comments
Hi @yuvalturg, can you elaborate your scenario a little bit?
Basically, how do you want to access this file after you pushing it to a repository? |
Yes a single layer is fine. Similar to what is described here https://oras.land/cli/1_pushing/ Oras push repo:tag /tmp/bigfile |
@Wwwsylvia Could you write an example for @yuvalturg? Besides, we probably need |
Thanks, I used oras-py, and it's as simple as |
@yuvalturg OK you will need a manifest to reference your file blob if you want to access it via a tag. |
Not really, I think a file store is needed anyway in this case. 🤔 |
This is great, I tried to that exactly that but I was missing |
@Wwwsylvia is there a way to get the local filename(s) from the filestore after pulling? |
@yuvalturg Regarding "get the local filename(s) from the filestore", my understanding is that you want to check the filenames associated with the pulled tag? Does the below code work for you? desc, err := fs.Resolve(ctx, tag)
if err != nil {
panic(err)
}
blobs, err := content.Successors(ctx, fs, desc)
if err != nil {
panic(err)
}
for _, b := range blobs {
if name := b.Annotations[v1.AnnotationTitle]; name != "" {
fmt.Println("filename: ", name)
}
} |
This works perfectly, thanks! |
Hello @yuvalturg, do you have any feedbacks on the user experiences of |
I can simply push any file using oras cli like below I can't simply find any example using oras-go. |
We may want to add a few more examples into https://pkg.go.dev/oras.land/oras-go/[email protected]/content/file#pkg-examples. |
The push/pull file example is now available at https://oras.land/client_libraries/0_go/#quick-start. |
This is also tracked by #434 |
Closed by #434 |
Hi,
Is there an example for a simple push-pull of a single, large (can't load it's entire content to memory) file to a repository?
Thanks!
The text was updated successfully, but these errors were encountered: