diff --git a/README.md b/README.md index cf168c7..8e03784 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,12 @@ Environment for running the Momentum LFRic model See [environments/lfric/README.md](environments/lfric/README.md) +### Verification + +Environment for model verification + +See [environments/verification/README.md](environments/verification/README.md) + ## Testing Once an enviornment has been built it can be tested by building and running a diff --git a/environments/verification/README.md b/environments/verification/README.md new file mode 100644 index 0000000..0f603cd --- /dev/null +++ b/environments/verification/README.md @@ -0,0 +1,7 @@ +# Verification + +Packages useful for verification work: + + - [CSET](https://metoffice.github.io/CSET/) + - [METPlus](https://metplus.readthedocs.io/en/latest/) + - [Scores](https://scores.readthedocs.io/en/stable/) diff --git a/environments/verification/commands.sh b/environments/verification/commands.sh new file mode 100644 index 0000000..2ce7956 --- /dev/null +++ b/environments/verification/commands.sh @@ -0,0 +1,7 @@ +ENV_COMMANDS=( + cset + python + jupyter + run_metplus + run_metplus.py +) diff --git a/environments/verification/conda.yaml b/environments/verification/conda.yaml new file mode 100644 index 0000000..0b8b9b2 --- /dev/null +++ b/environments/verification/conda.yaml @@ -0,0 +1,12 @@ +name: verification +channels: + - conda-forge + - nodefaults +dependencies: + - jupyterlab + - jupyterlab-lsp + - jedi-language-server + + - cset + - metplus + - scores diff --git a/site/nci/install-stage-two.sh b/site/nci/install-stage-two.sh index 1707678..d07b10a 100644 --- a/site/nci/install-stage-two.sh +++ b/site/nci/install-stage-two.sh @@ -37,12 +37,14 @@ if [[ -v NGMOENVS_DEBUG ]]; then exit 0 fi -if ! e "${APPTAINER[@]}" run "${MOUNT_ARGS[@]}" "$NGMOENVS_BASEIMAGE" /bin/bash "${SITE_DIR}/../../utils/install-stage-two.sh"; then - # Copy failed build logs to scratch - mkdir -p "/scratch/$PROJECT/$USER/tmp/spack-stage" - cp -r "$TMPDIR/$USER/spack-stage/"* "/scratch/$PROJECT/$USER/tmp/spack-stage" - echo "Logs available under /scrach/$PROJECT/$USER/tmp/spack-stage" - exit 1 +if [[ -f "$NGMOENVS_DEFS/enviornments/$ENVIRONMENT/spack.yaml" ]]; then + if ! e "${APPTAINER[@]}" run "${MOUNT_ARGS[@]}" "$NGMOENVS_BASEIMAGE" /bin/bash "${SITE_DIR}/../../utils/install-stage-two.sh"; then + # Copy failed build logs to scratch + mkdir -p "/scratch/$PROJECT/$USER/tmp/spack-stage" + cp -r "$TMPDIR/$USER/spack-stage/"* "/scratch/$PROJECT/$USER/tmp/spack-stage" + echo "Logs available under /scrach/$PROJECT/$USER/tmp/spack-stage" + exit 1 + fi fi # Convert to squashfs diff --git a/utils/install-stage-one.sh b/utils/install-stage-one.sh index 83a33c6..eee3821 100755 --- a/utils/install-stage-one.sh +++ b/utils/install-stage-one.sh @@ -164,7 +164,9 @@ fi EOF # Set compiler variables -cat "$ENVDIR/etc/compiler.sh" >> "$ENVDIR/bin/activate" +if [[ -f "$ENVDIR/etc/compiler.sh" ]]; then + cat "$ENVDIR/etc/compiler.sh" >> "$ENVDIR/bin/activate" +fi # Run script cat > "$ENVDIR/bin/envrun" <