Skip to content

Commit

Permalink
copy action from libcloudphxx workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pdziekan committed Nov 5, 2021
1 parent 39e7fa4 commit 5cd05dd
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'load UWLCM Singularity image'
description: 'set env var SI to point to the image location'
inputs:
path:
description: 'Where to put the image'
required: true
tag:
description: 'Image tag'
required: true
default: 'ubuntu_20_04_cuda_11_4'

runs:
using: "composite"
steps:

- name: Install Singularity
#when installed from this action, .SIF is always converted to sandbox (could be related to: https://githubmemory.com/repo/hpcng/singularity/issues/6065)
uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.8.3
#apt installation following https://sylabs.io/guides/3.0/user-guide/installation.html, but this is a too old version and uninstalls python-is-python3
# run: |
# wget -O- http://neuro.debian.net/lists/focal.de-fzj.libre | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
# sudo apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9
# sudo apt-get update
# sudo apt-get install -y singularity-container

- name: Cache UWLCM Singularity image
id: cache_singularity
uses: actions/cache@v2
with:
path: '${{ inputs.path }}/uwlcm_${{ inputs.tag }}.sif'
key: '${{ inputs.tag }}'

- name: Download UWLCM Singularity image
shell: bash
# if: steps.cache_singularity.outputs.cache-hit != 'true'
run: |
[ "${{steps.cache_singularity.outputs.cache-hit}}" != "true" ] && \
{
mkdir '${{ inputs.path }}';
singularity pull --disable-cache --dir '${{ inputs.path }}' library://pdziekan/default/uwlcm:${{ inputs.tag }};
} \
|| \
true
# disable Singularity cache, we cache manually

- name: Set friendly Singularity image name
uses: allenevans/set-env@v2.0.0
with:
SI: '${{ inputs.path }}/uwlcm_${{ inputs.tag }}.sif'

0 comments on commit 5cd05dd

Please sign in to comment.