Commit 2474565a authored by Jade Skye's avatar Jade Skye Committed by Mike Brady
Browse files

Deploy Basic Pipeline

parent a5c0dd19
Loading
Loading
Loading
Loading

.gitlab-ci-build.yml

0 → 100644
+69 −0
Original line number Diff line number Diff line
workflow:
  rules:
    - if: ($CI_PIPELINE_SOURCE == "parent_pipeline" || $CI_PIPELINE_SOURCE == "web")

before_script:
 - source /home/scrd530/.profile
 - source $CCCMA_REF/env_setup_file

stages:
 - report_configuration 
 - setup
 - build

report_build_configuration:
  stage: report_configuration
  script:
    - echo "---Report input variables:---"
    - pwd
    - ls -al
    - echo $BUILD
    - echo $MODE
    - echo $DEBUG
    - echo $ICAN
    - echo $ICC
    - echo $TWELVEMAX
    - echo "---All variables reported---"
  except:
    - branches@cccma/classic
    - tags@cccma/classic
    

prepare_build_space:
  stage: setup
  script:
    - echo "---Clear any previous setups for $BUILD and restablish fresh directories---"
    - if [ -d "/space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD" ]; then
    -   rm -rf /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD
    -   ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs
    - fi
    - mkdir -p /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs
    - echo "---Prepare $BUILD directory for storing build artifacts---"
    - mkdir -p /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/bin
    - cp Makefile /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD
    - cp /home/rec001/public/classic/make_classic.sh /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD # maybe get this file from another location at some point
    - cp -r src /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD
    - echo "---Setup for $BUILD complete---"
  except:
    - branches@cccma/classic
    - tags@cccma/classic

perform_build:
  stage: build
  script:
    - echo "---Perform necessary model code adjustments for $BUILD---"
    - cd /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD
    - pwd
    - sed -i "s/ican = 5/ican = ${ICAN}/g" src/base/classicParams.F90
    - sed -i "s/icc = 12/icc = ${ICC}/g" src/base/classicParams.F90
    - sed -i "s/l2max = 3/l2max = ${TWELVEMAX}/g" src/base/classicParams.F90
    - echo "---Compile model for $BUILD---"
    - ./make_classic.sh mode=$MODE debug=$DEBUG
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/bin
    - echo "---$BUILD compilation complete---"
  except:
    - branches@cccma/classic
    - tags@cccma/classic

.gitlab-ci-run.yml

0 → 100644
+102 −0
Original line number Diff line number Diff line
workflow:
  rules:
    - if: ($CI_PIPELINE_SOURCE == "parent_pipeline" || $CI_PIPELINE_SOURCE == "web")

before_script:
 - source /home/scrd530/.profile
 - source $CCCMA_REF/env_setup_file

stages:
 - report_configuration
 - setup
 - run
 - report_run_results
 - compare_checksums

report_run_configuration:
  stage: report_configuration
  script:
    - echo "---Report input variables:---"
    - pwd
    - ls -al
    - echo $RUN
    - echo $BUILD
    - echo $MODE
    - echo $PARAMS
    - echo "---All variables reported---"
  except:
    - branches@cccma/classic
    - tags@cccma/classic

prepare_run_space:
  stage: setup
  script:
    - echo "---Setup for $RUN---"
    - echo "---Clear any previous setups for $RUN and restablish fresh directories---"
    - if [ -d "/space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN" ]; then
    -   rm -rf /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN
    - fi
    - mkdir -p /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD
    - echo "---Run prep script for $RUN---"
    - . ssmuse-sh --verbose -x /fs/ssm/eccc/cmd/cmds/apps/mamba/master/mamba_2024.11.12_all
    - conda activate /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/conda/envs/classic_env
    - tools/regression_testing/submission_scripts/job_prep.sh runloc=/space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN $PARAMS
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN
    - cat /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/job_options.txt
    - cp tools/regression_testing/submission_scripts/job_submit.sh /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/job_submit.sh
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN
    - sed -i "/^output_directory/s|=.*|=/space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN|" /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/job_submit.sh
    - sed -i "/^executable/s|=.*|=/space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/bin/CLASSIC_$MODE|" /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/job_submit.sh
    - if [[ "${MODE}" == "serial_intel" || "${MODE}" == "serial_gnu" ]]; then
    -   sed -i "/^parallel_run_job/s|=.*|=false|" /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/job_submit.sh
    - fi
    - echo "---Setup for $RUN complete---"
  except:
    - branches@cccma/classic
    - tags@cccma/classic

