-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for cloud autort and blstores (#1887)
* Update rt.sh * Create RegressionTests_noaacloud.log * Create Jenkinsfile.noaacloud * Update rt.conf * Update bl.py
- Loading branch information
Showing
12 changed files
with
5,456 additions
and
4,288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
pipeline { | ||
agent none | ||
stages { | ||
stage('Start Parallelworks Cluster') { | ||
agent { | ||
label 'built-in' | ||
} | ||
steps { | ||
script { | ||
for (label in pullRequest.labels) { | ||
if ((label.matches("(.*)-aws-(.*)"))) { | ||
env.CHOICE_NODE='pclusternoaav2use1' | ||
} | ||
else if ((label.matches("(.*)-gcp-(.*)"))) { | ||
env.CHOICE_NODE='gclusternoaav2usc1' | ||
} | ||
else if ((label.matches("(.*)-azure-(.*)"))) { | ||
env.CHOICE_NODE='azclusternoaav2use1' | ||
} | ||
else { | ||
env.CHOICE_NODE='none' | ||
} | ||
} | ||
// Why do I need another if..block, because it just works this way. | ||
|
||
if (CHOICE_NODE == 'azclusternoaav2use1') { | ||
echo "Starting up Parallelworks cluster ${CHOICE_NODE}...this might take 5-10 minutes...please be patient." | ||
build job: 'parallel-works-jenkins-client/start-cluster', parameters: [string(name: 'PW_CLUSTER_NAME', value: 'azclusternoaav2use1'), string(name: 'PW_CLUSTER_SSH_KEY', value: '~/.ssh/pw_id_rsa'), string(name: 'JAVA_VERSION', value: '11')] | ||
|
||
} | ||
else if (CHOICE_NODE == 'gclusternoaav2usc1') { | ||
echo "Starting up Parallelworks cluster ${CHOICE_NODE}...this might take 5-10 minutes...please be patient." | ||
build job: 'parallel-works-jenkins-client/start-cluster', parameters: [string(name: 'PW_CLUSTER_NAME', value: 'gclusternoaav2usc1'), string(name: 'PW_CLUSTER_SSH_KEY', value: '~/.ssh/pw_id_rsa'), string(name: 'JAVA_VERSION', value: '11')] | ||
} | ||
else if (CHOICE_NODE == 'pclusternoaav2use1') { | ||
echo "Starting up Parallelworks cluster ${CHOICE_NODE}...this might take 5-10 minutes...please be patient." | ||
build job: 'parallel-works-jenkins-client/start-cluster', parameters: [string(name: 'PW_CLUSTER_NAME', value: 'pclusternoaav2use1'), string(name: 'PW_CLUSTER_SSH_KEY', value: '~/.ssh/pw_id_rsa'), string(name: 'JAVA_VERSION', value: '11')] | ||
} | ||
else { | ||
echo "${CHOICE_NODE} is NOT a Parallelworks cluster, moving on..." | ||
} | ||
} | ||
} | ||
} | ||
stage('Run Regression Tests script') { | ||
agent { | ||
label "${CHOICE_NODE}" | ||
} | ||
environment { | ||
GITHUB_SSH_KEY = credentials('ParallelworksGithubPrivateKey') | ||
ACCNR = 'epic' | ||
GITHUB_TOKEN = credentials('zachgithubtoken') | ||
NODE_PATH = '/lustre/' | ||
} | ||
steps { | ||
script { | ||
for (label in pullRequest.labels) { | ||
if ((label.matches("(.*)-BL"))) { | ||
env.CREATE_BASELINES='true' | ||
} | ||
else { | ||
env.CREATE_BASELINES='false' | ||
} | ||
} | ||
} | ||
cleanWs() | ||
checkout scm | ||
sh ''' | ||
pwd | ||
git submodule update --init --recursive | ||
cd tests/ | ||
if [[ "${CREATE_BASELINES}" = true ]] | ||
then | ||
echo "Creating baselines for regressions tests" | ||
./rt.sh -c -l rt.conf | ||
echo "Sending regression test logs to $GIT_URL" | ||
git config user.email "[email protected]" | ||
git config user.name "epic-cicd-jenkins" | ||
set +x | ||
cd ${WORKSPACE} | ||
export httpsorigin=`echo ${GIT_URL} | sed -e "s/github/$GITHUB_TOKEN@github/"` > /dev/null 2>&1 | ||
git remote -v | grep -w httpsorigin > /dev/null 2>&1 && git remote remove httpsorigin > /dev/null 2>&1 | ||
git remote add httpsorigin $httpsorigin > /dev/null 2>&1 | ||
git add tests/logs/RegressionTests_noaacloud.log | ||
git commit -m "[AutoRT] noaacloud Job Completed.\n\n\n on-behalf-of @ufs-community <[email protected]>" | ||
git push httpsorigin HEAD:$CHANGE_BRANCH > /dev/null 2>&1 | ||
set -x | ||
echo "Pushed logs to $GIT_URL $CHANGE_BRANCH" | ||
echo "Removing labels from $GIT_URL" | ||
GIT_OWNER=$(echo $GIT_URL | cut -d '/' -f4) | ||
GIT_REPO_NAME=$(echo $GIT_URL | cut -d '/' -f5 | cut -d '.' -f1) | ||
curl --silent -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels -d '{"labels":[".*BL"]}' | ||
else | ||
echo "Running regression tests and NOT creating baselines." | ||
./rt.sh -l rt.conf | ||
echo "Sending regression test logs to $GIT_URL" | ||
git config user.email "[email protected]" | ||
git config user.name "epic-cicd-jenkins" | ||
set +x | ||
cd ${WORKSPACE} | ||
export httpsorigin=`echo ${GIT_URL} | sed -e "s/github/$GITHUB_TOKEN@github/"` > /dev/null 2>&1 | ||
git remote -v | grep -w httpsorigin > /dev/null 2>&1 && git remote remove httpsorigin > /dev/null 2>&1 | ||
git remote add httpsorigin $httpsorigin > /dev/null 2>&1 | ||
git add tests/logs/RegressionTests_noaacloud.log | ||
git commit -m "[AutoRT] noaacloud Job Completed.\n\n\n on-behalf-of @ufs-community <[email protected]>" | ||
git push httpsorigin HEAD:$CHANGE_BRANCH > /dev/null 2>&1 | ||
set -x | ||
echo "Pushed logs to $GIT_URL $CHANGE_BRANCH" | ||
echo "Removing labels from $GIT_URL" | ||
GIT_OWNER=$(echo $GIT_URL | cut -d '/' -f4) | ||
GIT_REPO_NAME=$(echo $GIT_URL | cut -d '/' -f5 | cut -d '.' -f1) | ||
curl --silent -X DELETE -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/${GIT_OWNER}/${GIT_REPO_NAME}/issues/${CHANGE_ID}/labels -d '{"labels":[".*RT"]}' | ||
fi | ||
''' | ||
} | ||
} | ||
stage('Stop Parallelworks Cluster') { | ||
agent { | ||
label 'built-in' | ||
} | ||
// Pedantic comment. | ||
steps { | ||
script { | ||
if (CHOICE_NODE == 'azclusternoaav2use1') { | ||
echo "Shutting Down Parallelworks cluster ${CHOICE_NODE}." | ||
build job: 'parallel-works-jenkins-client/stop-cluster', parameters: [string(name: 'PW_CLUSTER_NAME', value: 'azclusternoaav2use1')] | ||
|
||
} | ||
else if (CHOICE_NODE == 'gclusternoaav2usc1') { | ||
echo "Shutting Down Parallelworks cluster ${CHOICE_NODE}." | ||
build job: 'parallel-works-jenkins-client/stop-cluster', parameters: [string(name: 'PW_CLUSTER_NAME', value: 'gclusternoaav2usc1')] | ||
} | ||
else if (CHOICE_NODE == 'pclusternoaav2use1') { | ||
echo "Shutting Down Parallelworks cluster ${CHOICE_NODE}." | ||
build job: 'parallel-works-jenkins-client/stop-cluster', parameters: [string(name: 'PW_CLUSTER_NAME', value: 'pclusternoaav2use1')] | ||
} | ||
else { | ||
echo "${CHOICE_NODE} is NOT a Parallelworks cluster, moving on..." | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.