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 -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(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', 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(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', 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', 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 build(container_format='singularity', flavour="devel", os_release='ubuntu', os_version='20.04', cuda_version='11.3.0', python_version='3.8', anaconda_version='4.9.2', alphafold_path="/opt/alphafold", version='2.1.2'): config.set_container_format(container_format) image = f'nvcr.io/nvidia/cuda:{cuda_version}-{flavour}-{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', 'vim' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += conda(eula=True, packages=[ f'python={python_version}', "openmm==7.5.1", "cudnn==8.2.1.32", "cudatoolkit==11.0.3", "pdbfixer==1.7", "hmmer==3.3.2", "hhsuite==3.3.0", "kalign2==2.04" ], channels=['conda-forge', 'bioconda'], version=anaconda_version) stage0 += environment(variables=from_prefix('/usr/local/anaconda')) stage0 += shell(commands=['conda activate base']) stage0 += shell(commands=[ f"mkdir -p {alphafold_path}", f'git clone -b v{version} https://github.com/deepmind/alphafold.git {alphafold_path}' ]) stage0 += environment(variables={"ALPHAFOLD_PATH": f"{alphafold_path}"}) stage0 += shell(commands=[ f'wget -q -P {alphafold_path}/alphafold/common/ https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt' ]) stage0 += pip(packages=[ "absl-py==0.13.0", "biopython==1.79", "chex==0.0.7", "dm-haiku==0.0.4", "dm-tree==0.1.6", "immutabledict==2.0.0", "ml-collections==0.1.0", "numpy==1.19.5", "scipy==1.7.0", "tensorflow==2.5.0", "pandas==1.3.4", "tensorflow-cpu==2.5.0" ], pip='pip3') stage0 += pip(packages=[ "jax", "jaxlib==0.1.69+cuda111 -f https://storage.googleapis.com/jax-releases/jax_releases.html" ], upgrade=True, pip='pip3') stage0 += pip(packages=[f'-r {alphafold_path}/requirements.txt'], pip='pip3') stage0 += shell(commands=[ f'cd /usr/local/anaconda/lib/python{python_version}/site-packages/ && patch -p0 < {alphafold_path}/docker/openmm.patch' ]) stage0 += shell(commands=[ f'cd {alphafold_path}', 'wget https://raw.githubusercontent.com/0luhancheng0/hpccm-containers/main/src/hpccm_containers/alphafold/run_alphafold.sh && chmod a+x run_alphafold.sh' ]) stage0 += runscript(commands=[ 'source /usr/local/anaconda/etc/profile.d/conda.sh', f"cd {alphafold_path}", f'{alphafold_path}/run_alphafold.sh $@' ]) return stage0
def build(container_format='singularity', image='ubuntu:20.04', version='3.8.7', gnu_version='10', mkl_version='2020.0-088', numpy_version='1.20.0rc2'): 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 /bin/sh && ln -s /bin/bash /bin/sh', '/bin/bash']) stage0 += packages(apt=[ 'wget', 'git', 'software-properties-common', 'build-essential', 'locales' ]) stage0 += shell(commands=['locale-gen en_AU.UTF-8']) stage0 += environment(variables={ 'LC_ALL': 'en_AU.UTF-8', 'LANGUAGE': 'en_AU.UTF-8', }) filename = f'Python-{version}.tar.xz' url = f'https://www.python.org/ftp/python/{version}/{filename}' stage0 += packages(apt=[ 'wget', 'xz-utils', 'build-essential', 'software-properties-common', 'libsqlite3-dev', 'libssl-dev', 'libbz2-dev', 'libgdbm-compat-dev', 'libssl-dev', 'liblzma-dev', 'tk-dev', 'uuid-dev', 'libreadline-dev', 'zlib1g-dev', 'python-dev', 'libncurses*-dev', 'libgdbm-dev', 'libsqlite3-dev', 'libffi-dev', 'git' ]) compiler = gnu(version=gnu_version) stage0 += compiler # stage0 += shell(commands=[ # 'export LDFLAGS="-rpath /usr/local/python/bin $LDFLAGS"' # ]) stage0 += generic_autotools( url=url, directory=f'Python-{version}', prefix='/usr/local/python', with_computed_goto=True, with_threads=True, enable_shared=True, enable_profiling=True, enable_optimizations=True, with_pydebug=True, enable_ipv6=True, toolchain=compiler.toolchain, # build_environment={ # 'CPPFLAGS': '"-Wl,-rpath=/usr/local/python/lib $CPPFLAGS"' # } ) stage0 += packages(apt=['patchelf']) stage0 += shell(commands=[ # 'snap install patchelf --edge --classic', 'patchelf --set-rpath /usr/local/python/lib /usr/local/python/bin/python3', ]) stage0 += environment(variables=from_prefix('/usr/local/python')) stage0 += mkl(version=mkl_version, eula=True) stage0 += shell(commands=['source /opt/intel/mkl/bin/mklvars.sh intel64']) stage0 += pip( packages=['Cython>0.29.21', 'pytest>1.15', 'Hypothesis>5.3.0'], pip='pip3') stage0 += shell(commands=[ f'git clone --branch v{numpy_version} https://github.com/numpy/numpy.git', 'apt remove -y python-numpy python-scipy', 'rm -rf /numpy' ]) stage0 += runscript(commands=['/usr/local/python/bin/python3 $*']) return stage0
def build(container_format='singularity', os='ubuntu20.04', cuda_version='11.0', gpu_version='V100', mkl_version='2020.0-088', version='psmp', tag='8.1.0'): image = f'nvcr.io/nvidia/cuda:{cuda_version}-devel-{os}' config.set_container_format(container_format) stage0 = Stage(name='stage0') stage0 += baseimage(image=image, _bootstrap='docker') stage0 += label(metadata={ 'maintainer': 'Luhan Cheng', 'email': '*****@*****.**' }) stage0 += comment( 'Toolchain installation translated from https://github.com/cp2k/cp2k/blob/master/tools/toolchain/Dockerfile.cuda_mkl' ) stage0 += packages(apt=[ 'git', 'gfortran', 'mpich', 'libmpich-dev', 'software-properties-common', 'python-dev' ]) stage0 += python() stage0 += shell(commands=[ f'git clone --depth 1 --branch v{tag} https://github.com/cp2k/cp2k.git /cp2k', 'cd /cp2k', 'git submodule update --init --recursive' ]) stage0 += shell( commands=['/cp2k/tools/toolchain/install_requirements_ubuntu.sh']) stage0 += environment( variables={ 'CUDA_PATH': '/usr/local/cuda', 'LD_LIBRARY_PATH': '/usr/local/cuda/:${LD_LIBRARY_PATH}', 'MKLROOT': '/opt/intel/compilers_and_libraries/linux/mkl', **from_prefix('/usr/local/cuda') }) stage0 += mkl(eula=True, version=mkl_version) stage0 += workdir(directory='/opt/cp2k-toolchain') stage0 += shell(commands=[ 'cd /opt/cp2k-toolchain', 'mkdir scripts && cp -r /cp2k/tools/toolchain/scripts/* ./scripts/', 'cp /cp2k/tools/toolchain/install_cp2k_toolchain.sh .', ]) stage0 += shell(commands=[ 'cd /opt/cp2k-toolchain', f'./install_cp2k_toolchain.sh --mpi-mode=openmpi --math-mode=mkl --with-reflapack=no --with-scalapack=no --with-elpa=no --gpu-ver={gpu_version}', 'rm -rf ./build' ]) stage0 += shell(commands=[ 'cp /opt/cp2k-toolchain/install/arch/* /cp2k/arch/', 'cd /cp2k', "sed 's/source /. /g' /opt/cp2k-toolchain/install/setup > /opt/cp2k-toolchain/install/setup ", '. /opt/cp2k-toolchain/install/setup', f'make ARCH=local VERSION="{version}" | tee /var/tmp/log.txt' ]) stage0 += environment(variables={'PATH': '/cp2k/exe/local:$PATH'}) stage0 += shell(commands=[ 'ln -s /usr/lib/x86_64-linux-gnu/libncursesw.so.6 /usr/lib/x86_64-linux-gnu/libncursesw.so.5', 'ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5' ]) stage0 += environment( variables={ 'LD_LIBRARY_PATH': '/usr/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH' }) return stage0
def build(container_format='singularity', os='ubuntu20.04', cuda_version='11.0', tensorflow_version='2.2.0', pytorch_version='1.7.1', pycuda_version='v2020.1'): image = f'nvcr.io/nvidia/cuda:{cuda_version}-devel-{os}' 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=['libxml2-dev', 'libxslt-dev', 'python3-pip', 'git']) stage0 += conda(eula=True, packages=[ 'python=3.7', f'tensorflow-gpu={tensorflow_version}', f'pytorch={pytorch_version}', 'torchvision', 'torchaudio' ], channels=['pytorch', 'anaconda', 'conda-forge']) stage0 += generic_build( repository='https://github.com/inducer/pycuda.git', branch=pycuda_version, build=[f'./configure.py --cuda-root=/usr/local/cuda-{cuda_version}'], ) stage0 += environment(variables=from_prefix('/usr/local/pycuda')) version = "7.2.1.6" os = "Ubuntu-18.04" arch = 'x86_64' cuda = "cuda-11.0" cudnn = "cudnn8.0" filename = f'TensorRT-{version}.{os}.{arch}-gnu.{cuda}.{cudnn}.tar.gz' TENSORRT_ROOT = '/usr/local/tensorrt' stage0 += copy(src=f'{filename}', dest=f'/{filename}') stage0 += shell(commands=[ f'mkdir -p {TENSORRT_ROOT}', f'tar -xf /TensorRT-7.2.1.6.Ubuntu-18.04.x86_64-gnu.cuda-11.0.cudnn8.0.tar.gz --strip-components 1 -C {TENSORRT_ROOT}', 'rm -rf /TensorRT-7.2.1.6.Ubuntu-18.04.x86_64-gnu.cuda-11.0.cudnn8.0.tar.gz' ]) stage0 += environment( variables={ 'LD_LIBRARY_PATH': f'$LD_LIBRARY_PATH:{TENSORRT_ROOT}/lib/', 'PATH': f'$PATH:{TENSORRT_ROOT}/bin/', 'C_INCLUDE_PATH': f'$C_INCLUDE_PATH:{TENSORRT_ROOT}/include/', **from_prefix('/usr/local/cuda'), **from_prefix('/usr/local/anaconda') }) stage0 += pip(packages=[ f'{TENSORRT_ROOT}/python/tensorrt-7.2.1.6-cp37-none-linux_x86_64.whl', f'{TENSORRT_ROOT}/uff/uff-0.6.9-py2.py3-none-any.whl', f'{TENSORRT_ROOT}/graphsurgeon/graphsurgeon-0.4.5-py2.py3-none-any.whl', f'{TENSORRT_ROOT}/onnx_graphsurgeon/onnx_graphsurgeon-0.2.6-py2.py3-none-any.whl' ], pip='pip3') cudnn_src = 'cudnn-11.0-linux-x64-v8.0.5.39.tgz' stage0 += copy(src=cudnn_src, dest=f'/{cudnn_src}') stage0 += shell(commands=[ 'mkdir -p /cudnn', f'tar -xf /{cudnn_src} -C /cudnn --strip-components 1', 'cp /cudnn/include/cudnn*.h /usr/local/cuda/include', 'cp /cudnn/lib64/libcudnn* /usr/local/cuda/lib64', 'chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*', 'rm -rf /cudnn /cudnn-11.0-linux-x64-v8.0.5.39.tgz' ]) return stage0
def build(python_version='3.6', freesurfer_version='6.0.1'): stage0 = Stage() config.set_container_format('singularity') stage0 += baseimage(image='nvidia/cuda:10.0-cudnn7-runtime-ubuntu16.04', _bootstrap='docker') stage0 += shell( commands=['rm /bin/sh', 'ln -s /bin/bash /bin/sh', '/bin/bash']) stage0 += packages(apt=[ 'build-essential', 'cmake', 'git', 'vim', 'wget', 'ca-certificates', 'bzip2', 'libx11-6', 'libjpeg-dev', 'libpng-dev', 'bc', 'tar', 'zip', 'gawk', 'tcsh', 'time', 'libgomp1', 'libglu1-mesa', 'libglu1-mesa-dev', 'perl-modules' ]) stage0 += comment( "https://github.com/Deep-MI/FastSurfer/blob/master/Docker/Dockerfile") stage0 += shell(commands=[ f"wget -qO- https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/{freesurfer_version}/freesurfer-Linux-centos6_x86_64-stable-pub-v{freesurfer_version}.tar.gz | tar zxv --no-same-owner -C /opt \ --exclude='freesurfer/trctrain' \ --exclude='freesurfer/subjects/fsaverage_sym' \ --exclude='freesurfer/subjects/fsaverage3' \ --exclude='freesurfer/subjects/fsaverage4' \ --exclude='freesurfer/subjects/fsaverage5' \ --exclude='freesurfer/subjects/fsaverage6' \ --exclude='freesurfer/subjects/cvs_avg35' \ --exclude='freesurfer/subjects/cvs_avg35_inMNI152' \ --exclude='freesurfer/subjects/bert' \ --exclude='freesurfer/subjects/V1_average' \ --exclude='freesurfer/average/mult-comp-cor' \ --exclude='freesurfer/lib/cuda' \ --exclude='freesurfer/lib/qt'", ]) stage0 += conda( channels=['pytorch', 'conda-forge'], packages=[ f'python={python_version}', 'scipy', 'numpy', 'matplotlib', 'h5py', 'scikit-image', 'pytorch', 'cudatoolkit=10.0', 'pytorch=1.2.0=py3.6_cuda10.0.130_cudnn7.6.2_0', 'torchvision=0.4.0', 'scikit-sparse', 'nibabel=2.5.1', 'pillow=7.1.1' ], eula=True, ) stage0 += generic_build( repository='https://github.com/Deep-MI/FastSurfer.git', # branch='c5894bd', build=['git checkout c5894bd'], install=['mkdir /fastsurfer && mv * /fastsurfer/']) stage0 += environment( variables={ 'OS': 'Linux', 'FS_OVERRIDE': 0, 'FIX_VERTEX_AREA': '', 'SUBJECTS_DIR': '/opt/freesurfer/subjects', 'FSF_OUTPUT_FORMAT': 'nii.gz', 'MNI_DIR': '/opt/freesurfer/mni', 'LOCAL_DIR': '/opt/freesurfer/local', 'FREESURFER_HOME': '/opt/freesurfer', 'FSFAST_HOME': '/opt/freesurfer/fsfast', 'PERL5LIB': '/opt/freesurfer/mni/lib/perl5/5.8.5', 'MNI_PERL4LIB': '/opt/freesurfer/mni/lib/perl5/5.8.5', 'PYTHONNUMBUFFERED': 0, 'PATH': '/fastsurfer/recon_surf:/fastsurfer:/usr/local/anaconda/bin:/opt/freesurfer/bin:/opt/freesurfer/fsfast/bin:/opt/freesurfer/tktools:/opt/freesurfer/mni/bin:$PATH', **from_prefix('/usr/local/cuda') }) stage0 += runscript(commands=[ 'cd /fastsurfer', 'source /usr/local/anaconda/etc/profile.d/conda.sh', 'source $FREESURFER_HOME/SetUpFreeSurfer.sh', "$*" ]) 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', '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
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 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 += comment('Installing pre-requisites') stage0 += primitives.copy( src="./ccp4-7.1.014-shelx-arpwarp-linux64.tar.gz", dest="/opt/ccp4-7.1.014-shelx-arpwarp-linux64.tar.gz") stage0 += shell(commands=[ 'cd /opt && tar -xf ccp4-7.1.014-shelx-arpwarp-linux64.tar.gz && rm ccp4-7.1.014-shelx-arpwarp-linux64.tar.gz', 'touch $HOME/.agree2ccp4v6', 'cd ccp4-7.1', './BINARY.setup', ]) stage0 += environment(variables=add_binary('/opt/ccp4-7.1/bin')) stage0 += comment('Installing CCP-EM') stage0 += primitives.copy(src="./ccpem-1.5.0-linux-x86_64.tar.gz", dest="/opt/ccpem-1.5.0-linux-x86_64.tar.gz") stage0 += primitives.copy(src="./input.txt", dest="/opt/input.txt") stage0 += shell(commands=[ 'touch $HOME/.agree2ccpemv1', 'cd /opt && tar -xf ccpem-1.5.0-linux-x86_64.tar.gz && rm ccpem-1.5.0-linux-x86_64.tar.gz', 'cd ccpem-1.5.0', './install_ccpem.sh', 'cat /opt/input.txt | bash install_modeller.sh' ]) return stage0