-
Notifications
You must be signed in to change notification settings - Fork 24
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
Enable Multi-Arch Building and Pushing for registry viewer #125
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6a7c255
update projects to use multi arch build
Jdubrick a85bec1
update dockerfile to customize timeout value
Jdubrick b48c1fd
add new script for building/pushing multi arch registry viewer
Jdubrick 443094f
free disk space and add qemu emulator
Jdubrick ed16040
use new build/push script and add qemu emulator
Jdubrick c04cf6f
add buildx setup to actions
Jdubrick 8a80f17
pin sha for buildx setup
Jdubrick fedf3f4
increase parallel to 4
Jdubrick c8ef2d3
break nx command into 2 separate commands
Jdubrick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Copyright Red Hat | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
BUILD_DIR=$ABSOLUTE_PATH/.. | ||
# Due to command differences between podman and docker we need to separate the process | ||
# for creating and adding images to a multi-arch manifest | ||
podman=${USE_PODMAN:-false} | ||
# Base Repository | ||
BASE_REPO="quay.io/devfile/registry-viewer" | ||
BASE_TAG="next" | ||
DEFAULT_IMG="$BASE_REPO:$BASE_TAG" | ||
# Platforms to build for | ||
PLATFORMS="linux/amd64,linux/arm64" | ||
|
||
if [ ${podman} == true ]; then | ||
echo "Executing with podman" | ||
|
||
podman manifest create "$DEFAULT_IMG" | ||
|
||
podman build --platform="$PLATFORMS" --manifest "$DEFAULT_IMG" "$BUILD_DIR" \ | ||
--no-cache \ | ||
--build-arg PROJECT_NAME=registry-viewer \ | ||
--build-arg NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH:-"/viewer"} | ||
|
||
podman manifest push "$DEFAULT_IMG" | ||
|
||
podman manifest rm "$DEFAULT_IMG" | ||
|
||
else | ||
echo "Executing with docker" | ||
|
||
docker buildx create --name registry-viewer-builder | ||
|
||
docker buildx use registry-viewer-builder | ||
|
||
docker buildx build --push --platform="$PLATFORMS" --tag "$DEFAULT_IMG" "$BUILD_DIR" \ | ||
--no-cache \ | ||
--provenance=false \ | ||
--build-arg PROJECT_NAME=registry-viewer \ | ||
--build-arg NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH:-"/viewer"} | ||
|
||
docker buildx rm registry-viewer-builder | ||
|
||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean a build might take close to one hour when this action runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The longest I've observed so far is around 30 minutes, I just increased it so we have a buffer since it is known to take a while. If GitHub supports arm64 runners in the future (the ones we use and not the large runners in which they now support arm), we'd be able to build the arm64 image in minutes.