Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
78562bb
remove the log lines from output of publish script when getting url
Feb 21, 2025
097cf03
remove the log lines from output of publish script when getting url a…
Feb 21, 2025
fefde1a
removed redundet excape one ticks for message output for build fails
Feb 21, 2025
13dd8b0
added necessary paths for Gaea C6 for Jenkins and a couple of script …
TerrenceMcGuinness-NOAA Feb 25, 2025
7a2d67e
updated Jenkinsfile with paths to run on GaeaC6
TerrenceMcGuinness-NOAA Feb 25, 2025
d9d241c
Merge branch 'NOAA-EMC:develop' into ci_jenkins_role_gaea6
TerrenceMcGuinness-NOAA Feb 25, 2025
f13014d
missed c in machine name for gaeac6
TerrenceMcGuinness-NOAA Feb 25, 2025
e6af0af
needed to cap C for Node Name in Jenkins for GaeaC6-EMC
TerrenceMcGuinness-NOAA Feb 25, 2025
4f34f5b
added new GaeaC6-EMC node to the NodeParameterDefinition list for res…
TerrenceMcGuinness-NOAA Feb 25, 2025
97384a3
updated mundge to MACHINE_ID to Cap C in Gaea names to match Node Nam…
TerrenceMcGuinness-NOAA Feb 25, 2025
8c052c5
removed cludge to mundge for capping C in system path to Jenkins Node…
TerrenceMcGuinness-NOAA Feb 25, 2025
cd90dd5
Merge branch 'NOAA-EMC:develop' into ci_jenkins_role_gaea6
TerrenceMcGuinness-NOAA Feb 26, 2025
468b7bc
added a better regex to get TOKEN for when gh updates the output
TerrenceMcGuinness-NOAA Feb 26, 2025
02486bc
Merge branch 'NOAA-EMC:develop' into ci_jenkins_role_gaea6
TerrenceMcGuinness-NOAA Feb 27, 2025
45fb69b
added getting authentication token from defined env vars from github …
TerrenceMcGuinness-NOAA Feb 27, 2025
199d18d
added shell check ingnore for setting HOMEgfs
TerrenceMcGuinness-NOAA Feb 27, 2025
70cdf0d
change shellnorm directive to disable because ignore is not a shellno…
TerrenceMcGuinness-NOAA Feb 27, 2025
7f839df
added step with Auth method from github python class for completness
TerrenceMcGuinness-NOAA Feb 27, 2025
a993717
temparaly removed all tests but low res ff for testing Jenkins
TerrenceMcGuinness-NOAA Feb 27, 2025
5f535e1
changed name of node for Gaea C6 after it was updated on the controle…
TerrenceMcGuinness-NOAA Feb 27, 2025
4148db4
Merge branch 'develop' into ci_jenkins_role_gaea6
TerrenceMcGuinness-NOAA Feb 27, 2025
0df7f35
fixed quoting on build fail report
Feb 21, 2025
64759c5
Merge branch 'develop' into ci_jenkins_role_gaea6
aerorahul Feb 28, 2025
2132efe
replaced quotes around body for message to single quotes since we too…
TerrenceMcGuinness-NOAA Feb 28, 2025
18b5152
adding back the tests after passing single test
Feb 28, 2025
b2fe776
Update ci/scripts/utils/launch_java_agent.sh
TerrenceMcGuinness-NOAA Feb 28, 2025
7bcda9d
cleaned up config in CI platforms for Gaea C6 and added updated path …
TerrenceMcGuinness-NOAA Feb 28, 2025
2e212da
Merge branch 'develop' into ci_jenkins_role_gaea6
TerrenceMcGuinness-NOAA Mar 3, 2025
6f48a11
Update ci/scripts/utils/launch_java_agent.sh
TerrenceMcGuinness-NOAA Mar 3, 2025
e1b2b08
Merge branch 'develop' into ci_jenkins_role_gaea6
TerrenceMcGuinness-NOAA Mar 3, 2025
b6fc870
Merge branch 'develop' into ci_jenkins_role_gaea6
DavidHuber-NOAA Mar 3, 2025
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
14 changes: 7 additions & 7 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ def HOMEgfs = 'none'
def CI_CASES = ''
def GH = 'none'
// Location of the custom workspaces for each machine in the CI system. They are persistent 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/global/CI/HERCULES', gaea: '/gpfs/f5/epic/proj-shared/global/CI']
def NodeName = [hera: 'Hera-EMC', orion: 'Orion-EMC', hercules: 'Hercules-EMC', gaea: 'Gaea', gaeac6: 'Gaeac6-EMC']
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', gaeac6: '/gpfs/f6/drsa-precip3/proj-shared/global/CI']
Comment thread
DavidHuber-NOAA marked this conversation as resolved.
def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git'
def STATUS = 'Passed'

