From c820bbe1440c50b0fc74267143efa9f85cebdba1 Mon Sep 17 00:00:00 2001 From: Marcos Amorim Date: Mon, 6 Jan 2025 10:16:08 -0500 Subject: [PATCH] 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. --- .../ee-multicloud-public/install_binaries.sh | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tools/execution_environments/ee-multicloud-public/install_binaries.sh b/tools/execution_environments/ee-multicloud-public/install_binaries.sh index 1afc1e32697..cab37d827bd 100755 --- a/tools/execution_environments/ee-multicloud-public/install_binaries.sh +++ b/tools/execution_environments/ee-multicloud-public/install_binaries.sh @@ -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 @@ -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