Skip to content

Commit 1df78dd

Browse files
authored
Merge branch 'develop' into feature/fire_blending
2 parents 8a471fa + 1cc4078 commit 1df78dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+431
-222
lines changed
Lines changed: 68 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
name: gw-ci-aws-centos
2-
3-
on: [workflow_dispatch]
4-
1+
name: gw-ci-aws
52
# TEST_DIR contains 2 directories;
63
# 1. HOMEgfs: clone of the global-workflow
74
# 2. RUNTESTS: A directory containing EXPDIR and COMROT for experiments
@@ -10,33 +7,73 @@ on: [workflow_dispatch]
107
# ├── HOMEgfs
118
# └── RUNTESTS
129
# ├── COMROT
13-
#   └── ${pslot}
10+
# └── ${pslot}
1411
# └── EXPDIR
1512
# └── ${pslot}
13+
14+
on:
15+
workflow_dispatch:
16+
inputs:
17+
pr_number:
18+
description: 'Pull Request Number (use 0 for non-PR)'
19+
required: true
20+
default: '0'
21+
os:
22+
description: 'Operating System'
23+
required: true
24+
type: choice
25+
options:
26+
- rocky
27+
- centos
28+
1629
env:
1730
TEST_DIR: ${{ github.workspace }}/${{ github.run_id }}
1831
MACHINE_ID: noaacloud
1932

2033
jobs:
34+
fetch-branch:
35+
runs-on: ubuntu-latest
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUBTOKEN }}
38+
outputs:
39+
branch: ${{ steps.get-branch.outputs.branch }}
40+
steps:
41+
- name: Fetch branch name for PR
42+
id: get-branch
43+
run: |
44+
pr_number=${{ github.event.inputs.pr_number }}
45+
repo=${{ github.repository }}
46+
if [ "$pr_number" -eq "0" ]; then
47+
branch=${{ github.event.inputs.ref }}
48+
else
49+
branch=$(gh pr view $pr_number --repo $repo --json headRefName --jq '.headRefName')
50+
fi
51+
echo "::set-output name=branch::$branch"
52+
2153
checkout:
22-
runs-on: [self-hosted, aws, parallelworks, centos]
54+
needs: fetch-branch
55+
runs-on:
56+
- self-hosted
57+
- aws
58+
- parallelworks
59+
- ${{ github.event.inputs.os }}
2360
timeout-minutes: 600
24-
2561
steps:
26-
2762
- name: Checkout global-workflow
2863
uses: actions/checkout@v4
2964
with:
3065
path: ${{ github.run_id }}/HOMEgfs
3166
submodules: 'recursive'
32-
ref: ${{ github.event.pull_request.head.ref }}
67+
ref: ${{ needs.fetch-branch.outputs.branch }}
3368

3469
build-link:
35-
runs-on: [self-hosted, aws, parallelworks, centos]
3670
needs: checkout
37-
71+
runs-on:
72+
- self-hosted
73+
- aws
74+
- parallelworks
75+
- ${{ github.event.inputs.os }}
3876
steps:
39-
4077
- name: Build components
4178
run: |
4279
cd ${{ env.TEST_DIR }}/HOMEgfs/sorc
@@ -48,12 +85,15 @@ jobs:
4885
./link_workflow.sh
4986
5087
create-experiments:
51-
needs: checkout
52-
runs-on: [self-hosted, aws, parallelworks, centos]
88+
needs: build-link
89+
runs-on:
90+
- self-hosted
91+
- aws
92+
- parallelworks
93+
- ${{ github.event.inputs.os }}
5394
strategy:
5495
matrix:
5596
case: ["C48_ATM"]
56-
5797
steps:
5898
- name: Create Experiments ${{ matrix.case }}
5999
env:
@@ -68,9 +108,12 @@ jobs:
68108
69109
run-experiments:
70110
needs: create-experiments
71-
runs-on: [self-hosted, aws, parallelworks, centos]
111+
runs-on:
112+
- self-hosted
113+
- aws
114+
- parallelworks
115+
- ${{ github.event.inputs.os }}
72116
strategy:
73-
max-parallel: 2
74117
matrix:
75118
case: ["C48_ATM"]
76119
steps:
@@ -81,9 +124,13 @@ jobs:
81124
82125
clean-up:
83126
needs: run-experiments
84-
runs-on: [self-hosted, aws, parallelworks, centos]
127+
runs-on:
128+
- self-hosted
129+
- aws
130+
- parallelworks
131+
- ${{ github.event.inputs.os }}
85132
steps:
86-
- name: Clean-up
133+
- name: Clean up workspace
87134
run: |
88-
cd ${{ github.workspace }}
89-
rm -rf ${{ github.run_id }}
135+
echo "Cleaning up workspace"
136+
rm -rf ${{ env.TEST_DIR }}

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,6 @@ ush/bufr2ioda_insitu*
171171
versions/build.ver
172172
versions/run.ver
173173

