Skip to content

Commit

Permalink
Check-in Jenkins Docker ORT CI (#1411)
Browse files Browse the repository at this point in the history
* Update input-data and hpc-stack containers

* Update Dockerfile and opnReqTest

* Update Jenkinsfile to handle PRs properly

Co-authored-by: JONG KIM <[email protected]>
  • Loading branch information
Jesse McFarland and jkbk2004 authored Oct 4, 2022
1 parent 14db6bb commit e6da626
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 26 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ jobs:
sudo systemctl restart docker
sleep 10
cd tests/ci && ./ci.sh -n ${{ matrix.name }} -b ${{ matrix.case }}
sudo docker image ls
- name: Free up disk space
run: |
sudo docker rmi $(sudo docker image ls | grep -E -m1 '<none>' | awk '{ print $3 }')
sudo docker rmi $(sudo docker image ls | awk '/ubuntu-hpc/ { print $3 }')
#- name: Free up disk space
# run: |
# sudo docker images --no-trunc --all --quiet --filter="dangling=true" | sudo xargs --no-run-if-empty docker rmi

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.bld_set }}.artifact
Expand Down Expand Up @@ -174,14 +174,14 @@ jobs:
cd ${{ github.workspace }}/tests/ci
./ci.sh -n ${{ matrix.name }} -r ${{ matrix.case }}
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: memory_stat_${{ matrix.test_set }}
path: memory_stat

- name: Clean up
if: ${{ always() }}
run: |
docker stop my-container && docker rm my-container
docker volume rm DataVolume
#- uses: actions/upload-artifact@v2
# if: ${{ always() }}
# with:
# name: memory_stat_${{ matrix.test_set }}
# path: memory_stat

#- name: Clean up
# if: ${{ always() }}
# run: |
#docker stop my-container && docker rm my-container
#docker volume rm DataVolume
15 changes: 8 additions & 7 deletions tests/ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
From noaaemc/ubuntu-hpc:v1.11b
From noaaepic/ubuntu20.04-gnu9.3-hpc-stack:v1.2

CMD ["/bin/bash"]

ENV HOME=/home/builder
COPY --chown=builder:builder . $HOME/ufs-weather-model

USER builder
ENV USER=builder
ARG test_name
ARG build_case
ARG run_case
ENV test_name=$test_name
ENV build_case=$build_case
ENV test_case=
ENV run_case=$run_case
ENV CI_TEST=true
ENV RT_COMPILER=gnu
ENV RT_MACHINE=linux.gnu
ENV RT_MACHINE=linux
ENV MACHINE_ID=linux

WORKDIR $HOME/ufs-weather-model/tests
RUN ./opnReqTest -n $test_name -c $build_case -z && tar -cvzf fv3.tar.gz fv3_*.exe modules.fv3_*
CMD ./opnReqTest -n $test_name -c $test_case -x
CMD ./opnReqTest -n $test_name -c $run_case
75 changes: 75 additions & 0 deletions tests/ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
pipeline {
agent none

options {
disableConcurrentBuilds()
overrideIndexTriggers(false)
skipDefaultCheckout(true)
}

stages {
stage('ORT') {
matrix {
axes {
axis {
name 'TEST_NAME'
values 'control', 'regional_control', 'cpld_control_nowave_noaero_p8'
}

axis {
name 'TEST_CASE'
values 'thr', 'mpi', 'dcp', 'rst', 'bit', 'dbg'
}
}

excludes {
exclude {
axis {
name 'TEST_NAME'
values 'regional_control'
}

axis {
name 'TEST_CASE'
values 'mpi', 'rst', 'bit', 'dbg'
}
}

exclude {
axis {
name 'TEST_NAME'
values 'cpld_control_nowave_noaero_p8'
}

axis {
name 'TEST_CASE'
values 'mpi', 'dcp', 'rst', 'bit', 'thr' // TODO: Remove thr case from cpld_control_nowave_noaero_p8 exclusions when it is passing again
}
}
}

stages {
stage('Test') {
when {
expression {
!changeRequest()
}
}

steps {
build job: 'ufs-weather-model/ort-docker-pipeline', parameters: [string(name: 'TEST_NAME', value: "${env.TEST_NAME}"), string(name: 'TEST_CASE', value: "${env.TEST_CASE}"), string(name: 'WRAPPER_GIT_BRANCH', value: "${env.BRANCH_NAME}")]
}
}

stage('Test for Change Request') {
when { changeRequest() }

steps {
build job: 'ufs-weather-model/ort-docker-pipeline', parameters: [string(name: 'TEST_NAME', value: "${env.TEST_NAME}"), string(name: 'TEST_CASE', value: "${env.TEST_CASE}"), booleanParam(name: 'WRAPPER_CHANGE_REQUEST', value: true), string(name: 'WRAPPER_GIT_BRANCH', value: "${env.CHANGE_TARGET}"), string(name: 'WRAPPER_CHANGE_BRANCH', value: "${env.CHANGE_BRANCH}"), string(name: 'WRAPPER_CHANGE_FORK', value: "${env.CHANGE_FORK}")]
}
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions tests/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ bash -x ${PATHTR}/build.sh

mv ${BUILD_DIR}/ufs_model ${PATHTR}/tests/${BUILD_NAME}.exe
if [[ "${MAKE_OPT}" == "-DDEBUG=ON" ]]; then
if [[ $MACHINE_ID == gaea.* ]]; then
if [[ $MACHINE_ID == gaea.* ]] || [[ $MACHINE_ID == linux.* ]]; then
cp ${PATHTR}/modulefiles/ufs_${MACHINE_ID}_debug ${PATHTR}/tests/modules.${BUILD_NAME}
else
cp ${PATHTR}/modulefiles/ufs_${MACHINE_ID}_debug.lua ${PATHTR}/tests/modules.${BUILD_NAME}.lua
fi
else
if [[ $MACHINE_ID == gaea.* ]]; then
if [[ $MACHINE_ID == gaea.* ]] || [[ $MACHINE_ID == linux.* ]]; then
cp ${PATHTR}/modulefiles/ufs_${MACHINE_ID} ${PATHTR}/tests/modules.${BUILD_NAME}
else
cp ${PATHTR}/modulefiles/ufs_${MACHINE_ID}.lua ${PATHTR}/tests/modules.${BUILD_NAME}.lua
Expand Down
2 changes: 1 addition & 1 deletion tests/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ MACHINE_ID=${MACHINE_ID:-false}
cp ${PATHRT}/fv3_${COMPILE_NR}.exe fv3.exe

# modulefile for FV3 prerequisites:
if [[ $MACHINE_ID == gaea.* ]]; then
if [[ $MACHINE_ID == gaea.* ]] || [[ $MACHINE_ID == linux.* ]]; then
cp ${PATHRT}/modules.fv3_${COMPILE_NR} modules.fv3
else
cp ${PATHRT}/modules.fv3_${COMPILE_NR}.lua modules.fv3.lua
Expand Down

0 comments on commit e6da626

Please sign in to comment.