Skip to content

Commit 1909a17

Browse files
johnbradleyhlapp
andcommitted
Add apptainer support
Adds apptainer definition and config to automatically build the apptainer image on release. The apptainer image is based on the docker image. Part of #27 Co-authored-by: Hilmar Lapp <[email protected]>
1 parent 12c503d commit 1909a17

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

.github/workflows/deploy-image.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Create and publish a Docker image
1+
2+
name: Create and publish container images
23

34
on:
45
release:
@@ -8,7 +9,7 @@ env:
89
IMAGE_NAME: ${{ github.repository }}
910

1011
jobs:
11-
build-and-push-image:
12+
build-and-push-docker:
1213
runs-on: ubuntu-latest
1314
permissions:
1415
contents: read
@@ -43,3 +44,38 @@ jobs:
4344
tags: ${{ steps.meta.outputs.tags }}
4445
labels: ${{ steps.meta.outputs.labels }}
4546
build-args: "PYBIOCLIP_VERSION=${{ steps.meta.outputs.version }}"
47+
48+
build-and-push-apptainer:
49+
runs-on: ubuntu-latest
50+
needs: build-and-push-docker
51+
permissions:
52+
contents: read
53+
packages: write
54+
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@v4
58+
59+
- name: Log in to the Container registry
60+
uses: docker/login-action@v3
61+
with:
62+
registry: ${{ env.REGISTRY }}
63+
username: ${{ github.actor }}
64+
password: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: Extract version for apptainer build
67+
id: meta
68+
uses: docker/metadata-action@v4
69+
with:
70+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
71+
72+
- name: Setup apptainer executable
73+
uses: eWaterCycle/setup-apptainer@v2
74+
with:
75+
apptainer-version: 1.3.3
76+
77+
- name: Build an apptainer image
78+
run: apptainer build --build-arg PYBIOCLIP_VERSION=${{ steps.meta.outputs.version }} apptainer.sif apptainer.def
79+
80+
- name: Publish apptainer image
81+
run: apptainer push apptainer.sif oras://${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-sif:${{ steps.meta.outputs.version }}

apptainer.def

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Bootstrap: docker
2+
From: ghcr.io/imageomics/pybioclip:{{ PYBIOCLIP_VERSION }}
3+
4+
%arguments
5+
PYBIOCLIP_VERSION=
6+
7+
%runscript
8+
exec "$@"

0 commit comments

Comments
 (0)