perform_run:
  stage: run
  script:
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN 
    - echo "---Submit $RUN---"
    - echo "KNOWN ISSUE - site level runs currently result in warnings coming from the submit scrip however the job .out files indicate the runs were successful."
    - /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/job_submit.sh
    - echo "---$RUN submitted---"
    - tools/regression_testing/sleepcheck.sh $( cat /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/job_id.txt )
    - echo "---Sleep check indicated $RUN is no longer active---"
    - ls
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/run_files
  except:
    - branches@cccma/classic
    - tags@cccma/classic

report_run:
  stage: report_run_results
  script:
    - echo "---Assess $RUN---"
    - echo "---and trigger pipeline failure on $RUN failure!---"
    - ls /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/run_files
    - cat /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/run_files/job_output.out
    - tools/regression_testing/submission_scripts/detect_job_error.sh -e /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/run_files/job_output.out kill abort error fail died SIGTERM signal
    - echo "---$RUN Assessment complete!---"
  except:
    - branches@cccma/classic
    - tags@cccma/classic

compare_run_checksums:
  stage: compare_checksums
  script:
    - echo "---Create compiled checksum file for $RUN---"
    - rm -rf /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/checksums.csv
    - . ssmuse-sh --verbose -x /fs/ssm/eccc/cmd/cmds/apps/mamba/master/mamba_2024.11.12_all
    - conda activate /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/conda/envs/classic_env
    - tools/regression_testing/regtest.py /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN
    - echo "---Assess checksums for $RUN---"
    - tools/regression_testing/verification.sh /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/cicd_for_classic/pipeline_outputs/$CI_COMMIT_SHA/$BUILD/$RUN/checksums.csv /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/classic_checksums/classic_pipeline_testcase_checksums/$BUILD-$RUN-checksums.csv
  except:
    - branches@cccma/classic
    - tags@cccma/classic
+134 −107
Original line number Diff line number Diff line
workflow:
  rules:
    - if: ($CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "web")

before_script:
 - source /home/scrd530/.profile
 - source $CCCMA_REF/env_setup_file

stages:
 - setup
 - build
 - submit
 - test
 - documentation
 - model_builds
 - model_runs

prepare_binary_folder:
  stage: setup
  script:
    - if [ -d "~/tmp/CLASSIC" ]; then
    -   rm -rf ~/tmp/CLASSIC/ctem_on
    -   rm -rf ~/tmp/CLASSIC/ctem_compete
    - else
    -   mkdir -p ~/tmp/CLASSIC/ctem_on
    -   mkdir -p ~/tmp/CLASSIC/ctem_compete
    - fi
    - echo "setup complete"
perform_builds:serial_gnu_build:
  stage: model_builds
  trigger:
    include: .gitlab-ci-build.yml
    strategy: depend
  parallel:
    matrix:
      - BUILD: "serial_gnu_build"
        MODE: "serial_gnu"
        DEBUG: "off"
        ICAN: 5
        ICC: 12
        TWELVEMAX: 3
  resource_group: build
  except:
    - branches@cccma/classic
    - tags@cccma/classic

compile:ctem_on:
  stage: build
  script:
    - cdir=$( pwd )
    - sed "/^executable/c\executable=$cdir/bin/CLASSIC_parallel_intel" tools/regression_testing/submission_scripts/job_submit.sh > ~/tmp/CLASSIC/ctem_on/tmp_ctem_on_submit.sh
    - cp Makefile ~/tmp/CLASSIC/ctem_on
    - cp -r src ~/tmp/CLASSIC/ctem_on
    - cd ~/tmp/CLASSIC/ctem_on
    - mkdir -p bin
    - . ssmuse-sh -x /fs/ssm/main/opt/intelcomp/inteloneapi-2022.1.2/intelcomp+mpi+mkl
    - . ssmuse-sh -x /fs/ssm/main/opt/hdf5-netcdf4/parallel/intelmpi-2022.1.2/static/inteloneapi-2022.1.2/01
    - sed -i 's/ican = 5/ican = 4/g' src/classicParams.F90
    - sed -i 's/icc = 12/icc = 9/g' src/classicParams.F90
    - /home/rec001/public/classic/make_classic.sh mode=parallel_intel
    - cp -r bin/CLASSIC_parallel_intel ~/tmp/CLASSIC/ctem_on
    - echo "ctem_on compilation complete"
perform_builds:parallel_intel_global_debug_build:
  stage: model_builds
  trigger:
    include: .gitlab-ci-build.yml
    strategy: depend
  parallel:
    matrix:
      - BUILD: "parallel_intel_global_debug_build"
        MODE: "parallel_intel"
        DEBUG: "on"
        ICAN: 4
        ICC: 9
        TWELVEMAX: 3
  needs: ["perform_builds:serial_gnu_build"]
  resource_group: build
  except:
    - branches@cccma/classic
    - tags@cccma/classic

compile:ctem_compete:
  stage: build
  script:
    - cdir=$( pwd )
    - sed "/^executable/c\executable=$cdir/bin/CLASSIC_parallel_intel_compete" tools/regression_testing/submission_scripts/job_submit.sh > ~/tmp/CLASSIC/ctem_compete/tmp_ctem_compete_submit.sh
    - cp Makefile ~/tmp/CLASSIC/ctem_compete
    - cp -r src ~/tmp/CLASSIC/ctem_compete
    - cd ~/tmp/CLASSIC/ctem_compete
    - mkdir -p bin
    - . ssmuse-sh -x /fs/ssm/main/opt/intelcomp/inteloneapi-2022.1.2/intelcomp+mpi+mkl
    - . ssmuse-sh -x /fs/ssm/main/opt/hdf5-netcdf4/parallel/intelmpi-2022.1.2/static/inteloneapi-2022.1.2/01
    - sed -i 's/ican = 5/ican = 4/g' src/classicParams.F90
    - sed -i 's/icc = 12/icc = 9/g' src/classicParams.F90
    - sed -i '/r8/a\        label=_compete' Makefile
    - /home/rec001/public/classic/make_classic.sh mode=parallel_intel
    - cp -r bin/CLASSIC_parallel_intel_compete ~/tmp/CLASSIC/ctem_compete
    - echo "ctem_compete compilation complete"
perform_builds:parallel_intel_global_12pft_debug_build:
  stage: model_builds
  trigger:
    include: .gitlab-ci-build.yml
    strategy: depend
  parallel:
    matrix:
      - BUILD: "parallel_intel_global_12pft_debug_build"
        MODE: "parallel_intel"
        DEBUG: "on"
        ICAN: 5
        ICC: 12
        TWELVEMAX: 3
  needs: ["perform_builds:serial_gnu_build"]
  resource_group: build
  except:
    - branches@cccma/classic
    - tags@cccma/classic

submit:ctem_on:
  stage: submit
  script:
    - tools/regression_testing/submission_scripts/tmp_ctem_on_submit.sh ctem_on
    - echo "job submitted"
    - rm -f /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/classic_checksums/ctem_on/checksums.csv
  dependencies:
    - compile:ctem_on
  artifacts:
    paths:
      - job_id.txt
perform_builds:parallel_intel_canada_debug_build:
  stage: model_builds
  trigger:
    include: .gitlab-ci-build.yml
    strategy: depend
  parallel:
    matrix:
      - BUILD: "parallel_intel_canada_debug_build"
        MODE: "parallel_intel"
        DEBUG: "on"
        ICAN: 5
        ICC: 15
        TWELVEMAX: 4
  needs: ["perform_builds:serial_gnu_build"]
  resource_group: build
  except:
    - branches@cccma/classic
    - tags@cccma/classic

submit:ctem_compete:
  stage: submit
  script:
    - tools/regression_testing/submission_scripts/tmp_ctem_compete_submit.sh ctem_compete
    - echo "job submitted"
    - rm -f /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/classic_checksums/ctem_compete/checksums.csv
  dependencies:
    - compile:ctem_compete
  artifacts:
    paths:
      - job_id.txt
