Skip to content
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

Nydusify: ignore arch for single manifest #359

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

imeoer
Copy link
Collaborator

@imeoer imeoer commented Mar 30, 2022

For a single manifest image, we just ignore the arch, so that allowing
to do a default conversion on a different arch's host, for example
converting an arm64 image on an amd64 host.

Signed-off-by: Yan Song imeoer@linux.alibaba.com

@imeoer imeoer changed the title [WIP] Nydusify: fix arm platform support for single manifest Nydusify: ignore arch for single manifest Apr 1, 2022
@@ -118,7 +118,7 @@ func (parser *Parser) pullIndex(ctx context.Context, desc *ocispec.Descriptor) (
}

func (parser *Parser) parseImage(
ctx context.Context, desc *ocispec.Descriptor, onlyManifest *ocispec.Manifest,
ctx context.Context, desc *ocispec.Descriptor, onlyManifest *ocispec.Manifest, ignoreArch bool,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no way for nydusify to specify ignoreArch?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it going to be used? Please add an example in the docs.

Copy link
Collaborator Author

@imeoer imeoer Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comment. No way to specify. For a single manifest image, it's an automatic behavior to ignore the image arch for ease of use, attempt to continue converting, and give a warning message. For the manifest list, nydusify selects host specified arch to convert, but the user still can specify an interesting platform (by --platform), the ultimate goal is that nydusify/nydus-image can convert any arch's image on any arch's host.

For a single manifest image, we just ignore the arch, so that allowing
to do a default conversion on a different arch's host, for example
converting an arm64 image on an amd64 host.

Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
}

// Just give user a simple hint telling option was ignored.
if config.Architecture != parser.interestedArch {
return nil, errors.Errorf("Specified %s architecture was not found", parser.interestedArch)
err = errors.Errorf("Found arch %s, but the specified target arch (--platform) is %s", config.Architecture, parser.interestedArch)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be move into else{} branch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same error message should be returned if no ignoreArch.

@bergwolf bergwolf merged commit a0ba196 into dragonflyoss:master Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants