Skip to content
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

Jenkins Declartive Pipeline for CI with gfs/gefs multibuilds #2246

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
472 commits
Select commit Hold shift + click to select a range
b62fac7
oops had a misspelling of gfsHOME
TerryMcGuinness-NOAA Jan 17, 2024
129c135
put the actual build back in
TerryMcGuinness-NOAA Jan 17, 2024
77d20dd
commented out sm and build
TerrenceMcGuinness-NOAA Jan 17, 2024
c9c3722
put back in scm and checkout to prime script locations on restart
TerrenceMcGuinness-NOAA Jan 17, 2024
cc57449
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Jan 17, 2024
64a37db
made two shared values between stages global in attempts to make pipe…
TerryMcGuinness-NOAA Jan 17, 2024
2e69d59
Merge branch 'jenkins-pipeline' of github.com:TerrenceMcGuinness-NOAA…
TerryMcGuinness-NOAA Jan 17, 2024
a7ac197
Update ci_utils.sh
TerrenceMcGuinness-NOAA Jan 18, 2024
154dd05
working on state added BUILD semaphore file in sorc dir
TerryMcGuinness-NOAA Jan 18, 2024
8262741
reversed logic for BUILT file semaphore
TerryMcGuinness-NOAA Jan 18, 2024
5a0c52a
added chmod x to sub scripts
TerryMcGuinness-NOAA Jan 18, 2024
bf8896b
needed to set HOMEgfs in run stub
TerryMcGuinness-NOAA Jan 18, 2024
7e60d23
needed to set HOMEgfs in run stub and looking at pullRequest.labels.c…
TerryMcGuinness-NOAA Jan 18, 2024
12e3126
typoed pslot in run check stub script
TerryMcGuinness-NOAA Jan 18, 2024
8f8e892
hard coded node name
TerryMcGuinness-NOAA Jan 18, 2024
94f8417
hard coded node names typo capped
TerryMcGuinness-NOAA Jan 18, 2024
0489383
returnStdout on cat BUIT semaphore didnt save
TerryMcGuinness-NOAA Jan 19, 2024
68d245b
added node properties
TerryMcGuinness-NOAA Jan 19, 2024
0834c3f
restored configurable node
TerryMcGuinness-NOAA Jan 19, 2024
d76e1f1
moved parameters into options block
TerryMcGuinness-NOAA Jan 19, 2024
5471c46
added just parameters section
TerryMcGuinness-NOAA Jan 19, 2024
8d7d4b2
moved parameters into options
TerryMcGuinness-NOAA Jan 19, 2024
abb7470
parameters can not be in options
TerryMcGuinness-NOAA Jan 19, 2024
c46fdd6
removed class in parameters
TerryMcGuinness-NOAA Jan 19, 2024
52bd973
added class in bracketrs
TerryMcGuinness-NOAA Jan 19, 2024
6d0eb3a
removed double bracket
TerryMcGuinness-NOAA Jan 19, 2024
b6f7212
not sure how to hadd class
TerryMcGuinness-NOAA Jan 19, 2024
a94f2ce
still can not get syntax for parameters
TerryMcGuinness-NOAA Jan 19, 2024
9ccf7bc
still not finding class
TerryMcGuinness-NOAA Jan 19, 2024
f4edcce
just removed class line
TerryMcGuinness-NOAA Jan 19, 2024
bd4d49c
moved properties into stage
TerryMcGuinness-NOAA Jan 19, 2024
45a8a4d
moved properties into script in Run Seection
TerryMcGuinness-NOAA Jan 19, 2024
5d29ceb
had machine instead of MACIHNE in node name
TerryMcGuinness-NOAA Jan 19, 2024
734d4fc
added properties for epic nodes
TerryMcGuinness-NOAA Jan 19, 2024
39529e5
needed to remove RUNTESTS dir on rebuild
TerryMcGuinness-NOAA Jan 19, 2024
9d5ab04
added exit 1 to run stub
TerryMcGuinness-NOAA Jan 19, 2024
4da660f
removed returnstatus flag on run stub
TerryMcGuinness-NOAA Jan 19, 2024
9206156
Updated properties to my controler
TerryMcGuinness-NOAA Jan 19, 2024
8715f57
Can not get parameteres to sork again
TerryMcGuinness-NOAA Jan 19, 2024
859d7cb
added defaut slave as running one
TerryMcGuinness-NOAA Jan 19, 2024
450bcab
added prop in create
TerryMcGuinness-NOAA Jan 19, 2024
fbbe569
added prop in create still brokek
TerryMcGuinness-NOAA Jan 19, 2024
a2226e2
still broken
TerryMcGuinness-NOAA Jan 19, 2024
48a34d0
moved prop under get machine script
TerryMcGuinness-NOAA Jan 19, 2024
2b7e941
made machine global
TerryMcGuinness-NOAA Jan 19, 2024
38ad4b4
Label issue
TerryMcGuinness-NOAA Jan 19, 2024
9e5dacf
removed Configuiration class
TerryMcGuinness-NOAA Jan 19, 2024
2ef5a62
added stub logic
TerryMcGuinness-NOAA Jan 19, 2024
a2cef59
remove exit 0 on create exper wrapper because once worked
TerryMcGuinness-NOAA Jan 19, 2024
8879946
two orion fake local adds
TerryMcGuinness-NOAA Jan 19, 2024
bf18bc8
added my spak python 3
TerryMcGuinness-NOAA Jan 20, 2024
26a3512
got =~ backwards
TerryMcGuinness-NOAA Jan 20, 2024
77af83d
explitly remove existing experment before re-running create
TerryMcGuinness-NOAA Jan 20, 2024
b6ffee9
hard coded HOMEgfs for testing
TerryMcGuinness-NOAA Jan 20, 2024
7c7fbbe
testing on node hera not orion
TerryMcGuinness-NOAA Jan 20, 2024
0638b6d
dump remove label constraint for now
TerryMcGuinness-NOAA Jan 20, 2024
6fc3581
RUNTESTS was wrong and yes works
TerryMcGuinness-NOAA Jan 20, 2024
35943ad
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Jan 22, 2024
4e807cc
removed hardcoded machine label on nodes
TerryMcGuinness-NOAA Jan 22, 2024
b66b9bc
restore away from local build cludges
TerryMcGuinness-NOAA Jan 22, 2024
29d790c
some linting
TerryMcGuinness-NOAA Jan 22, 2024
1b47f78
some eols
TerryMcGuinness-NOAA Jan 22, 2024
a30a555
wrong MACHINE in node label
TerryMcGuinness-NOAA Jan 22, 2024
ad1c71f
removed y pipe and added rm case in pipeline
TerryMcGuinness-NOAA Jan 22, 2024
65cc185
removed DefaultSlave in parameters
TerryMcGuinness-NOAA Jan 22, 2024
30dea74
added rm COMROOT line in pipeline
TerryMcGuinness-NOAA Jan 22, 2024
8657be5
try var in param
TerryMcGuinness-NOAA Jan 22, 2024
995b437
trying to add more choices
TerryMcGuinness-NOAA Jan 22, 2024
c2a9c86
add back real build run
TerryMcGuinness-NOAA Jan 22, 2024
49a7f71
revert
TerryMcGuinness-NOAA Jan 22, 2024
bfb1ef4
ready to start testing stub pipeline with system build
TerryMcGuinness-NOAA Jan 22, 2024
a2e8f07
wrap a stages around build matrix stage
TerryMcGuinness-NOAA Jan 22, 2024
d1e2359
wrap matrix around build stage
TerryMcGuinness-NOAA Jan 22, 2024
54baf54
needed axis not two axes
TerryMcGuinness-NOAA Jan 22, 2024
04288ce
put matrix wrap in buid stage
TerryMcGuinness-NOAA Jan 22, 2024
b8b8070
still trying to get matrix hierachey to work
TerryMcGuinness-NOAA Jan 22, 2024
dcf7a87
system literal literal
TerryMcGuinness-NOAA Jan 22, 2024
686be11
ws needed body
TerryMcGuinness-NOAA Jan 22, 2024
81380a8
remove workspaces
TerryMcGuinness-NOAA Jan 22, 2024
e0a420f
WORKSPACE git just outside of build matrix in node
TerryMcGuinness-NOAA Jan 22, 2024
d9303a2
Added TESTDIR
TerryMcGuinness-NOAA Jan 22, 2024
9b28ba3
deleted old script line
TerryMcGuinness-NOAA Jan 22, 2024
a6e0839
dir step needed bodey
TerryMcGuinness-NOAA Jan 22, 2024
6687bd5
created dedicated stage for getting global workspace for the PR
TerryMcGuinness-NOAA Jan 22, 2024
118d43d
made HOMEgfs local in matrix and removed from global
TerryMcGuinness-NOAA Jan 23, 2024
e601257
global HOME TESTDIR
TerryMcGuinness-NOAA Jan 23, 2024
c422f61
added local HOMEgfs and global HOME in Run Experiments
TerryMcGuinness-NOAA Jan 23, 2024
86f2c90
updated TESTDIR to global HOME
TerryMcGuinness-NOAA Jan 23, 2024
45601f5
remved stubs to run on Orion
TerryMcGuinness-NOAA Jan 23, 2024
3146a39
need updated buid all args for gefs
TerryMcGuinness-NOAA Jan 23, 2024
343020c
use old build all args for both systems
TerryMcGuinness-NOAA Jan 23, 2024
508e354
removed stubs add all nodes with restart selector and put back label rm
TerryMcGuinness-NOAA Jan 23, 2024
2b684c2
remove Running label without check
TerryMcGuinness-NOAA Jan 23, 2024
d80907a
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Jan 23, 2024
6775d49
add dir into sorc
TerryMcGuinness-NOAA Jan 23, 2024
7856081
moved mkdir on RUNTESTS into top stage in Create Experments
TerryMcGuinness-NOAA Jan 23, 2024
75bccbd
added entire stage to mkdir TESTDIR and update labels
TerryMcGuinness-NOAA Jan 23, 2024
b2b5243
added full path for dir() into sorc
TerryMcGuinness-NOAA Jan 23, 2024
5965d86
reduced save to three
TerryMcGuinness-NOAA Jan 23, 2024
e22dffa
can not figure out why dir() is not working
TerryMcGuinness-NOAA Jan 23, 2024
b394c3a
added a few more degubs and . for pwd path
TerryMcGuinness-NOAA Jan 23, 2024
9b02f36
added an explicit cd into the gfs/sorc dir to run build_all
TerryMcGuinness-NOAA Jan 25, 2024
c7053d1
fixed quote on echo PWD on script sh command line
TerryMcGuinness-NOAA Jan 25, 2024
457b3d7
added explicit git command for updating submoules recursivly, scm was…
TerryMcGuinness-NOAA Jan 25, 2024
e9fbf93
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Jan 26, 2024
6acc918
added max jobs on build all to 4
TerryMcGuinness-NOAA Jan 26, 2024
258e9c7
updated pipline with node on setup RUNDIR and removed system in run e…
TerryMcGuinness-NOAA Jan 26, 2024
960e0fe
updated path of HOMEgfs in run check scripts using gfs as default
TerryMcGuinness-NOAA Jan 26, 2024
0d09e5c
use HOME to point to RUNDIRS for run-check
TerryMcGuinness-NOAA Jan 26, 2024
4eb89e2
add label updates back move archive to post
TerryMcGuinness-NOAA Jan 27, 2024
2e159cd
added throttle to build
TerryMcGuinness-NOAA Jan 29, 2024
e1f054f
remove prop from throttle
TerryMcGuinness-NOAA Jan 29, 2024
03b551f
moveed throttle inside options block of stage build
TerryMcGuinness-NOAA Jan 29, 2024
2329c4a
updated fixed label check code
TerryMcGuinness-NOAA Jan 29, 2024
fc7a3a6
ndded script block in post always
TerryMcGuinness-NOAA Jan 29, 2024
5c4d4a6
added confgired catigory to throttle
TerryMcGuinness-NOAA Jan 29, 2024
c0b386f
took out throttle option and added limit j to 2 on both concurrent bu…
TerryMcGuinness-NOAA Jan 29, 2024
e896a1c
made remove all labels with machine in post alwasy a conventional loop
TerryMcGuinness-NOAA Jan 29, 2024
ec432da
Update Jenkinsfile
TerrenceMcGuinness-NOAA Jan 29, 2024
e9a8e2c
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Jan 30, 2024
1890259
added to matrix builds to make it sequential and added yaml reads
TerryMcGuinness-NOAA Jan 30, 2024
f3be7f3
had extra values line in first matrix build
TerryMcGuinness-NOAA Jan 30, 2024
8a26393
had an extra pasted GFS build
TerryMcGuinness-NOAA Jan 30, 2024
cbf32bc
added build yaml file in cases yamls
TerryMcGuinness-NOAA Jan 30, 2024
bed6fa8
variable key had to be imutable
TerryMcGuinness-NOAA Jan 30, 2024
e4426fc
testing imuable key
TerryMcGuinness-NOAA Jan 30, 2024
d8bbea9
testing yaml output
TerryMcGuinness-NOAA Jan 30, 2024
4a03f87
traverse build args
TerryMcGuinness-NOAA Jan 30, 2024
51ab85f
missed } on iter
TerryMcGuinness-NOAA Jan 30, 2024
f2a018a
use get in yaml
TerryMcGuinness-NOAA Jan 30, 2024
59f7aee
try it key
TerryMcGuinness-NOAA Jan 30, 2024
2910b53
just system
TerryMcGuinness-NOAA Jan 30, 2024
cbc9e22
to string
TerryMcGuinness-NOAA Jan 30, 2024
b373865
to string
TerryMcGuinness-NOAA Jan 30, 2024
a0fd397
still trying
TerryMcGuinness-NOAA Jan 30, 2024
09d6eb8
still foo
TerryMcGuinness-NOAA Jan 30, 2024
01e09ba
finally
TerryMcGuinness-NOAA Jan 30, 2024
bb7ff25
finally then trim
TerryMcGuinness-NOAA Jan 30, 2024
0156747
finally then trim and nulls
TerryMcGuinness-NOAA Jan 30, 2024
e9a6b70
got args to work
TerryMcGuinness-NOAA Jan 30, 2024
c4dcbe6
put clone back in
TerryMcGuinness-NOAA Jan 31, 2024
ec6ba94
added back throttled build and removed second build block
TerryMcGuinness-NOAA Jan 31, 2024
85522b7
removed extra leftover values line in build matrix
TerryMcGuinness-NOAA Jan 31, 2024
1c77e99
removed non yaml lines from cases so snakeyaml could read it
TerryMcGuinness-NOAA Jan 31, 2024
773164a
added override in create experment and removed stubed scripts
TerryMcGuinness-NOAA Jan 31, 2024
9747d7a
moved scm after semephore test
TerryMcGuinness-NOAA Jan 31, 2024
6d439b6
Update Jenkinsfile
TerrenceMcGuinness-NOAA Jan 31, 2024
a7ff014
Update Jenkinsfile
TerrenceMcGuinness-NOAA Jan 31, 2024
c2e0f82
Update Jenkinsfile
TerrenceMcGuinness-NOAA Feb 1, 2024
da9f7cd
added pre checkout in TESTDIR added source of gwsetup and changed fir…
TerryMcGuinness-NOAA Feb 1, 2024
3662f07
added git to hera gw setup module load
TerryMcGuinness-NOAA Feb 1, 2024
5c2eb59
made shallow checkout a function call
TerryMcGuinness-NOAA Feb 1, 2024
be7b72e
misplaced bracket in source of gw_setup
TerryMcGuinness-NOAA Feb 1, 2024
aeaa5cf
cd into TESTDIR for shallow clone
TerryMcGuinness-NOAA Feb 1, 2024
8fa7868
moved git load on gwset hera because it is in the stack spac
TerryMcGuinness-NOAA Feb 1, 2024
76f13ed
use shallow checkout and git submoudle recussive update directly
TerryMcGuinness-NOAA Feb 1, 2024
2685a85
configured scm shallow and using git modules recursive from host
TerryMcGuinness-NOAA Feb 1, 2024
0944fd4
still had shallow call and removed it
TerryMcGuinness-NOAA Feb 1, 2024
a1ba03b
put dir back at attempt to use ws
TerryMcGuinness-NOAA Feb 1, 2024
de514d9
take out pre checkout and just use submodule update directly
TerryMcGuinness-NOAA Feb 1, 2024
e866d28
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Feb 2, 2024
a80666e
stub build all to just gdas
TerryMcGuinness-NOAA Feb 2, 2024
2e43230
added git which and version for debugging
TerryMcGuinness-NOAA Feb 2, 2024
5071db1
put buile lines back in build yaml
TerryMcGuinness-NOAA Feb 2, 2024
948992c
added a second Jenkins file to test dynamic parallel build stages
TerryMcGuinness-NOAA Feb 2, 2024
e7790ee
removed Jenkinsfile2 to put it into its own repo
TerryMcGuinness-NOAA Feb 2, 2024
29f61f1
adding deleteDir to get scm to checkout again
TerryMcGuinness-NOAA Feb 2, 2024
74ff699
adding build stubs
TerryMcGuinness-NOAA Feb 2, 2024
2978c6c
adding build stubs again
TerryMcGuinness-NOAA Feb 2, 2024
af48ce8
forgot to add build.yaml updates
TerryMcGuinness-NOAA Feb 2, 2024
348c758
put throttle back and updated build args for gefs
TerryMcGuinness-NOAA Feb 2, 2024
a0386ed
use rsync to get clones before submodules
TerryMcGuinness-NOAA Feb 3, 2024
417688c
update rsync line
TerryMcGuinness-NOAA Feb 3, 2024
44b13e3
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Feb 3, 2024
240a262
revert to scm and comment out disable current builds
TerryMcGuinness-NOAA Feb 3, 2024
a185aa4
Merge branch 'jenkins-pipeline' of github.com:TerrenceMcGuinness-NOAA…
TerryMcGuinness-NOAA Feb 3, 2024
3799584
Update Jenkinsfile
TerrenceMcGuinness-NOAA Feb 4, 2024
afc6342
added checkoutsubdir
TerryMcGuinness-NOAA Feb 4, 2024
8e7e5b3
added checkoutsubdir
TerryMcGuinness-NOAA Feb 4, 2024
511ee95
extra bracket
TerryMcGuinness-NOAA Feb 4, 2024
3b3ebc0
moved options
TerryMcGuinness-NOAA Feb 4, 2024
600cd19
add no scm in exp
TerryMcGuinness-NOAA Feb 4, 2024
297a842
devult no scm others
TerryMcGuinness-NOAA Feb 5, 2024
a4174f5
put throuttle back in
TerryMcGuinness-NOAA Feb 5, 2024
74dbb16
try chaning workspace to get scm to checkout on second parallel matri…
TerryMcGuinness-NOAA Feb 5, 2024
881697f
added stubs for build all to test the Jenkins scm issue
TerryMcGuinness-NOAA Feb 5, 2024
b6f0129
removed throttle option for testing scm
TerryMcGuinness-NOAA Feb 5, 2024
213f6e4
Update ci/scripts/utils/ci_utils.sh
TerrenceMcGuinness-NOAA Feb 5, 2024
2d7e17b
Update ci/scripts/utils/ci_utils.sh
TerrenceMcGuinness-NOAA Feb 5, 2024
86722b0
Update ci/scripts/utils/ci_utils.sh
TerrenceMcGuinness-NOAA Feb 5, 2024
ef1112f
Update ci/scripts/utils/ci_utils.sh
TerrenceMcGuinness-NOAA Feb 5, 2024
0448492
Update modulefiles/module_gwsetup.hera.lua
TerrenceMcGuinness-NOAA Feb 5, 2024
62fe054
took out throuttle and put checkout subdir back
TerryMcGuinness-NOAA Feb 5, 2024
d305dda
Merge branch 'jenkins-pipeline' of github.com:TerrenceMcGuinness-NOAA…
TerryMcGuinness-NOAA Feb 5, 2024
45b87fa
update build args for faster buld tests
TerryMcGuinness-NOAA Feb 5, 2024
e7ecc8f
took stub to create tests and put the action back
TerryMcGuinness-NOAA Feb 5, 2024
d2a7b51
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Feb 5, 2024
a238eda
put throttle back and took out -j 2
TerryMcGuinness-NOAA Feb 5, 2024
fc3d5e8
Merge branch 'jenkins-pipeline' of github.com:TerrenceMcGuinness-NOAA…
TerryMcGuinness-NOAA Feb 5, 2024
7099e77
put concurrancy back in for the matrixed build stage because the scm …
TerryMcGuinness-NOAA Feb 5, 2024
25893ae
moved mkdir out of Setup RUNTESTS because it the agent options was no…
TerryMcGuinness-NOAA Feb 5, 2024
5ce3116
added explcit workspaces in create and using gfs as default for running
TerryMcGuinness-NOAA Feb 5, 2024
245a5fb
added explcit workspaces in create and using gfs as default for running
TerryMcGuinness-NOAA Feb 5, 2024
0bd51ed
took out case and put in if else in cancel_batch_jobs (for now)
TerryMcGuinness-NOAA Feb 5, 2024
cc6af42
missed bracket at end of cancel_batch_jobs in ci utils
TerryMcGuinness-NOAA Feb 5, 2024
5c5e860
add true to return status on run-check because it through that peski …
TerryMcGuinness-NOAA Feb 5, 2024
743e842
update all Jenkins script calls to returnStatus true and put full tes…
TerryMcGuinness-NOAA Feb 5, 2024
01298bb
adding with credentials
TerryMcGuinness-NOAA Feb 5, 2024
0a32c5b
stub create
TerryMcGuinness-NOAA Feb 5, 2024
5bf9d34
add short list for exper
TerryMcGuinness-NOAA Feb 5, 2024
b74d982
added withCredntials in all three post sections
TerryMcGuinness-NOAA Feb 5, 2024
04b3ed8
took out create experments stub
TerryMcGuinness-NOAA Feb 5, 2024
0f96056
put back in full test list for overnight run
TerryMcGuinness-NOAA Feb 5, 2024
9f67ef0
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Feb 5, 2024
271a453
Update Jenkinsfile
TerrenceMcGuinness-NOAA Feb 6, 2024
9bd850b
add agent to post block
Feb 6, 2024
343c8df
move post into Run Tests block
Feb 6, 2024
a57e4af
stubbed out create expermentens again
Feb 6, 2024
967bb6d
took out sub for create and made case short list
Feb 6, 2024
0ec0b6f
removed setup block
Feb 6, 2024
5914683
just do one test
Feb 6, 2024
9b83735
added back buildDiscarder
Feb 6, 2024
970e73b
commented out remove label in build
Feb 7, 2024
23fad4c
removed redundent checkout in subdir and commentout gitHub access aft…
Feb 7, 2024
4b8bec7
added ws with github creditials
Feb 7, 2024
db37fe0
misspelled WORKSPACE
Feb 7, 2024
682186d
missed a MACIHNE left in
Feb 7, 2024
8aa8b02
took timer out of Get Common
Feb 7, 2024
ed0562b
updated machine names to Machine in labels missed
Feb 7, 2024
d94a873
added commonworkspace in build update labels
Feb 7, 2024
5c04148
updated workspace in post to be the same in the matrix that ran the s…
Feb 7, 2024
8cf8a2a
remove local varible scope on HOMEgfs in Run experments in hopes it w…
Feb 7, 2024
68503b7
Merge branch 'NOAA-EMC:develop' into jenkins-pipeline
TerrenceMcGuinness-NOAA Feb 7, 2024
1964247
updated Machine in a label and in PR comments
Feb 7, 2024
8d66bcb
Merge branch 'jenkins-pipeline' of https://github.com/TerrenceMcGuinn…
Feb 7, 2024
b2c3c31
only replaced commonworkspace with HOMEgfs workspace in build matrix
Feb 7, 2024
12ec362
added info in Running message to use in GitHub PR
Feb 7, 2024
eb9e48f
put missing values line back in experments matrix
Feb 7, 2024
b0dab47
added u to gfs build and put all tests back in
Feb 7, 2024
9bb5c97
added a stubbed version of the Jenkinsfiel for testing
Feb 7, 2024
44947e0
put a try around removelabel in all
Feb 8, 2024
0f0df62
took pslot out for stubbing
Feb 8, 2024
5629890
added back just build to stub
Feb 8, 2024
89954dd
removed build non stub and made stub again
Feb 8, 2024
1ae8f43
added only buils scripts but disabled otherwise scan poll
Feb 8, 2024
3c83d6f
remove nested ws in build
Feb 8, 2024
2338e9a
added comments in Jenkinsfile
Feb 8, 2024
62ef2a4
added some markdown formatting in GitHub messages
Feb 8, 2024
cbc1bbe
updated some markdown formatting in main GitHub PR message
Feb 8, 2024
c8c4838
updated format with one more <br>
TerrenceMcGuinness-NOAA Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 188 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
def Machine = 'none'
def machine = 'none'
def HOME = 'none'
def localworkspace = 'none'
def commonworkspace = 'none'

