Skip to content

Commit

Permalink
Merge pull request #125 from casparvl/update_CI_to_v020
Browse files Browse the repository at this point in the history
Update CI to use version 0.2.0 of the test suite
  • Loading branch information
satishskamath authored Mar 12, 2024
2 parents 98008a8 + 9523e3d commit 4faca32
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 30 deletions.
10 changes: 9 additions & 1 deletion CI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ It should define:
- `REFRAME_VERSION` (mandatory): the version of ReFrame you'd like to use to drive the EESSI test suite in the CI pipeline.
- `REFRAME_URL` (optional): the URL that will be used to `git clone` the ReFrame repository (in order to provide the `hpctestlib`). Typically this points to the official repository, but you may want to use another URL from a fork for development purposes. Default: `https://github.com/reframe-hpc/reframe.git`.
- `REFRAME_BRANCH` (optional): the branch name to be cloned for the ReFrame repository (in order to provide the `hpctestlib`). Typically this points to the branch corresponding with `${REFRAME_VERSION}`, unless you want to run from a feature branch for development purposes. Default: `v${REFRAME_VERSION}`.
- `EESSI_VERSION` (mandatory): the version of the EESSI software stack you would like to be loaded & tested in the CI pipeline.
- `EESSI_CVMFS_REPO` (optional): the prefix for the CVMFS repository to use, e.g. `/cvmfs/software.eessi.io`
- `EESSI_VERSION` (optional): the version of the EESSI software stack you would like to be loaded & tested in the CI pipeline.
- `EESSI_TESTSUITE_URL` (optional): the URL that will be used to `git clone` the `EESSI/test-suite` repository. Typically this points to the official repository, but you may want to use another URL from a fork for development purposes. Default: `https://github.com/EESSI/test-suite.git`.
- `EESSI_TESTSUITE_VERSION` (optional): the version of the EESSI test-suite repository you want to use in the CI pipeline. Default: latest release.
- `RFM_CONFIG_FILES` (optional): the location of the ReFrame configuration file to be used for this system. Default: `${TEMPDIR}/test-suite/config/${EESSI_CI_SYSTEM_NAME}.py`.
Expand All @@ -44,6 +45,13 @@ echo "0 0 * * SUN EESSI_CI_SYSTEM_NAME=aws_citc ${HOME}/test-suite/CI/run_refram
```
Would create a cronjob running weekly on Sundays. See the crontab manual for other schedules.

Note that you can overwrite the settings in the ci_config.sh by setting environment variables in the crontab. E.g. the following crontab file would run single node and 2-node tests daily, and 1, 2, 4, 8, and 16-node tests weekly (on Sundays):
```
# crontab file
0 0 * * * EESSI_CI_SYSTEM_NAME=aws_mc REFRAME_ARGS="--tag CI --tag 1_node|2_nodes" ${HOME}/test-suite/CI/run_reframe_wrapper.sh
0 0 * * SUN EESSI_CI_SYSTEM_NAME=aws_mc REFRAME_ARGS="--tag CI --tag 1_node|2_nodes|4_nodes|8_nodes|16_nodes" ${HOME}/test-suite/CI/run_reframe_wrapper.sh
```

## Output of the CI pipeline
The whole point of the `run_reframe_wrapper.sh` script is to easily get the stdout and stderr from your `run_reframe.sh` in a time-stamped logfile. By default, these are stored in `${HOME}/EESSI_CI_LOGS`. This can be changed by setting the environment variable `EESSI_CI_LOGDIR`. Again, you'd have to set this when creating your `crontab` file, e.g.
```
Expand Down
3 changes: 0 additions & 3 deletions CI/aws_citc/ci_config.sh

This file was deleted.

13 changes: 7 additions & 6 deletions CI/aws_mc/ci_config.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Configurable items
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
REFRAME_VERSION=4.4.1 # ReFrame version that will be pip-installed to drive the test suite
# Latest release does not contain the `aws_mc.py` ReFrame config yet
# The custom EESSI_TESTSUITE_URL and EESSI_TESTSUITE_BRANCH can be removed in a follow-up PR
EESSI_TESTSUITE_URL='https://github.com/casparvl/test-suite.git'
EESSI_TESTSUITE_BRANCH='CI'
if [ -z "${REFRAME_ARGS}" ]; then
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
fi
# For now, software.eessi.io is not yet deployed on login nodes of the AWS MC cluster
if [ -z "${EESSI_CVMFS_REPO}" ]; then
EESSI_CVMFS_REPO="/cvmfs/pilot.eessi-hpc.org"
fi
9 changes: 3 additions & 6 deletions CI/it4i_karolina/ci_config.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Configurable items
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
REFRAME_VERSION=4.4.1 # ReFrame version that will be pip-installed to drive the test suite
# Latest release does not contain the `aws_mc.py` ReFrame config yet
# The custom EESSI_TESTSUITE_URL and EESSI_TESTSUITE_BRANCH can be removed in a follow-up PR
EESSI_TESTSUITE_URL='https://github.com/casparvl/test-suite.git'
EESSI_TESTSUITE_BRANCH='CI'
if [ -z "${REFRAME_ARGS}" ]; then
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
fi
5 changes: 3 additions & 2 deletions CI/izum_vega/ci_config.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Configurable items
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
REFRAME_VERSION=4.4.1 # ReFrame version that will be pip-installed to drive the test suite
if [ -z "${REFRAME_ARGS}" ]; then
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
fi
27 changes: 17 additions & 10 deletions CI/run_reframe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,40 @@
# Setup instructions: make sure you have your github access key configured in your .ssh/config
# i.e. configure an entry with HostName github.com and IdentityFile pointing to the ssh key registered with Github

