Skip to content

Commit

Permalink
Add multi-platform support for execution environment (#8951)
Browse files Browse the repository at this point in the history
* feat(ee-multicloud-public): add multi-platform support for execution environments

- Updated `install_binaries.sh` to dynamically detect system architecture (`ARCH`)
- Modified OpenShift CLI (`oc`) installation to use RHEL 8 version with architecture-specific tarballs.
- Adjusted AWS CLI download URL to include architecture detection.
- Added placeholder for Bitwarden CLI installation, as it does not support ARM64 yet.

* Update build-ee workflow adding support for multi arch

* Add QEMU setup for multi-platform builds in build-ee.yml

- Added QEMU setup using `docker/setup-qemu-action@v2` to enable emulation for multiple architectures.
- Installed `qemu` and `binfmt-support` as dependencies to ensure proper handling of multi-platform builds.

* fix(workflow): adjust QEMU setup order for multi-platform builds in build-ee.yml

- Added a step to install `qemu` and `binfmt-support` before setting up QEMU.

* add cache for Buildah layers in GitHub Actions

- Configures cache for `/var/lib/containers/storage` using `actions/cache@v4`.
- Implements keys to reuse layers from previous builds.
- Enables layer reuse in Buildah with `layers: true`.
  • Loading branch information
marcosmamorim authored Feb 12, 2025
1 parent 4c418e6 commit 914b18d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build-ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,36 @@ jobs:

- uses: actions/setup-python@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y qemu binfmt-support
- name: Setup QEMU for multi-platform builds
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Cache Buildah layers
uses: actions/cache@v4
with:
path: /var/lib/containers/storage
key: ${{ runner.os }}-buildah-cache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildah-cache-
- name: Buildah Action
uses: redhat-actions/buildah-build@v2
id: build-image
with:
image: ee-multicloud
tags: ${{inputs.tag}} ${{ github.sha }}
labels: ${{ inputs.labels }}
platforms: linux/amd64,linux/arm64
context: tools/execution_environments/ee-multicloud-public
containerfiles: |-
tools/execution_environments/ee-multicloud-public/Containerfile
layers: true

- name: Push To quay.io
id: push-to-quay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@ set -ue

cd /tmp

# OC
# initArch discovers the architecture for this system.
ARCH=$(uname -m)
case $ARCH in
armv5*) ARCH="armv5";;
armv6*) ARCH="armv6";;
armv7*) ARCH="arm";;
aarch64) ARCH="arm64";;
x86) ARCH="386";;
x86_64) ARCH="amd64";;
i686) ARCH="386";;
i386) ARCH="386";;
esac

# OC
# Install rhel8 version of oc
# https://access.redhat.com/solutions/7077895
version=stable
arch=x86_64
tarball=openshift-client-linux.tar.gz
url="https://mirror.openshift.com/pub/openshift-v4/${arch}/clients/ocp/${version}/${tarball}"
tarball=openshift-client-linux-${ARCH}-rhel8.tar.gz
url="https://mirror.openshift.com/pub/openshift-v4/${ARCH}/clients/ocp/${version}/${tarball}"
curl -s -L "${url}" -o ${tarball}
tar xzf ${tarball}
install -t /usr/bin oc kubectl
rm ${tarball}

# Bitwarden

# DISCLAIMER: BW doesn't support ARM64 yet, so this is just a placeholder
url="https://vault.bitwarden.com/download/?app=cli&platform=linux"
curl -s -L "${url}" -o bw.zip
unzip bw.zip
Expand All @@ -24,9 +37,8 @@ rm bw bw.zip


# AWS CLI

aws_version=2.4.23
curl -s -L "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${aws_version}.zip" \
curl -s -L "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m)-${aws_version}.zip" \
-o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
Expand Down

0 comments on commit 914b18d

Please sign in to comment.