From f2530bfc03ea7322a3b02dd418c0dcac01792741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 11:57:42 +0200 Subject: [PATCH 1/9] use multiarch container --- Dockerfile.bootstrap-prefix-centos8 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Dockerfile.bootstrap-prefix-centos8 diff --git a/Dockerfile.bootstrap-prefix-centos8 b/Dockerfile.bootstrap-prefix-centos8 new file mode 100644 index 00000000..042794d2 --- /dev/null +++ b/Dockerfile.bootstrap-prefix-centos8 @@ -0,0 +1,11 @@ +FROM centos:8.2.2004 + +COPY bootstrap-prefix.sh /usr/local/bin/bootstrap-prefix.sh + +RUN dnf install -y gcc gcc-c++ make diffutils gmp-devel +RUN chmod 755 /usr/local/bin/bootstrap-prefix.sh + +ENV LC_ALL=C +ENV PATH=/usr/local/bin:$PATH + +ENTRYPOINT ["/usr/local/bin/bootstrap-prefix.sh"] From c178eafd108aab70d2f44af45e0c2be90804a14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 12:42:29 +0200 Subject: [PATCH 2/9] add workflow for generating bootstrap docker image --- .../build-and-publish-bootstrap-container.yml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build-and-publish-bootstrap-container.yml diff --git a/.github/workflows/build-and-publish-bootstrap-container.yml b/.github/workflows/build-and-publish-bootstrap-container.yml new file mode 100644 index 00000000..27cabe83 --- /dev/null +++ b/.github/workflows/build-and-publish-bootstrap-container.yml @@ -0,0 +1,51 @@ +name: Build and publish EESSI Docker image for bootstrapping Gentoo Prefix +on: + push: + branches: + - main + - autobuild_bootstrap_container + paths: + - Dockerfile.bootstrap-prefix-centos8 + - bootstrap-prefix.sh + - .github/workflows/build-and-publish-bootstrap-container.yml + + pull_request: + branches: + - main + paths: + - Dockerfile.bootstrap-prefix-centos8 + - bootstrap-prefix.sh + - .github/workflows/build-and-publish-bootstrap-container.yml + +jobs: + build_and_publish: + name: Build and publish image + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push to GitHub Packages + uses: docker/build-push-action@v2 + with: + tags: ghcr.io/eessi/bootstrap-prefix:centos8 + file: containers/Dockerfile.bootstrap-prefix-centos8 + platforms: linux/amd64, linux/arm64, linux/ppc64le + push: ${{ github.event_name != 'pull_request' }} From 1bb45447d1a864758a05e6102566cd389c3ec6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 12:50:07 +0200 Subject: [PATCH 3/9] variable for repo owner --- .github/workflows/build-and-publish-bootstrap-container.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish-bootstrap-container.yml b/.github/workflows/build-and-publish-bootstrap-container.yml index 27cabe83..7340107c 100644 --- a/.github/workflows/build-and-publish-bootstrap-container.yml +++ b/.github/workflows/build-and-publish-bootstrap-container.yml @@ -42,10 +42,14 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Determine lowercase username + run: | + echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + - name: Build and push to GitHub Packages uses: docker/build-push-action@v2 with: - tags: ghcr.io/eessi/bootstrap-prefix:centos8 + tags: ghcr.io/${{ env.REPOSITORY_OWNER }}/bootstrap-prefix:centos8 file: containers/Dockerfile.bootstrap-prefix-centos8 platforms: linux/amd64, linux/arm64, linux/ppc64le push: ${{ github.event_name != 'pull_request' }} From a28bb1d1c41dad6b43e0d4d73ec1bd4b876c67d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 12:51:26 +0200 Subject: [PATCH 4/9] fix repo owner step --- .github/workflows/build-and-publish-bootstrap-container.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-publish-bootstrap-container.yml b/.github/workflows/build-and-publish-bootstrap-container.yml index 7340107c..0734ff30 100644 --- a/.github/workflows/build-and-publish-bootstrap-container.yml +++ b/.github/workflows/build-and-publish-bootstrap-container.yml @@ -42,9 +42,9 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Determine lowercase username + - name: Convert and store repository owner in lowercase run: | - echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV - name: Build and push to GitHub Packages uses: docker/build-push-action@v2 From b62ce36b9e8362b346633323946bf371b8ade5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 12:53:04 +0200 Subject: [PATCH 5/9] fix path to dockerfile --- .github/workflows/build-and-publish-bootstrap-container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish-bootstrap-container.yml b/.github/workflows/build-and-publish-bootstrap-container.yml index 0734ff30..6fa322d9 100644 --- a/.github/workflows/build-and-publish-bootstrap-container.yml +++ b/.github/workflows/build-and-publish-bootstrap-container.yml @@ -50,6 +50,6 @@ jobs: uses: docker/build-push-action@v2 with: tags: ghcr.io/${{ env.REPOSITORY_OWNER }}/bootstrap-prefix:centos8 - file: containers/Dockerfile.bootstrap-prefix-centos8 + file: Dockerfile.bootstrap-prefix-centos8 platforms: linux/amd64, linux/arm64, linux/ppc64le push: ${{ github.event_name != 'pull_request' }} From c62df7713ac74a3905c1b696dc9be2af92d7736d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 13:01:27 +0200 Subject: [PATCH 6/9] use image from githubs registry --- ansible/playbooks/roles/compatibility_layer/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 0bc816d1..adf4c534 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -24,7 +24,7 @@ prefix_user_defined_trusted_dirs: - "/opt/eessi/{{ eessi_version }}/lib" - "/opt/eessi/lib" prefix_singularity_command: "singularity run -B {{ gentoo_prefix_path }}:{{ gentoo_prefix_path }}" -prefix_source: "docker://eessi/bootstrap-prefix:centos8-{{ eessi_host_arch }}" +prefix_source: "docker://ghcr.io/eessi/bootstrap-prefix:centos8" prefix_source_options: "{{ gentoo_prefix_path }} noninteractive" prefix_install: >- SINGULARITYENV_USE_CPU_CORES={{ ansible_processor_vcpus }} From 93ce8fc4f013056e5dfcc7f2ddcb54a5fcd099b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 13:02:32 +0200 Subject: [PATCH 7/9] only run on (PRs to) main branch --- .github/workflows/build-and-publish-bootstrap-container.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-and-publish-bootstrap-container.yml b/.github/workflows/build-and-publish-bootstrap-container.yml index 6fa322d9..d5d98787 100644 --- a/.github/workflows/build-and-publish-bootstrap-container.yml +++ b/.github/workflows/build-and-publish-bootstrap-container.yml @@ -3,11 +3,9 @@ on: push: branches: - main - - autobuild_bootstrap_container paths: - Dockerfile.bootstrap-prefix-centos8 - bootstrap-prefix.sh - - .github/workflows/build-and-publish-bootstrap-container.yml pull_request: branches: @@ -15,7 +13,6 @@ on: paths: - Dockerfile.bootstrap-prefix-centos8 - bootstrap-prefix.sh - - .github/workflows/build-and-publish-bootstrap-container.yml jobs: build_and_publish: From 4e5f7925bd2bb622b880a4e79c0476b91f17cd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 28 Apr 2021 13:05:01 +0200 Subject: [PATCH 8/9] remove old dockerfiles+script and singularity def files --- Dockerfile.bootstrap-prefix-centos8-aarch64 | 11 ----------- Dockerfile.bootstrap-prefix-centos8-ppc64le | 11 ----------- Dockerfile.bootstrap-prefix-centos8-x86_64 | 11 ----------- docker_build_bootstrap_prefix.sh | 10 ---------- singularity-bootstrap-prefix.arm64v8.def | 16 ---------------- singularity-bootstrap-prefix.def | 16 ---------------- 6 files changed, 75 deletions(-) delete mode 100644 Dockerfile.bootstrap-prefix-centos8-aarch64 delete mode 100644 Dockerfile.bootstrap-prefix-centos8-ppc64le delete mode 100644 Dockerfile.bootstrap-prefix-centos8-x86_64 delete mode 100755 docker_build_bootstrap_prefix.sh delete mode 100644 singularity-bootstrap-prefix.arm64v8.def delete mode 100644 singularity-bootstrap-prefix.def diff --git a/Dockerfile.bootstrap-prefix-centos8-aarch64 b/Dockerfile.bootstrap-prefix-centos8-aarch64 deleted file mode 100644 index 0de29ba0..00000000 --- a/Dockerfile.bootstrap-prefix-centos8-aarch64 +++ /dev/null @@ -1,11 +0,0 @@ -FROM docker.io/arm64v8/centos:8.2.2004 - -COPY bootstrap-prefix.sh /usr/local/bin/bootstrap-prefix.sh - -RUN dnf install -y gcc gcc-c++ make diffutils gmp-devel -RUN chmod 755 /usr/local/bin/bootstrap-prefix.sh - -ENV LC_ALL=C -ENV PATH=/usr/local/bin:$PATH - -ENTRYPOINT ["/usr/local/bin/bootstrap-prefix.sh"] diff --git a/Dockerfile.bootstrap-prefix-centos8-ppc64le b/Dockerfile.bootstrap-prefix-centos8-ppc64le deleted file mode 100644 index 63a87c94..00000000 --- a/Dockerfile.bootstrap-prefix-centos8-ppc64le +++ /dev/null @@ -1,11 +0,0 @@ -FROM docker.io/ppc64le/centos:8.2.2004 - -COPY bootstrap-prefix.sh /usr/local/bin/bootstrap-prefix.sh - -RUN dnf install -y gcc gcc-c++ make diffutils gmp-devel -RUN chmod 755 /usr/local/bin/bootstrap-prefix.sh - -ENV LC_ALL=C -ENV PATH=/usr/local/bin:$PATH - -ENTRYPOINT ["/usr/local/bin/bootstrap-prefix.sh"] diff --git a/Dockerfile.bootstrap-prefix-centos8-x86_64 b/Dockerfile.bootstrap-prefix-centos8-x86_64 deleted file mode 100644 index 3291de8b..00000000 --- a/Dockerfile.bootstrap-prefix-centos8-x86_64 +++ /dev/null @@ -1,11 +0,0 @@ -FROM docker.io/library/centos:8.2.2004 - -COPY bootstrap-prefix.sh /usr/local/bin/bootstrap-prefix.sh - -RUN dnf install -y gcc gcc-c++ make diffutils gmp-devel -RUN chmod 755 /usr/local/bin/bootstrap-prefix.sh - -ENV LC_ALL=C -ENV PATH=/usr/local/bin:$PATH - -ENTRYPOINT ["/usr/local/bin/bootstrap-prefix.sh"] diff --git a/docker_build_bootstrap_prefix.sh b/docker_build_bootstrap_prefix.sh deleted file mode 100755 index 2da0d370..00000000 --- a/docker_build_bootstrap_prefix.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -cpu_arch=$(uname -m) -tag="eessi/bootstrap-prefix:centos8-${cpu_arch}" - -echo "Building EESSI container for bootstrapping Prefix on ${cpu_arch}..." -docker build --no-cache -f Dockerfile.bootstrap-prefix-centos8-${cpu_arch} -t ${tag} . - -echo "Pushing ${tag} to Docker Hub..." -docker push ${tag} diff --git a/singularity-bootstrap-prefix.arm64v8.def b/singularity-bootstrap-prefix.arm64v8.def deleted file mode 100644 index df091a5f..00000000 --- a/singularity-bootstrap-prefix.arm64v8.def +++ /dev/null @@ -1,16 +0,0 @@ -Bootstrap: docker -From: arm64v8/centos:8.2.2004 - -%post - dnf install -y gcc gcc-c++ make diffutils gmp-devel - chmod 755 /usr/local/bin/bootstrap-prefix.sh - -%environment - export LC_ALL=C - export PATH=/usr/local/bin:$PATH - -%files - bootstrap-prefix.sh /usr/local/bin - -%runscript - exec /usr/local/bin/bootstrap-prefix.sh "$@" diff --git a/singularity-bootstrap-prefix.def b/singularity-bootstrap-prefix.def deleted file mode 100644 index e9c4cf8e..00000000 --- a/singularity-bootstrap-prefix.def +++ /dev/null @@ -1,16 +0,0 @@ -Bootstrap: docker -From: centos:8.2.2004 - -%post - dnf install -y gcc gcc-c++ make diffutils - chmod 755 /usr/local/bin/bootstrap-prefix.sh - -%environment - export LC_ALL=C - export PATH=/usr/local/bin:$PATH - -%files - bootstrap-prefix.sh /usr/local/bin - -%runscript - exec /usr/local/bin/bootstrap-prefix.sh "$@" From 55846c4299c3238d5fbcd6824fb22555b7b34d2e Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Sat, 19 Jun 2021 15:46:29 +0200 Subject: [PATCH 9/9] use double quotes to add repo owner to env script --- .github/workflows/build-and-publish-bootstrap-container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish-bootstrap-container.yml b/.github/workflows/build-and-publish-bootstrap-container.yml index d5d98787..fba12a72 100644 --- a/.github/workflows/build-and-publish-bootstrap-container.yml +++ b/.github/workflows/build-and-publish-bootstrap-container.yml @@ -41,7 +41,7 @@ jobs: - name: Convert and store repository owner in lowercase run: | - echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + echo "REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - name: Build and push to GitHub Packages uses: docker/build-push-action@v2