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..fba12a72 --- /dev/null +++ b/.github/workflows/build-and-publish-bootstrap-container.yml @@ -0,0 +1,52 @@ +name: Build and publish EESSI Docker image for bootstrapping Gentoo Prefix +on: + push: + branches: + - main + paths: + - Dockerfile.bootstrap-prefix-centos8 + - bootstrap-prefix.sh + + pull_request: + branches: + - main + paths: + - Dockerfile.bootstrap-prefix-centos8 + - bootstrap-prefix.sh + +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: Convert and store repository owner in lowercase + 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/${{ env.REPOSITORY_OWNER }}/bootstrap-prefix:centos8 + file: Dockerfile.bootstrap-prefix-centos8 + platforms: linux/amd64, linux/arm64, linux/ppc64le + push: ${{ github.event_name != 'pull_request' }} diff --git a/Dockerfile.bootstrap-prefix-centos8-aarch64 b/Dockerfile.bootstrap-prefix-centos8 similarity index 87% rename from Dockerfile.bootstrap-prefix-centos8-aarch64 rename to Dockerfile.bootstrap-prefix-centos8 index 0de29ba0..042794d2 100644 --- a/Dockerfile.bootstrap-prefix-centos8-aarch64 +++ b/Dockerfile.bootstrap-prefix-centos8 @@ -1,4 +1,4 @@ -FROM docker.io/arm64v8/centos:8.2.2004 +FROM centos:8.2.2004 COPY bootstrap-prefix.sh /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/ansible/playbooks/roles/compatibility_layer/defaults/main.yml b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml index 8f648b36..a5bd0895 100644 --- a/ansible/playbooks/roles/compatibility_layer/defaults/main.yml +++ b/ansible/playbooks/roles/compatibility_layer/defaults/main.yml @@ -22,7 +22,7 @@ prefix_snapshot_version: 20210607 prefix_user_defined_trusted_dirs: - "/cvmfs/{{ cvmfs_repository }}/host_injections/{{ eessi_version }}/compat/{{ eessi_host_os }}/{{ eessi_host_arch }}/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 }} 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 "$@"