perform_builds:serial_intel_debug_build:
  stage: model_builds
  trigger:
    include: .gitlab-ci-build.yml
    strategy: depend
  parallel:
    matrix:
      - BUILD: "serial_intel_debug_build"
        MODE: "serial_intel"
        DEBUG: "on"
        ICAN: 5
        ICC: 12
        TWELVEMAX: 3
  needs: ["perform_builds:serial_gnu_build"]
  resource_group: build
  except:
    - branches@cccma/classic
    - tags@cccma/classic

regression_test:ctem_on:
  stage: test
  script:
    - tools/regression_testing/sleepcheck.sh $( cat job_id.txt )
    - tools/regression_testing/regtest.py /space/hall5/sitestore/eccc/crd/ccrp/users/bip001 ctem_on
    - chmod 777 -R /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/classic_checksums/* 2>/dev/null || true
    - tools/regression_testing/verification.sh ctem_on
    - echo "regression test complete "
  dependencies:
    - submit:ctem_on


perform_runs:parallel_intel_global_debug_build:
  stage: model_runs
  trigger:
    include: .gitlab-ci-run.yml
    strategy: depend
  parallel:
    matrix:
      - RUN: "parallel_intel_global_debug_baseline"
        BUILD: "parallel_intel_global_debug_build"
        MODE: "parallel_intel"
        PARAMS: "domain=global"
  needs: ["perform_builds:parallel_intel_global_debug_build"]
  except:
    - branches@cccma/classic
    - tags@cccma/classic


regression_test:ctem_compete:
  stage: test
  script:
    - tools/regression_testing/sleepcheck.sh $( cat job_id.txt )
    - tools/regression_testing/regtest.py /space/hall5/sitestore/eccc/crd/ccrp/users/bip001 ctem_compete
    - chmod 777 -R /space/hall5/sitestore/eccc/crd/ccrp/users/scrd530/classic_checksums/* 2>/dev/null || true
    - tools/regression_testing/verification.sh ctem_compete
    - echo "regression test complete"
  dependencies:
    - submit:ctem_compete
perform_runs:parallel_intel_canada_debug_build:
  stage: model_runs
  trigger:
    include: .gitlab-ci-run.yml
    strategy: depend
  parallel:
    matrix:
      - RUN: "parallel_intel_canada_debug_baseline"
        BUILD: "parallel_intel_canada_debug_build"
        MODE: "parallel_intel"
        PARAMS: "domain=canada allLocalTime=.true."
  needs: ["perform_builds:parallel_intel_canada_debug_build"]
  except:
    - branches@cccma/classic
    - tags@cccma/classic

perform_runs:serial_intel_debug_build:
  stage: model_runs
  trigger:
    include: .gitlab-ci-run.yml
    strategy: depend
  parallel:
    matrix:
      - RUN: "serial_intel_debug_baseline"
        BUILD: "serial_intel_debug_build"
        MODE: "serial_intel"
        PARAMS: "domain=site site=CA-Mer allLocalTime=.true."
  needs: ["perform_builds:serial_intel_debug_build"]
  except:
    - branches@cccma/classic
    - tags@cccma/classic

pages:
  stage: build
  image: ubuntu
  script:
  - apt update
  - apt install doxygen perl texlive-latex-base -y -f -m
  - doxygen Doxyfile
  - mv documentation/html/ public/
  - rm -r -f documentation/html
  - rm -f bib*
  - rm -f citelist*
  artifacts:
    paths:
    - public
  only:
perform_runs:serial_gnu_build:
  stage: model_runs
  trigger:
    include: .gitlab-ci-run.yml
    strategy: depend
  parallel:
    matrix:
      - RUN: "serial_gnu_baseline"
        BUILD: "serial_gnu_build"
        MODE: "serial_gnu"
        PARAMS: "domain=site site=CA-Mer allLocalTime=.true."
  needs: ["perform_builds:serial_gnu_build"]
  except:
    - branches@cccma/classic
    - tags@cccma/classic
+3 −15
Original line number Diff line number Diff line
@@ -17,24 +17,12 @@ If a developer is adding to or changing the logic of the program, these regressi

This testing suite was designed to be run automatically in the continuous integration pipeline implemented on the supercomputer. Manual checksum testing can be done, but will require significant effort from the tester.

## Running the tests on the supercomputer

The regression tests will be performed whenever a commit is pushed to the code repository. If you are using your own fork of the repository, it is crucial that pipelines are enabled and that a runner is available to execute the commands. As of 2019/07/01, Shared Services has an account with a shared runner to be used for in-house projects, including CLASSIC. This is the runner that is enabled on the main CLASSIC repository. It is recommended that this same runner is used for other forks.

When you are finished with your changes to the code, commit and push them. The pipeline status can then be viewed from the GitLab web interface. If the pipeline passes, the regression tests were successful (and thus the checksums were unchanged). Again, if the changes to the code were meant to change the internal logic, then the checksums will fail, and that is ok. However, if the goal of the changes was structural, and the testing suite fails, then the changes should be reexamined.

## Running the tests manually

If these tests are being run outside of ECCC's supercomputer environment, then the only necessary file is `regtest.py`. A baseline checksum needs to be established, so this is best done before any changes are introduced. Run CLASSIC like normal, and note the output directory. Open `regtest.py`, and change the `output_directory` variable to the absolute path of your output directory. Then run `python3 regtest.py`. If you navigate to the output directory, there should now be a `checksums.csv` file. Copy this file somewhere else for reference.
If these tests are being run outside of the CLASSIC CI/CD pipeline or ECCC's supercomputer environment, then the only necessary file is `regtest.py`. A baseline checksum needs to be established, so this is best done before any changes are introduced. Run CLASSIC like normal, and note the output directory. Run `regtest.py` on the model run output directory. If you navigate to the output directory, there should now be a `checksums.csv` file. Copy this file somewhere else for reference.

After you have made non-logical changes to the code, run CLASSIC again. Be sure to use the same job options file, with the same input files. Repeat the process of running `regtest.py` on the output. You should have a new `checksums.csv` file in your output directory. The only step left is to use `diff [checksum_file_1] [checksum_file_2]` with the before-and-after checksum files. An empty diff result indicates a pass of the regression test (identical checksum files).

# Creating new test cases (supercomputer)

At the time of writing, there are currently three test cases being run in the pipeline: ctem_on, ctem_off, and ctem_compete. Each of these references a particular job options file as well as tasks in the pipeline. In order to create new test cases, we will add to these.
# CLASSIC CI/CD pipeline tests

* First, a job options file should be created. The current runpath for checksum testing is `/space/hall3/sitestore/eccc/crd/ccrp/scrd530/classic_checksums/`. Navigate to this runpath, and into the `input_files` subdirectory. For simplicity's sake, it is best to copy one of the existing job options files (to keep the same input netcdf files) and simply tune the parameters to the new test case. The new file should be named `job_options_[name_of_test_case].txt`.
* Next, we will make a new submission script. Navigate to `tools/regression_testing/submission_scripts/` in your repository, and copy one of the existing submission scripts. Rename it to `job_submit_[name_of_test_case].sh`. Only two lines in the submission script must be modified, and both are at the top:
 * `/space/hall3/sitestore/eccc/crd/ccrp/scrd530/classic_checksums/[name_of_test_case]`
 * `/space/hall3/sitestore/eccc/crd/ccrp/scrd530/classic_checksums/input_files/job_options_[name_of_test_case].txt`
* Finally, we will create a new task by modifying `.gitlab-ci.yml` in the root of the repository. Again, this is best done by copying and modifying an existing test case. Two tasks in total need to be added: a run and a test. As an example, copy the `run:ctem_on` and `regression_test:ctem_on` jobs. Wherever you see `ctem_on` in these new jobs, change it to `[name_of_test_case]`. Push the changes and see if your new test case works!
The test cases within the CLASSIC pipeline are documented within the CLASSIC internal gitlab Wiki [here](https://gitlab.science.gc.ca/CanESM/CLASSIC/-/wikis/CLASSIC-CICD-Pipeline).
+3 −2
Original line number Diff line number Diff line
@@ -3,12 +3,12 @@ import sys
import os
import shutil

# USE: regtest.py $RUNPATH test_name
# USE: regtest.py <model run path>

def main():

  # get the path where the netcdf folders are located
  output_directory = sys.argv[1] + '/classic_checksums/' + sys.argv[2]
  output_directory = sys.argv[1]
  internal_dirs = os.listdir(output_directory)
  files = []
  netdirs = []
@@ -62,3 +62,4 @@ def main():

if __name__ == '__main__':
    main()
Loading