Skip to content

Commit e9f89ac

Browse files
committed
contrib/intel/jenkins: Move install location to jenkinsworkspace
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>
1 parent 2ef4de4 commit e9f89ac

File tree

4 files changed

+19
-27
lines changed

4 files changed

+19
-27
lines changed

contrib/intel/jenkins/Jenkinsfile

+1-6
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,10 @@ pipeline {
309309
}
310310
environment {
311311
JOB_CADENCE = 'PR'
312-
LOG_DIR = "${env.JOB_INSTALL_DIR}/${env.JOB_NAME}/${env.BUILD_NUMBER}/log_dir"
313312
WITH_ENV="'PATH+EXTRA=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:$PYTHONPATH'"
314-
DELETE_LOCATION="${env.JOB_INSTALL_DIR}/${env.JOB_NAME}/${env.BUILD_NUMBER}"
315313
RUN_LOCATION="${env.WORKSPACE}/${SCRIPT_LOCATION}/"
316314
CUSTOM_WORKSPACE="${CB_HOME}/workspace/${JOB_NAME}/${env.BUILD_NUMBER}"
315+
LOG_DIR = "${env.CUSTOM_WORKSPACE}/log_dir"
317316
}
318317
stages {
319318
stage ('checkout') {
@@ -777,7 +776,6 @@ pipeline {
777776
}
778777
aborted {
779778
node ('daos_head') {
780-
dir ("${DELETE_LOCATION}/middlewares") { deleteDir() }
781779
}
782780
node ('ze') {
783781
dir ("${DELETE_LOCATION}/middlewares") { deleteDir() }
@@ -786,16 +784,13 @@ pipeline {
786784
}
787785
cleanup {
788786
node ('daos_head') {
789-
dir ("${DELETE_LOCATION}") { deleteDir() }
790787
dir("${env.WORKSPACE}") { deleteDir() }
791788
dir("${env.WORKSPACE}@tmp") { deleteDir() }
792789
}
793790
node ('ze') {
794-
dir("${DELETE_LOCATION}") { deleteDir() }
795791
dir("${env.WORKSPACE}") { deleteDir() }
796792
dir("${env.WORKSPACE}@tmp") { deleteDir() }
797793
}
798-
dir("${DELETE_LOCATION}") { deleteDir() }
799794
dir("${env.WORKSPACE}") { deleteDir() }
800795
dir("${env.WORKSPACE}@tmp") { deleteDir() }
801796
}

contrib/intel/jenkins/build.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def log_dir(install_path, release=False):
155155
jobname = os.environ['JOB_NAME']
156156
buildno = os.environ['BUILD_NUMBER']
157157
workspace = os.environ['WORKSPACE']
158+
custom_workspace = os.environ['CUSTOM_WORKSPACE']
158159

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

187-
install_path = f'{cloudbees_config.install_dir}/{jobname}/{buildno}'
188-
libfab_install_path = f'{cloudbees_config.install_dir}/{jobname}/'\
189-
f'{buildno}/{build_hw}/{ofi_build_mode}'
188+
libfab_install_path = f'{custom_workspace}/{build_hw}/{ofi_build_mode}'
190189

191190
p = re.compile('mpi*')
192191

@@ -198,11 +197,11 @@ def log_dir(install_path, release=False):
198197
elif (build_item == 'fabtests'):
199198
build_fabtests(libfab_install_path, ofi_build_mode)
200199
elif (build_item == 'builddir'):
201-
copy_build_dir(install_path)
200+
copy_build_dir(custom_workspace)
202201
elif (build_item == 'logdir'):
203-
log_dir(install_path, release)
202+
log_dir(custom_workspace, release)
204203
elif(build_item == 'mpich'):
205-
build_mpich(install_path, libfab_install_path, build_hw)
206-
build_mpich_osu(install_path, libfab_install_path, build_hw)
204+
build_mpich(custom_workspace, libfab_install_path, build_hw)
205+
build_mpich_osu(custom_workspace, libfab_install_path, build_hw)
207206

208207
os.chdir(curr_dir)

contrib/intel/jenkins/summary.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from email import encoders
1313

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

1717
import cloudbees_config
1818
import argparse
@@ -769,7 +769,8 @@ def read_file(self):
769769
self.check_line(line)
770770

771771
def get_release_num():
772-
file_name = f'{os.environ["WORKSPACE"]}/source/release_num.txt'
772+
file_name = f'{os.environ["CUSTOM_WORKSPACE"]}/source/libfabric/'\
773+
'release_num.txt'
773774
if os.path.exists(file_name):
774775
with open(file_name) as f:
775776
num = f.readline()
@@ -932,6 +933,7 @@ def summarize_items(summary_item, logger, log_dir, mode):
932933
jobname = os.environ['JOB_NAME']
933934
buildno = os.environ['BUILD_NUMBER']
934935
workspace = os.environ['WORKSPACE']
936+
custom_workspace = os.environ['CUSTOM_WORKSPACE']
935937

936938
parser = argparse.ArgumentParser()
937939
parser.add_argument('--summary_item', help="functional test to summarize",
@@ -956,7 +958,7 @@ def summarize_items(summary_item, logger, log_dir, mode):
956958
send_mail = args.send_mail
957959

958960
mpi_list = ['impi', 'mpich', 'ompi']
959-
log_dir = f'{cloudbees_config.install_dir}/{jobname}/{buildno}/log_dir'
961+
log_dir = f'{custom_workspace}/log_dir'
960962
if (not os.path.exists(log_dir)):
961963
os.makedirs(log_dir)
962964

@@ -992,7 +994,7 @@ def summarize_items(summary_item, logger, log_dir, mode):
992994
err += summarize_items(summary_item, logger, log_dir, mode)
993995

994996
if (release):
995-
shutil.copyfile(f'{full_file_name}', f'{workspace}/{output_name}')
997+
shutil.copyfile(f'{full_file_name}', f'{custom_workspace}/{output_name}')
996998

997999
if (send_mail):
9981000
SendEmail(sender = os.environ['SENDER'],

contrib/intel/jenkins/tests.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,12 @@ def __init__ (self, jobname, buildno, testname, hw, core_prov, fabric,
3737
self.client = hosts[1]
3838

3939
self.nw_interface = cloudbees_config.interface_map[self.fabric]
40-
self.libfab_installpath = f'{cloudbees_config.install_dir}/'\
41-
f'{self.jobname}/{self.buildno}/{self.hw}/'\
42-
f'{self.ofi_build_mode}'
43-
44-
self.middlewares_path = f'{cloudbees_config.install_dir}/'\
45-
f'{self.jobname}/{self.buildno}/'\
46-
'middlewares'
47-
self.ci_logdir_path = f'{cloudbees_config.install_dir}/'\
48-
f'{self.jobname}/{self.buildno}/'\
49-
'log_dir'
40+
self.custom_workspace = os.environ['CUSTOM_WORKSPACE']
41+
self.libfab_installpath = f'{self.custom_workspace}/'\
42+
f'{self.hw}/{self.ofi_build_mode}'
43+
44+
self.middlewares_path = f'{self.custom_workspace}/middlewares'
45+
self.ci_logdir_path = f'{self.custom_workspace}/log_dir'
5046
self.env = user_env
5147

5248
self.mpi = ''

0 commit comments

Comments
 (0)