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 support for 'platform' parameter #75

Merged
merged 1 commit into from Oct 14, 2021
Merged

Add support for 'platform' parameter #75

merged 1 commit into from Oct 14, 2021

Conversation

jayaddison
Copy link
Contributor

@jayaddison jayaddison commented Oct 5, 2021

Description

This adds support for the platform argument to buildah, which can be used to configure the build OS, architecture and variant within a single parameter.

Related Issue(s)

Resolves #65.

Checklist

  • This PR includes a documentation change
  • This PR does not need a documentation change

  • This PR includes test changes
  • This PR's changes are already tested

  • This change is not user-facing
  • This change is a patch change
  • This change is a minor change
  • This change is a major (breaking) change

Changes made

Add the platform argument to both from-scratch and from-container-file build paths.

@jayaddison jayaddison marked this pull request as ready for review October 6, 2021 18:23
Copy link
Member

@divyansh42 divyansh42 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution 👍

I think we should not use the --arch flag when input platform is provided otherwise, it will result in an error.
I was assuming this will be handled by the buildah, but it fails if both the flags are provided.

error building system context: invalid --platform may not be used with --os, --arch, or --variant

Also, it will be great if you can add a test for this in the multiarch build workflow

@jayaddison
Copy link
Contributor Author

Thank you @divyansh42 for the review; I'll make those changes here soon, hopefully within the next few days.

@jayaddison
Copy link
Contributor Author

Reading a bit more of the history of the platform option, I noticed that containers/buildah@41ea934 (released in v1.23.0) recently added support for multiple platform values (the option changes from a singleton String type into a list-based StringSlice type).

That makes me wonder whether we should use getInputList to retrieve platform? (a YAML list isn't possible because GitHub Actions is awaiting support for a list input type)

@divyansh42
Copy link
Member

Reading a bit more of the history of the platform option, I noticed that containers/buildah@41ea934 (released in v1.23.0) recently added support for multiple platform values (the option changes from a singleton String type into a list-based StringSlice type).

That makes me wonder whether we should use getInputList to retrieve platform? (a YAML list isn't possible because GitHub Actions is awaiting support for a list input type)

@jayaddison Ubuntu 20.04 runners are still on buildah 1.21.3, so I think we'll have to wait for runners to update buildah to support multiple platform input.
For now probably we can go with single platform and meanwhile we can create an issue to add support for multiple platform once we have buildah v1.23.0 available.

Copy link
Member

@divyansh42 divyansh42 left a comment

Choose a reason for hiding this comment

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

@jayaddison I think we'll have to add separate jobs for arch and platform input. As both the inputs are contradictory and it will be hard to add these via matrix.
There is a syntax problem in the workflow you modified.

src/buildah.ts Outdated Show resolved Hide resolved
@jayaddison
Copy link
Contributor Author

I'm not certain whether this is the exact cause of the build failures at 7b92604, but I noticed that the available OS/Arch list on Docker Hub uses a full os/arch/variant format for the ARM64v8 image.

image

I've pushed 9871340 as an experiment to see if updating the platform argument to use that fixes the build, but am experimenting a bit at this point.

@divyansh42
Copy link
Member

I'm not certain whether this is the exact cause of the build failures at 7b92604, but I noticed that the available OS/Arch list on Docker Hub uses a full os/arch/variant format for the ARM64v8 image.

image

I've pushed 9871340 as an experiment to see if updating the platform argument to use that fixes the build, but am experimenting a bit at this point.

linux/arm64/v8 worked 👍

Copy link
Member

@divyansh42 divyansh42 left a comment

Choose a reason for hiding this comment

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

Thank you for addressing those reviews.
These changes looks good to me.

/cc @tetchel

@tetchel
Copy link
Contributor

tetchel commented Oct 12, 2021

Please fix the merge conflicts (#76 went in)

@jayaddison
Copy link
Contributor Author

Thanks both - merge conflicts now resolved.

Signed-off-by: James Addison <jay@jp-hosting.net>
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.

'platform' support
3 participants