-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from sigven/apptainer
Singularity/Apptainer support
- Loading branch information
Showing
6 changed files
with
163 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: apptainer | ||
|
||
on: | ||
push: | ||
branches: | ||
- apptainer | ||
|
||
env: | ||
VERSION: '1.4.1.9006' # versioned by bump2version | ||
jobs: | ||
docker2apptainer: | ||
name: Docker2apptainer | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Free Disk Space | ||
uses: jlumbroso/free-disk-space@main | ||
- name: Check free space | ||
run: | | ||
echo "Free space:" | ||
df -h | ||
- name: Code checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: v${{ env.VERSION }} | ||
- name: 🏰 QEMU setup | ||
uses: docker/setup-qemu-action@v3 | ||
- name: 🏯 Buildx setup | ||
uses: docker/setup-buildx-action@v3 | ||
- name: DockerHub login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: 🐳 Docker img build and push to DockerHub | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . # yes, dot | ||
push: false | ||
load: true | ||
platforms: linux/amd64 | ||
tags: | | ||
sigven/pcgr:${{ env.VERSION }} | ||
- name: Apptainer setup | ||
uses: eWaterCycle/setup-apptainer@v2 | ||
|
||
- name: Apptainer build | ||
run: | | ||
docker image ls -a | ||
docker save sigven/pcgr:${VERSION} -o pcgr_${VERSION}.tar | ||
ls -la | ||
df -h | ||
echo "Building Apptainer SIF" | ||
echo "---------------------------------" | ||
apptainer build pcgr_${VERSION}.sif docker-archive://pcgr_${VERSION}.tar | ||
echo "---------------------------------" | ||
ls -la | ||
df -h | ||
- name: Upload SIF to GHCR | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | apptainer registry login -u ${{ github.actor }} --password-stdin oras://ghcr.io | ||
apptainer push pcgr_${VERSION}.sif oras://ghcr.io/${GITHUB_REPOSITORY}:${VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.