Skip to content

Commit

Permalink
Merge pull request #100 from lanl/rberger/ats4
Browse files Browse the repository at this point in the history
Add ATS4 CI
  • Loading branch information
rbberger authored Sep 30, 2024
2 parents 4495030 + 831dd3d commit 77bfdb7
Show file tree
Hide file tree
Showing 6 changed files with 500 additions and 58 deletions.
71 changes: 42 additions & 29 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,62 @@
stages:
- build_n_test

default:
interruptible: true

variables:
ENABLED_CLUSTERS: "darwin"
GIT_SUBMODULE_STRATEGY: normal
PROJECT_NAME: spiner
ENABLE_CDASH: false

.ascgit_job:
id_tokens:
SITE_ID_TOKEN:
aud: https://asc-git.lanl.gov
include:
- .gitlab/common.yml

.darwin_job:
rules:
- if: $ENABLED_CLUSTERS =~ /darwin/
variables:
CLUSTER: darwin
SCHEDULER_PARAMETERS: "-N 1 --qos=debug -p general,skylake-gold,skylake-platinum --constraint=\"(cpu_family:skylake)&ib:edr\""
tags:
- darwin-slurm-shared

.build_and_test:
########
# Jobs #
########

prereq_offline_deps:
stage: build_n_test
extends: [.ascgit_job]
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "push"
needs: []
script:
- source .gitlab/build_and_test.sh ${CLUSTER} ${SPACK_ENV_NAME}
- mkdir extern
- git clone --bare https://gitlab-ci-token:${CI_JOB_TOKEN}@re-git.lanl.gov/xcap/oss/ports-of-call.git extern/ports-of-call.git
artifacts:
expire_in: 2 weeks
expire_in: 2 days
paths:
- ${CI_PROJECT_DIR}/build/tests.xml
reports:
junit: ${CI_PROJECT_DIR}/build/tests.xml

########
# Jobs #
########
- extern

openmpi_gcc:
extends: [.ascgit_job, .darwin_job, .build_and_test]
extends: [.ascgit_job, .darwin_job, .darwin_regular_job, .build_and_test]
variables:
SPACK_ENV_NAME: openmpi-gcc

openmpi_cuda_gcc_volta:
extends: [.ascgit_job, .darwin_job, .darwin_regular_job, .build_and_test]
variables:
SPACK_ENV_NAME: openmpi-cuda-gcc-volta
SCHEDULER_PARAMETERS: "-N 1 --qos=debug -p volta-x86 -C cpu_family:haswell --time=02:00:00"

openmpi_cuda_gcc_ampere:
extends: [.ascgit_job, .darwin_job, .build_and_test]
extends: [.ascgit_job, .darwin_job, .darwin_regular_job, .build_and_test]
variables:
SPACK_ENV_NAME: openmpi-cuda-gcc-ampere
SCHEDULER_PARAMETERS: "-N 1 --qos=debug -p shared-gpu-ampere"

rzvernal_craympich_rocm_mi250_gcc:
extends: [.ascgit_job, .rzadams_job, .rzvernal_regular_job, .build_and_test]
needs:
- prereq_offline_deps
variables:
SPACK_ENV_NAME: craympich-rocm-gfx90a-gcc

rzadams_craympich_rocm_mi300_gcc:
extends: [.ascgit_job, .rzadams_job, .rzadams_regular_job, .build_and_test]
needs:
- prereq_offline_deps
variables:
SPACK_ENV_NAME: craympich-rocm-gfx942-gcc
75 changes: 75 additions & 0 deletions .gitlab/build_and_test.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
set(CTEST_SOURCE_DIRECTORY "$ENV{SOURCE_DIR}")
set(CTEST_BINARY_DIRECTORY "$ENV{BUILD_DIR}")
set(CTEST_PROJECT_NAME "$ENV{PROJECT_NAME}")


set(CTEST_SITE "$ENV{SYSTEM_NAME}")
set(CTEST_BUILD_NAME "$ENV{SPACK_ENV_NAME}")

set(CTEST_SUBMIT_URL "$ENV{CDASH_SERVER_URL}/submit.php?project=${CTEST_PROJECT_NAME}")
set(CTEST_CURL_OPTIONS CURLOPT_SSL_VERIFYPEER_OFF CURLOPT_SSL_VERIFYHOST_OFF)
set(CTEST_NIGHTLY_START_TIME "22:00:00 MDT")
set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 1024000)
set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 1024000)

set(CTEST_UPDATE_COMMAND "git")
set(CTEST_GIT_UPDATE_CUSTOM "${CMAKE_COMMAND}" "-E" "echo" "Skipping git update (no-op).")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_BUILD_CONFIGURATION "RelWithDebInfo")

set(CTEST_MODE "$ENV{CTEST_MODE}")

set(CTEST_OUTPUT_ON_FAILURE ON)
set(CTEST_USE_LAUNCHERS TRUE)

cmake_host_system_information(RESULT NUM_PHYSICAL_CORES QUERY NUMBER_OF_PHYSICAL_CORES)

if(${NUM_PHYSICAL_CORES} EQUAL 1)
# workaround for GraceHopper
include(ProcessorCount)
ProcessorCount(NUM_PHYSICAL_CORES)
endif()

if(${CTEST_SCRIPT_ARG} MATCHES Configure)
ctest_start(${CTEST_MODE})
else()
ctest_start(${CTEST_MODE} APPEND)
endif()

if(${CTEST_SCRIPT_ARG} MATCHES Configure)
ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}")
ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE configure_error)

if(configure_error)
if(${CTEST_SCRIPT_ARG} MATCHES ReportErrors)
ctest_submit()
endif()
message(FATAL_ERROR "configure error")
endif()
endif()

if(${CTEST_SCRIPT_ARG} MATCHES Build)
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL ${NUM_PHYSICAL_CORES} RETURN_VALUE build_error)

if(build_error)
if(${CTEST_SCRIPT_ARG} MATCHES ReportErrors)
ctest_submit()
endif()
message(FATAL_ERROR "build error")
endif()
endif()

if(${CTEST_SCRIPT_ARG} MATCHES Test)
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" OUTPUT_JUNIT tests.xml RETURN_VALUE test_error)

if(test_error)
if(${CTEST_SCRIPT_ARG} MATCHES ReportErrors)
ctest_submit()
endif()
message(FATAL_ERROR "test error")
endif()
endif()

if(${CTEST_SCRIPT_ARG} MATCHES Submit)
ctest_submit()
endif()
Loading

0 comments on commit 77bfdb7

Please sign in to comment.