-
Notifications
You must be signed in to change notification settings - Fork 210
run GW using container with spack-stack 1.9.2 #3964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
weihuang-jedi
wants to merge
206
commits into
NOAA-EMC:develop
from
NOAA-EPIC:feature/use_container_spack-stack-1.9.2
Closed
Changes from all commits
Commits
Show all changes
206 commits
Select commit
Hold shift + click to select a range
f071994
change noaacloud NodeName
weihuang-jedi 11accd8
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi a4771df
add download fix subset data, also serve as a test PR to trigger CI t…
weihuang-jedi 4f1e679
fix pynorm error
weihuang-jedi 2241227
fix pynorm error 2
weihuang-jedi 9679617
fix pynorm error3
weihuang-jedi fe88751
fix pynorm error 4
weihuang-jedi 0284fb7
fix pynorm error 5
weihuang-jedi 27ca2f1
fix pynorm error 6
weihuang-jedi f39bfd9
fix pynorm error 7
weihuang-jedi 8f7fc23
fix pynorm error 8
weihuang-jedi c248e12
fix pynorm error 9
weihuang-jedi 85120f3
fix pynorm error 10
weihuang-jedi 2a7f1c9
fix a syntax error
weihuang-jedi 9f8ee2d
use just /lutre/jenkins for CI testing work directory
weihuang-jedi fbeb220
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi df4179c
using argparse and logging instead of getopt and print
weihuang-jedi 6a168ae
using argparse and logging instead of getopt and print
weihuang-jedi a23662f
Updating with proper nomenclature.
kbooker79 3c223cf
Merge pull request #5 from NOAA-EPIC/download-subset-fix-data
kbooker79 6b60421
consist with Terry's code
weihuang-jedi 35f35f2
add a ls command to make sure code in cloned
weihuang-jedi 9e53aa4
try clone the code directly
weihuang-jedi 98c50d9
use https to clone
weihuang-jedi b4c507f
Merge branch 'NOAA-EMC:develop' into develop
weihuang-jedi 3089f00
add more debug ls
weihuang-jedi 57b2a51
fix a typo
weihuang-jedi 8fefe2a
remove 2 comments
weihuang-jedi 8f6db95
reset HOMEgfs
weihuang-jedi 1f05a51
compile for gfs only for now
weihuang-jedi 4640b6a
comment gh pr eidt for now
weihuang-jedi c906547
skip CI on AWS
weihuang-jedi eac272e
trying to fix runtime bug
weihuang-jedi 35a6cd0
still trying to figure out HOEgfs issue
weihuang-jedi b55f4a1
add compile gefs
weihuang-jedi e1724cb
add compile gefs
weihuang-jedi 4264c15
add compile gefs
weihuang-jedi 20c1211
switch back to 'checkout scm instead of git clone'
weihuang-jedi f8a6a6d
using checkout scm
weihuang-jedi c952a73
using checkout scm
weihuang-jedi 12b09df
remove memory from resource if on AWS
weihuang-jedi 98570b7
remove memory requirement for AWS
weihuang-jedi 2039132
Merge branch 'NOAA-EMC:develop' into develop
weihuang-jedi e4fe644
sync
weihuang-jedi c83e940
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi 475b44f
add container
weihuang-jedi 49b0a87
add container to link_workflow.sh
weihuang-jedi d862910
changes for container, module reset, and machine-id over-write
weihuang-jedi d493152
sync
weihuang-jedi 83d48d7
sync
weihuang-jedi a95789e
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi 94a4ffa
add more for container
weihuang-jedi 668b3a8
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi cc2cb49
Merge branch 'use_container_stack-stack-1.6.0' of ssh://github.com/NO…
weihuang-jedi 342d67d
sync
weihuang-jedi 5281e0b
trying run in container
weihuang-jedi 18e7fde
sync with use_container_stack-stack-1.6.0
weihuang-jedi 12c95ad
use EPIC container branch
weihuang-jedi def6882
run on hera with container
weihuang-jedi 0d04e51
add run_gfs_model.sh script
weihuang-jedi 7feb8e0
sync
weihuang-jedi 0fd25c0
use wgrib2 from container
weihuang-jedi c3866ac
using python for stage-ic
weihuang-jedi 4773dcc
ursa changes
weihuang-jedi 8d226ea
for ursa
weihuang-jedi b9ecb10
sync
weihuang-jedi 60b7782
sync with container changes
weihuang-jedi b57bdb6
create bin dir
weihuang-jedi 856fb2b
add run_python and run_wgrib2 to use python and wgrib2 from container
weihuang-jedi dd257aa
stage-ic ok on AWS
weihuang-jedi a7f8d13
ad-hoc work around to run container GW on Ursa to demo that only roco…
weihuang-jedi 7402ec5
on gaea
weihuang-jedi 37d0faa
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi 9a450a1
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi 1e218f9
prepare ursa demo
weihuang-jedi ca63cf1
working on demo
weihuang-jedi 7b841cd
working on demo
weihuang-jedi e62a6a8
sync with develop
weihuang-jedi 6ec552f
for GW run with container on gaeac6
weihuang-jedi ba9a01c
Merge branch 'NOAA-EMC:develop' into feature/container-on-ursa-readonly
weihuang-jedi fa132ab
generalize container setup on ursa
weihuang-jedi 81ec75f
sync
weihuang-jedi 11bce6d
create a directory dev/container to hold container code
weihuang-jedi 11d1d98
pull ursa changes in
weihuang-jedi d6f5283
sync with ursa
weihuang-jedi ccbdb97
sync with ursa
weihuang-jedi 8b27108
merge in ursa changes
weihuang-jedi 4137587
gaea changes
weihuang-jedi 52f4cb3
testing on AWS
weihuang-jedi 2d0d808
sync with dev
weihuang-jedi 958bb9c
add note for multiple nodes run on AWS
weihuang-jedi 00bd88b
sync with dev
weihuang-jedi e6f437c
sync with aws changes
weihuang-jedi a7f4dff
wants to run with or without container on AWS
weihuang-jedi 3664c84
Merge branch 'NOAA-EMC:develop' into feature/container-on-AWS
weihuang-jedi 682b8d5
sync and remove extra code
weihuang-jedi 92dedd2
retest
weihuang-jedi 1f19ab7
before merge AWS changes
weihuang-jedi 52774de
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi c9c7f9f
sync with AWS
weihuang-jedi 60039dc
change for atmos products on gaea
weihuang-jedi 777ac7b
sync
weihuang-jedi e19a65e
add highmemory partition for atmos products
weihuang-jedi 8141155
testing on gaezc6
weihuang-jedi 1e07a0c
fix wgrib2 file location error
weihuang-jedi ca3d4ba
sync
weihuang-jedi 12cf63f
sync
weihuang-jedi cbc380b
update to ss-1.9.1
weihuang-jedi c0dd64a
re-test
weihuang-jedi e51fbd2
re-test on AWS
weihuang-jedi a220369
update wgrib2 to 3.6.0 and make shell script executable
weihuang-jedi 0a6dba3
update atmos_produts
weihuang-jedi d197f95
direct use interp_atmos_master[sflux]
weihuang-jedi 769e042
sync 2 develop
weihuang-jedi d2f255f
trying to make ss192 container working on AWS
weihuang-jedi 5814ef9
run check_land_input_orography.py using container python, if run with…
weihuang-jedi d797607
detect container
weihuang-jedi 340aeae
resolve conflict for merge ursa to ss192
weihuang-jedi 8545b9f
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 1f5a539
Merge branch 'develop' into feature/use_container_spack-stack-1.9.2
weihuang-jedi 4fc22a9
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi 7077d1a
testing on ursa
weihuang-jedi 8bdcbe0
testing on ursa
weihuang-jedi bbb8e63
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi dfd1efe
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 3c1603a
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 7ced447
sync with emc repo
weihuang-jedi 629ef7d
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi cec1523
remove duplicated scripts
weihuang-jedi 5e351a5
ursa to ss192
weihuang-jedi 3f99898
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 98c1e12
testing on ursa
weihuang-jedi 5c3a0f3
Merge branch 'feature/use_container_spack-stack-1.9.2' of github.com:…
weihuang-jedi 38670a3
testing on ursa
weihuang-jedi 74353f3
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi 699a4d2
Merge branch 'feature/use_container_spack-stack-1.9.2' of github.com:…
weihuang-jedi 79a3037
upper level need to detect machine as well
weihuang-jedi 42f2580
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 0bfa75b
Merge branch 'feature/use_container_spack-stack-1.9.2' of github.com:…
weihuang-jedi 81a5a53
C48_ATM containerized GW worked on Ursa with ss192
weihuang-jedi b4580de
testing c48-s2sw on ursa
weihuang-jedi 12ea104
sync with ursa
weihuang-jedi 99c08a3
more test on ursa for gefs
weihuang-jedi f3ab33b
add machine-id to link_model.sh
weihuang-jedi 9b69fc4
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 003b39b
update CDMBWD to CDMBGWD
weihuang-jedi 11ddfb2
WM using UFSATM instead of FV3
weihuang-jedi fd711e8
do not need use prod_util from home now
weihuang-jedi 8a00789
add cpfs and cpreq to bash_utils
weihuang-jedi aab3b8a
remove redundent code
weihuang-jedi db7855c
remove redundent code
weihuang-jedi 0f5e6b5
add 2 versions files for container
weihuang-jedi fde2ef2
sync
weihuang-jedi 2e04b65
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 6922c86
simplifying and sync
weihuang-jedi 870a0ea
need to source gw_run env, not just preamble
weihuang-jedi 7349461
change exit code to positive numbers
weihuang-jedi 3e67ee2
Merge branch 'feature/use_container_spack-stack-1.9.2' of github.com:…
weihuang-jedi 26bc3f7
reverse changes
weihuang-jedi 0b8a029
remove wgrib2 from explicit wrapper, and remove commented echo
weihuang-jedi e39997d
Merge branch 'feature/use_container_spack-stack-1.9.2' of ssh://githu…
weihuang-jedi c617e8d
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi a6a0ba9
fixing lint shell script check
weihuang-jedi e1099f6
fixing lint shell script check
weihuang-jedi 9ff1c7e
fixing lint shell script check
weihuang-jedi 6d6d76a
making lint complaint
weihuang-jedi d581da6
making lint compliant
weihuang-jedi c193688
making lint compliant
weihuang-jedi d96672a
update container forecast to use module in container
weihuang-jedi ff08841
re-test on ursa
weihuang-jedi 66bb7ca
check on aws
weihuang-jedi fbb8250
sync
weihuang-jedi 2e8c332
re-merge on aws
weihuang-jedi 024f319
Merge remote-tracking branch 'origin/develop' into feature/use_contai…
weihuang-jedi 8166dcf
sync
weihuang-jedi 59c8897
save local change
weihuang-jedi 04ebd5b
remove versions for container, and no host modules for container
weihuang-jedi 66a448e
sync
weihuang-jedi d7bf8b8
sync
weihuang-jedi cfa9619
sync
weihuang-jedi 4fc8265
add rocotorun to rocoto_parser
weihuang-jedi c0d0154
remove unused dir
weihuang-jedi 3b65244
working on aws
weihuang-jedi 2499b30
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 6bb0373
testing on ursa
weihuang-jedi a8730ec
recover ursa.yaml
weihuang-jedi 2823766
remove config.resources.URSA from sfs
weihuang-jedi 335ae74
need run_mpmd.sh changes
weihuang-jedi 3429ed8
only double quota varaibles
weihuang-jedi 57b7337
only double quota varaibles
weihuang-jedi 810d5d3
update gaeac6, ursa env
weihuang-jedi 7ca20aa
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 4d772f0
reverse to GW repo code, and new way to handle jobs scripts
weihuang-jedi a9c6644
combine few scripts to decrease numbers
weihuang-jedi 39e6392
fix archive script
weihuang-jedi 5ae3c67
using PYCMD
weihuang-jedi 3132c9b
using PYCMD
weihuang-jedi 7c204eb
sync
weihuang-jedi b79c4d1
merge develop change in
weihuang-jedi 8d7c082
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi 73311d1
add PYCMD
weihuang-jedi e443224
no need to save to repo, as it is a link
weihuang-jedi d8678e2
testing on AWS
weihuang-jedi f86f639
remove env/*.container
weihuang-jedi 55d7262
remove env/*.container
weihuang-jedi 31a09d8
Merge branch 'NOAA-EMC:develop' into feature/use_container_spack-stac…
weihuang-jedi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -x | ||
|
|
||
| HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 && pwd )" | ||
| source "${HOMEgfs}/ush/detect_machine.sh" | ||
|
|
||
| run_with_container="YES" | ||
| #run_with_container="NO" | ||
|
|
||
| casetype="pr" | ||
| #yamllist="C48_ATM" | ||
| yamllist="C48_S2SW" | ||
| #yamllist="C48_S2SWA_gefs" | ||
| #yamllist="C96mx100_S2S" | ||
|
|
||
| #casetype=hires | ||
| #yamllist="C768_S2SW" | ||
|
|
||
| HOMEDIR=${HOMEgfs} | ||
| img=ubuntu22.04-intel-ufs-env-v1.9.2.img | ||
| if [[ ${MACHINE_ID} = ursa* ]] ; then | ||
| container=/scratch3/NCEPDEV/nems/role.epic/containers/${img} | ||
| rundir=/scratch3/NAGAPE/epic/${USER}/run | ||
| bindings="-B /scratch3 -B /scratch4" | ||
| HPC_ACCOUNT=epic | ||
|
|
||
| module load rocoto/1.3.7 | ||
| rocotocmd=$(command -v rocotorun) | ||
| elif [[ ${MACHINE_ID} = gaea* ]] ; then | ||
| container=/gpfs/f6/scratch/Wei.Huang/container/${img} | ||
| rundir=/gpfs/f6/scratch/${USER}/run | ||
| bindings="-B /gpfs/f6/scratch -B /ncrc/home1/${USER}" | ||
| HPC_ACCOUNT=bil-fire8 | ||
|
|
||
| rocotocmd=/autofs/ncrc-svm1_home2/Christopher.W.Harrop/rocoto-1.3.7/bin/rocotorun | ||
| elif [[ ${MACHINE_ID} = noaacloud* ]] ; then | ||
| TOPICDIR=/bucket/global-workflow-shared-data/ICSDIR | ||
| container=/contrib/containers/${img} | ||
| rundir=/lustre/${USER}/run | ||
| bindings="--env \"I_MPI_FABRICS=shm:ofi,I_MPI_DEBUG=6\" -B /apps/slurm/default/lib/libpmi2.so -B /contrib -B /lustre -B /bucket" | ||
| #bindings="-B /apps/slurm/default/lib/libpmi2.so -B /contrib -B /lustre -B /bucket" | ||
| HPC_ACCOUNT=${USER} | ||
|
|
||
| module load rocoto/1.3.7 | ||
| rocotocmd=$(command -v rocotorun) | ||
| fi | ||
|
|
||
| set -x | ||
|
|
||
| mkdir -p "${rundir}" | ||
| mkdir -p "${HOMEDIR}"/exec | ||
| mkdir -p "${HOMEDIR}"/ush/container | ||
|
|
||
| cd "${HOMEDIR}/dev/workflow" || exit 1 | ||
|
|
||
| if [[ "${run_with_container}" == "YES" ]]; then | ||
| "${HOMEDIR}/dev/container/utils/gen-wrapper.sh" -H "${HOMEDIR}" -c "${container}" -b "${bindings}" -v | ||
|
|
||
| TOPICDIR=${TOPICDIR} \ | ||
| RUNTESTS=${rundir} \ | ||
| RUNDIRS=${rundir} \ | ||
| ./generate_workflows.sh \ | ||
| -H "${HOMEDIR}" \ | ||
| -y "${yamllist}" \ | ||
| -Y "${HOMEDIR}/dev/ci/cases/${casetype}" \ | ||
| -A "${HPC_ACCOUNT}" \ | ||
| -e "${USER}@noaa.gov" \ | ||
| -r "${rocotocmd}" \ | ||
| -v -R | ||
|
|
||
| "${HOMEDIR}/dev/container/utils/create-atmos-products.sh" -H "${HOMEDIR}" -c "${container}" -b "${bindings}" | ||
| "${HOMEDIR}/dev/container/utils/create-container-links.sh" -H "${HOMEDIR}" -c "${container}" -b "${bindings}" -M "${MACHINE_ID}" | ||
| else | ||
| TOPICDIR=${TOPICDIR} \ | ||
| RUNTESTS=${rundir} \ | ||
| RUNDIRS=${rundir} \ | ||
| ./generate_workflows.sh \ | ||
| -H "${HOMEDIR}" \ | ||
| -y "${yamllist}" \ | ||
| -Y "${HOMEDIR}/dev/ci/cases/${casetype}" \ | ||
| -A "${HPC_ACCOUNT}" \ | ||
| -e "${USER}@noaa.gov" \ | ||
| -v | ||
| fi | ||
|
|
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -x | ||
|
|
||
| HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 && pwd )" | ||
| source "${HOMEgfs}/ush/detect_machine.sh" | ||
| sif=ubuntu22.04-intel-ufs-env-v1.9.2.img | ||
|
|
||
| if [[ ${MACHINE_ID} = ursa* ]] ; then | ||
| img=/scratch3/NCEPDEV/nems/role.epic/containers/${sif} | ||
| bindings="-B /scratch3 -B /scratch4" | ||
| elif [[ ${MACHINE_ID} = gaea* ]] ; then | ||
| img=/gpfs/f6/scratch/${USER}/container/${sif} | ||
| bindings="-B /gpfs/f6/scratch -B /ncrc/home1/${USER}" | ||
| elif [[ ${MACHINE_ID} = noaacloud* ]] ; then | ||
| img=/contrib/containers/${sif} | ||
| bindings="-B /contrib -B /lustre -B /bucket" | ||
| fi | ||
|
|
||
| singularity shell -e ${bindings} "${img}" | ||
|
|
||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #!/bin/bash | ||
|
|
||
| verbose=false | ||
|
|
||
| while [[ "$#" -gt 0 ]]; do | ||
| case "$1" in | ||
| -H|--HOMEgfs) | ||
| HOMEgfs="$2" | ||
| shift 2 | ||
| ;; | ||
| -c|--container) | ||
| container="$2" | ||
| shift 2 | ||
| ;; | ||
| -b|--bindings) | ||
| bindings="$2" | ||
| shift 2 | ||
| ;; | ||
| -v|--verbose) | ||
| verbose=true | ||
| shift | ||
| ;; | ||
| *) | ||
| echo "Unknown option: $1" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ ! -v HOMEgfs || ! -v container || ! -v bindings ]]; then | ||
| echo "Usage: create-container-links.sh -H/--HOMEgfs gw-home-dir -c/--container container-fullpath -b/--bindings list-of-binding-dirs [-v]" | ||
| exit 11 | ||
| fi | ||
|
|
||
| if [[ "${verbose}" == "true" ]]; then | ||
| echo "Verbose: ${verbose}" | ||
| echo "HOMEgfs: ${HOMEgfs}" | ||
| echo "container: ${container}" | ||
| echo "bindings: ${bindings}" | ||
| fi | ||
|
|
||
| eap_script="${HOMEgfs}"/exec/exglobal_atmos_products.sh | ||
| cat > "${eap_script}" << EOF_ATMOS_PRODUCTS | ||
| #!/bin/bash | ||
| LD_LIBRARY_PATH=\$(dirname ${HOMEgfs}) | ||
| export LD_LIBRARY_PATH | ||
|
|
||
| singularity exec \\ | ||
| ${bindings} \\ | ||
| ${container} \\ | ||
| ${HOMEgfs}/scripts/exglobal_atmos_products.sh "\$@" | ||
| EOF_ATMOS_PRODUCTS | ||
|
|
||
| chmod +x "${eap_script}" | ||
|
|
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| #!/bin/bash | ||
|
|
||
| verbose=false | ||
|
|
||
| while [[ "$#" -gt 0 ]]; do | ||
| case "$1" in | ||
| -H|--HOMEgfs) | ||
| HOMEgfs="$2" | ||
| shift 2 | ||
| ;; | ||
| -c|--container) | ||
| container="$2" | ||
| shift 2 | ||
| ;; | ||
| -b|--bindings) | ||
| bindings="$2" | ||
| shift 2 | ||
| ;; | ||
| -v|--verbose) | ||
| verbose=true | ||
| shift | ||
| ;; | ||
| -M|--MACHINE_ID) | ||
| machineid="$2" | ||
| shift 2 | ||
| ;; | ||
| *) | ||
| echo "Unknown option: $1" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ ! -v HOMEgfs || ! -v container || ! -v bindings || ! -v MACHINE_ID ]]; then | ||
| echo "Usage: create-container-links.sh -H/--HOMEgfs gw-home-dir -c/--container container-fullpath -b/--bindings -M|--MACHINE_ID list-of-binding-dirs [-v]" | ||
| exit 11 | ||
| fi | ||
|
|
||
| if [[ "${verbose}" == "true" ]]; then | ||
| echo "HOMEgfs: ${HOMEgfs}" | ||
| echo "container: ${container}" | ||
| echo "bindings: ${bindings}" | ||
| echo "Verbose: ${verbose}" | ||
| fi | ||
|
|
||
| "${HOMEgfs}/dev/container/utils/link_ww3.sh" -H "${HOMEgfs}" -c "${container}" -b "${bindings}" -t gfs | ||
| "${HOMEgfs}/dev/container/utils/link_ww3.sh" -H "${HOMEgfs}" -c "${container}" -b "${bindings}" -t sfs | ||
| "${HOMEgfs}/dev/container/utils/link_ww3.sh" -H "${HOMEgfs}" -c "${container}" -b "${bindings}" -t gefs | ||
|
|
||
| "${HOMEgfs}/dev/container/utils/link_model.sh" -H "${HOMEgfs}" -c "${container}" -m gfs_model -b "${bindings}" -M "${machineid}" | ||
| "${HOMEgfs}/dev/container/utils/link_model.sh" -H "${HOMEgfs}" -c "${container}" -m sfs_model -b "${bindings}" -M "${machineid}" | ||
| "${HOMEgfs}/dev/container/utils/link_model.sh" -H "${HOMEgfs}" -c "${container}" -m gefs_model -b "${bindings}" -M "${machineid}" | ||
|
|
||
| "${HOMEgfs}/dev/container/utils/link_gfs_utils.sh" -H "${HOMEgfs}" -c "${container}" -b "${bindings}" | ||
| "${HOMEgfs}/dev/container/utils/link_ufs_utils.sh" -H "${HOMEgfs}" -c "${container}" -b "${bindings}" | ||
|
|
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| #!/bin/bash | ||
|
|
||
| verbose=false | ||
|
|
||
| while [[ "$#" -gt 0 ]]; do | ||
| case "$1" in | ||
| -H|--HOMEgfs) | ||
| HOMEgfs="$2" | ||
| shift 2 | ||
| ;; | ||
| -b|--bindings) | ||
| bindings="$2" | ||
| shift 2 | ||
| ;; | ||
| -c|--container) | ||
| container="$2" | ||
| shift 2 | ||
| ;; | ||
| -v|--verbose) | ||
| verbose=true | ||
| shift | ||
| ;; | ||
| *) | ||
| echo "Unknown option: $1" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| if [[ ! -v HOMEgfs || ! -v container ]]; then | ||
| echo "Usage: link_model.sh -H/-HOMEgfs gw-home-dir -c/--container full-path-container-image -b/--bindings -B dirname [-B dirname1 [...]] [-v]" | ||
| exit 11 | ||
| fi | ||
|
|
||
| if [[ "${verbose}" == "true" ]]; then | ||
| set -x | ||
| fi | ||
|
|
||
| exec_python_script="${HOMEgfs}"/exec/run_python.sh | ||
|
|
||
| cat > "${exec_python_script}" << EOF_EXEC_PYTHON | ||
| #!/bin/bash | ||
| LD_LIBRARY_PATH=\$(dirname "${container}") | ||
| export LD_LIBRARY_PATH | ||
|
|
||
| singularity exec \\ | ||
| ${bindings} \\ | ||
| ${container} \\ | ||
| ${HOMEgfs}/ush/container/run_python.sh "\$@" | ||
| EOF_EXEC_PYTHON | ||
|
|
||
| run_python_script="${HOMEgfs}"/ush/container/run_python.sh | ||
|
|
||
| cat > "${run_python_script}" << EOF_RUN_PYTHON | ||
| #!/bin/bash | ||
|
|
||
| source /usr/lmod/lmod/init/bash | ||
| module purge | ||
| module use "${HOMEgfs}"/sorc/gfs_utils.fd/modulefiles | ||
| module load gfsutils_container.intel | ||
| module load python | ||
| module load py-netcdf4 | ||
| module load py-xarray | ||
| module load py-f90nml | ||
| module load py-numpy | ||
| module load py-jinja2 | ||
| module load py-pyyaml | ||
|
|
||
| wxflowPATH=${HOMEgfs}/ush/python:${HOMEgfs}/sorc/wxflow/src | ||
| export PYTHONPATH=\${PYTHONPATH:+\${PYTHONPATH}:}${HOMEgfs}/ush:\${wxflowPATH} | ||
|
|
||
| python "\$@" | ||
| EOF_RUN_PYTHON | ||
|
|
||
| sed -i 's/RUN_WITH_CONTAINER=NO/RUN_WITH_CONTAINER=YES/g' "${HOMEgfs}/ush/preamble.sh" | ||
| chmod +x "${exec_python_script}" | ||
| chmod +x "${run_python_script}" | ||
|
|
||
| for item in JGLOBAL_WAVE_INIT | ||
Check warningCode scanning / shellcheck This loop will only ever run once. Bad quoting or missing glob/expansion? Warning
This loop will only ever run once. Bad quoting or missing glob/expansion?
|
||
| do | ||
| exec_script="${HOMEgfs}"/exec/"${item}" | ||
|
|
||
| cat > "${exec_script}" << EOF_SCRIPT | ||
| #!/bin/bash | ||
| #Need these lines on AWS to run more than one node. | ||
| #export I_MPI_DEBUG=10 | ||
| #export I_MPI_FABRICS=shm:ofi | ||
| #export I_MPI_OFI_PROVIDER=tcp | ||
| #export FI_PROVIDER=tcp | ||
| #export FI_TCP_IFACE=eth0 | ||
|
|
||
| LD_LIBRARY_PATH=\$(dirname "${container}") | ||
| export LD_LIBRARY_PATH | ||
|
|
||
| singularity exec \\ | ||
| ${bindings} \\ | ||
| ${container} \\ | ||
| ${HOMEgfs}/jobs/${item} | ||
| EOF_SCRIPT | ||
|
|
||
| chmod +x "${exec_script}" | ||
| done | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.