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

Multi Arch Support for Devfile Index and Devfile Index Base #245

Merged
merged 6 commits into from
Jun 6, 2024

Conversation

Jdubrick
Copy link
Contributor

@Jdubrick Jdubrick commented Jun 3, 2024

Please specify the area for this PR
Building images for multiple architectures

What does does this PR do / why we need it:
This PR allows for the devfile-index-base image to be built for different architectures. A summary of the changes are:

  • Added support for ./build.sh to take an optional argument that allows a user to build for a different architecture. The default is linux/amd64.
  • Added build-multi-arch.sh which takes care of building and pushing a multi-arch image called devfile-index-base:next to quay. This allows for users to pull from quay.io/devfile/devfile-index-base:next and it will provide them with the correct image for their arch.
  • Updated testing run on PRs to test the image build for both linux/amd64 and linux/arm64.
  • Updated pushimage-next.yaml to utilize the new build-multi-arch.sh script.
  • Updated documentation to explain the new ability to use the build scripts for different architectures.
  • Updated .ci/Dockerfile to set the yq architecture to be consistent with the architecture being built, previously it was hardcoded to amd64.

Which issue(s) this PR fixes:

fixes devfile/api#1547
partially fixes devfile/api#1551

PR acceptance criteria:

  • Test Coverage
    • Are your changes sufficiently tested, and are any applicable test cases added or updated to cover your changes?

Documentation (WIP)

How to test changes / Special notes to the reviewer:

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 3, 2024
Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

lgtm tested locally all the scripts and they were ok. Left a minor comment regarding logging.

@@ -110,7 +110,7 @@ jobs:
cd index/server
export GOPATH=$(go env GOPATH)
go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@${{ env.OAPI_CODEGEN_VERSION }}
bash ./build.sh
bash ./build.sh && bash ./build.sh linux/arm64
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering here how we could make it more explicit when something fails. Like, if it makes sense to add different steps per architecture OR maybe add some (kind-of) logging in the building script. This way when something fails we can see it quickly from the workflow logs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope for the PR but might be good to add the commands here in a script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this line is just testing to make sure the builds are working on a PR I can split it up so instead of them being combined they can each have their own setup? One for amd64 and one for arm64?

On the other hand with logging I can also try to alter the script to add some more logging into it, I will try both and see which one is more clear! I don't mind checking it out in this PR as I feel proper logging for the arch is part of the scope for this.

@thepetk
Copy link
Contributor

thepetk commented Jun 5, 2024

@Jdubrick Ive also read today this blog post. Not sure if it's something that we would like to use here

https://github.blog/2024-06-03-arm64-on-github-actions-powering-faster-more-efficient-build-systems/

Copy link
Member

@maysunfaisal maysunfaisal left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2024
Copy link

openshift-ci bot commented Jun 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jdubrick, maysunfaisal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Jdubrick Jdubrick merged commit c1f12da into devfile:main Jun 6, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
3 participants