pipeline {
agent { label 'built-in' }

options {
skipDefaultCheckout()
buildDiscarder(logRotator(numToKeepStr: '2'))
}

stages { // This initial stage is used to get the Machine name from the GitHub labels on the PR
// which is used to designate the Nodes in the Jenkins Controler by the agent label
// Each Jenknis Node is connected to said machine via an JAVA agent via an ssh tunnel

stage('Get Machine') {
agent { label 'built-in' }
steps {
script {
localworkspace = env.WORKSPACE
machine = 'none'
for (label in pullRequest.labels) {
echo "Label: ${label}"
if ((label.matches("CI-Hera-Ready"))) {
machine = 'hera'
} else if ((label.matches("CI-Orion-Ready"))) {
machine = 'orion'
} else if ((label.matches("CI-Hercules-Ready"))) {
machine = 'hercules'
}
} // createing a second machine varible with first letter capital
// because the first letter of the machine name is captitalized in the GitHub labels
Machine = machine[0].toUpperCase() + machine.substring(1)
}
}
}

stage('Get Common Workspace') {
agent { label "${machine}-emc" }
steps {
script {
properties([parameters([[$class: 'NodeParameterDefinition', allowedSlaves: ['built-in','Hera-EMC','Orion-EMC'], defaultSlaves: ['built-in'], name: '', nodeEligibility: [$class: 'AllNodeEligibility'], triggerIfResult: 'allCases']])])
HOME = "${WORKSPACE}/TESTDIR"
commonworkspace = "${WORKSPACE}"
sh( script: "mkdir -p ${HOME}/RUNTESTS", returnStatus: true)
pullRequest.addLabel("CI-${Machine}-Building")
if ( pullRequest.labels.any{ value -> value.matches("CI-${Machine}-Ready") } ) {
pullRequest.removeLabel("CI-${Machine}-Ready")
}
}
}
}

stage('Build System') {
matrix {
agent { label "${machine}-emc" }
//options {
// throttle(['global_matrix_build'])
//}
axes {
axis {
name "system"
values "gfs", "gefs"
}
}
stages {
stage("build system") {
steps {
script {
def HOMEgfs = "${HOME}/${system}" // local HOMEgfs is used to build the system on per system basis under the common workspace HOME
sh( script: "mkdir -p ${HOMEgfs}", returnStatus: true)
ws(HOMEgfs) {
env.MACHINE_ID = machine // MACHINE_ID is used in the build scripts to determine the machine and is added to the shell environment
if (fileExists("${HOMEgfs}/sorc/BUILT_semaphor")) { // if the system is already built, skip the build in the case of re-runs
sh( script: "cat ${HOMEgfs}/sorc/BUILT_semaphor", returnStdout: true).trim() // TODO: and user configurable control to manage build semphore
ws(commonworkspace) { pullRequest.comment("Cloned PR already built (or build skipped) on ${machine} in directory ${HOMEgfs}") }
} else {
checkout scm
sh( script: "source workflow/gw_setup.sh;which git;git --version;git submodule update --init --recursive", returnStatus: true)
def builds_file = readYaml file: "ci/cases/yamls/build.yaml"
def build_args_list = builds_file['builds']
def build_args = build_args_list[system].join(" ").trim().replaceAll("null", "")
dir("${HOMEgfs}/sorc") {
sh( script: "${build_args}", returnStatus: true)
sh( script: "./link_workflow.sh", returnStatus: true)
sh( script: "echo ${HOMEgfs} > BUILT_semaphor", returnStatus: true)
}
}
if ( pullRequest.labels.any{ value -> value.matches("CI-${Machine}-Building") } ) {
pullRequest.removeLabel("CI-${Machine}-Building")
}
pullRequest.addLabel("CI-${Machine}-Running")
}
}
}
}
}
}
}

stage('Run Tests') {
matrix {
agent { label "${machine}-emc" }
axes {
axis {
name "Case"
values "C48_ATM", "C48_S2SWA_gefs", "C48_S2SW", "C96_atm3DVar" // TODO add dynamic list of cases from env vars (needs addtional plugins)
}
}
stages {
stage('Create Experiment') {
steps {
script {
sh( script: "sed -n '/{.*}/!p' ${HOME}/gfs/ci/cases/pr/${Case}.yaml > ${HOME}/gfs/ci/cases/pr/${Case}.yaml.tmp", returnStatus: true)
def yaml_case = readYaml file: "${HOME}/gfs/ci/cases/pr/${Case}.yaml.tmp"
system = yaml_case.experiment.system
def HOMEgfs = "${HOME}/${system}" // local HOMEgfs is used to populate the XML on per system basis
env.RUNTESTS = "${HOME}/RUNTESTS"
sh( script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${Case}.yaml", returnStatus: true)
}
}
}
stage('Run Experiments') {
steps {
script {
HOMEgfs = "${HOME}/gfs" // common HOMEgfs is used to launch the scripts that run the experiments
ws(HOMEgfs) {
pslot = sh( script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh get_pslot ${HOME}/RUNTESTS ${Case}", returnStdout: true ).trim()
pullRequest.comment("**Running experiments: ${Case} on ${Machine}**<br>Built against system **${system}** in directory:<br>`${HOMEgfs}`<br>With the experiment in directory:<br>`${HOME}/RUNTESTS/${pslot}`")
try {
sh( script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${HOME} ${pslot}", returnStatus: true)
} catch (Exception e) {
pullRequest.comment("**FAILURE** running experiments: ${Case} on ${Machine}")
error("Failed to run experiments ${Case} on ${Machine}")
}
pullRequest.comment("**SUCCESS** running experiments: ${Case} on ${Machine}")
}
}
}
post {
always {
script {
ws (HOMEgfs) {
for (label in pullRequest.labels) {
if (label.contains("${Machine}")) {
pullRequest.removeLabel(label)
}
}
}
}
}
success {
script {
ws (HOMEgfs) {
pullRequest.addLabel("CI-${Machine}-Passed")
def timestamp = new Date().format("MM dd HH:mm:ss", TimeZone.getTimeZone('America/New_York'))
pullRequest.comment("**CI SUCCESS** ${Machine} at ${timestamp}\n\nBuilt and ran in directory `${HOME}`")
}
}
}
failure {
script {
ws (HOMEgfs) {
pullRequest.addLabel("CI-${Machine}-Failed")
def timestamp = new Date().format("MM dd HH:mm:ss", TimeZone.getTimeZone('America/New_York'))
pullRequest.comment("**CI FAILED** ${Machine} at ${timestamp}<br>Built and ran in directory `${HOME}`")
if (fileExists('${HOME}/RUNTESTS/ci.log')) {
def fileContent = readFile '${HOME}/RUNTESTS/ci.log'
fileContent.eachLine { line ->
if( line.contains(".log")) {
archiveArtifacts artifacts: "${line}", fingerprint: true
}
}
}
}
}
}
}
}
}
}
}
}

}
3 changes: 3 additions & 0 deletions ci/cases/yamls/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
builds:
- gefs: './build_all.sh'
- gfs: './build_all.sh -gu'
4 changes: 3 additions & 1 deletion ci/scripts/run-check_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ pslot=${2:-${pslot:-?}} # Name of the experiment being tested by this scr
# │   └── ${pslot}
# └── EXPDIR
# └── ${pslot}
HOMEgfs="${TEST_DIR}/HOMEgfs"
# Two system build directories created at build time gfs, and gdas
# TODO: Make this configurable (for now all scripts run from gfs for CI at runtime)
HOMEgfs="${TEST_DIR}/gfs"
RUNTESTS="${TEST_DIR}/RUNTESTS"

# Source modules and setup logging
Expand Down
124 changes: 110 additions & 14 deletions ci/scripts/utils/ci_utils.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,120 @@
#!/bin/env bash

function cancel_slurm_jobs() {
function determine_scheduler() {
if command -v sbatch &> /dev/null; then
echo "slurm";
elif command -v qsub &> /dev/null; then
echo "torque";
else
echo "unknown"
fi
}

# Usage: cancel_slurm_jobs <substring>
# Example: cancel_slurm_jobs "C48_ATM_3c4e7f74"
function cancel_batch_jobs() {
TerrenceMcGuinness-NOAA marked this conversation as resolved.
Show resolved Hide resolved
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
# Usage: cancel_batch_jobs <substring>
# Example: cancel_batch_jobs "C48_ATM_3c4e7f74"
#
# Cancel all Slurm jobs that have the given substring in their name
# Cancel all batch jobs that have the given substring in their name
# So like in the example all jobs with "C48_ATM_3c4e7f74"
# in their name will be canceled

local substring=$1
local job_ids
job_ids=$(squeue -u "${USER}" -h -o "%i")

for job_id in ${job_ids}; do
job_name=$(sacct -j "${job_id}" --format=JobName%100 | head -3 | tail -1 | sed -r 's/\s+//g') || true
if [[ "${job_name}" =~ ${substring} ]]; then
echo "Canceling Slurm Job ${job_name} with: scancel ${job_id}"
scancel "${job_id}"
continue
fi
done

scheduler=$(determine_scheduler)

if [[ "${schduler}" == "torque" ]]; then
job_ids=$(qstat -u "${USER}" | awk '{print $1}') || true

for job_id in ${job_ids}; do
job_name=$(qstat -f "${job_id}" | grep Job_Name | awk '{print $3}') || true
if [[ "${job_name}" =~ ${substring} ]]; then
echo "Canceling PBS Job ${job_name} with: qdel ${job_id}"
qdel "${job_id}"
continue
fi
done

elif [[ "${scheduler}" == "slurm" ]]; then

job_ids=$(squeue -u "${USER}" -h -o "%i")

for job_id in ${job_ids}; do
job_name=$(sacct -j "${job_id}" --format=JobName%100 | head -3 | tail -1 | sed -r 's/\s+//g') || true
if [[ "${job_name}" =~ ${substring} ]]; then
echo "Canceling Slurm Job ${job_name} with: scancel ${job_id}"
scancel "${job_id}"
continue
fi
done

else
echo "FATAL: Unknown/unsupported job scheduler"
exit 1
fi
TerrenceMcGuinness-NOAA marked this conversation as resolved.
Show resolved Hide resolved
}


function get_pr_case_list () {

#############################################################
# loop over every yaml file in the PR's ci/cases
# and create an run directory for each one for this PR loop
#############################################################
for yaml_config in "${HOMEgfs}/ci/cases/pr/"*.yaml; do
case=$(basename "${yaml_config}" .yaml) || true
echo "${case}"
done
}

function get_pslot_list () {

local RUNTESTS="${1}"

#############################################################
# loop over expdir directories in RUNTESTS
# and create list of the directory names (pslot) with the hash tag
#############################################################
for pslot_dir in "${RUNTESTS}/EXPDIR/"*; do
pslot=$(basename "${pslot_dir}") || true
echo "${pslot}"
done

}

function get_pslot () {

local RUNTESTS="${1}"
local case="${2}"

#############################################################
# loop over expdir directories in RUNTESTS
# and return the name of the pslot with its tag that matches the case
#############################################################
for pslot_dir in "${RUNTESTS}/EXPDIR/"*; do
pslot=$(basename "${pslot_dir}")
check_case=$(echo "${pslot}" | rev | cut -d"_" -f2- | rev) || true
if [[ "${check_case}" == "${case}" ]]; then
echo "${pslot}"
break
fi
done

}

function create_experiment () {

local yaml_config="${1}"
cd "${HOMEgfs}" || exit 1
pr_sha=$(git rev-parse --short HEAD)
case=$(basename "${yaml_config}" .yaml) || true
export pslot=${case}_${pr_sha}

source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}"
source "${HOMEgfs}/workflow/gw_setup.sh"

# system=$(grep "system:" "${yaml_config}" | cut -d":" -f2 | tr -d " ") || true

"${HOMEgfs}/${system}/workflow/create_experiment.py" --overwrite --yaml "${yaml_config}"

}
9 changes: 9 additions & 0 deletions ci/scripts/utils/ci_utils_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null 2>&1 && pwd )"
source "${HOMEgfs}/ush/detect_machine.sh"

utitilty_function="${1}"

source "${HOMEgfs}/ci/scripts/utils/ci_utils.sh"
Fixed Show fixed Hide fixed
${utitilty_function} "${@:2}"
2 changes: 2 additions & 0 deletions modulefiles/module_gwsetup.hera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ load(pathJoin("python", python_ver))
load("py-jinja2")
load("py-pyyaml")
load("py-numpy")
local git_ver=os.getenv("git_ver") or "2.40.0"
load(pathJoin("git", git_ver))

whatis("Description: GFS run setup environment")
Loading