Skip to content

Commit

Permalink
Update build workflow to test that build singularity image works
Browse files Browse the repository at this point in the history
  • Loading branch information
HippocampusGirl committed Dec 10, 2024
1 parent 99b717b commit 7a7a066
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down

0 comments on commit 7a7a066

Please sign in to comment.