Skip to content

Commit

Permalink
contrib/intel/jenkins: Move install location to jenkinsworkspace
Browse files Browse the repository at this point in the history
Install location is moving to jenkinsworkspace to reduce the amount
of directory changes to non-jenkins controller controlled areas.

Signed-off-by: Zach Dworkin <zachary.dworkin@intel.com>
  • Loading branch information
zachdworkin committed Jan 8, 2024
1 parent 01efcdf commit c8a5c8e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 27 deletions.
7 changes: 1 addition & 6 deletions contrib/intel/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,10 @@ pipeline {
}
environment {
JOB_CADENCE = 'PR'
LOG_DIR = "${env.JOB_INSTALL_DIR}/${env.JOB_NAME}/${env.BUILD_NUMBER}/log_dir"
WITH_ENV="'PATH+EXTRA=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:$PYTHONPATH'"
DELETE_LOCATION="${env.JOB_INSTALL_DIR}/${env.JOB_NAME}/${env.BUILD_NUMBER}"
RUN_LOCATION="${env.WORKSPACE}/${SCRIPT_LOCATION}/"
CUSTOM_WORKSPACE="${CB_HOME}/workspace/${JOB_NAME}/${env.BUILD_NUMBER}"
LOG_DIR = "${env.CUSTOM_WORKSPACE}/log_dir"
}
stages {
stage ('checkout') {
Expand Down Expand Up @@ -768,7 +767,6 @@ pipeline {
}
aborted {
node ('daos_head') {
dir ("${DELETE_LOCATION}/middlewares") { deleteDir() }
}
node ('ze') {
dir ("${DELETE_LOCATION}/middlewares") { deleteDir() }
Expand All @@ -777,16 +775,13 @@ pipeline {
}
cleanup {
node ('daos_head') {
dir ("${DELETE_LOCATION}") { deleteDir() }
dir("${env.WORKSPACE}") { deleteDir() }
dir("${env.WORKSPACE}@tmp") { deleteDir() }
}
node ('ze') {
dir("${DELETE_LOCATION}") { deleteDir() }
dir("${env.WORKSPACE}") { deleteDir() }
dir("${env.WORKSPACE}@tmp") { deleteDir() }
}
dir("${DELETE_LOCATION}") { deleteDir() }
dir("${env.WORKSPACE}") { deleteDir() }
dir("${env.WORKSPACE}@tmp") { deleteDir() }
}
Expand Down
13 changes: 6 additions & 7 deletions contrib/intel/jenkins/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def log_dir(install_path, release=False):
jobname = os.environ['JOB_NAME']
buildno = os.environ['BUILD_NUMBER']
workspace = os.environ['WORKSPACE']
custom_workspace = os.environ['CUSTOM_WORKSPACE']

parser = argparse.ArgumentParser()
parser.add_argument('--build_item', help="build libfabric or fabtests", \
Expand Down Expand Up @@ -184,9 +185,7 @@ def log_dir(install_path, release=False):
else:
ofi_build_mode = 'reg'

install_path = f'{cloudbees_config.install_dir}/{jobname}/{buildno}'
libfab_install_path = f'{cloudbees_config.install_dir}/{jobname}/'\
f'{buildno}/{build_hw}/{ofi_build_mode}'
libfab_install_path = f'{custom_workspace}/{build_hw}/{ofi_build_mode}'

p = re.compile('mpi*')

Expand All @@ -198,11 +197,11 @@ def log_dir(install_path, release=False):
elif (build_item == 'fabtests'):
build_fabtests(libfab_install_path, ofi_build_mode)
elif (build_item == 'builddir'):
copy_build_dir(install_path)
copy_build_dir(custom_workspace)
elif (build_item == 'logdir'):
log_dir(install_path, release)
log_dir(custom_workspace, release)
elif(build_item == 'mpich'):
build_mpich(install_path, libfab_install_path, build_hw)
build_mpich_osu(install_path, libfab_install_path, build_hw)
build_mpich(custom_workspace, libfab_install_path, build_hw)
build_mpich_osu(custom_workspace, libfab_install_path, build_hw)

os.chdir(curr_dir)
10 changes: 6 additions & 4 deletions contrib/intel/jenkins/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from email import encoders

# add jenkins config location to PATH
sys.path.append(f"{os.environ['WORKSPACE']}/ci_resources/configs/{os.environ['CLUSTER']}")
sys.path.append(f"{os.environ['CUSTOM_WORKSPACE']}/ci_resources/configs/{os.environ['CLUSTER']}")

import cloudbees_config
import argparse
Expand Down Expand Up @@ -769,7 +769,8 @@ def read_file(self):
self.check_line(line)

def get_release_num():
file_name = f'{os.environ["WORKSPACE"]}/source/release_num.txt'
file_name = f'{os.environ["CUSTOM_WORKSPACE"]}/source/libfabric/'\
'release_num.txt'
if os.path.exists(file_name):
with open(file_name) as f:
num = f.readline()
Expand Down Expand Up @@ -921,6 +922,7 @@ def summarize_items(summary_item, logger, log_dir, mode):
jobname = os.environ['JOB_NAME']
buildno = os.environ['BUILD_NUMBER']
workspace = os.environ['WORKSPACE']
custom_workspace = os.environ['CUSTOM_WORKSPACE']

parser = argparse.ArgumentParser()
parser.add_argument('--summary_item', help="functional test to summarize",
Expand All @@ -945,7 +947,7 @@ def summarize_items(summary_item, logger, log_dir, mode):
send_mail = args.send_mail

mpi_list = ['impi', 'mpich', 'ompi']
log_dir = f'{cloudbees_config.install_dir}/{jobname}/{buildno}/log_dir'
log_dir = f'{custom_workspace}/log_dir'
if (not os.path.exists(log_dir)):
os.makedirs(log_dir)

Expand Down Expand Up @@ -981,7 +983,7 @@ def summarize_items(summary_item, logger, log_dir, mode):
err += summarize_items(summary_item, logger, log_dir, mode)

if (release):
shutil.copyfile(f'{full_file_name}', f'{workspace}/{output_name}')
shutil.copyfile(f'{full_file_name}', f'{custom_workspace}/{output_name}')

if (send_mail):
SendEmail(sender = os.environ['SENDER'],
Expand Down
16 changes: 6 additions & 10 deletions contrib/intel/jenkins/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,12 @@ def __init__ (self, jobname, buildno, testname, hw, core_prov, fabric,
self.client = hosts[1]

self.nw_interface = cloudbees_config.interface_map[self.fabric]
self.libfab_installpath = f'{cloudbees_config.install_dir}/'\
f'{self.jobname}/{self.buildno}/{self.hw}/'\
f'{self.ofi_build_mode}'

self.middlewares_path = f'{cloudbees_config.install_dir}/'\
f'{self.jobname}/{self.buildno}/'\
'middlewares'
self.ci_logdir_path = f'{cloudbees_config.install_dir}/'\
f'{self.jobname}/{self.buildno}/'\
'log_dir'
self.custom_workspace = os.environ['CUSTOM_WORKSPACE']
self.libfab_installpath = f'{self.custom_workspace}/'\
f'{self.hw}/{self.ofi_build_mode}'

self.middlewares_path = f'{self.custom_workspace}/middlewares'
self.ci_logdir_path = f'{self.custom_workspace}/log_dir'
self.env = user_env
self.way = way

Expand Down

0 comments on commit c8a5c8e

Please sign in to comment.