Expand Down Expand Up @@ -79,7 +79,7 @@ pipeline {
Machine = machine[0].toUpperCase() + machine.substring(1)
echo "Getting Common Workspace for ${Machine}"
ws("${custom_workspace[machine]}/${env.CHANGE_ID}") {
properties([parameters([[$class: 'NodeParameterDefinition', allowedSlaves: ['built-in', 'Hercules-EMC', 'Hera-EMC', 'Orion-EMC', 'Gaea'], defaultSlaves: ['built-in'], name: '', nodeEligibility: [$class: 'AllNodeEligibility'], triggerIfResult: 'allCases']])])
properties([parameters([[$class: 'NodeParameterDefinition', allowedSlaves: ['built-in', 'Hercules-EMC', 'Hera-EMC', 'Orion-EMC', 'Gaea', 'GaeaC6-EMC'], defaultSlaves: ['built-in'], name: '', nodeEligibility: [$class: 'AllNodeEligibility'], triggerIfResult: 'allCases']])])
GH = sh(script: "which gh || echo '~/bin/gh'", returnStdout: true).trim()
CUSTOM_WORKSPACE = "${WORKSPACE}"
HOMEgfs = "${CUSTOM_WORKSPACE}/global-workflow"
Expand Down Expand Up @@ -144,9 +144,9 @@ pipeline {
""")
gist_url=sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID}
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID} | tail -n 1
""", returnStdout: true).trim()
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Build **FAILED** on **${Machine}** in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """)
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body 'Build **FAILED** on **${Machine}** in Build# ${env.BUILD_NUMBER} with error logs:\n```\n${error_logs_message}```\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})' """)
} catch (Exception error_comment) {
echo "Failed to comment on PR: ${error_comment.getMessage()}"
}
Expand Down Expand Up @@ -242,9 +242,9 @@ pipeline {
try {
gist_url = sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_${env.CHANGE_ID}
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_${env.CHANGE_ID} | tail -n 1
""", returnStdout: true).trim()
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Experiment ${caseName} **FAILED** on ${Machine} in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """)
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body 'Experiment ${caseName} **FAILED** on ${Machine} in Build# ${env.BUILD_NUMBER} with error logs:\n```\n${error_logs_message}```\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})' """)
sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_${env.CHANGE_ID}
Expand Down
15 changes: 13 additions & 2 deletions ci/platforms/config.gaeac6
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#!/usr/bin/bash

export GFS_CI_ROOT=/gpfs/f6/drsa-precip3/scratch/${USER}/GFS_CI_ROOT
export ICSDIR_ROOT=/gpfs/f6/drsa-precip3/world-shared/role.glopara/data/ICSDIR
export GFS_CI_ROOT=/ncrc/proj/nggps_emc/${USER}/GFS_CI_CD
Comment thread
DavidHuber-NOAA marked this conversation as resolved.
export ICSDIR_ROOT=/gpfs/f6/bil-fire8/world-shared/global/glopara/data/ICSDIR

# CI BASH test directories
export GFS_BASH_CI_ROOT=${GFS_CI_ROOT}/Bash

# Jenkins directories
export JENKINS_AGENT_LANUCH_DIR=${GFS_CI_ROOT}/Jenkins/agent
export JENKINS_WORK_DIR=${GFS_CI_ROOT}/Jenkins/workspace

# CTest functional test directories for pre stagged input data
export STAGED_TESTS_DIR=${GFS_CI_ROOT}/STAGED_TESTS_DIR

export HPC_ACCOUNT=drsa-precip3
export max_concurrent_cases=5
export max_concurrent_pr=4
29 changes: 23 additions & 6 deletions ci/scripts/utils/githubpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import os
import re

from github import Github, GithubException, InputFileContent, UnknownObjectException
from wxflow import which
from github import Auth, Github, GithubException, InputFileContent, UnknownObjectException
from wxflow import which, Logger

# Initialize logger with environment variable for logging level
logger = Logger(level=os.environ.get("LOGGING_LEVEL", "DEBUG"), colored_log=False)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking, should this remain at LOGGING_LEVEL=DEBUG? Or was that just for testing?

Also, I have been looking for a way to disable colors when logging. Thanks for showing off this colored_log=False!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

David, All of the python scripts that use the wxflow Logger are set at the DEBUG level, so I thought it best to follow form here. Notice that we can alter the Level at runtime with the environment variable LOGGING_LEVEL, so it appears the intent was to have DEBUG as the default.



class GitHubDBError(Exception):
Expand Down Expand Up @@ -54,10 +57,24 @@ def __init__(self, repo_url=None, TOKEN=None):
environment variable when repo_url is not provided.
"""
if TOKEN is None:
gh_cli = which('gh')
gh_cli.add_default_arg(['auth', 'status', '--show-token'])
TOKEN = gh_cli(output=str, error=str).split('\n')[3].split(': ')[1]
super().__init__(TOKEN)
TOKEN = os.environ.get('GH_TOKEN') or os.environ.get('GITHUB_TOKEN')
if TOKEN:
logger.info("Using TOKEN from environment variable.")
else:
gh_cli = which('gh')
gh_cli.add_default_arg(['auth', 'status', '--show-token'])
gh_output = gh_cli(output=str, error=str)
token_match = re.search(r"Token:\s*([a-zA-Z0-9_]+)", gh_output)
if token_match:
TOKEN = token_match.group(1)
logger.info("Using TOKEN from gh CLI tool.")
else:
raise ValueError("Token not found in gh CLI output.")
else:
logger.info("Using provided TOKEN.")

auth = Auth.Token(TOKEN)
super().__init__(auth=auth)

self.repo = self.get_repo_url(repo_url)
self.pulls = self.repo.get_pulls(state='open', sort='updated', direction='desc')
Expand Down
4 changes: 2 additions & 2 deletions ci/scripts/utils/launch_java_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ host=$(hostname)

source "${HOMEGFS_}/ush/detect_machine.sh"
case ${MACHINE_ID} in
hera | orion | hercules | wcoss2 | gaea)
hera | orion | hercules | wcoss2 | gaeac5 | gaeac6 )
echo "Launch Jenkins Java Controler on ${MACHINE_ID}";;
*)
echo "Unsupported platform. Exiting with error."
Expand All @@ -84,7 +84,7 @@ esac
LOG=lanuched_agent-$(date +%Y%m%d%M).log
rm -f "${LOG}"

source "${HOMEGFS_}/ush/module-setup.sh"
HOMEgfs="${HOMEGFS_}" source "${HOMEGFS_}/ush/module-setup.sh"
module use "${HOMEGFS_}/modulefiles"
module load "module_gwsetup.${MACHINE_ID}"
source "${HOMEGFS_}/ci/platforms/config.${MACHINE_ID}"
Expand Down