From 485f1fee5a4bd24708fcb06b3eb6b21c2ad4ef86 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Wed, 8 May 2024 13:46:40 +0100 Subject: [PATCH] Build arm images --- .github/workflows/build-push-docker.yaml | 1 + Dockerfile.dask-worker | 3 ++- Dockerfile.jupyterhub | 3 ++- Dockerfile.jupyterlab | 3 ++- Dockerfile.workflow-controller | 3 ++- scripts/install-conda.sh | 13 +++++++++++-- 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-push-docker.yaml b/.github/workflows/build-push-docker.yaml index 2453f6d..4893364 100644 --- a/.github/workflows/build-push-docker.yaml +++ b/.github/workflows/build-push-docker.yaml @@ -119,3 +119,4 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max build-args: BASE_IMAGE=${{ env.BASE_IMAGE }} + platforms: linux/amd64,linux/arm64 \ No newline at end of file diff --git a/Dockerfile.dask-worker b/Dockerfile.dask-worker index e04a8e4..6d27211 100644 --- a/Dockerfile.dask-worker +++ b/Dockerfile.dask-worker @@ -16,7 +16,8 @@ RUN /opt/scripts/install-apt-minimal.sh COPY scripts/fix-permissions /opt/scripts/fix-permissions ENV MAMBAFORGE_VERSION 4.13.0-1 -ENV MAMBAFORGE_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c +ENV MAMBAFORGE_AARCH64_SHA256 69e3c90092f61916da7add745474e15317ed0dc6d48bfe4e4c90f359ba141d23 +ENV MAMBAFORGE_X86_64_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c SHELL ["/bin/bash", "-c"] ENV PATH=/opt/conda/bin:${PATH}:/opt/scripts diff --git a/Dockerfile.jupyterhub b/Dockerfile.jupyterhub index e611792..5d1fec5 100644 --- a/Dockerfile.jupyterhub +++ b/Dockerfile.jupyterhub @@ -15,7 +15,8 @@ RUN /opt/scripts/install-apt-minimal.sh COPY scripts/fix-permissions /opt/scripts/fix-permissions ENV MAMBAFORGE_VERSION 4.13.0-1 -ENV MAMBAFORGE_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c +ENV MAMBAFORGE_AARCH64_SHA256 69e3c90092f61916da7add745474e15317ed0dc6d48bfe4e4c90f359ba141d23 +ENV MAMBAFORGE_X86_64_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c SHELL ["/bin/bash", "-c"] ENV PATH="/opt/conda/bin:$PATH:/opt/scripts" diff --git a/Dockerfile.jupyterlab b/Dockerfile.jupyterlab index 2693b2b..a5cc94c 100644 --- a/Dockerfile.jupyterlab +++ b/Dockerfile.jupyterlab @@ -18,7 +18,8 @@ RUN /opt/scripts/install-apt-minimal.sh COPY scripts/fix-permissions /opt/scripts/fix-permissions ENV MAMBAFORGE_VERSION 4.13.0-1 -ENV MAMBAFORGE_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c +ENV MAMBAFORGE_AARCH64_SHA256 69e3c90092f61916da7add745474e15317ed0dc6d48bfe4e4c90f359ba141d23 +ENV MAMBAFORGE_X86_64_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c SHELL ["/bin/bash", "-c"] ENV CONDA_DIR=/opt/conda \ DEFAULT_ENV=default diff --git a/Dockerfile.workflow-controller b/Dockerfile.workflow-controller index 2313c74..81a8985 100644 --- a/Dockerfile.workflow-controller +++ b/Dockerfile.workflow-controller @@ -18,7 +18,8 @@ RUN /opt/scripts/install-apt-minimal.sh COPY scripts/fix-permissions /opt/scripts/fix-permissions ENV MAMBAFORGE_VERSION 4.13.0-1 -ENV MAMBAFORGE_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c +ENV MAMBAFORGE_AARCH64_SHA256 69e3c90092f61916da7add745474e15317ed0dc6d48bfe4e4c90f359ba141d23 +ENV MAMBAFORGE_X86_64_SHA256 412b79330e90e49cf7e39a7b6f4752970fcdb8eb54b1a45cc91afe6777e8518c SHELL ["/bin/bash", "-c"] ENV CONDA_DIR=/opt/conda \ DEFAULT_ENV=default diff --git a/scripts/install-conda.sh b/scripts/install-conda.sh index 8e2e23b..fa46ac7 100755 --- a/scripts/install-conda.sh +++ b/scripts/install-conda.sh @@ -5,8 +5,17 @@ set -xe # Requires environment MAMBAFORGE_SHA256, MINIFORGE_VERSION, and DEFAULT_ENV -wget --quiet -O mambaforge.sh https://github.com/conda-forge/miniforge/releases/download/$MAMBAFORGE_VERSION/Mambaforge-Linux-x86_64.sh -echo "${MAMBAFORGE_SHA256} mambaforge.sh" >mambaforge.checksum +arch=$(uname -i) +wget --quiet -O mambaforge.sh https://github.com/conda-forge/miniforge/releases/download/$MAMBAFORGE_VERSION/Mambaforge-Linux-$arch.sh + +if [[ $arch == "aarch64" ]]; then + echo "${MAMBAFORGE_AARCH64_SHA256} mambaforge.sh" >mambaforge.checksum +elif [[ $arch == "x86_64" ]]; then + echo "${MAMBAFORGE_X86_64_SHA256} mambaforge.sh" >mambaforge.checksum +else + echo "Unsupported architecture: $arch" + exit 1 +fi echo $(sha256sum -c mambaforge.checksum)