From 8b57438bd8ed6ad1b47100928fd384ba6d915940 Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 14 Dec 2023 15:57:08 -0700 Subject: [PATCH 01/10] test arm builds for current builds Signed-off-by: vsoch --- .github/workflows/build-matrices.yaml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-matrices.yaml b/.github/workflows/build-matrices.yaml index 7f5efc8..deff629 100644 --- a/.github/workflows/build-matrices.yaml +++ b/.github/workflows/build-matrices.yaml @@ -47,16 +47,23 @@ jobs: fail-fast: false matrix: result: ${{ fromJson(needs.generate.outputs.dockerbuild_matrix) }} - arch: [linux/amd64] + arch: [linux/amd64, linux/arm64] 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 - uses: actions/setup-go@v3 + - name: Add custom buildx ARM builder + if: (matrix.arch == 'linux/arm64') + run: | + docker buildx create --name armbuilder + docker buildx use armbuilder + docker buildx inspect --bootstrap + - name: GHCR Login if: (github.event_name != 'pull_request') uses: docker/login-action@v2 @@ -80,6 +87,15 @@ jobs: echo "Container name is ${container_name}" echo "container_name=${container_name}" >> $GITHUB_ENV + - name: Set Container name + if: (matrix.arch == 'linux/arm64') + env: + container: ${{ matrix.result.container_name }} + run: | + container_name=$(python .github/container_name.py "${container}" flux-view-arm) + echo "Container name is ${container_name}" + echo "container_name=${container_name}" >> $GITHUB_ENV + - name: Pull Docker Layers run: docker pull ghcr.io/converged-computing/${container_name} || exit 0 @@ -112,7 +128,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 }} From cca4785d2d0d30b5637a4c18f43704cae0e1ac6d Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 14 Dec 2023 16:16:25 -0700 Subject: [PATCH 02/10] add arch build arg to container Signed-off-by: vsoch --- .github/workflows/build-matrices.yaml | 1 + rocky/Dockerfile | 7 ++++++- ubuntu/Dockerfile | 9 +++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-matrices.yaml b/.github/workflows/build-matrices.yaml index deff629..be734e8 100644 --- a/.github/workflows/build-matrices.yaml +++ b/.github/workflows/build-matrices.yaml @@ -132,4 +132,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} build-args: | ${{ env.build_args }} + ARCH=${{ matrix.arch }} tags: ${{ env.container_name }} diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 756aa78..23a4939 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -1,5 +1,7 @@ ARG tag=8 FROM spack/rockylinux${tag}:latest as builder +ARG ARCH=x86_64 +ENV ARCH=${ARCH} # Specify flux deps in the spack manifest file (spack.yaml) RUN mkdir /opt/spack-environment \ @@ -10,10 +12,13 @@ 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 +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 diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index 444f0dc..abf973d 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -1,5 +1,7 @@ ARG tag=jammy FROM spack/ubuntu-${tag}:latest as builder +ARG ARCH=x86_64 +ENV ARCH=${ARCH} # What we want to install and how we want to install it # is specified in a manifest file (spack.yaml) @@ -11,9 +13,12 @@ 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 From afb358cd1143f88f8baeefdeca16630ca2137288 Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 14 Dec 2023 16:27:28 -0700 Subject: [PATCH 03/10] add arch build arg to container Signed-off-by: vsoch --- rocky/Dockerfile | 2 ++ ubuntu/Dockerfile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 23a4939..7e2f6c9 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -3,6 +3,8 @@ FROM spack/rockylinux${tag}:latest as builder ARG ARCH=x86_64 ENV ARCH=${ARCH} +RUN dnf update && dnf install -y gettext + # Specify flux deps in the spack manifest file (spack.yaml) RUN mkdir /opt/spack-environment \ && (echo spack: \ diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index abf973d..749cdfa 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -3,6 +3,8 @@ FROM spack/ubuntu-${tag}:latest as builder ARG ARCH=x86_64 ENV ARCH=${ARCH} +RUN apt-get update && apt-get install gettext-base + # What we want to install and how we want to install it # is specified in a manifest file (spack.yaml) RUN mkdir /opt/spack-environment \ From 1f12821fb16c0447b845e4733b8592111e1cc573 Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 14 Dec 2023 16:31:47 -0700 Subject: [PATCH 04/10] add arch build arg to container Signed-off-by: vsoch --- .github/workflows/build-matrices.yaml | 4 +++- rocky/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-matrices.yaml b/.github/workflows/build-matrices.yaml index be734e8..0583ac0 100644 --- a/.github/workflows/build-matrices.yaml +++ b/.github/workflows/build-matrices.yaml @@ -86,6 +86,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: Set Container name if: (matrix.arch == 'linux/arm64') @@ -95,6 +96,7 @@ jobs: container_name=$(python .github/container_name.py "${container}" flux-view-arm) echo "Container name is ${container_name}" echo "container_name=${container_name}" >> $GITHUB_ENV + echo "container_arch=arm" >> $GITHUB_ENV - name: Pull Docker Layers run: docker pull ghcr.io/converged-computing/${container_name} || exit 0 @@ -132,5 +134,5 @@ jobs: push: ${{ github.event_name != 'pull_request' }} build-args: | ${{ env.build_args }} - ARCH=${{ matrix.arch }} + ARCH=${{ env.container_arch }} tags: ${{ env.container_name }} diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 7e2f6c9..5d5f305 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -3,7 +3,7 @@ FROM spack/rockylinux${tag}:latest as builder ARG ARCH=x86_64 ENV ARCH=${ARCH} -RUN dnf update && dnf install -y gettext +RUN dnf update -y && dnf install -y gettext # Specify flux deps in the spack manifest file (spack.yaml) RUN mkdir /opt/spack-environment \ From 08d28869c9a5253209e3d745373866cc0c15afd8 Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 14 Dec 2023 16:34:52 -0700 Subject: [PATCH 05/10] add arch build arg to container Signed-off-by: vsoch --- rocky/Dockerfile | 5 ++++- ubuntu/Dockerfile | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 5d5f305..59abdc2 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -22,7 +22,10 @@ RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environme 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 749cdfa..1107d4f 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -23,7 +23,11 @@ RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environme 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 '{}' \; | \ From 79354f4be5df2d019ee15b7b04cf6d8ec64d75ac Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 14 Dec 2023 16:42:09 -0700 Subject: [PATCH 06/10] add arch build arg to container Signed-off-by: vsoch --- rocky/Dockerfile | 5 +++-- ubuntu/Dockerfile | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 59abdc2..09708cc 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -3,7 +3,7 @@ FROM spack/rockylinux${tag}:latest as builder ARG ARCH=x86_64 ENV ARCH=${ARCH} -RUN dnf update -y && dnf install -y gettext +RUN dnf update -y && dnf install -y gettext curl # Specify flux deps in the spack manifest file (spack.yaml) RUN mkdir /opt/spack-environment \ @@ -16,7 +16,7 @@ RUN mkdir /opt/spack-environment \ && echo ' all:' \ && 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 @@ -25,6 +25,7 @@ RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environme RUN cd /opt/spack-environment && \ . /opt/spack/share/spack/setup-env.sh && \ spack env activate . && \ + spack external find curl && \ spack install --fail-fast && spack gc -y # Strip all the binaries diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index 1107d4f..bb3ab87 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -3,7 +3,7 @@ FROM spack/ubuntu-${tag}:latest as builder ARG ARCH=x86_64 ENV ARCH=${ARCH} -RUN apt-get update && apt-get install gettext-base +RUN apt-get update && apt-get install gettext-base curl # What we want to install and how we want to install it # is specified in a manifest file (spack.yaml) @@ -26,9 +26,9 @@ RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environme RUN cd /opt/spack-environment && \ . /opt/spack/share/spack/setup-env.sh && \ spack env activate . && \ + spack external find curl && \ spack install --fail-fast && spack gc -y - # Strip all the binaries RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \ xargs file -i | \ From 97ece42665e4710d502326c84ba0d4577ebafcca Mon Sep 17 00:00:00 2001 From: vsoch Date: Thu, 14 Dec 2023 16:44:18 -0700 Subject: [PATCH 07/10] add arch build arg to container Signed-off-by: vsoch --- rocky/Dockerfile | 2 +- ubuntu/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 09708cc..8728516 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -3,7 +3,7 @@ FROM spack/rockylinux${tag}:latest as builder ARG ARCH=x86_64 ENV ARCH=${ARCH} -RUN dnf update -y && dnf install -y gettext curl +RUN dnf update -y && dnf install -y gettext # Specify flux deps in the spack manifest file (spack.yaml) RUN mkdir /opt/spack-environment \ diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index bb3ab87..731ac18 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -3,7 +3,7 @@ FROM spack/ubuntu-${tag}:latest as builder ARG ARCH=x86_64 ENV ARCH=${ARCH} -RUN apt-get update && apt-get install gettext-base curl +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) From 79a72d3c0f3a11ac5fdeb9f10fec104936e77f69 Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 15 Dec 2023 11:36:37 -0700 Subject: [PATCH 08/10] try aarch64 instead of arm Signed-off-by: vsoch --- .github/workflows/build-matrices.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-matrices.yaml b/.github/workflows/build-matrices.yaml index 0583ac0..0494959 100644 --- a/.github/workflows/build-matrices.yaml +++ b/.github/workflows/build-matrices.yaml @@ -96,7 +96,7 @@ jobs: container_name=$(python .github/container_name.py "${container}" flux-view-arm) echo "Container name is ${container_name}" echo "container_name=${container_name}" >> $GITHUB_ENV - echo "container_arch=arm" >> $GITHUB_ENV + echo "container_arch=aarch64" >> $GITHUB_ENV - name: Pull Docker Layers run: docker pull ghcr.io/converged-computing/${container_name} || exit 0 From 3fa09819d24fa8843082f9efcd0441d1ec8dd808 Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 15 Dec 2023 11:57:03 -0700 Subject: [PATCH 09/10] remove curl Signed-off-by: vsoch --- rocky/Dockerfile | 1 - ubuntu/Dockerfile | 1 - 2 files changed, 2 deletions(-) diff --git a/rocky/Dockerfile b/rocky/Dockerfile index 8728516..d51aacc 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -25,7 +25,6 @@ RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environme RUN cd /opt/spack-environment && \ . /opt/spack/share/spack/setup-env.sh && \ spack env activate . && \ - spack external find curl && \ spack install --fail-fast && spack gc -y # Strip all the binaries diff --git a/ubuntu/Dockerfile b/ubuntu/Dockerfile index 731ac18..9543690 100644 --- a/ubuntu/Dockerfile +++ b/ubuntu/Dockerfile @@ -26,7 +26,6 @@ RUN envsubst < /opt/spack-environment/spack-template.yaml > /opt/spack-environme RUN cd /opt/spack-environment && \ . /opt/spack/share/spack/setup-env.sh && \ spack env activate . && \ - spack external find curl && \ spack install --fail-fast && spack gc -y # Strip all the binaries From 71200607959f6a008a4c82427e018b0eacc6aaff Mon Sep 17 00:00:00 2001 From: vsoch Date: Fri, 15 Dec 2023 18:04:06 -0700 Subject: [PATCH 10/10] remove arm will need to do these manually - it goes over 6 hours Signed-off-by: vsoch --- .github/workflows/build-matrices.yaml | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.github/workflows/build-matrices.yaml b/.github/workflows/build-matrices.yaml index 0494959..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: @@ -47,7 +46,7 @@ jobs: fail-fast: false matrix: result: ${{ fromJson(needs.generate.outputs.dockerbuild_matrix) }} - arch: [linux/amd64, linux/arm64] + arch: [linux/amd64] if: ${{ needs.generate.outputs.empty_matrix == 'false' }} @@ -57,13 +56,6 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-go@v3 - - name: Add custom buildx ARM builder - if: (matrix.arch == 'linux/arm64') - run: | - docker buildx create --name armbuilder - docker buildx use armbuilder - docker buildx inspect --bootstrap - - name: GHCR Login if: (github.event_name != 'pull_request') uses: docker/login-action@v2 @@ -88,16 +80,6 @@ jobs: echo "container_name=${container_name}" >> $GITHUB_ENV echo "container_arch=x86_64" >> $GITHUB_ENV - - name: Set Container name - if: (matrix.arch == 'linux/arm64') - env: - container: ${{ matrix.result.container_name }} - run: | - container_name=$(python .github/container_name.py "${container}" flux-view-arm) - echo "Container name is ${container_name}" - echo "container_name=${container_name}" >> $GITHUB_ENV - echo "container_arch=aarch64" >> $GITHUB_ENV - - name: Pull Docker Layers run: docker pull ghcr.io/converged-computing/${container_name} || exit 0 @@ -134,5 +116,4 @@ jobs: push: ${{ github.event_name != 'pull_request' }} build-args: | ${{ env.build_args }} - ARCH=${{ env.container_arch }} tags: ${{ env.container_name }}