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

Add the --arch and --arch-variant build options #327

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

afbjorklund
Copy link
Contributor

@afbjorklund afbjorklund commented Feb 14, 2025

Description of the Pull Request (PR):

Documents the --arch and --arch-variant options for pull and for build.

Currently variant is only used on arm32, not on amd64 and not on arm64.

The default in docker and in kubernetes is to use arm32v7, and arm64v8.

https://github.com/docker-library/official-images#architectures-other-than-amd64

For amd64 the default is v1, but v2 and v3 are now used by RHEL 9 and 10.

For arm64 the default is v8, but v9 is now getting more common as well...

But currently these architectures do not support (and do not need) any variants.

This fixes or addresses the following GitHub issues:

@afbjorklund
Copy link
Contributor Author

I opened another issue, to make the --arch-variant option obsolete - by having it just default to 7.

Also wondered, if the --arch-variant options should be written as v7 and v8 (instead of 7 and 8)?

The apptainer commands already accept both forms.

@afbjorklund afbjorklund requested a review from DrDaveD February 22, 2025 16:30
Copy link
Contributor

@DrDaveD DrDaveD left a comment

Choose a reason for hiding this comment

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

I still see one thing missing. The CPU emulation section is in this file but it only talks about running a container. Somewhere there needs to be something that says that CPU emulation needs to be enabled in order to build for different architectures. I think it probably makes most sense in the new Build architecture section but I leave that up to you.

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Feb 24, 2025

There is potentially some duplication (for now I just linked the other two places to the one with the information).

And not all image builds actually do require emulation, but most of them do (depending on scripts vs. just files)

EDIT: I guess technically I only linked "specifying an architecture", not the "CPU emulation" chapter below it...

Perhaps we need some common section outside either command, and then link both pull and build to it?

@DrDaveD
Copy link
Contributor

DrDaveD commented Feb 24, 2025

Also wondered, if the --arch-variant options should be written as v7 and v8 (instead of 7 and 8)?

The apptainer commands already accept both forms.

I don't have an opinion on that, I'll leave it up to you.

@afbjorklund
Copy link
Contributor Author

Added links to both sections, and examples of both. Hopefully the --arch-variant will soon be obsolete.

The names of the variants in the documentation should follow the code, so when that changes it will too...

supported variants are [5, 6, 7] (changed to supported variants are [v5, v6, v7])

@afbjorklund afbjorklund requested a review from DrDaveD February 24, 2025 20:20
@DrDaveD DrDaveD merged commit 450886e into apptainer:main Feb 24, 2025
2 checks passed
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.

Document --arch and --arch-variant for build
2 participants