Skip to content
Snippets Groups Projects
Commit 8f8292f1 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Merge in staging-v2.0.0

parents ea3ad66a b2136d4f
No related branches found
No related tags found
1 merge request!2Release version for v2.0.0 container
#!/bin/bash
head -n1 ../../VERSION
Bootstrap: docker
From: eicweb.phy.anl.gov:4567/containers/eic_container/eic_container:latest
%help
EIC software container.
Tools:
- root : root version used for the analyzer
- rootls, rootbrowse, root-config, hadd, h2root
- dd4hep: ddeve, ddsim
- genfit
%labels
Maintainer "Whitney Armstrong"
Version v1.0
%post -c /bin/bash
echo " Image build is now mostly done in dockerfile"
echo " -------------------------------------------------"
echo " ===> Image setup complete"
echo " -------------------------------------------------"
# ===================================
# GLOBAL
# ===================================
%environment -c /bin/bash
export PYTHONPATH=/usr/local/lib:$PYTHONPATH
export PATH=/usr/loca/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=/usr/local/include
export EPICS_ROOT=/usr/local/epics
export EPICS_BASE=/usr/local/epics/base
export EPICS_HOST_ARCH=linux-x86_64
export PATH=$EPICS_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$EPICS_ROOT/lib:$LD_LIBRARY_PATH
export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$PATH
export LD_LIBRARY_PATH=$EPICS_BASE/lib/$EPICS_HOST_ARCH:$LD_LIBRARY_PATH
%runscript -c /bin/bash
echo "Launching a shell in the Hall A/C container."
echo "Use through singularity apps recommended (see help for more info)."
exec "$@"
# ===================================
# ddsim
# ===================================
#%apprun ddsim
# . /usr/local/bin/thisdd4hep.sh
# ddsim "%@"
#
#%appenv ddsim
# export PYTHONPATH=/usr/local/lib:$PYTHONPATH
# export PATH=/usr/loca/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## ddeve
## =======================
#%apprun ddeve
# . /usr/local/bin/thisdd4hep.sh
# ddeve "$@"
#
#%appenv ddeve
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## root
## =======================
#%apprun root
# . /usr/local/bin/thisdd4hep.sh
# root "$@"
#
#%appenv root
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
# export EPICS_ROOT=/usr/local/epics
# export EPICS_BASE=/usr/local/epics/base
# export EPICS_HOST_ARCH=linux-x86_64
# export PATH=$EPICS_ROOT/bin:$PATH
# export LD_LIBRARY_PATH=$EPICS_ROOT/lib:$LD_LIBRARY_PATH
# export PATH=$EPICS_BASE/bin/$EPICS_HOST_ARCH:$PATH
# export LD_LIBRARY_PATH=$EPICS_BASE/lib/$EPICS_HOST_ARCH:$LD_LIBRARY_PATH
#
## =======================
## root-config
## =======================
#%apprun root-config
# . /usr/local/bin/thisdd4hep.sh
# root-config "$@"
#
#%appenv root-config
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
#
## =======================
## rootbrowse
## =======================
#%apprun rootbrowse
# . /usr/local/bin/thisdd4hep.sh
# rootbrowse "$@"
#
#%appenv rootbrowse
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## rootls
## =======================
#%apprun rootls
# . /usr/local/bin/thisdd4hep.sh
# rootls "$@"
#
#%appenv rootls
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## hadd
## =======================
#%apprun hadd
# . /usr/local/bin/thisdd4hep.sh
# hadd "$@"
#
#%appenv hadd
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## h2root
## =======================
#%apprun h2root
# . /usr/local/bin/thisdd4hep.sh
# h2root "$@"
#
#%appenv h2root
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## xml2evio
## =======================
#%apprun xml2evio
# . /usr/local/bin/thisdd4hep.sh
# xml2evio "$@"
#
#%appenv xml2evio
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## evio2xml
## =======================
#%apprun evio2xml
# evio2xml "$@"
#
#%appenv evio2xml
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## evioCat
## =======================
#%apprun evioCat
# . /usr/local/bin/thisdd4hep.sh
# evioCat "$@"
#
#%appenv evioCat
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
#
## =======================
## eviocopy
## =======================
#%apprun eviocopy
# eviocopy "$@"
#
#%appenv eviocopy
# export PYTHONPATH=/usr/local/lib:${PYTHONPATH}
# export PATH=/usr/local/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=/usr/local/include
...@@ -22,42 +22,16 @@ from install.util import smart_mkdir, project_version, InvalidArgumentError ...@@ -22,42 +22,16 @@ from install.util import smart_mkdir, project_version, InvalidArgumentError
## Gitlab group and project/program name. ## Gitlab group and project/program name.
GROUP_NAME='containers' GROUP_NAME='containers'
PROJECT_NAME='eic_container' PROJECT_NAME='eic_container'
PROGRAMS = [('container_dev', '/usr/bin/bash'), IMAGE_ROOT='eic'
'ddsim',
'geoConverter', PROGRAMS = [('eic_shell', '/usr/bin/bash'),
'materialScan', 'root',
'geoDisplay', 'ipython']
'geoPluginRun',
'teveDisplay',
'ddeve',
'g4FromXML'
'geoDisplay',
'listcomponents',
'print_materials',
'dumpBfield',
'g4gdmlDisplay',
'geoPluginRun',
'materialBudget',
'pyddg4',
'dumpdetector',
'graphicalScan',
'root',
'root-config',
'rootbrowse',
'rootls',
'mongo',
'mongod',
'mongodump',
'mongoexport',
'mongoimport',
'mongostat']
## URL for the current container (git tag will be filled in by the script) ## URL for the current container (git tag will be filled in by the script)
CONTAINER_URL = r'https://eicweb.phy.anl.gov/{group}/{project}/-/jobs/artifacts/{version}/raw/build/eic.sif?job=eic_singularity' CONTAINER_URL = r'https://eicweb.phy.anl.gov/{group}/{project}/-/jobs/artifacts/{version}/raw/build/{img}.sif?job={img}_singularity'
CONTAINER_ENV=r'''source /usr/local/bin/thisdd4hep.sh CONTAINER_ENV=r'''source /etc/profile'''
ROOT_INCLUDE_PATH=/usr/local/include:/usr/include/eigen3:$ROOT_INCLUDE_PATH
'''
## Singularity bind directive ## Singularity bind directive
BIND_DIRECTIVE= '-B {0}:{0}' BIND_DIRECTIVE= '-B {0}:{0}'
...@@ -86,6 +60,10 @@ if __name__ == "__main__": ...@@ -86,6 +60,10 @@ if __name__ == "__main__":
'-m', '--module-path', '-m', '--module-path',
dest='module_path', dest='module_path',
help='(opt.) Root module path where you want to install a modulefile. D: <prefix>/../../etc/modulefiles') help='(opt.) Root module path where you want to install a modulefile. D: <prefix>/../../etc/modulefiles')
parser.add_argument(
'--install-builder',
dest='builder',
help='(opt.) Install fat builder image, instead of normal slim image')
args = parser.parse_args() args = parser.parse_args()
...@@ -114,14 +92,14 @@ if __name__ == "__main__": ...@@ -114,14 +92,14 @@ if __name__ == "__main__":
## Create our install prefix if needed and ensure it is writable ## Create our install prefix if needed and ensure it is writable
args.prefix = os.path.abspath(args.prefix) args.prefix = os.path.abspath(args.prefix)
if not args.module_path: if not args.module_path:
args.module_path = '{}/etc/modulefiles'.format(args.prefix) args.module_path = os.path.abspath('{}/../../etc/modulefiles'.format(args.prefix))
print('Install prefix:', args.prefix) print('Install prefix:', args.prefix)
print('Creating install prefix if needed...') print('Creating install prefix if needed...')
bindir = '{}/bin'.format(args.prefix) bindir = '{}/bin'.format(args.prefix)
libdir = '{}/lib'.format(args.prefix) libdir = '{}/lib'.format(args.prefix)
libexecdir = '{}/libexec'.format(args.prefix) libexecdir = '{}/libexec'.format(args.prefix)
root_prefix = os.path.abspath('{}/..'.format(args.prefix)) root_prefix = os.path.abspath('{}/..'.format(args.prefix))
moduledir = '{}/etc/modulefiles/{}'.format(root_prefix, PROJECT_NAME) moduledir = '{}/{}'.format(args.module_path, PROJECT_NAME)
for dir in [bindir, libdir, libexecdir, moduledir]: for dir in [bindir, libdir, libexecdir, moduledir]:
print(' -', dir) print(' -', dir)
smart_mkdir(dir) smart_mkdir(dir)
...@@ -131,9 +109,13 @@ if __name__ == "__main__": ...@@ -131,9 +109,13 @@ if __name__ == "__main__":
## Get the container ## Get the container
## We want to slightly modify our version specifier: if it leads with a 'v' drop the v ## We want to slightly modify our version specifier: if it leads with a 'v' drop the v
container = '{}/{}.sif.{}'.format(libdir, PROJECT_NAME, version) img = IMAGE_ROOT
if args.builder:
img += "_builder"
container = '{}/{}.sif.{}'.format(libdir, img, version)
if not os.path.exists(container) or args.force: if not os.path.exists(container) or args.force:
url = CONTAINER_URL.format(group=GROUP_NAME, project=PROJECT_NAME, version=vversion) url = CONTAINER_URL.format(group=GROUP_NAME, project=PROJECT_NAME,
version=vversion, img=img)
print('Downloading container from:', url) print('Downloading container from:', url)
print('Destination:', container) print('Destination:', container)
urllib.request.urlretrieve(url, container) urllib.request.urlretrieve(url, container)
......
...@@ -94,7 +94,7 @@ def make_launcher(app, container, bindir, ...@@ -94,7 +94,7 @@ def make_launcher(app, container, bindir,
libexecdir = bindir libexecdir = bindir
## actual exe we want to run, default: same as app ## actual exe we want to run, default: same as app
exe=app exe=exe
## paths ## paths
launcher_path = '{}/{}'.format(bindir, app) launcher_path = '{}/{}'.format(bindir, app)
......
################################################################################
## Configure modulefile for our environment
################################################################################
set(MODULEFILE "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
configure_file(modulefile.in ${MODULEFILE} @ONLY)
################################################################################
## Install the modulefile to <install_module_dir>/<project>/<version>
################################################################################
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MODULEFILE}
DESTINATION "${INSTALL_MODULE_DIR}/${PROJECT_NAME}" COMPONENT lib)
#%Module1.0#####################################################################
##
## for tmux
##
proc ModulesHelp { } {
puts stderr "This module sets up the environment for the EIC container"
}
module-whatis "@PROJECT_NAME@ @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@"
# for Tcl script use only
set version 4.1.4
set iprefix @CMAKE_INSTALL_PREFIX@
prepend-path PATH $iprefix/bin
################################################################################
## Configure launcher scripts for our singularity apps
################################################################################
set(APPS
"ddsim"
"geoConverter"
"materialScan"
"geoDisplay"
"geoPluginRun"
"teveDisplay"
"ddeve"
"g4FromXML"
"geoDisplay"
"listcomponents"
"print_materials"
"dumpBfield"
"g4gdmlDisplay"
"geoPluginRun"
"materialBudget"
"pyddg4"
"dumpdetector"
"graphicalScan"
"root"
"root-config"
"rootbrowse"
"rootls"
"mongo"
"mongod"
"mongodump"
"mongoexport"
"mongoimport"
"mongostat"
)
set(APPS_ABSOLUTE_PATH "")
## Bind directive for known systems
set (OPT_BIND_DIRECTIVE "")
foreach(BIND_PATH ${INSTALL_BIND_PATH})
if (NOT "${BIND_PATH} " EQUAL " " AND EXISTS ${BIND_PATH})
set (OPT_BIND_DIRECTIVE "${OPT_BIND_DIRECTIVE} -B ${BIND_PATH}:${BIND_PATH} ")
endif ()
endforeach()
message("Adding singularity bind directive: '${OPT_BIND_DIRECTIVE}'")
find_program(SINGULARITY singularity)
foreach(APP ${APPS})
configure_file(launcher.in ${APP} @ONLY)
configure_file(wrapper.in ${APP}_wrap @ONLY)
set(APPS_ABSOLUTE_PATH ${APPS_ABSOLUTE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/${APP}")
set(APPS_ABSOLUTE_PATH ${APPS_ABSOLUTE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/${APP}_wrap")
endforeach ()
configure_file(container_dev.in container_dev @ONLY)
configure_file(container_shell_wrap.in container_shell_wrap @ONLY)
set(APPS_ABSOLUTE_PATH ${APPS_ABSOLUTE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/container_dev")
set(APPS_ABSOLUTE_PATH ${APPS_ABSOLUTE_PATH} "${CMAKE_CURRENT_BINARY_DIR}/container_shell_wrap")
################################################################################
## Install the launcher scripts to <prefix>/bin
################################################################################
install(PROGRAMS ${APPS_ABSOLUTE_PATH}
DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin)
#!/bin/bash
piped_args=
if [ -p /dev/stdin ]; then
# If we want to read the input line by line
while IFS= read line; do
#echo "Line: ${line}"
if [ -z "$piped_args" ]; then
piped_args="${line}"
else
piped_args="${piped_args}\n${line}"
fi
done
fi
if [ ${piped_args} ] ; then
echo -e ${piped_args} | @SINGULARITY@ exec @OPT_BIND_DIRECTIVE@@INSTALL_LIB_DIR@/@CONTAINER@ @INSTALL_BIN_DIR@/container_shell_wrap $@
else
@SINGULARITY@ exec @OPT_BIND_DIRECTIVE@@INSTALL_LIB_DIR@/@CONTAINER@ @INSTALL_BIN_DIR@/container_shell_wrap $@
fi
#!/bin/bash
source /usr/local/bin/thisdd4hep.sh
ROOT_INCLUDE_PATH=/usr/local/include:/usr/include/eigen3:$ROOT_INCLUDE_PATH
piped_args=
if [ -p /dev/stdin ]; then
# If we want to read the input line by line
while IFS= read line; do
#echo "Line: ${line}"
if [ -z "$piped_args" ]; then
piped_args="${line}"
else
piped_args="${piped_args}\n${line}"
fi
done
fi
if [ ${piped_args} ] ; then
echo -e ${piped_args} | /usr/bin/bash $@
else
/usr/bin/bash $@
fi
#!/bin/bash
piped_args=
if [ -p /dev/stdin ]; then
# If we want to read the input line by line
while IFS= read line; do
#echo "Line: ${line}"
if [ -z "$piped_args" ]; then
piped_args="${line}"
else
piped_args="${piped_args}\n${line}"
fi
done
fi
if [ ${piped_args} ] ; then
echo -e ${piped_args} | @SINGULARITY@ exec @OPT_BIND_DIRECTIVE@@INSTALL_LIB_DIR@/@CONTAINER@ @INSTALL_BIN_DIR@/@APP@_wrap $@
else
@SINGULARITY@ exec @OPT_BIND_DIRECTIVE@@INSTALL_LIB_DIR@/@CONTAINER@ @INSTALL_BIN_DIR@/@APP@_wrap $@
fi
#!/bin/bash
source /usr/local/bin/thisdd4hep.sh
ROOT_INCLUDE_PATH=/usr/local/include:/usr/include/eigen3:$ROOT_INCLUDE_PATH
piped_args=
if [ -p /dev/stdin ]; then
# If we want to read the input line by line
while IFS= read line; do
#echo "Line: ${line}"
if [ -z "$piped_args" ]; then
piped_args="${line}"
else
piped_args="${piped_args}\n${line}"
fi
done
fi
if [ ${piped_args} ] ; then
echo -e ${piped_args} | @APP@ $@
else
@APP@ $@
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment