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

Adding Jenkins CI to GaeaC6 using role account #3389

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
6 changes: 3 additions & 3 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']
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
3 changes: 3 additions & 0 deletions ci/platforms/config.gaeac6
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ export ICSDIR_ROOT=/gpfs/f6/bil-fire8/world-shared/global/glopara/data/ICSDIR
export HPC_ACCOUNT=drsa-precip3
export max_concurrent_cases=5
export max_concurrent_pr=4

export JENKINS_AGENT_LANUCH_DIR=/ncrc/proj/nggps_emc/role.glopara/GFS_CI_CD/Jenkins/agent
export JENKINS_WORK_DIR=/ncrc/proj/nggps_emc/role.glopara/GFS_CI_CD/Jenkins/workspace
8 changes: 6 additions & 2 deletions ci/scripts/utils/launch_java_agent.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env bash
#!/usr/bin/env bash

set -e

Expand Down Expand Up @@ -74,7 +74,7 @@

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

HOMEgfs="${HOMEGFS_}"
source "${HOMEGFS_}/ush/module-setup.sh"
module use "${HOMEGFS_}/modulefiles"
module load "module_gwsetup.${MACHINE_ID}"
Expand Down Expand Up @@ -142,6 +143,9 @@
EOF
chmod u+x parse.py

# Needed for Gaea as it has C capatalized on the Node names in Jenkins
MACHINE_ID="$(echo "$MACHINE_ID" | sed 's/c\([0-9]\)/C\1/g')"

check_node_online() {
rm -f curl_response
curl_response=$(curl --silent -u "${controller_user}:${JENKINS_TOKEN}" "${controller_url}/computer/${MACHINE_ID^}-EMC/api/json?pretty=true") || true
Expand Down