-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi Arch Support for Devfile Index and Devfile Index Base (#245)
* add multi arch build and push script Signed-off-by: Jordan Dubrick <[email protected]> * add ability to build for different arch to existing build scripts and update docs Signed-off-by: Jordan Dubrick <[email protected]> * update workflows to build and push multi arch index base Signed-off-by: Jordan Dubrick <[email protected]> * update ci dockerfile to download proper arch for yq Signed-off-by: Jordan Dubrick <[email protected]> * pr-comment: improve log readability Signed-off-by: Jordan Dubrick <[email protected]> * pr-comment: update ci to have jobs for each arch Signed-off-by: Jordan Dubrick <[email protected]> --------- Signed-off-by: Jordan Dubrick <[email protected]>
- Loading branch information
Showing
8 changed files
with
110 additions
and
10 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,20 +31,20 @@ jobs: | |
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | ||
with: | ||
go-version: 1.19 | ||
- name: Set up QEMU # Enables arm64 image building | ||
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 #v3.0.0 | ||
- name: Login to Quay | ||
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
- name: Build the index server base image | ||
- name: Build and push the index server base image | ||
run: | | ||
cd index/server | ||
export GOPATH=$(go env GOPATH) | ||
go install github.com/deepmap/oapi-codegen/cmd/[email protected] | ||
bash ./build.sh | ||
- name: Push the index server base image | ||
run: cd index/server && bash ./push.sh quay.io/devfile/devfile-index-base:next | ||
bash ./build-multi-arch.sh | ||
dispatch: | ||
needs: indexServerBuild | ||
|
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,55 @@ | ||
#!/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. | ||
|
||
# Build the index container for the registry | ||
buildfolder="$(realpath $(dirname ${BASH_SOURCE[0]}))" | ||
# 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/devfile-index-base" | ||
BASE_TAG="next" | ||
DEFAULT_IMG="$BASE_REPO:$BASE_TAG" | ||
# Platforms to build for | ||
PLATFORMS="linux/amd64,linux/arm64" | ||
|
||
# Generate OpenAPI endpoint and type definitions | ||
bash ${buildfolder}/codegen.sh | ||
|
||
if [ ${podman} == true ]; then | ||
echo "Executing with podman" | ||
|
||
podman manifest create "$DEFAULT_IMG" | ||
|
||
podman build --platform="$PLATFORMS" --manifest "$DEFAULT_IMG" --build-arg ENABLE_HTTP2=${ENABLE_HTTP2} $buildfolder | ||
|
||
podman manifest push "$DEFAULT_IMG" | ||
|
||
podman manifest rm "$DEFAULT_IMG" | ||
|
||
else | ||
echo "Executing with docker" | ||
|
||
docker buildx create --name index-base-builder | ||
|
||
docker buildx use index-base-builder | ||
|
||
docker buildx build --push --platform="$PLATFORMS" --tag "$DEFAULT_IMG" --provenance=false --build-arg ENABLE_HTTP2=${ENABLE_HTTP2} $buildfolder | ||
|
||
docker buildx rm index-base-builder | ||
|
||
fi |
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