174-
# wxflow checkout and symlinks
175-
ush/python/wxflow
176-
workflow/wxflow
177-
ci/scripts/wxflow
178-
179174
# jcb checkout and symlinks
180175
ush/python/jcb
181176
workflow/jcb

ci/Jenkinsfile

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def cases = ''
55
def GH = 'none'
66
// Location of the custom workspaces for each machine in the CI system. They are persitent for each iteration of the PR.
77
def NodeName = [hera: 'Hera-EMC', orion: 'Orion-EMC', hercules: 'Hercules-EMC', gaea: 'Gaea']
8-
def custom_workspace = [hera: '/scratch1/NCEPDEV/global/CI', orion: '/work2/noaa/stmp/CI/ORION', hercules: '/work2/noaa/stmp/CI/HERCULES', gaea: '/gpfs/f5/epic/proj-shared/global/CI']
8+
def custom_workspace = [hera: '/scratch1/NCEPDEV/global/CI', orion: '/work2/noaa/stmp/CI/ORION', hercules: '/work2/noaa/global/CI/HERCULES', gaea: '/gpfs/f5/epic/proj-shared/global/CI']
99
def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git'
1010
def STATUS = 'Passed'
1111

@@ -101,9 +101,10 @@ pipeline {
101101
stages {
102102
stage('Building') {
103103
steps {
104-
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
104+
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
105105
script {
106106
def HOMEgfs = "${CUSTOM_WORKSPACE}/${system}" // local HOMEgfs is used to build the system on per system basis under the custome workspace for each buile system
107+
env.HOME_GFS = HOMEgfs // setting path in HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc
107108
sh(script: "mkdir -p ${HOMEgfs}")
108109
ws(HOMEgfs) {
109110
if (fileExists("${HOMEgfs}/sorc/BUILT_semaphor")) { // if the system is already built, skip the build in the case of re-runs
@@ -172,9 +173,10 @@ pipeline {
172173
}
173174
if (system == 'gfs') {
174175
cases = sh(script: "${HOMEgfs}/ci/scripts/utils/get_host_case_list.py ${machine}", returnStdout: true).trim().split()
176+
echo "Cases to run: ${cases}"
175177
}
176178
}
177-
}
179+
}
178180
}
179181
}
180182
}
@@ -192,32 +194,34 @@ pipeline {
192194
def parallelStages = cases.collectEntries { caseName ->
193195
["${caseName}": {
194196
stage("Create ${caseName}") {
195-
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
196-
script {
197-
sh(script: "sed -n '/{.*}/!p' ${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml > ${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp")
198-
def yaml_case = readYaml file: "${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp"
199-
system = yaml_case.experiment.system
200-
def HOMEgfs = "${CUSTOM_WORKSPACE}/${system}" // local HOMEgfs is used to populate the XML on per system basis
201-
env.RUNTESTS = "${CUSTOM_WORKSPACE}/RUNTESTS"
202-
try {
203-
error_output = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${caseName}.yaml", returnStdout: true).trim()
204-
} catch (Exception error_create) {
205-
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${Case} **FAILED** to create experment on ${Machine} in BUILD# ${env.BUILD_NUMBER}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """)
206-
error("Case ${caseName} failed to create experment directory")
207-
}
197+
script {
198+
sh(script: "sed -n '/{.*}/!p' ${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml > ${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp")
199+
def yaml_case = readYaml file: "${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp"
200+
def build_system = yaml_case.experiment.system
201+
def HOMEgfs = "${CUSTOM_WORKSPACE}/${build_system}" // local HOMEgfs is used to populate the XML on per system basis
202+
env.HOME_GFS = HOMEgfs // setting path in HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc
203+
env.RUNTESTS = "${CUSTOM_WORKSPACE}/RUNTESTS"
204+
try {
205+
error_output = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${caseName}.yaml", returnStdout: true).trim()
206+
} catch (Exception error_create) {
207+
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${Case} **FAILED** to create experment on ${Machine} in BUILD# ${env.BUILD_NUMBER}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """)
208+
error("Case ${caseName} failed to create experment directory")
208209
}
209-
}
210+
}
210211
}
211212

212213
stage("Running ${caseName}") {
213214
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
214215
script {
215216
HOMEgfs = "${CUSTOM_WORKSPACE}/gfs" // common HOMEgfs is used to launch the scripts that run the experiments
217+
env.HOME_GFS = HOMEgfs // setting path in HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc
216218
def pslot = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh get_pslot ${CUSTOM_WORKSPACE}/RUNTESTS ${caseName}", returnStdout: true).trim()
217219
def error_file = "${CUSTOM_WORKSPACE}/RUNTESTS/${pslot}_error.logs"
218220
sh(script: " rm -f ${error_file}")
221+
def yaml_case = readYaml file: "${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp"
222+
def build_system = yaml_case.experiment.system
219223
try {
220-
sh(script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} ${system}")
224+
sh(script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} ${build_system}")
221225
} catch (Exception error_experment) {
222226
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_batch_jobs ${pslot}")
223227
ws(CUSTOM_WORKSPACE) {
@@ -268,11 +272,11 @@ pipeline {
268272
}
269273
}
270274

271-
272275
stage( '5. FINALIZE' ) {
273276
agent { label NodeName[machine].toLowerCase() }
274277
steps {
275278
script {
279+
env.HOME_GFS = "${CUSTOM_WORKSPACE}/gfs" // setting path to HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc
276280
sh(script: """
277281
labels=\$(${GH} pr view ${env.CHANGE_ID} --repo ${repo_url} --json labels --jq '.labels[].name')
278282
for label in \$labels; do

ci/cases/pr/C48mx500_hybAOWCDA.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
experiment:
2+
system: gfs
3+
mode: cycled
4+
5+
arguments:
6+
pslot: {{ 'pslot' | getenv }}
7+
app: S2S
8+
resdetatmos: 48
9+
resdetocean: 5.0
10+
resensatmos: 48
11+
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
12+
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
13+
icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C48mx500/20240610
14+
idate: 2021032412
15+
edate: 2021032418
16+
nens: 3
17+
interval: 0
18+
start: warm
19+
yaml: {{ HOMEgfs }}/ci/cases/yamls/soca_gfs_defaults_ci.yaml
20+
21+
skip_ci_on_hosts:
22+
- wcoss2
23+
- orion
24+
- hercules
25+
- hera
26+
- gaea

ci/cases/pr/C96C48_hybatmaerosnowDA.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ arguments:
1818
yaml: {{ HOMEgfs }}/ci/cases/yamls/atmaerosnowDA_defaults_ci.yaml
1919

2020
skip_ci_on_hosts:
21+
- wcoss2
2122
- orion
2223
- gaea
2324
- hercules

ci/scripts/utils/launch_java_agent.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export GH="${HOME}/bin/gh"
106106
[[ -f "${GH}" ]] || echo "gh is not installed in ${HOME}/bin"
107107
${GH} --version
108108

109-
check_mark=$(gh auth status -t 2>&1 | grep "Token:" | awk '{print $1}') || true
109+
check_mark=$("${GH}" auth status -t 2>&1 | grep "Token:" | awk '{print $1}') || true
110110
if [[ "${check_mark}" != "" ]]; then
111111
echo "gh not authenticating with emcbot token"
112112
exit 1

ci/scripts/wxflow

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../sorc/wxflow/src/wxflow

docs/source/clone.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Quick Instructions
99
Quick clone/build/link instructions (more detailed instructions below).
1010

1111
.. note::
12-
Here we are making the assumption that you are using the workflow to run an experiment and so are working from the authoritative repository. If you are using a development branch then follow the instructions in :doc:`development.rst`. Once you do that you can follow the instructions here with the only difference being the repository/fork you are cloning from.
12+
Here we are making the assumption that you are using the workflow to run an experiment and so are working from the authoritative repository. If you are using a development branch then follow the instructions in :doc:`development`. Once you do that you can follow the instructions here with the only difference being the repository/fork you are cloning from.
1313

1414
Clone the `global-workflow` and `cd` into the `sorc` directory:
1515

docs/source/development.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Code managers
1212

1313
* Kate Friedman - @KateFriedman-NOAA / kate.friedman@noaa.gov
1414
* Walter Kolczynski - @WalterKolczynski-NOAA / walter.kolczynski@noaa.gov
15+
* David Huber - @DavidHuber-NOAA / david.huber@noaa.gov
1516

1617
.. _development:
1718

@@ -70,7 +71,29 @@ The following steps should be followed in order to make changes to the develop b
7071
Development Tools
7172
=================
7273

73-
See the ``/test`` folder in global-workflow for available development and testing tools.
74+
Two sets of testing are available for use by developers. The first is the capability to run continuous integration tests locally and the second are a set of comparison tools.
75+
76+
---------------------------
77+
Continuous Integration (CI)
78+
---------------------------
79+
80+
The global workflow comes fitted with a suite of system tests that run various types of workflow. These tests are commonly run for pull requests before they may be merged into the develop branch. At a minimum, developers are expected to run the CI test(s) that will be impacted by their changes on at least one platform.
81+
82+
The commonly run tests are written in YAML format and can be found in the ``ci/cases/pr`` directory. The ``workflow/generate_workflows.sh`` tool is available to aid running these cases. See the help documentation by running ``./generate_workflows.sh -h``. The script has the capability to prepare the EXPDIR and COMROOT directories for a specified or implied suite of CI tests (see :doc:`setup` for details on these directories). The script also has options to automatically build and run all tests for a given system (i.e. GFS or GEFS and a placeholder for SFS). For instance, to build the workflow and run all of the GFS tests, one would execute
83+
84+
::
85+
86+
cd workflow
87+
./generate_workflows.sh -A "your_hpc_account" -b -G -c /path/to/root/directory
88+
89+
where:
90+
91+
* ``-A`` is used to specify the HPC (slurm or PBS) account to use
92+
* ``-b`` indicates that the workflow should be built fresh
93+
* ``-G`` specifies that all of the GFS cases should be run (this also influences the build flags to use)
94+
* ``-c`` tells the tool to append the rocotorun commands for each experiment to your crontab
95+
96+
More details on how to use the tool are provided by running ``generate_workflows.sh -h``.
7497

7598
----------------
7699
Comparison Tools

docs/source/hpc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Optimizing the global workflow on S4
9090

9191
The S4 cluster is relatively small and so optimizations are recommended to improve cycled runtimes. Please contact Innocent Souopgui (innocent.souopgui@noaa.gov) if you are planning on running a cycled experiment on this system to obtain optimized configuration files.
9292

93-
========================================
93+
==================================================
9494
Stacksize on R&Ds (Hera, Orion, Hercules, Jet, S4)
95-
========================================
95+
==================================================
9696

9797
Some GFS components, like the UPP, need an unlimited stacksize. Add the following setting into your appropriate .*rc file to support these components:
9898

docs/source/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Operations/production output location on HPSS: /NCEPPROD/hpssprod/runhistory/rh
301301
| | | | |
302302
| | gfs.t. ``hh`` z.sfcanl.nc | | |
303303
+----------------+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+
304-
| v16.2[3]+ ops | gfs.t. ``hh`` z.atmanl.nc | com_gfs_ ``gfs_ver`` _gfs. ``yyyymmdd`` _ ``hh`` .gfs_nca.tar | gfs. ``yyyymmdd`` /``hh``/atmos|
304+
| v16.2[3]+ ops | gfs.t. ``hh`` z.atmanl.nc | com_gfs\_ ``gfs_ver`` _gfs. ``yyyymmdd`` _ ``hh`` .gfs_nca.tar | gfs. ``yyyymmdd`` /``hh``/atmos|
305305
| | | | |
306306
| | gfs.t. ``hh`` z.sfcanl.nc | | |
307307
+----------------+---------------------------------+-----------------------------------------------------------------------------+--------------------------------+

docs/source/setup.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _experiment-setup:
2+
13
================
24
Experiment Setup
35
================
@@ -179,8 +181,6 @@ where:
179181
* ``$EXPDIR`` is the path to your experiment directory where your configs will be placed and where you will find your workflow monitoring files (i.e. rocoto database and xml file). DO NOT include PSLOT folder at end of path, it will be built for you. [default: $HOME]
180182
* ``$ICSDIR`` is the path to the ICs for your run if generated separately. [default: None]
181183

182-
.. [#] More Coupled configurations in cycled mode are currently under development and not yet available
183-
184184
Example:
185185

186186
::

0 commit comments

Comments
 (0)