From 722fafc26356c75825b13ea2dfda082e0e8d9dd7 Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Fri, 15 Dec 2023 17:11:20 -0800 Subject: [PATCH] test arm builds for current builds (#7) * test arm builds for current builds (will need to do on aws instance) Signed-off-by: vsoch --- .github/workflows/build-matrices.yaml | 6 +++--- rocky/Dockerfile | 16 +++++++++++++--- ubuntu/Dockerfile | 16 +++++++++++++--- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-matrices.yaml b/.github/workflows/build-matrices.yaml index 7f5efc8..da1080e 100644 --- a/.github/workflows/build-matrices.yaml +++ b/.github/workflows/build-matrices.yaml @@ -1,7 +1,6 @@ name: Flux View Build Matrices on: - # Enable for testing builds for a PR workflow_dispatch: pull_request: [] push: @@ -51,7 +50,7 @@ jobs: if: ${{ needs.generate.outputs.empty_matrix == 'false' }} - name: Build ${{ matrix.result.container_name }} ${{ matrix.arch[0] }} + name: Build ${{ matrix.result.container_name }} ${{ matrix.arch }} steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -79,6 +78,7 @@ jobs: container_name=$(python .github/container_name.py "${container}" flux-view) echo "Container name is ${container_name}" echo "container_name=${container_name}" >> $GITHUB_ENV + echo "container_arch=x86_64" >> $GITHUB_ENV - name: Pull Docker Layers run: docker pull ghcr.io/converged-computing/${container_name} || exit 0 @@ -112,7 +112,7 @@ jobs: with: context: ${{ env.dockerfile_dir }} file: ${{ env.filename }} - platforms: ${{ matrix.arch[0] }} + platforms: ${{ matrix.arch }} push: ${{ github.event_name != 'pull_request' }} build-args: | ${{ env.build_args }} diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 756aa78..d51aacc 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -1,5 +1,9 @@ ARG tag=8 FROM spack/rockylinux${tag}:latest as builder +ARG ARCH=x86_64 +ENV ARCH=${ARCH} + +RUN dnf update -y && dnf install -y gettext # Specify flux deps in the spack manifest file (spack.yaml) RUN mkdir /opt/spack-environment \ @@ -10,12 +14,18 @@ RUN mkdir /opt/spack-environment \ && echo ' unify: true' \ && echo ' packages:' \ && echo ' all:' \ -&& echo ' require: ["target=:x86_64"]' \ +&& echo ' require: ["target=:${ARCH}"]' \ && echo ' config:' \ -&& echo ' install_tree: /opt/software') > /opt/spack-environment/spack.yaml +&& echo ' install_tree: /opt/software') > /opt/spack-environment/spack-template.yaml + +RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environment/spack.yaml && \ + cat /opt/spack-environment/spack.yaml # Install the software, remove unnecessary deps -RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y +RUN cd /opt/spack-environment && \ + . /opt/spack/share/spack/setup-env.sh && \ + spack env activate . && \ + spack install --fail-fast && spack gc -y # Strip all the binaries RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \ diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index 444f0dc..9543690 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -1,5 +1,9 @@ ARG tag=jammy FROM spack/ubuntu-${tag}:latest as builder +ARG ARCH=x86_64 +ENV ARCH=${ARCH} + +RUN apt-get update && apt-get install -y gettext-base # What we want to install and how we want to install it # is specified in a manifest file (spack.yaml) @@ -11,12 +15,18 @@ RUN mkdir /opt/spack-environment \ && echo ' unify: true' \ && echo ' packages:' \ && echo ' all:' \ -&& echo ' require: ["target=:x86_64"]' \ +&& echo ' require: ["target=:${ARCH}"]' \ && echo ' config:' \ -&& echo ' install_tree: /opt/software') > /opt/spack-environment/spack.yaml +&& echo ' install_tree: /opt/software') > /opt/spack-environment/spack-template.yaml + +RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environment/spack.yaml && \ + cat /opt/spack-environment/spack.yaml # Install the software, remove unnecessary deps -RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y +RUN cd /opt/spack-environment && \ + . /opt/spack/share/spack/setup-env.sh && \ + spack env activate . && \ + spack install --fail-fast && spack gc -y # Strip all the binaries RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \