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

[1.21.x] contrib/intel/jenkins: Pick migration of Intel CI scripts and new CI Module #9977

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
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
105 changes: 74 additions & 31 deletions contrib/intel/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import groovy.transform.Field
properties([disableConcurrentBuilds(abortPrevious: true)])
@Field def DO_RUN=true
@Field def TARGET="main"
@Field def SCRIPT_LOCATION="upstream/libfabric/contrib/intel/jenkins"
@Field def RELEASE=false
@Field def BUILD_MODES=["reg", "dbg", "dl"]
@Field def PYTHON_VERSION="3.9"
Expand Down Expand Up @@ -94,6 +93,14 @@ def run_middleware(providers, stage_name, test, hw, partition, node_num,
}
}

def run_ci(stage_name, config_name) {
sh """source ${CI_LOCATION}/${env.CI_MODULE}/venv/bin/activate;\
python run.py \
--output=${env.LOG_DIR}/${stage_name} \
--job=${config_name}
"""
}

def gather_logs(cluster, key, dest, source) {
def address = "${env.USER}@${cluster}"

Expand Down Expand Up @@ -160,9 +167,22 @@ def checkout_ci_resources() {
"""
}

def checkout_ci() {
sh """
if [[ ! -d ${env.WORKSPACE}/ci ]]; then
mkdir ${env.WORKSPACE}/ci
else
rm -rf ${env.WORKSPACE}/ci && mkdir ${env.WORKSPACE}/ci
fi

git clone --recurse-submodules ${env.CI} ${env.WORKSPACE}/ci
"""
}

def checkout_external_resources() {
checkout_ci_resources()
checkout_upstream()
checkout_ci()
}

def generate_diff(def branch_name, def output_loc) {
Expand Down Expand Up @@ -241,6 +261,10 @@ def build(item, mode=null, hw=null, additional_args=null) {
run_python(PYTHON_VERSION, cmd)
}

def build_ci() {
sh "${CI_LOCATION}/${env.CI_MODULE}/bootstrap.sh"
}

def check_target() {
echo "CHANGE_TARGET = ${env.CHANGE_TARGET}"
if (changeRequest()) {
Expand Down Expand Up @@ -320,9 +344,10 @@ pipeline {
environment {
JOB_CADENCE = 'PR'
WITH_ENV="'PATH+EXTRA=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:$PYTHONPATH'"
RUN_LOCATION="${env.WORKSPACE}/${SCRIPT_LOCATION}/"
CUSTOM_WORKSPACE="${CB_HOME}/workspace/${JOB_NAME}/${env.BUILD_NUMBER}"
DELETE_LOCATION="${env.CUSTOM_WORKSPACE}/middlewares"
RUN_LOCATION="${env.CUSTOM_WORKSPACE}/ci_resources/legacy_pipeline_scripts/"
CI_LOCATION="${env.CUSTOM_WORKSPACE}/ci"
LOG_DIR = "${env.CUSTOM_WORKSPACE}/log_dir"
}
stages {
Expand Down Expand Up @@ -395,7 +420,17 @@ pipeline {
stage ('parallel-builds') {
when { equals expected: true, actual: DO_RUN }
parallel {
stage ('build-ci') {
steps {
script {
build_ci()
}
}
}
stage ('build-water') {
environment {
build_type = "water"
}
steps {
script {
slurm_build(BUILD_MODES, "water", "water", "water")
Expand All @@ -413,6 +448,9 @@ pipeline {
}
}
stage ('build-grass') {
environment {
build_type = "grass"
}
steps {
script {
slurm_build(BUILD_MODES, "grass", "grass", "grass")
Expand All @@ -430,6 +468,9 @@ pipeline {
}
}
stage ('build-electric') {
environment {
build_type = "electric"
}
steps {
script {
slurm_build(BUILD_MODES, "electric", "electric", "electric")
Expand Down Expand Up @@ -506,48 +547,50 @@ pipeline {
stage('parallel-tests') {
when { equals expected: true, actual: DO_RUN }
parallel {
stage('MPI_verbs-rxm_IMB') {
stage ('CI_MPI_verbs-rxm_IMB') {
environment {
build_type = "water"
}
steps {
script {
dir (RUN_LOCATION) {
def providers = [["verbs", "rxm"]]
for (def mpi in ["impi"]) {
for (imb_grp = 1; imb_grp < 4; imb_grp++) {
run_middleware(providers, "MPI", "IMB", "water",
"squirtle,totodile", "2", "${mpi}",
"${imb_grp}")
}
}
dir (CI_LOCATION) {
run_ci("CI_MPI_verbs-rxm_IMB", "pr_imb_water.json")
}
}
}
}
stage('MPI_verbs-rxm_OSU') {
stage ('CI_MPI_verbs-rxm_OSU') {
environment {
build_type = "water"
}
steps {
script {
dir (RUN_LOCATION) {
def providers = [["verbs", "rxm"]]
for (def mpi in ["impi", "mpich"]) {
run_middleware(providers, "MPI", "osu", "water",
"squirtle,totodile", "2", "${mpi}")
}
dir (CI_LOCATION) {
run_ci("CI_MPI_verbs-rxm_OSU", "pr_osu_water.json")
}
}
}
}
stage('MPI_tcp') {
stage ('CI_MPI_tcp_IMB') {
environment {
build_type = "grass"
}
steps {
script {
dir (RUN_LOCATION) {
def providers = [["tcp", null]]
for (imb_grp = 1; imb_grp < 4; imb_grp++) {
run_middleware(providers, "MPI", "IMB", "grass",
"bulbasaur", "2", "impi", "${imb_grp}")
}
for (def mpi in ["impi", "mpich"]) {
run_middleware(providers, "MPI", "osu", "grass", "bulbasaur",
"2", "${mpi}")
}
dir (CI_LOCATION) {
run_ci("CI_MPI_tcp_IMB", "pr_imb_grass.json")
}
}
}
}
stage ('CI_MPI_tcp_OSU') {
environment {
build_type = "grass"
}
steps {
script {
dir (CI_LOCATION) {
run_ci("CI_MPI_tcp_OSU", "pr_osu_grass.json")
}
}
}
Expand Down Expand Up @@ -766,7 +809,7 @@ pipeline {
options { skipDefaultCheckout() }
steps {
script {
dir ("${env.WORKSPACE}/${SCRIPT_LOCATION}/") {
dir (RUN_LOCATION) {
dmabuf_output = "${LOG_DIR}/DMABUF-Tests_verbs-rxm_dmabuf"
cmd = """ python3.9 runtests.py --test=dmabuf \
--prov=verbs --util=rxm --build_hw=gpu"""
Expand Down
7 changes: 5 additions & 2 deletions contrib/intel/jenkins/README
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Introduction
============
Jenkins is a CI/CD (Continuous Integration/Continuous Development) Pipelining tool that Intel uses to test code changes to libfabric. It follows the Jenkinsfile pipeline stages to build, test, and cleanup resources.
Jenkins is a CI/CD (Continuous Integration/Continuous Development) Pipelining
tool that Intel uses to test code changes to libfabric. It follows the
Jenkinsfile pipeline stages to build, test, and cleanup resources.

The runtime flow generally follows, Jenkinsfile -> build.py -> runtests.py -> run.py -> tests.py.
The scripts that this pipeline uses are stored in an internal Intel CI
repository.

Tests, Middlewares and Libraries supported by Intel CI/CD are:
Fabtests
Expand Down
Loading