From 0538fdf228e5130ae1ff9b1fb9aeb4e13161ad9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:25:15 +0200 Subject: [PATCH 01/12] Update to Apptainer plus multi-arch support --- Dockerfile | 65 +++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c37623..e724177 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,65 +1,70 @@ -FROM ubuntu:20.10 AS base +FROM ubuntu:22.04 AS base -RUN apt-get update && apt-get install --yes --no-install-recommends \ - # support singularity build/pull workflows +RUN apt update && apt install --yes --no-install-recommends \ + # add singularity build and singularity pull OS dependencies ca-certificates squashfs-tools \ - && rm -rf /var/lib/apt/lists/* + && apt-get clean && rm -rf /var/lib/apt/lists/* FROM base AS builder -# https://sylabs.io/guides/3.7/admin-guide/installation.html#installation-on-linux +# https://apptainer.org/docs/admin/main/installation.html#install-from-source -RUN apt-get update && apt-get install --yes --no-install-recommends \ +RUN apt update && apt install --yes --no-install-recommends \ build-essential \ - libssl-dev \ uuid-dev \ - libgpgme11-dev \ + libgpgme-dev \ squashfs-tools \ libseccomp-dev \ - wget ca-certificates \ + wget \ pkg-config \ git \ - cryptsetup \ - && rm -rf /var/lib/apt/lists/* + cryptsetup-bin -RUN export VERSION=1.16.4 \ - && wget --quiet https://golang.org/dl/go${VERSION}.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf go${VERSION}.linux-amd64.tar.gz \ - && rm /go${VERSION}.linux-amd64.tar.gz +ARG TARGETPLATFORM +ARG BUILDPLATFORM + +SHELL ["/bin/bash", "-c"] + +RUN export VERSION=1.18.2 \ + && export ARCH=linux-${TARGETPLATFORM#'linux/'} \ + && wget --quiet https://go.dev/dl/go${VERSION}.${ARCH}.tar.gz \ + && tar -C /usr/local -xzf go${VERSION}.${ARCH}.tar.gz ENV PATH=$PATH:/usr/local/go/bin -RUN export VERSION=3.7.3 \ +RUN export VERSION=1.0.2 \ && cd /tmp \ - && wget --quiet https://github.com/hpcng/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz \ - && tar -xzf singularity-${VERSION}.tar.gz \ - && cd singularity \ - && ./mconfig --prefix=/singularity \ + && wget --quiet https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-${VERSION}.tar.gz \ + && tar -xzf apptainer-${VERSION}.tar.gz \ + && mv apptainer-${VERSION} apptainer \ + && cd apptainer \ + && ./mconfig --prefix=/apptainer \ && make -C builddir \ && make -C builddir install FROM base -# Original Singularity information. +# Add Apptainer information. -COPY --from=builder /tmp/singularity/LICENSE.md /singularity/LICENSE.md -COPY --from=builder /tmp/singularity/README.md /singularity/README.md +COPY --from=builder /tmp/apptainer/LICENSE*.md /apptainer/ +COPY --from=builder /tmp/apptainer/README.md /apptainer/README.md -# This repository's information. +# Add this Github repository's information. ADD README.md LICENSE Dockerfile / -# Singularity executable. +# Apptainer executable. # Full install... -#COPY --from=builder /singularity /singularity +#COPY --from=builder /apptainer /apptainer # Minimal install... supports singularity pull/build workflows. -COPY --from=builder /singularity/bin/singularity /singularity/bin/singularity -COPY --from=builder /singularity/etc/singularity/singularity.conf /singularity/etc/singularity/singularity.conf +COPY --from=builder /apptainer/bin/apptainer /apptainer/bin/apptainer +COPY --from=builder /apptainer/bin/singularity /apptainer/bin/singularity +COPY --from=builder /apptainer/etc/apptainer/apptainer.conf /apptainer/etc/apptainer/apptainer.conf -# Conveniences. +# Docker image conveniences. -ENV PATH=$PATH:/singularity/bin +ENV PATH=$PATH:/apptainer/bin RUN mkdir /output WORKDIR /output From b27490ffbb90839cb3f2bc078adda058030eb741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:26:45 +0200 Subject: [PATCH 02/12] Add multi-arch support --- .github/workflows/build-and-push-image.yml | 63 +++++++++++++++------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-and-push-image.yml index 78a28ce..e84458d 100644 --- a/.github/workflows/build-and-push-image.yml +++ b/.github/workflows/build-and-push-image.yml @@ -1,37 +1,64 @@ -name: build and push image +name: build, test and push multi-arch Docker container images on: + pull_request: + branches: main push: branches: main paths: Dockerfile env: GITHUB_SHA: ${{ github.sha }} - TARGET_REPO: kathoef/docker2singularity + DOCKERHUB_TARGET_REPO: kathoef/dfjghsdfg jobs: - build_and_push: + build_test_push: runs-on: ubuntu-latest steps: - - name: Specify image target + - name: Specify tags run: | - CALVER="$( date -u '+%Y.%m.%d' )" - SHA7="${GITHUB_SHA::7}" - CALVER_TARGET=${TARGET_REPO}:v${CALVER}-${SHA7} - LATEST_TARGET=${TARGET_REPO}:latest - echo "CALVER_TARGET=${CALVER_TARGET}" >> $GITHUB_ENV - echo "LATEST_TARGET=${LATEST_TARGET}" >> $GITHUB_ENV - echo "${CALVER_TARGET}" - echo "${LATEST_TARGET}" - - name: Checkout repository + CALVER="$( date -u '+%Y.%m.%d' )" + SHA7="${GITHUB_SHA::7}" + CALVER_TARGET=${DOCKERHUB_TARGET_REPO}:v${CALVER}-${SHA7} + LATEST_TARGET=${DOCKERHUB_TARGET_REPO}:latest + echo "CALVER_TARGET=${CALVER_TARGET}" >> $GITHUB_ENV + echo "LATEST_TARGET=${LATEST_TARGET}" >> $GITHUB_ENV + - name: Set up QEMU + if: ${{ startsWith(github.ref, 'refs/heads/main')}} + uses: docker/setup-qemu-action@v2 + - name: Set up Buildx + if: ${{ startsWith(github.ref, 'refs/heads/main')}} + uses: docker/setup-buildx-action@v2 + - name: Show available Buildx platforms + if: ${{ startsWith(github.ref, 'refs/heads/main')}} + run: docker buildx ls + - name: Checkout Github repository uses: actions/checkout@v2 + - name: Build default arch Docker image + uses: docker/build-push-action@v3 + with: + load: true # publish as local Docker image + tags: "${{env.CALVER_TARGET}}, ${{env.LATEST_TARGET}}" + - name: "Test default arch Docker image: singularity pull" + run: | + docker run -v $PWD:/output --rm "${{env.LATEST_TARGET}}" singularity pull alpine_latest.sif docker://alpine:latest + ls && test -f alpine_latest.sif && rm alpine_latest.sif + - name: "Test default arch Docker image: singularity build" + run: | + echo 'FROM alpine:latest' > Dockerfile + docker build -f Dockerfile -t local/from_local_build_workflow . + docker run -v $PWD:/output -v /var/run/docker.sock:/var/run/docker.sock:ro --rm "${{env.LATEST_TARGET}}" singularity build local.sif docker-daemon://local/from_local_build_workflow:latest + ls && test -f local.sif && rm local.sif - name: Login to DockerHub - uses: docker/login-action@v1 + if: ${{ startsWith(github.ref, 'refs/heads/main')}} + uses: docker/login-action@v1 with: - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push to DockerHub - uses: docker/build-push-action@v2 + username: ${{ secrets.DOCKERHUB_LOGIN_USER }} + password: ${{ secrets.DOCKERHUB_LOGIN_TOKEN }} + - name: Build and push multi-arch Docker images + if: ${{ startsWith(github.ref, 'refs/heads/main')}} + uses: docker/build-push-action@v3 with: + platforms: linux/amd64, linux/arm64 tags: "${{env.CALVER_TARGET}}, ${{env.LATEST_TARGET}}" push: true From 0bbf6c01746e5e24d4d7581707cfad2c0544eb3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:33:12 +0200 Subject: [PATCH 03/12] Tweak Docker image tests --- .github/workflows/test-docker-image.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-docker-image.yml b/.github/workflows/test-docker-image.yml index 8a1a1c8..a710ca4 100644 --- a/.github/workflows/test-docker-image.yml +++ b/.github/workflows/test-docker-image.yml @@ -1,4 +1,4 @@ -name: Docker image tests +name: test default architecture Docker image on: push: @@ -13,15 +13,15 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Pull latest Docker image + - name: Pull default architecture Docker image run: docker pull ${{env.TESTING_IMAGE}} - name: Test singularity pull run: | docker run -v $PWD:/output --rm ${{env.TESTING_IMAGE}} singularity pull alpine_latest.sif docker://alpine:latest - ls; test -f alpine_latest.sif - - name: Test singularity build from localhost + test -f alpine_latest.sif && rm alpine_latest.sif + - name: Test singularity build run: | - echo 'FROM alpine:latest' > Dockerfile_for_local_build_workflow - docker build -f Dockerfile_for_local_build_workflow -t localhost/from_local_build_workflow . - docker run -v $PWD:/output -v /var/run/docker.sock:/var/run/docker.sock --rm ${{env.TESTING_IMAGE}} singularity build localhost.sif docker-daemon://localhost/from_local_build_workflow:latest - ls; test -f localhost.sif + echo 'FROM alpine:latest' > Dockerfile + docker build -f Dockerfile -t local/from_local_build_workflow . + docker run -v $PWD:/output -v /var/run/docker.sock:/var/run/docker.sock:ro --rm ${{env.TESTING_IMAGE}} singularity build local.sif docker-daemon://local/from_local_build_workflow:latest + test -f local.sif && rm local.sif From b23b5b1312f707c425b29be12ff93f42bcb08c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:35:28 +0200 Subject: [PATCH 04/12] Rename Github action workflows --- .../{build-and-push-image.yml => build-test-and-push.yml} | 0 .../{test-docker-image.yml => test-dockerhub-image.yml} | 0 README.md | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build-and-push-image.yml => build-test-and-push.yml} (100%) rename .github/workflows/{test-docker-image.yml => test-dockerhub-image.yml} (100%) diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-test-and-push.yml similarity index 100% rename from .github/workflows/build-and-push-image.yml rename to .github/workflows/build-test-and-push.yml diff --git a/.github/workflows/test-docker-image.yml b/.github/workflows/test-dockerhub-image.yml similarity index 100% rename from .github/workflows/test-docker-image.yml rename to .github/workflows/test-dockerhub-image.yml diff --git a/README.md b/README.md index fb5ed41..0dcdd1d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # docker2singularity -[![](https://github.com/kathoef/docker2singularity/actions/workflows/test-docker-image.yml/badge.svg?branch=main)](https://github.com/kathoef/docker2singularity/blob/main/.github/workflows/test-docker-image.yml) +[![](https://github.com/kathoef/docker2singularity/actions/workflows/test-dockerhub-image.yml/badge.svg?branch=main)](https://github.com/kathoef/docker2singularity/blob/main/.github/workflows/test-dockerhub-image.yml) [![](https://shields.io/docker/image-size/kathoef/docker2singularity/latest)](https://hub.docker.com/r/kathoef/docker2singularity) This is an alternative implementation of [docker2singularity](https://github.com/singularityhub/docker2singularity) that does not rely on Docker in Docker and having to grant the container host device root capabilities via the `--privileged` flag. From e7544cd5152e711db779f6d49881a72560239cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:47:42 +0200 Subject: [PATCH 05/12] Restructure README.md --- README.md | 55 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0dcdd1d..614b394 100644 --- a/README.md +++ b/README.md @@ -3,38 +3,39 @@ [![](https://github.com/kathoef/docker2singularity/actions/workflows/test-dockerhub-image.yml/badge.svg?branch=main)](https://github.com/kathoef/docker2singularity/blob/main/.github/workflows/test-dockerhub-image.yml) [![](https://shields.io/docker/image-size/kathoef/docker2singularity/latest)](https://hub.docker.com/r/kathoef/docker2singularity) -This is an alternative implementation of [docker2singularity](https://github.com/singularityhub/docker2singularity) that does not rely on Docker in Docker and having to grant the container host device root capabilities via the `--privileged` flag. -(Which should in general be done only if absolutely necessary, could be considered bad practice, and turned out not to be necessary for the local container build workflow that is described below.) +This is an alternative implementation of [docker2singularity](https://github.com/singularityhub/docker2singularity) that does not rely on Docker in Docker and granting the container full host device root capabilities via the `--privileged` flag. +(Which should in general be done only if absolutely necessary, could be considered bad practice, and turned out not to be necessary for the local container build workflows described below.) -The Docker image provided here was originally specified for [container image portability tests](https://github.com/ExaESM-WP4/Batch-scheduler-Singularity-bindings/blob/e4be0220f8938b9cc3275267bc44be44e925b3ea/test_image_compatibility/) and to have a fully controllable Singularity pull environment available. -It turned out that my local Docker image Singularity build tasks also worked quite well and only required the Docker socket to be mounted. -(No tinkering with default Docker run privileges necessary.) +## Use cases -As I use these Docker-based fully local Singularity container image build pipelines quite often (mainly because CI and/or hub-based workflows add complexity to a single-user project that feels unnecessary and also because I have seen `singularity pull` attempts on the big machines failing) I thought I'd provide a bit more of a structured ground to this workflow here. +### Singularity build -Maybe it's useful to others as well, feedback is welcome. - -## Use case - -Build a Singularity image from a Docker image that was built locally on your system, +Build a Singularity image from a locally build Docker image, ``` -$ ls -l Dockerfile --rw-rw-r-- 1 kathoef kathoef 58 Mai 15 17:14 Dockerfile -$ docker build -t localhost/test . +$ docker pull kathoef/docker2singularity:latest +$ docker build -f Dockerfile -t localhost/test . +$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro -v ${PWD}:/output \ + kathoef/docker2singularity singularity build test.sif docker-daemon://localhost/test:latest ``` +### Singularity pull + +Build a Singularity image from a remotely hosted Docker image, + ``` $ docker pull kathoef/docker2singularity:latest -$ docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/output \ -kathoef/docker2singularity singularity build test.sif docker-daemon://localhost/test:latest +$ docker run --rm -v ${PWD}:/output \ + kathoef/docker2singularity singularity pull alpine_latest.sif docker://alpine:latest ``` -This was tested on Linux, MacOS Mojave and Windows 10 (w/ Hyper-V backend) and [Docker Desktop](https://www.docker.com/products/docker-desktop) with Docker Engine v20.10.6 installed. +### Compatibility + +These workflows were tested on Linux, MacOS Mojave and Windows 10 (w/ Hyper-V backend) and [Docker Desktop](https://www.docker.com/products/docker-desktop) with Docker Engine v20.10.6 installed. ### For Linux -You might want to change the Singularity image's file ownership afterwards, +You might want to fix the Singularity image file ownership after conversion, ``` $ ls -l test.sif @@ -44,9 +45,23 @@ $ ls -l test.sif -rwxr-xr-x 1 kathoef kathoef 2777088 Mai 15 17:19 test.sif ``` +## Background information + +The Docker image provided here was originally used during [container image portability tests](https://github.com/ExaESM-WP4/Batch-scheduler-Singularity-bindings/blob/e4be0220f8938b9cc3275267bc44be44e925b3ea/test_image_compatibility/) in order to have a fully controllable Singularity pull environment available. +It turned out that my local Docker image Singularity build tasks also worked well and only required a read-only Docker socket mount. +(No tinkering with the default Docker run privileges necessary.) + +Since I use these Docker-based fully local Singularity container image build pipelines quite often (mainly because CI and/or DockerHub-based workflows add complexity to a single-user project that feels unnecessary and also because I have seen `singularity pull` attempts on HPC machines failing) I thought I'd provide a bit more of a structured ground to this build workflow here. +Maybe it's useful to others, feedback is welcome. + ## References +Singularity/Apptainer, * https://github.com/singularityhub/docker2singularity * https://sylabs.io/guides/3.7/user-guide/singularity_and_docker.html#locally-available-images-cached-by-docker -* https://sylabs.io/guides/3.7/admin-guide/installation.html#installation-on-linux -* https://github.com/hpcng/singularity +* https://github.com/apptainer/singularity + +Multi-architecture build, +* https://docs.docker.com/buildx/working-with-buildx/ +* https://github.com/docker/setup-buildx-action#with-qemu +* https://github.com/docker/build-push-action/blob/c5e6528d5ddefc82f682165021e05edf58044bce/docs/advanced/test-before-push.md From 51fc269394a64250f46ef378a2a45d3d5125da4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:48:00 +0200 Subject: [PATCH 06/12] Update date range --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 9dec5fb..cbe31a4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Katharina Höflich +Copyright (c) 2021-2022 Katharina Höflich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 26b37474936307b17a4583fce5eef4ef7a7b6596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:56:10 +0200 Subject: [PATCH 07/12] Tweaks --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 614b394..b492ad3 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![](https://shields.io/docker/image-size/kathoef/docker2singularity/latest)](https://hub.docker.com/r/kathoef/docker2singularity) This is an alternative implementation of [docker2singularity](https://github.com/singularityhub/docker2singularity) that does not rely on Docker in Docker and granting the container full host device root capabilities via the `--privileged` flag. + (Which should in general be done only if absolutely necessary, could be considered bad practice, and turned out not to be necessary for the local container build workflows described below.) ## Use cases @@ -33,7 +34,7 @@ $ docker run --rm -v ${PWD}:/output \ These workflows were tested on Linux, MacOS Mojave and Windows 10 (w/ Hyper-V backend) and [Docker Desktop](https://www.docker.com/products/docker-desktop) with Docker Engine v20.10.6 installed. -### For Linux +### For Linux hosts You might want to fix the Singularity image file ownership after conversion, @@ -48,16 +49,17 @@ $ ls -l test.sif ## Background information The Docker image provided here was originally used during [container image portability tests](https://github.com/ExaESM-WP4/Batch-scheduler-Singularity-bindings/blob/e4be0220f8938b9cc3275267bc44be44e925b3ea/test_image_compatibility/) in order to have a fully controllable Singularity pull environment available. -It turned out that my local Docker image Singularity build tasks also worked well and only required a read-only Docker socket mount. -(No tinkering with the default Docker run privileges necessary.) +It turned out that my local Docker image Singularity build tasks also worked quite well and only required the Docker socket to be mounted as read-only. + +Since I use Docker-based local Singularity container image build pipelines quite often [1] I thought I'd provide a bit more of a structured ground to this workflow here. +Maybe it happens to be useful to others, feedback is welcome! -Since I use these Docker-based fully local Singularity container image build pipelines quite often (mainly because CI and/or DockerHub-based workflows add complexity to a single-user project that feels unnecessary and also because I have seen `singularity pull` attempts on HPC machines failing) I thought I'd provide a bit more of a structured ground to this build workflow here. -Maybe it's useful to others, feedback is welcome. +[1]: mainly because Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user data analysis project that feels unnecessary and also because I have seen `singularity pull` attempts on target-architecture HPC machines failing ## References Singularity/Apptainer, -* https://github.com/singularityhub/docker2singularity +* https://github.com/singularityhub/docker2singularity (the original!) * https://sylabs.io/guides/3.7/user-guide/singularity_and_docker.html#locally-available-images-cached-by-docker * https://github.com/apptainer/singularity From e8cd6482f8ce92ae76ab9688b140190ec95304d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 19:59:17 +0200 Subject: [PATCH 08/12] Fix footnote --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b492ad3..70c2b2d 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,10 @@ $ ls -l test.sif The Docker image provided here was originally used during [container image portability tests](https://github.com/ExaESM-WP4/Batch-scheduler-Singularity-bindings/blob/e4be0220f8938b9cc3275267bc44be44e925b3ea/test_image_compatibility/) in order to have a fully controllable Singularity pull environment available. It turned out that my local Docker image Singularity build tasks also worked quite well and only required the Docker socket to be mounted as read-only. -Since I use Docker-based local Singularity container image build pipelines quite often [1] I thought I'd provide a bit more of a structured ground to this workflow here. +Since I use Docker-based local Singularity container image build pipelines quite often [^1] I thought I'd provide a bit more of a structured ground to this workflow here. Maybe it happens to be useful to others, feedback is welcome! -[1]: mainly because Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user data analysis project that feels unnecessary and also because I have seen `singularity pull` attempts on target-architecture HPC machines failing +[^1]: mainly because Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user data analysis project that feels unnecessary and also because I have seen `singularity pull` attempts on target-architecture HPC machines failing ## References From fb99bdbf4f5223bdba38621158128b14d6219fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 20:01:25 +0200 Subject: [PATCH 09/12] Tweaks --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 70c2b2d..f1d5df5 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,10 @@ $ ls -l test.sif The Docker image provided here was originally used during [container image portability tests](https://github.com/ExaESM-WP4/Batch-scheduler-Singularity-bindings/blob/e4be0220f8938b9cc3275267bc44be44e925b3ea/test_image_compatibility/) in order to have a fully controllable Singularity pull environment available. It turned out that my local Docker image Singularity build tasks also worked quite well and only required the Docker socket to be mounted as read-only. -Since I use Docker-based local Singularity container image build pipelines quite often [^1] I thought I'd provide a bit more of a structured ground to this workflow here. +Since I use these Docker-based local Singularity container image build pipelines quite often [^1] I thought I'd provide a bit more of a structured ground here. Maybe it happens to be useful to others, feedback is welcome! -[^1]: mainly because Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user data analysis project that feels unnecessary and also because I have seen `singularity pull` attempts on target-architecture HPC machines failing +[^1]: mainly because Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user science or data analysis project that feels unnecessary and also because I have seen `singularity pull` attempts on HPC machines failing ## References From 5c50243da69dd6241ba35e2a43765ba9cd3e331a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 20:07:35 +0200 Subject: [PATCH 10/12] More tweaks --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f1d5df5..db45ac1 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,14 @@ $ ls -l test.sif ## Background information -The Docker image provided here was originally used during [container image portability tests](https://github.com/ExaESM-WP4/Batch-scheduler-Singularity-bindings/blob/e4be0220f8938b9cc3275267bc44be44e925b3ea/test_image_compatibility/) in order to have a fully controllable Singularity pull environment available. +The Docker image provided here was originally specified for [container image portability tests](https://github.com/ExaESM-WP4/Batch-scheduler-Singularity-bindings/blob/e4be0220f8938b9cc3275267bc44be44e925b3ea/test_image_compatibility/) in order to have a fully controllable Singularity pull environment available. It turned out that my local Docker image Singularity build tasks also worked quite well and only required the Docker socket to be mounted as read-only. -Since I use these Docker-based local Singularity container image build pipelines quite often [^1] I thought I'd provide a bit more of a structured ground here. +Since I use these Docker-based local Singularity container image build workflows quite often [^1] I thought I'd provide a bit more of a structured ground to this approach here. + Maybe it happens to be useful to others, feedback is welcome! -[^1]: mainly because Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user science or data analysis project that feels unnecessary and also because I have seen `singularity pull` attempts on HPC machines failing +[^1]: mainly since Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user data analysis project that seems "overkill" and also since I have seen `singularity pull` attempts on e.g. HPC machines failing ## References From 38fb3db7711cdf475a5c8f71ec6f47090498608d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 20:11:59 +0200 Subject: [PATCH 11/12] Tweak paths --- .github/workflows/build-test-and-push.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-and-push.yml b/.github/workflows/build-test-and-push.yml index e84458d..0e08ec6 100644 --- a/.github/workflows/build-test-and-push.yml +++ b/.github/workflows/build-test-and-push.yml @@ -3,9 +3,14 @@ name: build, test and push multi-arch Docker container images on: pull_request: branches: main + paths: + - Dockerfile + - .github/workflows/build-test-and-push.yml push: branches: main - paths: Dockerfile + paths: + - Dockerfile + - .github/workflows/build-test-and-push.yml env: GITHUB_SHA: ${{ github.sha }} @@ -55,7 +60,7 @@ jobs: with: username: ${{ secrets.DOCKERHUB_LOGIN_USER }} password: ${{ secrets.DOCKERHUB_LOGIN_TOKEN }} - - name: Build and push multi-arch Docker images + - name: Build and push the multi-arch Docker images if: ${{ startsWith(github.ref, 'refs/heads/main')}} uses: docker/build-push-action@v3 with: From 932a9c471d7544c0dfd51ddae104576260c10b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katharina=20H=C3=B6flich?= <37177103+kathoef@users.noreply.github.com> Date: Sun, 15 May 2022 20:14:41 +0200 Subject: [PATCH 12/12] Tweak --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db45ac1..18b7515 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Since I use these Docker-based local Singularity container image build workflows Maybe it happens to be useful to others, feedback is welcome! -[^1]: mainly since Continuous Integration and/or manual DockerHub-based workflows add complexity to a single-user data analysis project that seems "overkill" and also since I have seen `singularity pull` attempts on e.g. HPC machines failing +[^1]: mainly since CI and/or manual DockerHub-based workflows add complexity to a single-user data analysis project that seems unnecessary and also because I have seen `singularity pull` attempts on e.g. HPC machines failing ## References