# Print on which host this CI is running
echo "Running CI on host $(hostname)"

# Get directory of the current script
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

echo $SCRIPT_DIR
# Check if EESSI_CI_SYSTEM_NAME is defined
if [ -z "${EESSI_CI_SYSTEM_NAME}" ]; then
echo "You have to define the EESSI_CI_SYSTEM_NAME environment variable in order to run the EESSI test suite CI" > /dev/stderr
echo "Valid EESSI_CI_SYSTEM_NAME's are:"
echo "$(find $SCRIPT_DIR -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)"
exit 1
fi

# Check if CI_CONFIG file file exists
CI_CONFIG="${SCRIPT_DIR}/${EESSI_CI_SYSTEM_NAME}/ci_config.sh"
if [ ! -f "${CI_CONFIG}" ]; then
echo "File ${CI_CONFIG} does not exist. Please check your RFM_CI_SYSTEM_NAME (${EESSI_CI_SYSTEM_NAME}) and make sure the directory in which the current script resides (${SCRIPT_DIR}) contains a subdirectory with that name, and a CI configuration file (ci_config.sh) inside". > /dev/stderr
echo "File ${CI_CONFIG} does not exist. Please check your EESSI_CI_SYSTEM_NAME (${EESSI_CI_SYSTEM_NAME}) and make sure the directory in which the current script resides (${SCRIPT_DIR}) contains a subdirectory with that name, and a CI configuration file (ci_config.sh) inside". > /dev/stderr
exit 1
fi

# Set the CI configuration for this system
source "${CI_CONFIG}"

# Set default configuration
# Set default configuration, but let anything set by CI_CONFIG take priority
if [ -z "${TEMPDIR}" ]; then
TEMPDIR=$(mktemp --directory --tmpdir=/tmp -t rfm.XXXXXXXXXX)
fi
if [ -z "${REFRAME_ARGS}" ]; then
REFRAME_ARGS="--tag CI --tag 1_node"
fi
if [ -z "${REFRAME_VERSION}"]; then
REFRAME_VERSION=4.5.1
fi
if [ -z "${REFRAME_URL}" ]; then
REFRAME_URL='https://github.com/reframe-hpc/reframe.git'
fi
Expand All @@ -40,10 +48,13 @@ if [ -z "${EESSI_TESTSUITE_URL}" ]; then
EESSI_TESTSUITE_URL='https://github.com/EESSI/test-suite.git'
fi
if [ -z "${EESSI_TESTSUITE_BRANCH}" ]; then
EESSI_TESTSUITE_BRANCH='v0.1.0'
EESSI_TESTSUITE_BRANCH='v0.2.0'
fi
if [ -z "${EESSI_CVMFS_REPO}" ]; then
export EESSI_CVMFS_REPO=/cvmfs/software.eessi.io
fi
if [ -z "${EESSI_VERSION}" ]; then
EESSI_VERSION='latest'
export EESSI_VERSION=2023.06
fi
if [ -z "${RFM_CONFIG_FILES}" ]; then
export RFM_CONFIG_FILES="${TEMPDIR}/test-suite/config/${EESSI_CI_SYSTEM_NAME}.py"
Expand Down Expand Up @@ -74,11 +85,7 @@ export PYTHONPATH="${PYTHONPATH}":"${TEMPDIR}"/test-suite/

# Start the EESSI environment
unset MODULEPATH
if [ "${EESSI_VERSION}" = 'latest' ]; then
eessi_init_path=/cvmfs/pilot.eessi-hpc.org/latest/init/bash
else
eessi_init_path=/cvmfs/pilot.eessi-hpc.org/versions/"${EESSI_VERSION}"/init/bash
fi
eessi_init_path="${EESSI_CVMFS_REPO}"/versions/"${EESSI_VERSION}"/init/bash
source "${eessi_init_path}"

# Needed in order to make sure the reframe from our TEMPDIR is first on the PATH,
Expand Down
5 changes: 3 additions & 2 deletions CI/surf_snellius/ci_config.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Configurable items
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
REFRAME_VERSION=4.4.1 # ReFrame version that will be pip-installed to drive the test suite
if [ -z "${REFRAME_ARGS}" ]; then
REFRAME_ARGS="--tag CI --tag 1_node|2_nodes"
fi

0 comments on commit 4faca32

Please sign in to comment.