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

Provide a way to specify desired platform when creating packages and builders #1459

Closed
1 task done
Tracked by #294
dmikusa opened this issue Jun 15, 2022 · 13 comments · Fixed by #2086
Closed
1 task done
Tracked by #294

Provide a way to specify desired platform when creating packages and builders #1459

dmikusa opened this issue Jun 15, 2022 · 13 comments · Fixed by #2086
Assignees
Labels
epic/multi-arch status/blocked Issue or PR that is blocked. See comments. status/requires-rfc Issue or PR that requires an RFC to be filed. type/enhancement Issue that requests a new feature or improvement.
Milestone

Comments

@dmikusa
Copy link
Contributor

dmikusa commented Jun 15, 2022

Description

With the growing need for ARM64 images, it is a challenge to build them with the current tool support. It would be helpful if we had the ability to cross package buildpacks.

If I'm on an x86_64 system, I can cross-compile my buildpack code with Go (or I could be using something that doesn't need to be compiled like Bash), however, when I run pack buildpack package, it will only package the image for the architecture on which I'm presently running. That doesn't seem on the surface that it would be a technical requirement to assemble the image though, the architecture-specific files are being passed into the tool.

Proposed solution

I could see this being done in a few different ways:

  1. As a flag to the pack cli.
  2. As an option in package.toml, one could then specify a different package.toml file for each desired image
  3. Both 1 and 2.

Describe alternatives you've considered

You can not do this, but it complicates the process as you then need a host OS for every os/architecture that you'd like to support.

Additional context

  • This feature should be documented somewhere
@dmikusa dmikusa added status/triage Issue or PR that requires contributor attention. type/enhancement Issue that requests a new feature or improvement. labels Jun 15, 2022
@jromero jromero added status/requires-rfc Issue or PR that requires an RFC to be filed. and removed status/triage Issue or PR that requires contributor attention. labels Jun 17, 2022
@shruti1421
Copy link

Hey @dmikusa, I'm really interested to work on this project under LFX Mentorship 2023. Kindly guide me how to apply to this project and what are the resources required for solving this issue.

@dmikusa
Copy link
Contributor Author

dmikusa commented Feb 9, 2023

If you reach out on the project Slack -> https://cloud-native.slack.com there's a #buildpacks-mentoring channel. Someone there should be able to help you out.

@abhinandanudupa
Copy link

If you reach out on the project Slack -> https://cloud-native.slack.com there's a #buildpacks-mentoring channel. Someone there should be able to help you out.

@dmikusa unfortunately we cannot join the Slack community without a @rafay.co or @huawei.com email.

@dfreilich
Copy link
Member

@abhinandanudupa That is probably another slack instance. You can get an invitation to the Cloud Native slack for any email here: https://communityinviter.com/apps/cloud-native/cncf

@abhinandanudupa
Copy link

@dfreilich Thank you!

@natalieparellano
Copy link
Member

Here is a Miro board that we've used to illustrate how things work today and what a future workflow might be: https://miro.com/app/board/uXjVPrqGPB4=/

It might make sense to split this issue into two (one for buildpack packages, other for builders).

Buildpack packages

pack buildpack package

should look at the target data in buildpack.toml and create a different package for each os/arch combination that is supported by the buildpack. Optionally,

pack buildpack package --platform XXX

could create a package for the desired platform.

Builders

pack create builder --config builder.toml

Where builder.toml contains a reference to a build-time base image and runtime base image:

# This image is used at runtime
run-image = "cnbs/sample-stack-run:bionic"
# This image is used at build-time
build-image = "cnbs/sample-stack-build:bionic"

Note this schema will be modified as part of #1303.

If the referenced build-image and the referenced run-image are manifest lists, pack should create a different builder for each os/arch combination that is supported by all buildpacks. Optionally,

pack create builder --config builder.toml --platform XXX

should create a builder for the desired platform, failing if all buildpacks do not support it. Where builder.toml [[buildpacks]] references buildpack packages, those packages should be manifest lists (see #1460).

cc @AidanDelaney @jabrown85 @jjbustamante @joe-kimmel-vmw @jpena-r7 @ryanmoran

@jjbustamante
Copy link
Member

Also, here is a recording of the meeting where we were talking using the mirror board mentioned by @natalieparellano

@AnirudhBot
Copy link

Hey @jjbustamante , I am really interested in this discussion and proposed solutions. I went through the buildpacks concepts and also the miro board link to get an understanding of pack build and the platform specification workflow. I would love to be a value contributor to this issue as a LFX mentee and eventually many more! Looking forward :)

@jjbustamante
Copy link
Member

Now that the stack removal was shipped, this issue requires a sub-team RFC to clarify how we can implement the requirement now that targets are part of the buildpack.toml

@jjbustamante jjbustamante added this to the 0.31.0 milestone Aug 18, 2023
@jjbustamante
Copy link
Member

jjbustamante commented Aug 18, 2023

@dmikusa Do you have time to work on this? or do you want someone else to pick it up?

@hone I think this is related to what you mentioned in the last WG, how do we set the arch/os during creation of buildpackage

@dmikusa dmikusa removed their assignment Aug 18, 2023
@dmikusa
Copy link
Contributor Author

dmikusa commented Aug 18, 2023

Happy to help in terms of discussion & testing, I don't have time at the moment to help with dev work.

@jjbustamante jjbustamante modified the milestones: 0.32.0, 0.33.0 Oct 17, 2023
@jjbustamante jjbustamante modified the milestones: 0.33.0, 0.34.0 Nov 22, 2023
@jjbustamante jjbustamante added the status/blocked Issue or PR that is blocked. See comments. label Nov 22, 2023
@jjbustamante
Copy link
Member

blocked on the following RFC

@edmorley
Copy link
Contributor

edmorley commented Jun 5, 2024

I think the milestone for this issue is incorrect? It's currently in 0.35.0 but #2086 landed in 0.34.0.

@jjbustamante jjbustamante modified the milestones: 0.35.0, 0.34.0 Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic/multi-arch status/blocked Issue or PR that is blocked. See comments. status/requires-rfc Issue or PR that requires an RFC to be filed. type/enhancement Issue that requests a new feature or improvement.
Projects
Status: Done
9 participants