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

Support multi-arch builds in next-build GH Workflow #1212

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

AObuchow
Copy link
Collaborator

@AObuchow AObuchow commented Dec 4, 2023

What does this PR do?

This PR extends the Next container build GitHub action to build the devworkspace-controller
& project-clone images for the following platforms:

  • linux/amd64
  • linux/arm64
  • linux/ppc64le
  • linux/s390x

Support for building the index, bundle and respect digest images for these platforms was also added in 8b80138. However, the implementation is a bit awkward: rather than using the docker buildx action, the buildx builder is manually setup and used in the build_digests_bundle.sh and build_index_image.sh scripts if the new --multi-arch flag is used.

Additionally, it seems that docker buildx uses a single virtual network layer for all platform builds which are run in parallel. When building the olm images, the opm --serve --cache-only command binds to localhost:6000, causing the other builds to fail as they cannot bind to the smart address/port. The quay.io/operator-framework/opm:latest image does not include a shell, so changing the port used based on the architecture we're building for is not possible (unless we copy over a shell from another image). As a workaround, I'm configuring the buildx builder to disable parallelism in the buildkitd.toml to prevent this race condition.

Che/DevSpaces might not even need the index, bundle and digest images to be built for multiple platforms anyhow -- so this commit could optionally be removed.

What issues does this PR fix or reference?

#559

Is it tested? How?

Since these changes only get triggered after merging to the main branch, I tested that the build-next-imgs & build-next-olm-imgs jobs succeeded on my fork.

The resulting images were build for all 4 architectures and pushed to my quay repo's:

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f4dd026) 52.78% compared to head (b270e62) 52.79%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1212   +/-   ##
=======================================
  Coverage   52.78%   52.79%           
=======================================
  Files          84       84           
  Lines        7604     7616   +12     
=======================================
+ Hits         4014     4021    +7     
- Misses       3302     3306    +4     
- Partials      288      289    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

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

LGTM

build/scripts/build_digests_bundle.sh Outdated Show resolved Hide resolved
build/scripts/build_digests_bundle.sh Outdated Show resolved Hide resolved
build/scripts/build_index_image.sh Outdated Show resolved Hide resolved
build/scripts/build_index_image.sh Outdated Show resolved Hide resolved
build/scripts/build_digests_bundle.sh Outdated Show resolved Hide resolved
Copy link

openshift-ci bot commented Dec 4, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, AObuchow

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

@openshift-ci openshift-ci bot added approved and removed lgtm labels Dec 4, 2023
Copy link

openshift-ci bot commented Dec 6, 2023

New changes are detected. LGTM label has been removed.

@AObuchow AObuchow force-pushed the multi-arch-builds-new branch from b7ba107 to cb30572 Compare December 6, 2023 18:28
@AObuchow AObuchow force-pushed the multi-arch-builds-new branch from cb30572 to b270e62 Compare December 6, 2023 20:12
@AObuchow AObuchow merged commit af32e29 into devfile:main Dec 6, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants