-
Notifications
You must be signed in to change notification settings - Fork 181
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
Oras attach with plateform weird behavior when using oras cp #812
Comments
|
In the below graph:
graph TD
A --> index
index --> linux/amd64
index --> linux/arm64
index --> linux/s390x
B --> linux/s390x
|
Sorry it's a typo error the cp -r has been done to I have redo the step:
And if i use the cp -r
I use the wrong oras cp command, or did I not understand something? |
Or i don't need to use the platform flag but only the digest of the Linux/s390x ? |
sorry I don't get it, do you mean when copying? |
I cannot reproduce this, if |
Yeah i'm sure that the -r is used |
yes |
I cannot reproduce the issue, I can copy the index(4169ef297659) and its referrers(f28da388ea96) even when the index is already in the registry.
Can you double check again? In below log, if both the index(4169ef297659) and its referrers(f28da388ea96) are both existent in the registry, the log should show the existence of the up-most node, which is the referrer (in your log,
|
I have recreated the repository and have done this:
and this
Then if I check the discover:
|
This is expected behavior. What you have done is recursively copying from the
graph TD
index --> linux/amd64
index --> linux/arm64
index --> linux/s390x
sha256:31669797 --> linux/s390x
|
Double checked, this is indeed a bug, summarizing it:
|
@SamirPS Before we fix this issue, there is a workaround: if you need to recursively copying a certain-arch image, PLEASE don't specify the image via |
@qweeah Okay, I do this
Only the linux/s390x image and the artefacts it's copied, but how to copy also at the same time the image for the other arches like am64? Do I need to redo copy with the digest? Would you happen to have some examples of commands? |
The digest |
The first command :
The second: same error. But how do I give them the v1 tag in the destination registry? Like what I want at the end in xxx.azurecr.io/artifactstest:v1 it's an multi-arch manifest with an oci artifact attached to linux/s390x |
You can only tag x390s as v1 since you are copying recursively from x390s |
#816 I created this issue, after it's done, you may do the tagging and referrer copying all in one line. |
what index do I tag ? do you have some examples of commands? because don't really see how to do the step2 |
|
Updated: try below if you want to get the index digest automatically:
|
Basically the #816 makes sure that you copy whatever you need in one line command and don't need to mess around with those digests. |
Thanks for this command; for now it's work but need for me to run more test |
@SamirPS After taking a close look at the code I realized that I have made some mistakes in my early replies. To clarify, Copying from a specific arch recursively will NOT cover the multi-arch index manifest and images in other architectures. (I have crossed out my false statements, sorry for the trouble) |
@SamirPS Suppose you have a multi-arch image and artifacts attached to s390x image and index manifest: graph TD
Z>v1] -..-> index
index -- linux/amd64 --> A[image]
index -- linux/arm64 --> B[image]
index -- linux/s390x --> C[image]
artifact0 --> index
artifact1 --> C
If you want to copy everything(index, artifact0, artifact1, all the images) from # 1. copy the multi-arch image list
oras cp -r $A:v1 $B:v1 # this copies index, artifact0 and all images
# 2. copy EACH image with artifact attached (in this case s390x only)
oras cp -r $A@$DIGEST_OF_S390X $B # this copies artifact1 You can also replace After #818 is merged and released, you don't need to obtain the digest of a certain and can simply use below command: # 1. copy the multi-arch image list
oras cp -r $A:v1 $B:v1 # this copies index, artifact0 and all images
# 2. copy EACH image with artifact attached (in this case s390x only)
oras cp -r $A:v1 $B --platform linux/s390x # this copies artifact1 |
@qweeah Thanks for the update. So if I understand well, if I have attached one artefact to the platform amd64 and one on s390x. The workflow would be as follows:
And these workflows permit sending all the images and the artefact on amd64 and s390x? |
I have tested it and seem to work thanks @qweeah |
What happened in your environment?
I have done this:
the output is
After that, I want to copy this to an azure repository with the following:
output:
But now if I do
I have this:
But if I do
So right now I don't know on what these two artifacts are related and it's weird that no artifact is related to the linux/s390x platform
What did you expect to happen?
Normally when I don't use the platform flag I will have no discovered artefact. But with the platform flag, I need to have 1 artefact named sbom.
How can we reproduce it?
Ubuntu jammy and theses commands:
What is the version of your ORAS CLI?
Version: 1.0.0-rc.1+unreleased
Go version: go1.20
Git commit: 8bda262
Git tree state: clean
What is your OS environment?
Ubuntu jammy
Are you willing to submit PRs to fix it?
The text was updated successfully, but these errors were encountered: