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

[develop] Update Jenkinsfile to run post-build functional tests #847

Merged
merged 18 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
21dd906
Update Jenkinsfile to run post-build functional tests
BruceKropp-Raytheon Jun 29, 2023
8f7bca3
Update Jenkinsfile to remove EXPTDIR= from shell call to srw_ftest.sh
BruceKropp-Raytheon Jun 30, 2023
db7c32e
Update srw_ftest.sh to limit target machines and load hpss
BruceKropp-Raytheon Jun 30, 2023
15e62b3
Update Jenkinsfile to include saving functional_test_results*.txt
BruceKropp-Raytheon Jun 30, 2023
cceacba
Update srw_ftest.sh to configure use of staged data for HPSS
BruceKropp-Raytheon Jun 30, 2023
938f9c8
Update srw_ftest.sh to conda activate workflow_tools
BruceKropp-Raytheon Jun 30, 2023
4b7049c
Update srw_ftest.sh change the config.yaml for tasks needing data
BruceKropp-Raytheon Jun 30, 2023
e220873
Update srw_ftest.sh to make sure there is a results_file
BruceKropp-Raytheon Jul 5, 2023
2a573e4
Update srw_ftest.sh change to a list of deny_machines
BruceKropp-Raytheon Jul 5, 2023
47c678c
Update srw_ftest.sh to allow orion to run this manually
BruceKropp-Raytheon Jul 6, 2023
5c82f87
Update srw_ftest.sh to enable HPSS staged data and update PYTHONPATH,…
BruceKropp-Raytheon Jul 7, 2023
0df77e1
Consistency check is not consistent on all platforms
BruceKropp-Raytheon Jul 10, 2023
7357850
Update srw_ftest.sh to add a second space to changed line in config.yaml
BruceKropp-Raytheon Jul 10, 2023
4bcfa8e
Update srw_ftest.sh to deny Hera, since it wont accept ulimit -s unli…
BruceKropp-Raytheon Jul 11, 2023
78ce1cb
Update srw_ftest.sh to overcome ulimit error from hera.yaml
BruceKropp-Raytheon Jul 12, 2023
5624d53
Update srw_ftest.sh to go back to deny Hera, since the ulimit change …
BruceKropp-Raytheon Jul 12, 2023
4c80a54
Update srw_ftest.sh to extend PYTHONPATH to also include ush/python_u…
BruceKropp-Raytheon Jul 19, 2023
a44fc58
Update srw_ftest.sh to Adjust for strict limitation of stack size
BruceKropp-Raytheon Jul 20, 2023
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
13 changes: 11 additions & 2 deletions .cicd/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ pipeline {
}

// Run the unittest functional tests that require an HPC platform
stage('Functional Tests') {
stage('Functional UnitTests') {
steps {
echo "Running unittest on retrieve_data.py"
sh 'bash --login "${WORKSPACE}/.cicd/scripts/srw_unittest.sh"'
}
}

// Run the unified build script; if successful create a tarball of the build and upload to S3
stage('Build') {
steps {
Expand All @@ -148,6 +149,14 @@ pipeline {
}
}

// Try a few Workflow Task scripts to make sure E2E tests can be launched in a follow-on 'Test' stage
stage('Functional WorkflowTaskTests') {
steps {
echo "Running simple workflow script task tests on ${env.SRW_PLATFORM} (using ${env.WORKSPACE})"
sh 'bash --login "${WORKSPACE}/.cicd/scripts/srw_ftest.sh"'
}
}

// Run the unified test script
stage('Test') {
environment {
Expand Down Expand Up @@ -187,7 +196,7 @@ pipeline {
sh 'cd "${SRW_WE2E_EXPERIMENT_BASE_DIR}" && tar --create --gzip --verbose --dereference --file "${WORKSPACE}/we2e_test_logs-${SRW_PLATFORM}-${SRW_COMPILER}.tgz" */log.generate_FV3LAM_wflow */log/* ${WORKSPACE}/tests/WE2E/WE2E_tests_*yaml WE2E_summary*txt ${WORKSPACE}/tests/WE2E/log.*'
// Remove the data sets from the experiments directory to conserve disk space
sh 'find "${SRW_WE2E_EXPERIMENT_BASE_DIR}" -regextype posix-extended -regex "^.*(orog|[0-9]{10})$" -type d | xargs rm -rf'
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: 'we2e_test_results-*-*.txt', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false], [bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: 'we2e_test_logs-*-*.tgz', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: '*_test_results-*-*.txt', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false], [bucket: 'noaa-epic-prod-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: 'we2e_test_logs-*-*.tgz', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: []
}
}
}
Expand Down
28 changes: 22 additions & 6 deletions .cicd/scripts/srw_ftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# We want this following a normal SRW build in an attempt to exercise environment setup, modules,
# data sets, and workflow scripts, without using too much time nor account resources.
# We hope to catch any snags that might prevent WE2E fundamental testing, which follows this gate.
# NOTE: At this time, this script is a placeholder for functional test framework.
# NOTE:
# At this time, we are leaving the exercise of graphical plotting for a later stage, perhaps WE2E state.
#
# Required:
Expand Down Expand Up @@ -71,19 +71,27 @@ echo "DATA_LOCATION=${DATA_LOCATION}"
sed "s|^task_get_extrn_ics:|task_get_extrn_ics:\n EXTRN_MDL_SOURCE_BASEDIR_ICS: ${DATA_LOCATION}/FV3GFS/grib2/2019061518|1" -i ush/config.yaml
sed "s|^task_get_extrn_lbcs:|task_get_extrn_lbcs:\n EXTRN_MDL_SOURCE_BASEDIR_LBCS: ${DATA_LOCATION}/FV3GFS/grib2/2019061518|1" -i ush/config.yaml

# Use staged data for HPSS supported machines
sed 's|^platform:|platform:\n EXTRN_MDL_DATA_STORES: disk|g' -i ush/config.yaml

# Activate the workflow environment ...
source etc/lmod-setup.sh ${platform,,}
module use modulefiles
module load build_${platform,,}_${SRW_COMPILER}
module load wflow_${platform,,}

[[ ${FORGIVE_CONDA} == true ]] && set +e +u # Some platforms have incomplete python3 or conda support, but wouldn't necessarily block workflow tests
conda activate regional_workflow
conda activate workflow_tools
set -e -u
MichaelLueken marked this conversation as resolved.
Show resolved Hide resolved

export PYTHONPATH=${workspace}/ush/python_utils/workflow-tools:${workspace}/ush/python_utils/workflow-tools/src

# Adjust for strict limitation of stack size
sed "s|ulimit -s unlimited;|ulimit -S -s unlimited;|" -i ${workspace}/ush/machine/hera.yaml

cd ${workspace}/ush
# Consistency check ...
./config_utils.py -c ./config.yaml -v ./config_defaults.yaml -k "(\!rocoto\b)"
#./config_utils.py -c ./config.yaml -v ./config_defaults.yaml -k "(\!rocoto\b)"
# Generate workflow files ...
./generate_FV3LAM_wflow.py
cd ${workspace}
Expand Down Expand Up @@ -115,16 +123,24 @@ export OMP_NUM_THREADS=1
)
set +x

echo "# Try the first few simple SRW tasks ..."
results_file=${workspace}/functional_test_results_${SRW_PLATFORM}_${SRW_COMPILER}.txt
rm -f ${results_file}

status=0
for task in ${TASKS[@]:0:${TASK_DEPTH}} ; do

# Limit to machines that are fully ready
deny_machines=( gaea )
if [[ ${deny_machines[@]} =~ ${platform,,} ]] ; then
echo "# Deny ${platform} - incomplete configuration." | tee -a ${results_file}
else
echo "# Try ${platform} with the first few simple SRW tasks ..." | tee -a ${results_file}
for task in ${TASKS[@]:0:${TASK_DEPTH}} ; do
echo -n "./$task.sh ... "
./$task.sh > $task-log.txt 2>&1 && echo "COMPLETE" || echo "FAIL rc=$(( status+=$? ))"
# stop at the first sign of trouble ...
[[ 0 != ${status} ]] && echo "$task: FAIL" >> ${results_file} && break || echo "$task: COMPLETE" >> ${results_file}
done
done
fi
MichaelLueken marked this conversation as resolved.
Show resolved Hide resolved

# Set exit code to number of failures
set +e
Expand Down
Loading