def get_compiler(args, compiler_build_stage: hpccm.Stage = None) -> bb_base: # Compiler if args.icc is not None: raise RuntimeError('Intel compiler toolchain recipe not implemented yet') if args.llvm is not None: # Build our own version instead to get TSAN + OMP if args.tsan is not None: if compiler_build_stage is not None: compiler = compiler_build_stage.runtime(_from='tsan') else: raise RuntimeError('No TSAN compiler build stage!') # Build the default compiler if we don't need special support else: compiler = hpccm.building_blocks.llvm(extra_repository=True, version=args.llvm) elif args.oneapi is not None: if compiler_build_stage is not None: compiler = compiler_build_stage.runtime(_from='oneapi') # Prepare the toolchain (needed only for builds done within the Dockerfile, e.g. # OpenMPI builds, which don't currently work for other reasons) oneapi_toolchain = hpccm.toolchain(CC='/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icc', CXX='/opt/intel/oneapi/compiler/latest/linux/bin/intel64/icpc') setattr(compiler, 'toolchain', oneapi_toolchain) else: raise RuntimeError('No oneAPI compiler build stage!') elif args.gcc is not None: compiler = hpccm.building_blocks.gnu(extra_repository=True, version=args.gcc, fortran=False) else: raise RuntimeError('Logic error: no compiler toolchain selected.') return compiler
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', 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', 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']) 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'): 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 get_compiler(args, compiler_build_stage: hpccm.Stage = None) -> bb_base: # Compiler if args.llvm is not None: # Build our own version instead to get TSAN + OMP if args.tsan is not None: if compiler_build_stage is not None: compiler = compiler_build_stage.runtime(_from='tsan') else: raise RuntimeError('No TSAN compiler build stage!') # Build the default compiler if we don't need special support else: # Always use the "upstream" llvm repositories because the # main ubuntu repositories stop adding support for new # llvm versions after a few llvm releases. compiler = hpccm.building_blocks.llvm(version=args.llvm, upstream=True) elif args.oneapi is not None: if compiler_build_stage is not None: compiler = compiler_build_stage.runtime(_from='oneapi') # Prepare the toolchain (needed only for builds done within the Dockerfile, e.g. # OpenMPI builds, which don't currently work for other reasons) oneapi_toolchain = hpccm.toolchain( CC= f'/opt/intel/oneapi/compiler/{args.oneapi}/linux/bin/intel64/icx', CXX= f'/opt/intel/oneapi/compiler/{args.oneapi}/linux/bin/intel64/icpx' ) setattr(compiler, 'toolchain', oneapi_toolchain) else: raise RuntimeError('No oneAPI compiler build stage!') elif args.gcc is not None: if args.cp2k is not None: compiler = hpccm.building_blocks.gnu(extra_repository=True, version=args.gcc, fortran=True) else: compiler = hpccm.building_blocks.gnu(extra_repository=True, version=args.gcc, fortran=False) else: raise RuntimeError('Logic error: no compiler toolchain selected.') return compiler
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 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 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 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 get_compiler(args, tsan_stage: hpccm.Stage = None) -> bb_base: # Compiler if args.icc is not None: raise RuntimeError('Intel compiler toolchain recipe not implemented yet') if args.llvm is not None: # Build our own version instead to get TSAN + OMP if args.tsan is not None: if tsan_stage is not None: compiler = tsan_stage.runtime(_from='tsan') else: raise RuntimeError('No TSAN stage!') # Build the default compiler if we don't need special support else: compiler = hpccm.building_blocks.llvm(extra_repository=True, version=args.llvm) elif (args.gcc is not None): compiler = hpccm.building_blocks.gnu(extra_repository=True, version=args.gcc, fortran=False) else: raise RuntimeError('Logic error: no compiler toolchain selected.') return compiler
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', 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'): 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='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_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
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', 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', 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