Skip to content

Commit

Permalink
Change singularity to apptainer
Browse files Browse the repository at this point in the history
  • Loading branch information
sfegan committed Oct 30, 2024
1 parent c4a6c2c commit b5ddb3c
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/singularity-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# calin/.github/workflows/singularity-build-and-deploy.yml - Stephen Fegan - 2021-08-23
#
# Continuous deployment using Github Actions and singularity
# Continuous deployment using Github Actions and apptainer
#
# Build and deploy calin container to the Github container repository
#
Expand Down Expand Up @@ -124,40 +124,23 @@ jobs:
name: calin_installed_${{matrix.os}}_${{matrix.arch}}
path: /tmp

- name: Set up Go 1.21.1
uses: actions/setup-go@v5
- name: Install apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
go-version: 1.21.1
cache: false
id: go

- name: Install Singularity
env:
SINGULARITY_VERSION: 3.8.3
GOPATH: /tmp/go
run: |
mkdir -p $GOPATH
sudo mkdir -p /usr/local/var/singularity/mnt
mkdir -p $GOPATH/src/github.com/sylabs
cd $GOPATH/src/github.com/sylabs
wget -qO- https://github.com/sylabs/singularity/releases/download/v${SINGULARITY_VERSION}/singularity-ce-${SINGULARITY_VERSION}.tar.gz | tar -zxf -
cd singularity-ce-${SINGULARITY_VERSION}
./mconfig -p /usr/local
make -C builddir
sudo make -C builddir install
- name: Build calin singularity container
apptainer-version: 1.3.4

- name: Build calin apptainer container
run: |
sudo -E singularity build calin-${{ matrix.arch }}.sif singularity_build.def
sudo -E apptainer build calin-${{ matrix.arch }}.sif singularity_build.def
ls -l calin-${{ matrix.arch }}.sif
singularity inspect calin-${{ matrix.arch }}.sif
apptainer inspect calin-${{ matrix.arch }}.sif
- name: Login and deploy Container
run: |
echo ${{ secrets.GITHUB_TOKEN }} | singularity remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
singularity push -U calin-${{ matrix.arch }}.sif oras://ghcr.io/${{ github.repository }}:${{ matrix.arch }}
echo ${{ secrets.GITHUB_TOKEN }} | apptainer remote login -u ${{ github.actor }} --password-stdin oras://ghcr.io
apptainer push -U calin-${{ matrix.arch }}.sif oras://ghcr.io/${{ github.repository }}:${{ matrix.arch }}
- name: Pull container and compare
run: |
singularity pull calin-pulled.sif oras://ghcr.io/${{ github.repository }}:${{ matrix.arch }}
apptainer pull calin-pulled.sif oras://ghcr.io/${{ github.repository }}:${{ matrix.arch }}
diff calin-${{ matrix.arch }}.sif calin-pulled.sif

0 comments on commit b5ddb3c

Please sign in to comment.