From 9e537e85718e98483d838aacfef0904db2d08947 Mon Sep 17 00:00:00 2001 From: "Terry.McGuinness" Date: Thu, 11 Jul 2024 17:52:19 +0000 Subject: [PATCH 01/15] no op for CI self-test --- ci/scripts/driver.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index 0f53ebff6f..70244506a8 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -12,6 +12,7 @@ set -eux # development branch for the global-workflow repo. It then stages tests directories per # PR number and calls clone-build_ci.sh to perform a clone and full build from the PR. # It then is ready to run a suite of regression tests with various configurations +# no op for CI self test ####################################################################################### export REPO_URL=${REPO_URL:-"git@github.com:NOAA-EMC/global-workflow.git"} From 60410df90650938e6c06c2aa847bd60780993cd5 Mon Sep 17 00:00:00 2001 From: "Terry.McGuinness" Date: Tue, 16 Jul 2024 16:13:53 +0000 Subject: [PATCH 02/15] adding prototype job launch script --- ci/scripts/utils/launch_job.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 ci/scripts/utils/launch_job.sh diff --git a/ci/scripts/utils/launch_job.sh b/ci/scripts/utils/launch_job.sh new file mode 100755 index 0000000000..067d0343c0 --- /dev/null +++ b/ci/scripts/utils/launch_job.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -x + +controller_url="https://jenkins.epic.oarcloud.noaa.gov" +api_token=112991ee61d29bdf912525a4815a7cc97e +project_name=global-workflow +job_name=EMC-Pipelines +username=terry.mcguinness +pr_number=PR-292 +node=Hera-EMC +machine_name=hera + +build_url="${controller_url}/job/${project_name}/job/${job_name}/job/${pr_number}/buildWithParameters?delay=0sec" + +echo "" +echo $build_url +echo "" + +curl -sSL "${contoller_url}/pluginManager/api/json?depth=1" -u $username:$api_token ${build_url} +#| jq '.plugins[] | {shortName, version, enabled}' + +exit + +curl -X POST ${build_url} --user $username:$api_token ${build_url} --data-urlencode "Node=${node}" --data-urlencode "machine=${machine_name}" From 760fab7d951a419b2469a6b109342dd0b43f83f1 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 18:14:19 +0000 Subject: [PATCH 03/15] updated URL to dev grep in Jenkins file for developing launch --- ci/Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 05d38b7898..cf22c76f7d 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -5,7 +5,8 @@ def caseList = '' // Location of the custom workspaces for each machine in the CI system. They are persitent for each iteration of the PR. def NodeName = [hera: 'Hera-EMC', orion: 'Orion-EMC', hercules: 'Hercules-EMC', gaea: 'Gaea'] 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'] -def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git' +#def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git' +def repo_url = 'git@github.com:TerrenceMcGuinness-NOAA/global-workflow.git' def STATUS = 'Passed' pipeline { From a4532953a73167f71f5b3e9c57df16cd434282e6 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 18:15:21 +0000 Subject: [PATCH 04/15] oops wrong comment char --- ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index cf22c76f7d..6d331d5b31 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -5,7 +5,7 @@ def caseList = '' // Location of the custom workspaces for each machine in the CI system. They are persitent for each iteration of the PR. def NodeName = [hera: 'Hera-EMC', orion: 'Orion-EMC', hercules: 'Hercules-EMC', gaea: 'Gaea'] 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'] -#def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git' +//def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git' def repo_url = 'git@github.com:TerrenceMcGuinness-NOAA/global-workflow.git' def STATUS = 'Passed' From 849803a2a4d6fc22c4106878fa27286fb0ec3108 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 18:37:02 +0000 Subject: [PATCH 05/15] no op to test indexing contraints with webhook label depedancies in the Jenkins Contoller --- ci/scripts/driver.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/scripts/driver.sh b/ci/scripts/driver.sh index 70244506a8..0f53ebff6f 100755 --- a/ci/scripts/driver.sh +++ b/ci/scripts/driver.sh @@ -12,7 +12,6 @@ set -eux # development branch for the global-workflow repo. It then stages tests directories per # PR number and calls clone-build_ci.sh to perform a clone and full build from the PR. # It then is ready to run a suite of regression tests with various configurations -# no op for CI self test ####################################################################################### export REPO_URL=${REPO_URL:-"git@github.com:NOAA-EMC/global-workflow.git"} From 07b282a82455103abc9033fe9a84b941faf15757 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 18:58:36 +0000 Subject: [PATCH 06/15] reverting back to auterative repo for testing configuration --- ci/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 6d331d5b31..718ff19b37 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -5,8 +5,8 @@ def caseList = '' // Location of the custom workspaces for each machine in the CI system. They are persitent for each iteration of the PR. def NodeName = [hera: 'Hera-EMC', orion: 'Orion-EMC', hercules: 'Hercules-EMC', gaea: 'Gaea'] 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'] -//def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git' -def repo_url = 'git@github.com:TerrenceMcGuinness-NOAA/global-workflow.git' +def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git' +//def repo_url = 'git@github.com:TerrenceMcGuinness-NOAA/global-workflow.git' def STATUS = 'Passed' pipeline { From b59911347243b8e7d48cd647df0e3cd02156f01d Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 19:00:10 +0000 Subject: [PATCH 07/15] removed lauch job --- ci/scripts/utils/launch_job.sh | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100755 ci/scripts/utils/launch_job.sh diff --git a/ci/scripts/utils/launch_job.sh b/ci/scripts/utils/launch_job.sh deleted file mode 100755 index 067d0343c0..0000000000 --- a/ci/scripts/utils/launch_job.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -set -x - -controller_url="https://jenkins.epic.oarcloud.noaa.gov" -api_token=112991ee61d29bdf912525a4815a7cc97e -project_name=global-workflow -job_name=EMC-Pipelines -username=terry.mcguinness -pr_number=PR-292 -node=Hera-EMC -machine_name=hera - -build_url="${controller_url}/job/${project_name}/job/${job_name}/job/${pr_number}/buildWithParameters?delay=0sec" - -echo "" -echo $build_url -echo "" - -curl -sSL "${contoller_url}/pluginManager/api/json?depth=1" -u $username:$api_token ${build_url} -#| jq '.plugins[] | {shortName, version, enabled}' - -exit - -curl -X POST ${build_url} --user $username:$api_token ${build_url} --data-urlencode "Node=${node}" --data-urlencode "machine=${machine_name}" From c6bd1087dacdbe8b44fee5a8f2b51bae7626d7a8 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 19:34:23 +0000 Subject: [PATCH 08/15] added check to see if the laucnch was cause by build with parameters --- ci/Jenkinsfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 718ff19b37..20363ccecc 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -33,8 +33,12 @@ pipeline { cause instanceof hudson.model.Cause.UpstreamCause } + dif isSpawnedFromParameteriedBuild = causes.any { cause -> + cause instanceof hudson.model.Cause.ParameterizedCause + } + def run_nodes = [] - if (isSpawnedFromAnotherJob) { + if (isSpawnedFromAnotherJob || isSpawnedFromParameteriedBuild) { echo "machine being set to value passed to this spawned job" echo "passed machine: ${params.machine}" machine = params.machine From be3c744533cbddea82f0503ac257ee0964a53340 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 19:45:51 +0000 Subject: [PATCH 09/15] do we have to get causes again? --- ci/Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 20363ccecc..8794aecf97 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -33,6 +33,7 @@ pipeline { cause instanceof hudson.model.Cause.UpstreamCause } + def causes = currentBuild.rawBuild.getCauses() dif isSpawnedFromParameteriedBuild = causes.any { cause -> cause instanceof hudson.model.Cause.ParameterizedCause } From cf8019fea1f04333954219d51c6da2e02b5f6423 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 19:47:39 +0000 Subject: [PATCH 10/15] do we have to get causes again?? --- ci/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 8794aecf97..434b624c39 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -33,8 +33,8 @@ pipeline { cause instanceof hudson.model.Cause.UpstreamCause } - def causes = currentBuild.rawBuild.getCauses() - dif isSpawnedFromParameteriedBuild = causes.any { cause -> + def causes2 = currentBuild.rawBuild.getCauses() + dif isSpawnedFromParameteriedBuild = causes2.any { cause -> cause instanceof hudson.model.Cause.ParameterizedCause } From 721a631de6985039dbefcd6e84d2a7661eca9ef8 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 20:02:19 +0000 Subject: [PATCH 11/15] updated cause methond name for ParamterizedBuid --- ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 434b624c39..282d13bcc6 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -35,7 +35,7 @@ pipeline { def causes2 = currentBuild.rawBuild.getCauses() dif isSpawnedFromParameteriedBuild = causes2.any { cause -> - cause instanceof hudson.model.Cause.ParameterizedCause + cause instanceof hudson.model.Cause.ParameterizedBuildTriggerCause } def run_nodes = [] From 164c3ace256335e8b5f558e5599762f30a10b327 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 20:08:41 +0000 Subject: [PATCH 12/15] I had a typo in def all this time --- ci/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 282d13bcc6..5c07a4fd23 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -33,8 +33,7 @@ pipeline { cause instanceof hudson.model.Cause.UpstreamCause } - def causes2 = currentBuild.rawBuild.getCauses() - dif isSpawnedFromParameteriedBuild = causes2.any { cause -> + def isSpawnedFromParameteriedBuild = causes.any { cause -> cause instanceof hudson.model.Cause.ParameterizedBuildTriggerCause } From 27f80e381fb3a1c14671af3b396774af3a78a1ec Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 20:15:55 +0000 Subject: [PATCH 13/15] try resolving method in Cause class with $ --- ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 5c07a4fd23..bfb3763c96 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -34,7 +34,7 @@ pipeline { } def isSpawnedFromParameteriedBuild = causes.any { cause -> - cause instanceof hudson.model.Cause.ParameterizedBuildTriggerCause + cause instanceof hudson.model.Cause$ParameterizedBuildTriggerCause } def run_nodes = [] From 5bcb5c110163265f1dd7db58d809db2a98d2e8ae Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 20:23:24 +0000 Subject: [PATCH 14/15] lets try RemoteCause --- ci/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index bfb3763c96..99d4a0fa15 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -33,8 +33,8 @@ pipeline { cause instanceof hudson.model.Cause.UpstreamCause } - def isSpawnedFromParameteriedBuild = causes.any { cause -> - cause instanceof hudson.model.Cause$ParameterizedBuildTriggerCause + def isSpawnedFromRemoteCause = causes.any { cause -> + cause instanceof hudson.model.Cause.RemoteCause } def run_nodes = [] From 97f11894b3f381d038fc8054b4a1ac8066015e43 Mon Sep 17 00:00:00 2001 From: tmcguinness Date: Tue, 16 Jul 2024 20:26:02 +0000 Subject: [PATCH 15/15] updated next var for capturing RemoteCause --- ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 99d4a0fa15..15e4c81e94 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -38,7 +38,7 @@ pipeline { } def run_nodes = [] - if (isSpawnedFromAnotherJob || isSpawnedFromParameteriedBuild) { + if (isSpawnedFromAnotherJob || isSpawnedFromRemoteCause) { echo "machine being set to value passed to this spawned job" echo "passed machine: ${params.machine}" machine = params.machine