def build(image="Characterisation-Virtual-Laboratory/CharacterisationVL-Software:2004", _bootstrap='shub', mash_version='v2.2.2', capnp_version='0.8.0', quicktree_version='v2.5'): stage0 = hpccm.Stage() hpccm.config.set_container_format("singularity") stage0 += baseimage(image=image, _bootstrap=_bootstrap, _distro='ubuntu20') stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += packages(ospackages=['cpanminus', 'libexpat1-dev', 'sqlite3', 'libsqlite3-dev', 'autoconf']) stage0 += generic_build( repository='https://github.com/khowe/quicktree', branch=quicktree_version, build=['make'], install=[ 'mv quicktree /usr/local/bin', 'mv include/* /usr/local/include/' ], ) stage0 += boost() stage0 += generic_autotools( url=f'https://capnproto.org/capnproto-c++-{capnp_version}.tar.gz' ) stage0 += shell(commands=['cpanm -l /usr/local/perl5 --notest BioPerl Bio::Sketch::Mash DBD::SQLite DBI']) stage0 += generic_autotools( repository=f'https://github.com/marbl/Mash', preconfigure=['./bootstrap.sh'], branch=mash_version, with_capnp='/usr/local/', with_boost='/usr/local/boost/', ) stage0 += environment(variables={'PERL5LIB': '$PERL5LIB:/usr/local', **from_prefix('/usr/local/mashtree')}) stage0 += shell(commands=['cpanm -f -l /usr/local/mashtree Mashtree']) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=['wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev']) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += packages(apt=['g++', 'clang', 'cmake', 'make', 'bison', 'flex', 'ronn', 'fuse3', 'pkg-config', 'binutils-dev', 'libarchive-dev', 'libboost-context-dev', 'libboost-filesystem-dev', 'libboost-program-options-dev', 'libboost-python-dev', 'libboost-regex-dev', 'libboost-system-dev', 'libboost-thread-dev', 'libevent-dev', 'libjemalloc-dev', 'libdouble-conversion-dev', 'libiberty-dev', 'liblz4-dev', 'liblzma-dev', 'libssl-dev', 'libunwind-dev', 'libdwarf-dev', 'libelf-dev', 'libfmt-dev', 'libfuse3-dev', 'libgoogle-glog-dev']) stage0 += generic_cmake( prefix='/usr/local/dwarfs', repository='https://github.com/mhx/dwarfs.git', branch='v0.5.5', recursive=True, cmake_opts=["-D WITH_TESTS=1"], ) stage0 += environment(variables=from_prefix('/usr/local/dwarfs')) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04', gpu=True, cuda_version='11.0', desktop=True): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=['wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev', 'dirmngr', 'gpg-agent']) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += shell(commands=[ "wget -O- http://neuro.debian.net/lists/bionic.us-ca.full | tee /etc/apt/sources.list.d/neurodebian.sources.list", "apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com 0xA5D32F012649A5A9 2>&1", ]) stage0 += packages(apt=["fsl-complete"]) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04', gpu=True, cuda_version='11.0', desktop=True): config.set_container_format(container_format) if gpu: image = f'nvcr.io/nvidia/cuda:{cuda_version}-devel-{os_release}{os_version}' else: image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) if gpu: stage0 += environment(variables=from_prefix('/usr/local/cuda')) stage0 += packages(apt=['wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev']) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) if desktop: stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=['ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk']) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash' ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += conda(eula=True, channels=['defaults', 'conda-forge', 'bioconda'], packages=['python=3.6', 'nullarbor']) stage0 += environment(variables={'PATH': '/usr/local/anaconda/bin:$PATH'}) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=[ 'ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk' ]) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) # coin3d stage0 += packages(apt=[ 'mesa-common-dev', 'libglu1-mesa-dev', 'freeglut3-dev', 'autoconf', 'autogen', 'doxygen' ]) compiler = gnu(version="10") stage0 += compiler stage0 += boost() stage0 += generic_cmake( repository="https://github.com/coin3d/coin", recursive=True, cmake_opts=[ '-G "Unix Makefiles"', "-DCMAKE_BUILD_TYPE=Release", "-DCOIN_BUILD_DOCUMENTATION=OFF", "-DCMAKE_INSTALL_PREFIX=/usr/local/coin3d" ], postinstall=['cd cpack.d', 'cpack --config debian.cmake']) return stage0
def CVL_ubuntu_stage(gpu=False, stage_name='stage0'): image = "Characterisation-Virtual-Laboratory/CharacterisationVL-Software:2004" if not gpu else 'Characterisation-Virtual-Laboratory/CharacterisationVL-Software:2004-cuda11.0' stage0 = hpccm.Stage(name=stage_name) hpccm.config.set_container_format("singularity") stage0 += baseimage(image=image, _bootstrap='shub', _distro='ubuntu20') stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04', cuda_version='11.0'): config.set_container_format(container_format) image = f'nvcr.io/nvidia/cuda:{cuda_version}-devel-{os_release}{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += environment(variables=from_prefix('/usr/local/cuda')) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=[ 'ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk' ]) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) stage0 += packages(apt=[ "qt5-qmake", 'qtmultimedia5-dev', 'libqt5multimediawidgets5', 'libqt5multimedia5-plugins', 'libqt5multimedia5', 'libglew-dev', 'glew-utils', 'libqglviewer-dev-qt5', 'libnetcdf-dev', 'libnetcdf-cxx-legacy-dev', 'freeglut3-dev', 'libassimp-dev' ]) stage0 += shell(commands=[ 'mkdir -p /opt/', "cd /opt", 'git clone --branch v-2.7linux https://github.com/nci/drishti.git', 'cd drishti/drishti', 'qmake -qt=5', 'export LDFLAGS="$LDFLAGS -L/usr/lib/x86_64-linux-gnu/ -lassimp"', 'ln -s /usr/lib/x86_64-linux-gnu/libQGLViewer-qt5.so /usr/lib/x86_64-linux-gnu/libQGLViewer.so', 'make' ]) return stage0
def build(): stage0 = Stage() config.set_container_format('singularity') stage0 += baseimage(image='ubuntu:18.04') stage0 += nvhpc( eula=True, mpi=True, ) stage0 += copy(src='heat_mpi.f90', dest='/var/tmp/heat_mpi.f90') stage0 += shell( commands=['mpif90 /var/tmp/heat_mpi.f90 -o /usr/local/bin/heat_mpi']) return stage0
def main(): parser = argparse.ArgumentParser( description='Script to generate a container receipt for Alpaka', formatter_class=argparse.RawTextHelpFormatter) parser.add_argument( '--container', type=str, default='singularity', choices=['docker', 'singularity'], help='generate receipt for docker or singularity (default: singularity)' ) parser.add_argument('-i', type=str, default='ubuntu18.04', choices=images.keys(), help='Choice the base image. (default: ubuntu18.04)') parser.add_argument( '-c', metavar='', nargs='+', type=str, help='Install extra compiler. Supported are GCC and Clang. ' 'E.g -c gcc:8 clang:7.0 clang:8') parser.add_argument('--alpaka', action='store_true', help='Install Alpaka to /usr/local') args = parser.parse_args() # verify distribution, CUDA support and extra compiler ubuntu_version = check_distribution(images[args.i]) cuda_support = True if 'cuda' in args.i else False if args.c: check_compiler(args.c) # create baseimage hpccm.config.set_container_format(args.container) if args.i == 'singularity': hpccm.config.set_singularity_version('3.3') stage = hpccm.Stage() stage += baseimage(image=images[args.i]) if not gn.add_alpaka_dep_layer(stage, ubuntu_version, cuda_support, args.c, args.alpaka): print('add alpaka dependencies layer failed', file=sys.stderr) exit(1) install_ninja(stage) print(stage)
def build(container_format='singularity', os_release='ubuntu', os_version='20.04', openmpi_version='3.1.6', gnu_version='10', ucx_version="1.12.1", cuda_version='11.0', gdrcopy_version="1.3", knem_version="1.1.3"): config.set_container_format(container_format) image = f'nvcr.io/nvidia/cuda:{cuda_version}-devel-{os_release}{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash' ]) stage0 += environment(variables=from_prefix('/usr/local/cuda')) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += gnu(version=gnu_version) stage0 += gdrcopy(version=gdrcopy_version, ldconfig=True) stage0 += knem(version=knem_version, ldconfig=True) stage0 += ucx(knem='/usr/local/knem', version=ucx_version, ldconfig=True) stage0 += openmpi(cuda=False, infiniband=True, version=openmpi_version, ucx="/usr/local/ucx", ldconfig=True) # stage0 += shell(commands=[ # f'mkdir -p {TESTCASE_DIR} && cd {TESTCASE_DIR}', # *[f'wget {i}' for i in TESTCASES], # 'for i in *;do echo $i;done' # ]) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', 'ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7 /usr/lib/x86_64-linux-gnu/libffi.so.6' ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=[ 'ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk' ]) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) stage0 += primitives.copy(src='./ChimeraX-1.2.5.tar.gz', dest='/opt/ChimeraX-1.2.5.tar.gz') stage0 += shell(commands=[ 'tar xfv /opt/ChimeraX-1.2.5.tar.gz -C /opt', 'rm /opt/ChimeraX-1.2.5.tar.gz' ]) stage0 += environment( variables=from_prefix('/opt/chimerax-1.2.5-rc-2021.05.24')) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=['wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev', 'bc', 'cmake', 'bison', 'flex', 'libx11-dev', 'x11proto-core-dev', 'libxi6', 'libxi-dev', 'libxmu6', 'libxmu-dev', 'libxmu-headers', 'libgl1-mesa-dev', 'libglu1-mesa-dev', 'libjpeg-dev', 'libevent-dev', 'libncurses-dev', 'pkg-config', 'libopenblas-dev']) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=['ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk']) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) stage0 += generic_cmake( repository='https://github.com/BIC-MNI/minc-toolkit-v2.git', branch='release-1.9.18.1', recursive=True, prefix='/opt/minc/1.9.18', preconfigure=['sed -i -e \'s/http\:\/\/mirrors\.ibiblio\.org\/gnu\/ftp\/gnu\/gsl/http\:\/\/ftp\.\sun\.ac\.za\/ftp\/pub\/mirrors\/ftp\.gnu\.org\/gsl/g\' cmake-modules/BuildGSL.cmake', ], cmake_opts=['-DCMAKE_BUILD_TYPE:STRING=Release', '-DCMAKE_INSTALL_PREFIX:PATH=/opt/minc/1.9.18', '-DMT_BUILD_ABC:BOOL=ON', '-DMT_BUILD_ANTS:BOOL=ON', '-DMT_BUILD_C3D:BOOL=ON', '-DMT_BUILD_ELASTIX:BOOL=ON', '-DMT_BUILD_IM:BOOL=OFF', '-DMT_BUILD_ITK_TOOLS:BOOL=ON', '-DMT_BUILD_LITE:BOOL=OFF', '-DMT_BUILD_SHARED_LIBS:BOOL=ON', '-DMT_BUILD_VISUAL_TOOLS:BOOL=ON', '-DMT_USE_OPENMP:BOOL=ON', '-DUSE_SYSTEM_FFTW3D:BOOL=OFF', '-DUSE_SYSTEM_FFTW3F:BOOL=OFF', '-DUSE_SYSTEM_GLUT:BOOL=OFF', '-DUSE_SYSTEM_GSL:BOOL=OFF', '-DUSE_SYSTEM_HDF5:BOOL=OFF', '-DUSE_SYSTEM_ITK:BOOL=OFF', '-DUSE_SYSTEM_NETCDF:BOOL=OFF', '-DUSE_SYSTEM_NIFTI:BOOL=OFF', '-DUSE_SYSTEM_PCRE:BOOL=OFF', '-DUSE_SYSTEM_ZLIB:BOOL=OFF'] ) stage0 += environment(variables=from_prefix('/opt/minc/1.9.18.1')) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=[ 'ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk', 'cmake', 'libgtk2.0-dev', 'libasound2-dev', 'libavformat-dev', 'libjack-jackd2-dev', 'uuid-dev' ]) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) stage0 += shell(commands=['pip install conan']) stage0 += generic_cmake(repository='https://github.com/audacity/audacity/', branch='Audacity-3.0.5') return stage0
def main(): ############################################################################ # setup basics ############################################################################ hpccm.config.set_container_format('singularity') hpccm.config.set_singularity_version('3.3') stage0 = hpccm.Stage() stage0 += baseimage(image='ubuntu:bionic') stage0 += packages(ospackages=[ 'git', 'g++', 'wget', 'pkg-config', 'less', 'uuid-dev', 'gdb', 'locales', 'gpg-agent', 'gnupg2', 'locales-all', 'unzip' ]) # set language to en_US.UTF-8 to avoid some problems with the cling output system stage0 += shell( commands=['locale-gen en_US.UTF-8', 'update-locale LANG=en_US.UTF-8']) ############################################################################ # install clang/llvm ############################################################################ stage0 += llvm(version='9', extra_repository=True) ############################################################################ # install ninja build system ############################################################################ stage0 += shell(commands=[ 'cd /opt', 'wget --no-check-certificate ' + 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip', 'unzip ninja-linux.zip', 'mv ninja /usr/local/bin/', 'rm ninja-linux.zip', 'cd -' ]) ############################################################################ # install cmake ############################################################################ stage0 += cmake(eula=True, version='3.16.1') ############################################################################ # write recipe.def ############################################################################ with open('recipe.def', 'w') as filehandle: filehandle.write(stage0.__str__())
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += shell(commands=['rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash']) stage0 += packages(apt=['wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev']) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=['ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk']) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) stage0 += shell(commands=[ 'curl -sL https://deb.nodesource.com/setup_12.x | bash -', 'apt install -y nodejs npm' ]) prefix = '/var/www' stage0 += shell(commands=[ f'mkdir {prefix} && cd {prefix}', 'git clone --branch 1.16.10-release https://github.com/gmod/jbrowse .', './setup.sh', ]) stage0 += environment(variables={ 'PATH': f'{prefix}/bin:$PATH' }) stage0 += runscript(commands=[ f'cd {prefix}', 'npm run start $*' ]) return stage0
def build(container_format='singularity', gnu_version='9', fermi_lite_version='0.1', macs_version='3.0.0a5'): image = 'ubuntu:20.04' config.set_container_format(container_format) stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += packages(apt=[ 'wget', 'software-properties-common', 'build-essential', 'git', 'python-dev', 'zlib1g-dev' ]) compilers = gnu(version=gnu_version) stage0 += compilers stage0 += generic_build(repository='https://github.com/lh3/fermi-lite', branch=f'v{fermi_lite_version}', build=['make'], install=[ 'mkdir -p /usr/local/fermi_lite/', 'mv * /usr/local/fermi_lite/' ], toolchain=compilers.toolchain) stage0 += environment( variables={ 'PATH': '/usr/local/fermi_lite/:/usr/local/anaconda/bin:$PATH', 'LIBRARY_PATH': '/usr/local/fermi_lite/:$LIBRARY_PATH', 'C_INCLUDE_PATH': '/usr/local/fermi_lite/:$C_INCLUDE_PATH' }) stage0 += conda(packages=['python=3.8', 'numpy', 'cython', 'cykhash'], channels=['anaconda', 'conda-forge'], eula=True) stage0 += generic_build( repository='https://github.com/macs3-project/MACS.git', recursive=True, branch=f'v{macs_version}', build=['python3 setup.py install'], ) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += packages(apt=[ 'perl', 'libmodule-install-perl', 'libxml-parser-perl', 'cpanminus' ]) stage0 += shell(commands=[ 'cpanm inc::latest', 'cpanm BioPerl Bio::SeqIO Getopt::Euclid List::Util Math::Random::MT version' ]) stage0 += shell(commands=[ 'wget https://sourceforge.net/projects/biogrinder/files/biogrinder/Grinder-0.5.4/Grinder-0.5.4.tar.gz && tar -xf Grinder-0.5.4.tar.gz && rm Grinder-0.5.4.tar.gz', 'cd Grinder-0.5.4', 'perl Makefile.PL', 'make', 'make install' ]) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04', conda_packages=['conda', 'numpy', 'scipy', 'pandas'], python_version='3.9.1', channels=['anaconda', 'defaults', 'conda-forge'], anaconda_version='4.9.2'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash' ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += conda(eula=True, packages=[f'python={python_version}'] + conda_packages, channels=channels, version=anaconda_version) stage0 += environment(variables=from_prefix('/usr/local/anaconda')) stage0 += runscript(commands=[ 'source /usr/local/anaconda/etc/profile.d/conda.sh', '/usr/local/anaconda/bin/python3 $*' ]) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += shell(commands=['rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash']) stage0 += packages(apt=['wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev', 'perl', 'openssh-server', 'libssl-dev', 'gnuplot', 'globus-gridftp-server-progs', 'rsync', 'acl-dev']) stage0 += gnu(version='10') stage0 += shell(commands=[ 'yes | cpan Data::MessagePack', 'yes | cpan IO::Socket::SSL' ]) stage0 += generic_build( repository='https://github.com/eeertekin/bbcp.git', commit='64af832', prefix='/usr/local/bbcp/', build=['make -C src'], install=['mv bin/amd64_linux/bbcp /usr/local/bbcp/'] ) stage0 += environment(variables=add_binary('/usr/local/bbcp')) stage0 += generic_build( repository='https://github.com/pkolano/shift.git', commit='ffb7f5f', prefix='/usr/local/shift', directory='shift/c', build=['make nolustre'], install=['mdkir /usr/local/shift/bin && mv c/shift-bin /usr/local/shift/bin'] ) return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04', cuda_version='11.0'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={'maintainer': 'Luhan Cheng', 'email': '*****@*****.**'}) stage0 += shell(commands=['rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash']) stage0 += packages(apt=['wget', 'git', 'software-properties-common', 'build-essential', 'locales']) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=['ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk']) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) stage0 += conda( eula=True, packages=['python=3.8.5', 'openjdk', 'pip'], ) stage0 += environment(variables=from_prefix('/usr/local/anaconda')) stage0 += shell(commands=['pip install --upgrade minerl']) stage0 += shell(commands=[ 'wget https://launcher.mojang.com/download/Minecraft.deb && dpkg -i Minecraft.deb && rm Minecraft.deb', ]) stage0 += runscript(commands=['source /usr/local/anaconda/etc/profile.d/conda.sh', '/usr/local/anaconda/bin/python3 $*']) return stage0
def get_stage(container): # generate baseimage hpccm.config.set_container_format(container) # version >3.2 is necessary for multi-stage build if container == 'singularity': hpccm.config.set_singularity_version('3.3') Stage0 = hpccm.Stage() Stage0 += baseimage(image='ubuntu:bionic') # copy project from outside in the container if container == 'singularity': Stage0 += copy(src='../hello_world_tool', dest='/opt/') else: # docker: cannot copy files from outsite the build context # so, we need to move the build context one level up Stage0 += copy(src='./hello_world_tool', dest='/opt/hello_world_tool') # install compiler tools Stage0 += cmake(eula=True, version='3.14.5') Stage0 += packages(ospackages=['g++', 'make', 'wget', 'build-essential']) # build and install project cmb = CMakeBuild() cm = [] cm.append(cmb.configure_step(build_directory='/opt/build_hello_world_tool', directory='/opt/hello_world_tool/')) cm.append(cmb.build_step(target='install')) Stage0 += shell(commands=cm) Stage0 += shell(commands=build_openssl(name='openssl-1.1.1c', build_dir='/opt/openssl_build')) # script that runs when # - singularity uses the run parameter or the image runs directly # - docker uses the run parameter without arguments Stage0 += runscript(commands=['hello_world_tool']) return Stage0
def build(container_format='singularity', os='ubuntu20.04', cuda_version='11.0', openmpi_version='4.0.3', gnu_version='9.1.0'): baseimage = f'nvcr.io/nvidia/cuda:{cuda_version}-devel-{os}' config.set_container_format(container_format) stage0 = Stage(name='stage0') stage0 += primitives.baseimage(image=baseimage, _bootstrap='docker') stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) compilers = gnu( version=gnu_version, source=True, openacc=True, ) stage0 += openmpi(cuda=True, infiniband=False, version=openmpi_version, toolchain=compilers.toolchain) return stage0
def build(container_format='singularity', os='ubuntu:18.04'): image = os config.set_container_format(container_format) stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash' ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += shell(commands=[ 'cd /etc/apt/sources.list.d/', 'wget http://downloads.perfsonar.net/debian/perfsonar-release.list', 'wget -qO - http://downloads.perfsonar.net/debian/perfsonar-official.gpg.key | apt-key add -', 'add-apt-repository -y universe', 'apt-get update' ]) stage0 += packages(apt=[ 'perfsonar-tools', 'perfsonar-testpoint', 'perfsonar-core', 'perfsonar-centralmanagement', 'perfsonar-toolkit' ]) stage0 += shell( commands=['/usr/lib/perfsonar/scripts/install-optional-packages.py']) return stage0
def build(container_format='singularity', openmpi_version='2.0.4', gnu_version='10', cfdem_prefix='/usr/local/cfdem', cfdem_version='3.8.0', liggghts_prefix='/usr/local/ligghts', lpp_prefix='/usr/local/lpp', image='ubuntu:20.04', mlton_version='on-20210117-release', gmp_version='6.2.1'): config.set_container_format(container_format) stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash' ]) stage0 += packages(apt=[ 'locales', 'wget', 'software-properties-common', 'git', 'build-essential', 'flex', 'bison', 'cmake', 'zlib1g-dev', 'gnuplot', 'libreadline-dev', 'libncurses-dev', 'libxt-dev', 'libscotch-dev', 'libptscotch-dev', 'libvtk6-dev', 'python-numpy', 'python-dev', 'qt5-default', 'git-core', 'libboost-system-dev', 'libboost-thread-dev', 'libqt5x11extras5-dev', 'qttools5-dev', 'curl', 'libgl1-mesa-dev', 'libosmesa6-dev', 'libssh2-1', 'libtool' ]) compilers = gnu(version=gnu_version) stage0 += compilers openmpi_building_block = openmpi(version=openmpi_version, toolchain=compilers.toolchain, cuda=False) stage0 += openmpi_building_block stage0 += generic_autotools( url=f'https://gmplib.org/download/gmp/gmp-{gmp_version}.tar.xz', prefix='/usr/local/gmp', directory=f'gmp-{gmp_version}/', ) stage0 += environment(variables=from_library('/usr/local/gmp')) stage0 += generic_build(repository='https://github.com/MLton/mlton.git', branch=mlton_version, build=['make -j'], install=['make PREFIX=/usr/local/mlton']) if cfdem_version == '3.8.0': OF_release = '5.x' OF_commitHashtag = '538044ac05c4672b37c7df607dca1116fa88df88' else: raise Exception( 'Check https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC/blob/master/src/lagrangian/cfdemParticle/cfdTools/versionInfo.H' ) stage0 += comment('Obtain CFDEM source') stage0 += shell(commands=[ f'mkdir -p {cfdem_prefix} {liggghts_prefix} {lpp_prefix}', f'git clone --branch {cfdem_version} https://github.com/CFDEMproject/CFDEMcoupling-PUBLIC.git {cfdem_prefix}', f'git clone --branch {cfdem_version} https://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git {liggghts_prefix}', f'git clone https://github.com/CFDEMproject/LPP.git {lpp_prefix}' ]) stage0 += comment('Install OpenFoam') openfoam_prefix = f'/usr/local/OpenFOAM-{OF_release}' thirdparty_prefix = f'/usr/local/ThirdParty-{OF_release}' stage0 += shell(commands=[ f'mkdir -p {openfoam_prefix} {thirdparty_prefix}', f'git clone https://github.com/OpenFOAM/OpenFOAM-{OF_release}.git {openfoam_prefix} && cd {openfoam_prefix} && git checkout {OF_commitHashtag}', f'git clone https://github.com/OpenFOAM/ThirdParty-{OF_release}.git {thirdparty_prefix}', ]) stage0 += shell(commands=[ f'echo "source {openfoam_prefix}/etc/bashrc" >> ~/.bashrc', ]) # DLIB_PATH = '/usr/lib/x86_64-linux-gnu' # INCLUDE_PATH = '/usr/include' stage0 += shell_with_log(commands=[ f'{thirdparty_prefix}/Allwmake -j', # this breaks with openmpi >= 3, error: static assertion failed: "MPI_Type_extent was removed in MPI-3.0. Use MPI_Type_get_extent instead." # f'{thirdparty_prefix}/makeParaView -mpi -mesa -mesa-lib {DLIB_PATH}/libOSMesa.so -mesa-include {INCLUDE_PATH}/GL -verbose', f'{thirdparty_prefix}/makeParaView -mpi' 'wmRefresh' ]) stage0 += shell(commands=[ f'{openfoam_prefix}/Allwmake -j', ]) # /usr/bin/g++ -fPIC -O3 -DNDEBUG -Wl,--no-undefined -lc -shared -Wl,-soname,libvtkCommonSystem-pv5.4.so.1 -o ../../../lib/libvtkCommonSystem-pv5.4.so.1 CMakeFiles/vtkCommonSystem.dir/vtkClientSocket.cxx.o CMakeFiles/vtkCommonSystem.dir/vtkDirectory.cxx.o CMakeFiles/vtkCommonSystem.dir/vtkServerSocket.cxx.o CMakeFiles/vtkCommonSystem.dir/vtkSocket.cxx.o CMakeFiles/vtkCommonSystem.dir/vtkSocketCollection.cxx.o CMakeFiles/vtkCommonSystem.dir/vtkThreadMessager.cxx.o CMakeFiles/vtkCommonSystem.dir/vtkTimerLog.cxx.o -Wl,-rpath,/usr/local/ThirdParty-5.x/build/linux64Gcc/ParaView-5.4.0/lib: ../../../lib/libvtkCommonCore-pv5.4.so.1 ../../../lib/libvtksys-pv5.4.so.1 -lpthread -ldl return stage0
def build(container_format='singularity', os_release='ubuntu', os_version='20.04', cuda_version='11.0.3'): config.set_container_format(container_format) # image = f'{os_release}:{os_version}' image = f'nvcr.io/nvidia/cuda:{cuda_version}-devel-{os_release}{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm -f /bin/sh && ln -s /bin/bash /bin/sh', 'rm -f /usr/bin/sh && ln -s /usr/bin/bash /usr/bin/sh', '/bin/bash', ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += packages(apt=[ 'freeglut3-dev', 'build-essential', 'libx11-dev', 'libxmu-dev', 'libxi-dev', 'libglu1-mesa', 'libglu1-mesa-dev', 'mesa-utils', 'libgl1-mesa-glx' ]) stage0 += environment(variables=from_prefix('/usr/local/cuda')) stage0 += comment('Installing vglrun and TurboVNC') stage0 += packages(apt=[ 'ubuntu-desktop', 'vim', 'mesa-utils', 'python3-pip', 'python3-pyqt5', 'pyqt5-dev', 'python3-tk' ]) stage0 += shell(commands=[ 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/turbovnc_2.2.5_amd64.deb && dpkg -i turbovnc_2.2.5_amd64.deb && rm turbovnc_2.2.5_amd64.deb', 'wget https://swift.rc.nectar.org.au/v1/AUTH_810/CVL-Singularity-External-Files/virtualgl_2.6.4_amd64.deb && dpkg -i virtualgl_2.6.4_amd64.deb && rm virtualgl_2.6.4_amd64.deb', 'apt update', 'apt -y upgrade' ]) stage0 += packages(apt=[ 'make', 'libopenmpi-dev', 'python3-tk', 'libfftw3-dev', 'libhdf5-dev', 'libtiff-dev', 'libjpeg-dev', 'libsqlite3-dev', 'openjdk-8-jdk' ]) stage0 += environment( variables={ 'LD_LIBRARY_PATH': "$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/hdf5/serial", }) prefix = '/usr/local/scipion' stage0 += shell(commands=[ 'python3 -m pip install --user scipion-installer', f'python3 -m scipioninstaller {prefix} -j 4' ]) stage0 += environment(variables=from_prefix(prefix)) return stage0
def get_stage(container): # generate baseimage hpccm.config.set_container_format(container) # version >3.2 is necessary for multi-stage build if container == 'singularity': hpccm.config.set_singularity_version('3.3') Stage0 = hpccm.Stage() # the stages need "names" so that they can reference each other Stage0 += baseimage(image='ubuntu:bionic', _as='Stage0') # copy project from outside in the container if container == 'singularity': Stage0 += copy(src='../hello_world_tool', dest='/opt/') else: # docker: cannot copy files from outsite the build context # so, we need to move the build context one level up Stage0 += copy(src='./hello_world_tool', dest='/opt/hello_world_tool') # install compiler tools Stage0 += cmake(eula=True, version='3.14.5') Stage0 += packages(ospackages=['g++', 'make', 'wget', 'build-essential']) # build and install project cmb = CMakeBuild(prefix="/opt/hello_install/") cm = [] cm.append( cmb.configure_step(build_directory='/opt/build_hello_world_tool', directory='/opt/hello_world_tool/', opts=['-DCMAKE_INSTALL_RPATH=/usr/local/lib/'])) cm.append(cmb.build_step(target='install')) Stage0 += shell(commands=cm) Stage0 += shell(commands=build_openssl(name='openssl-1.1.1c', build_dir='/opt/openssl_build')) # add release stage Stage1 = hpccm.Stage() Stage1 += baseimage(image='ubuntu:bionic', _as='Stage1') Stage1 += copy(_from='Stage0', src='/opt/hello_install/', dest='/usr/local/') Stage1 += copy(_from='Stage0', src='/opt/openssl_install/', dest='/usr/local/') # the commands merge the bin, lib ect. folders of hello_install and openssl_install # in the /usr/local folder if container == "singularity": Stage1 += shell(commands=[ 'cp -rl /usr/local/hello_install/* /usr/local/', 'cp -rl /usr/local/openssl_install/* /usr/local/', 'rm -r /usr/local/hello_install/', 'rm -r /usr/local/openssl_install/' ]) # script that runs when # - singularity uses the run parameter or the image runs directly # - docker uses the run parameter without arguments Stage1 += runscript(commands=['hello_world_tool']) return [Stage0, Stage1]
def build(container_format='singularity', os_release='ubuntu', os_version='20.04'): config.set_container_format(container_format) image = f'{os_release}:{os_version}' stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += shell(commands=[ 'rm /usr/bin/sh', 'ln -s /usr/bin/bash /usr/bin/sh', '/usr/bin/bash' ]) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales', 'zlib1g-dev', 'perl', 'ncbi-blast+', 'libx11-dev' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += gnu(version='10') stage0 += generic_build( url= 'http://search.cpan.org/CPAN/authors/id/Y/YA/YANICK/Parallel-ForkManager-1.19.tar.gz', prefix='/usr/local/parallel-forkmanager', build=['perl Makefile.PL', 'make install'], install=['mv * /usr/local/parallel-forkmanager/']) stage0 += environment( variables=add_binary('/usr/local/parallel-forkmanager')) stage0 += generic_build( url= 'ftp://ftp.ebi.ac.uk/pub/software/clustalw2/2.1/clustalw-2.1-linux-x86_64-libcppstatic.tar.gz', prefix='/usr/local/clustalw', install=['mv clustalw2 /usr/local/clustalw/clustalw']) stage0 += environment(variables=add_binary('/usr/local/clustalw')) stage0 += generic_autotools( url='ftp://emboss.open-bio.org/pub/EMBOSS/EMBOSS-6.6.0.tar.gz', prefix='/usr/local/emboss', ) stage0 += environment(variables=from_prefix('/usr/local/emboss')) stage0 += generic_autotools( url= 'https://www.tbi.univie.ac.at/RNA/download/sourcecode/2_4_x/ViennaRNA-2.4.17.tar.gz', prefix='/usr/local/viennarna') stage0 += environment(variables=from_prefix('/usr/local/viennarna')) stage0 += generic_build( url='https://github.com/weizhongli/cdhit/archive/V4.8.1.tar.gz', prefix='/usr/local/cdhit', directory='cdhit-4.8.1', build=['make'], install=['mv * /usr/local/cdhit/']) stage0 += environment(variables=add_binary('/usr/local/cdhit')) stage0 += generic_build( repository='https://github.com/ambarishbiswas/CRISPRDetect_2.2.git', commit='0f8249f', prefix='/usr/local/crisprdetect', install=['mv * /usr/local/crisprdetect/']) stage0 += environment(variables=add_binary('/usr/local/crisprdetect')) return stage0
## Prerequisite: # - HPCCM - https://github.com/NVIDIA/hpc-container-maker # - Singularity >= v 3.2 to support the staged build. # - MotionCor2_1.2.6.zip - https://msg.ucsf.edu/software ## # hpccm --recipe relion_3.0.7_staged.py # --format singularity # --singularity-version 3.2 > recipe.def # Start "base recipe, known as '18.04_cuda9'" # add docstring to Dockerfile Stage0 += comment(__doc__.strip(), reformat=False) #Stage0 = hpccm.Stage() Stage0.name = '18.04_cuda9' Stage0 += baseimage(image="ubuntu:18.04", _as=Stage0.name) # Setting up environment vars for container build and runtime. Stage0 += environment(variables={ "LC_ALL": "en_AU.UTF-8", "LANGUAGE": "en_AU.UTF-8" }) # Set apt repos and packages to install base_packages = apt_get( repositories=[ "deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted", "deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted", "deb http://us.archive.ubuntu.com/ubuntu/ bionic universe", "deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe", ],