diff --git a/.github/workflows/singularity_image.yml b/.github/workflows/singularity_image.yml index b4c1cb4..66bb4fe 100644 --- a/.github/workflows/singularity_image.yml +++ b/.github/workflows/singularity_image.yml @@ -11,15 +11,33 @@ on: 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: | - singularity build ciroh-ngen-singularity.sif singularity/singularity_ngen.def + sudo singularity build ciroh-ngen-singularity.sif singularity_ngen.def + - name: Test + run: | + rm -rf /home/ubuntu/workspace/AWI_09_004/partitions*.json + rm -rf /home/ubuntu/workspace/AWI_09_004/*.csv + rm -rf /home/ubuntu/workspace/AWI_09_004/*.parquet + rm -rf /home/ubuntu/workspace/AWI_09_004/outputs/* + singularity run --bind /home/ubuntu/workspace/AWI_09_004:/ngen/ngen/data ciroh-ngen-singularity.sif "/ngen/ngen/data auto 2" + output_count=`ls /home/ubuntu/workspace/AWI_09_004/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 + singularity push -U ciroh-ngen-singularity.sif library://awiciroh/ngiab/ciroh-ngen-singularity:latest \ No newline at end of file diff --git a/singularity/templates/ngen/install_ngen.sh b/singularity/templates/ngen/install_ngen.sh index 6d95d46..bbbce8e 100755 --- a/singularity/templates/ngen/install_ngen.sh +++ b/singularity/templates/ngen/install_ngen.sh @@ -22,6 +22,7 @@ then fi git clone https://github.com/NOAA-OWP/ngen.git cd ngen +git checkout f91e2ea echo "===========================================================" echo "==========================================================="