Build and Push Singularity Image #41
Workflow file for this run
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
name: Build and Push Singularity Image | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: X86 | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./singularity | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Build Singularity Image | |
run: | | |
sudo singularity build ciroh-ngen-singularity.sif singularity_ngen.def | |
- name: Test | |
run: | | |
rm -rf /home/ubuntu/workspace/AWI_16_2853886_006/partitions*.json | |
rm -rf /home/ubuntu/workspace/AWI_16_2853886_006/*.csv | |
rm -rf /home/ubuntu/workspace/AWI_16_2853886_006/*.parquet | |
rm -rf /home/ubuntu/workspace/AWI_16_2853886_006/outputs/*/* | |
singularity run --bind /home/ubuntu/workspace/AWI_16_2853886_006:/ngen/ngen/data ciroh-ngen-singularity.sif "/ngen/ngen/data auto 2" | |
output_count=`ls /home/ubuntu/workspace/AWI_16_2853886_006/outputs/* | wc -l` | |
if [[ "$output_count" < 1 ]]; then | |
echo "No outputs found" | |
exit 1 | |
else | |
echo "Test run successfully" | |
fi | |
- name: Push Singularity Image to Library | |
run: | | |
singularity push -U ciroh-ngen-singularity.sif library://awiciroh/ngiab/ciroh-ngen-singularity:latest |