Skip to content
Snippets Groups Projects
Commit 6ddc2201 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

chore: epic@22.11.1; remove ip6 from nightly

parent c8e5df5e
Branches
Tags
1 merge request!390chore: epic@22.11.1; remove ip6 from nightly
...@@ -5,7 +5,7 @@ import yaml ...@@ -5,7 +5,7 @@ import yaml
import argparse import argparse
DETECTOR_REPO_GROUP = 'https://github.com/eic' DETECTOR_REPO_GROUP = 'https://github.com/eic'
DETECTOR_ENV =''' DETECTOR_BEAMLINE_ENV ='''
#!/bin/sh #!/bin/sh
export DETECTOR={detector} export DETECTOR={detector}
export DETECTOR_PATH={data_prefix} export DETECTOR_PATH={data_prefix}
...@@ -32,6 +32,22 @@ export PS1="{branch}${{PS1_SIGIL}}>${{PS1#*>}}" ...@@ -32,6 +32,22 @@ export PS1="{branch}${{PS1_SIGIL}}>${{PS1#*>}}"
unset branch unset branch
''' '''
DETECTOR_ENV ='''
#!/bin/sh
export DETECTOR={detector}
export DETECTOR_PATH={data_prefix}
export DETECTOR_CONFIG={detector}
export DETECTOR_VERSION={version}
## Export detector libraries
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{prefix}/lib
## modify PS1 for this detector version
export PS1="${{PS1:-}}"
export PS1="{branch}${{PS1_SIGIL}}>${{PS1#*>}}"
unset branch
'''
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument( parser.add_argument(
...@@ -86,14 +102,17 @@ if __name__ == '__main__': ...@@ -86,14 +102,17 @@ if __name__ == '__main__':
del detectors[det]['nightly'] del detectors[det]['nightly']
for branch in detectors[det]: for branch in detectors[det]:
cfg = detectors[det][branch] cfg = detectors[det][branch]
ip = cfg['ip']
version = cfg['version'] if branch != 'nightly' else 'nightly' version = cfg['version'] if branch != 'nightly' else 'nightly'
print(' - {}-{} and {}-{}'.format(
det, cfg['version'], ip['config'], ip['version']))
prefix = '{}/{}-{}'.format(args.prefix, det, version) prefix = '{}/{}-{}'.format(args.prefix, det, version)
data_dir = '{}/share/{}'.format(prefix, det) data_dir = '{}/share/{}'.format(prefix, det)
## build and install detector and IP code ## build list of projects to install
for (proj, vers) in [(det, cfg['version']), (ip['config'], ip['version'])]: proj_vers_list = [(det, cfg['version'])]
if 'ip' in cfg:
ip = cfg['ip']
proj_vers_list.append((ip['config'], ip['version']))
## build and install projects
for (proj, vers) in proj_vers_list:
print(' - {}-{}'.format(proj, vers))
## clone/build/install detector libraries ## clone/build/install detector libraries
cmd = ['rm -rf /tmp/build /tmp/det', cmd = ['rm -rf /tmp/build /tmp/det',
'&&', '&&',
...@@ -122,7 +141,7 @@ if __name__ == '__main__': ...@@ -122,7 +141,7 @@ if __name__ == '__main__':
print(' '.join(cmd)) print(' '.join(cmd))
os.system(' '.join(cmd)) os.system(' '.join(cmd))
## also copy over IP configuration to the detector ## also copy over IP configuration to the detector
if os.path.exists('/tmp/det/{ip}'.format(ip=ip['config'])): if 'ip' in cfg and os.path.exists('/tmp/det/{ip}'.format(ip=cfg['ip']['config'])):
cmd = 'cp -r /tmp/det/{ip} {data_dir}'.format( cmd = 'cp -r /tmp/det/{ip} {data_dir}'.format(
ip=ip['config'], data_dir=data_dir) ip=ip['config'], data_dir=data_dir)
print(cmd) print(cmd)
...@@ -142,7 +161,8 @@ if __name__ == '__main__': ...@@ -142,7 +161,8 @@ if __name__ == '__main__':
os.system(cmd) os.system(cmd)
## write an environment file for this detector ## write an environment file for this detector
with open('{prefix}/setup.sh'.format(prefix=prefix), 'w') as f: with open('{prefix}/setup.sh'.format(prefix=prefix), 'w') as f:
print(DETECTOR_ENV.format( if 'ip' in cfg:
print(DETECTOR_BEAMLINE_ENV.format(
prefix=prefix, prefix=prefix,
detector=det, detector=det,
data_prefix=data_dir, data_prefix=data_dir,
...@@ -150,7 +170,15 @@ if __name__ == '__main__': ...@@ -150,7 +170,15 @@ if __name__ == '__main__':
ip=ip['config'], ip=ip['config'],
ip_version=ip['version'], ip_version=ip['version'],
branch=branch), branch=branch),
file=f) file=f)
else:
print(DETECTOR_ENV.format(
prefix=prefix,
detector=det,
data_prefix=data_dir,
version=cfg['version'],
branch=branch),
file=f)
## run once inside global prefix to initialize artifacts in /opt/detectors ## run once inside global prefix to initialize artifacts in /opt/detectors
os.environ['DETECTOR_PATH'] = args.prefix os.environ['DETECTOR_PATH'] = args.prefix
cmd = f'bash -c \'cd {args.prefix} && source {prefix}/setup.sh && checkGeometry -c {prefix}/share/{det}/{det}.xml\'' cmd = f'bash -c \'cd {args.prefix} && source {prefix}/setup.sh && checkGeometry -c {prefix}/share/{det}/{det}.xml\''
......
...@@ -3,9 +3,6 @@ detectors: ...@@ -3,9 +3,6 @@ detectors:
nightly: nightly:
default: true default: true
version: main version: main
ip:
config: ip6
version: master
22.10.0: 22.10.0:
version: 22.10.0 version: 22.10.0
ip: ip:
...@@ -16,6 +13,11 @@ detectors: ...@@ -16,6 +13,11 @@ detectors:
ip: ip:
config: ip6 config: ip6
version: 22.11.0 version: 22.11.0
22.11.1:
version: 22.11.1
ip:
config: ip6
version: 22.11.0
athena: athena:
nightly: nightly:
version: master version: master
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment