From 7a7a066b4b38ce26c0b2a137249e749fead4475b Mon Sep 17 00:00:00 2001 From: Lea Waller Date: Tue, 10 Dec 2024 01:02:40 +0100 Subject: [PATCH] Update build workflow to test that build singularity image works --- .github/workflows/build.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4cdd8d5..4770fbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,15 +151,21 @@ jobs: AWS_ENDPOINT_URL: ${{ secrets.AWS_ENDPOINT_URL }} run: | mkdir --parents singularity-2 - docker run \ + container=(docker run \ --privileged \ --rm \ --volume="/var/run/docker.sock:/var/run/docker.sock" \ --volume="$(pwd)/singularity-2:/output" \ - quay.io/singularity/docker2singularity:v2.6 \ + --entrypoint="" \ + "quay.io/singularity/docker2singularity:v2.6") + ${container[@]} /docker2singularity.sh \ --name ${{ steps.metadata.outputs.singularity_name }} \ ${{ steps.metadata.outputs.build_tag }} image_file=$(find singularity-2 -type f | head --lines=1) + # Check if the container works + ${container[@]} singularity exec \ + /output/$(basename "${image_file}") score --help + # Upload the container aws s3 mv \ --only-show-errors \ --acl public-read \ @@ -174,16 +180,20 @@ jobs: AWS_ENDPOINT_URL: ${{ secrets.AWS_ENDPOINT_URL }} run: | mkdir --parents singularity - docker run \ + singularity=(docker run \ --rm \ --volume="/var/run/docker.sock:/var/run/docker.sock" \ --volume="$(pwd)/singularity:/output" \ - quay.io/singularity/singularity:v4.1.0 \ - build \ + "quay.io/singularity/singularity:v4.1.0") + ${singularity[@]} build \ --disable-cache \ /output/${{ steps.metadata.outputs.singularity_name }} \ docker-daemon://${{ steps.metadata.outputs.build_tag }} image_file=$(find singularity -type f | head --lines=1) + # Check if the container works + ${singularity[@]} exec \ + /output/$(basename "${image_file}") score --help + # Upload the container aws s3 mv \ --only-show-errors \ --acl public-read \