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

CI updates #299

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Changes from all commits
Commits
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
21 changes: 13 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,23 @@ variables:
SINGULARITY_EOS_CUDA_VERSION: "11.6.0"
SINGULARITY_EOS_BUILD_TYPE: "RelWithDebInfo"
SINGULARITY_EOS_SPACK_SPEC: "singularity-eos@main+mpi+hdf5+python+tests%gcc@${SINGULARITY_EOS_GCC_VERSION} ^openmpi@${SINGULARITY_EOS_OPENMPI_VERSION}"
COLOR_CYAN: '\033[1;36m'
COLOR_PLAIN: '\033[0m'
COLOR_CYAN: "\e[1;36m"
COLOR_PLAIN: "\e[0m"
# set to different spack upstream for testing
SINGULARITY_EOS_TEMP_SPACK_DIR: ""
# uncomment for debugging the CI and persist the Spack installation
# SPACK_USER_CACHE_PATH: "${CI_PROJECT_DIR}/spack-local"
# DEVEL_SPACK_CHECKOUT: "${CI_PROJECT_DIR}/spack"

before_script:
- echo "Running on $(hostname)"
- section() { echo $'\e[0K'"section_$1:$(date +%s):$2"$'\r\e[0K'"${3+${COLOR_CYAN}$3${COLOR_PLAIN}}"; }
- export PYTHONNOUSERSITE=1
- export SPACK_DISABLE_LOCAL_CONFIG=true
- export SPACK_USER_CACHE_PATH=${SPACK_USER_CACHE_PATH:-/tmp/spack-local}
- export DEVEL_SPACK_CHECKOUT=${DEVEL_SPACK_CHECKOUT:-/tmp/spack}
- export SINGULARITY_EOS_SPACK_DIR=${SINGULARITY_EOS_TEMP_SPACK_DIR:=$XCAP_OSS_SPACK_DIR}
- echo -e "\e[0Ksection_start:`date +%s`:spack_init[collapsed=true]\r\e[0K${COLOR_CYAN}Creating Spack instance at ${DEVEL_SPACK_CHECKOUT}${COLOR_PLAIN}"
- section start "spack_init[collapsed=true]" "Creating Spack instance at ${DEVEL_SPACK_CHECKOUT}"
- |
rsync -rpl \
--exclude=".git" \
Expand All @@ -39,7 +41,7 @@ before_script:
- source ${DEVEL_SPACK_CHECKOUT}/share/spack/setup-env.sh
- spack --version
- spack compiler list
- echo -e "\e[0Ksection_end:`date +%s`:spack_init\r\e[0K"
- section end spack_init

##########################
# Build Matrix Variables #
Expand Down Expand Up @@ -81,6 +83,9 @@ before_script:
#################

.job: &job_def
id_tokens:
SITE_ID_TOKEN:
aud: https://re-git.lanl.gov
tags:
- darwin-slurm-shared
variables:
Expand All @@ -106,17 +111,17 @@ before_script:
- |
if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]];
then
echo -e "\e[0Ksection_start:`date +%s`:spack_build[collapsed=true]\r\e[0K${COLOR_CYAN}Building via Spack${COLOR_PLAIN}"
section start "spack_build[collapsed=true]" "Building via Spack"
mkdir -p spack_build_env
spack env create spack_build_env
spack env activate spack_build_env
spack repo add spack-repo
spack config add upstreams:default:install_tree:${SINGULARITY_EOS_SPACK_DIR}/opt/spack/
spack dev-build -j $(nproc) ${SINGULARITY_EOS_SPACK_SPEC}
spack env deactivate
echo -e "\e[0Ksection_end:`date +%s`:spack_build\r\e[0K"
section end spack_build
fi
- echo -e "\e[0Ksection_start:`date +%s`:spack_env[collapsed=true]\r\e[0K${COLOR_CYAN}Creating Spack environment${COLOR_PLAIN}"
- section start "spack_env[collapsed=true]" "Creating Spack environment"
- mkdir -p spack_env
- spack env create spack_env
- spack env activate spack_env
Expand All @@ -125,7 +130,7 @@ before_script:
- spack spec -I ${SINGULARITY_EOS_SPACK_SPEC}
- spack add ${SINGULARITY_EOS_SPACK_SPEC}
- spack install -j $(nproc) --show-log-on-error --no-checksum --yes-to-all -u cmake
- echo -e "\e[0Ksection_end:`date +%s`:spack_env\r\e[0K"
- section end spack_env
- |
if [[ -n ${SINGULARITY_USE_CUDA} ]];
then
Expand Down
Loading