def singleStageBuild(stage):
    stage += label(metadata={'MAINTAINER': 'Simeon Ehrig'})
    stage += label(metadata={'EMAIL': '*****@*****.**'})
    stage += label(metadata={'Version': str(container_version)})
    stage += environment(variables={'GOL_VERSION': str(container_version)})

    # copy example inside container
    stage += copy(src='notebook', dest='/')

    # copy and build the pnwriter library
    stage += copy(src='pngwriter', dest='/opt')
    stage += packages(ospackages=['libpng-dev'])
    cmake = CMakeBuild(prefix='/notebook/pngwriter')
    stage += shell(commands=[
        cmake.configure_step(directory='/opt/pngwriter',
                             opts=['-DBUILD_SHARED_LIBS=ON']),
        cmake.build_step(target='install'), 'rm -rf /opt/pngwriter'
    ])

    # Copy notebook examples and pngwriter lib to the host's /tmp file system to obtain a writable file system.
    stage += runscript(commands=[
        'if [ ! -d /tmp/GOL-xeus-cling-cuda ]; then \n'
        ' mkdir /tmp/GOL-xeus-cling-cuda &&'
        ' cp -r /notebook/ /tmp/GOL-xeus-cling-cuda\n fi',
        'cd /tmp/GOL-xeus-cling-cuda/notebook', 'jupyter-lab'
    ])

    print(stage.__str__())
def recipe() -> str:
    """Generate the recipe

    :returns: singularity recipe
    :rtype: str

    """
    hpccm.config.set_container_format('singularity')
    hpccm.config.set_singularity_version('3.3')
    stage = hpccm.Stage()
    stage += label(metadata={'CLING ALPAKA VERSION': str(version)})
    stage += environment(variables={'CLING_ALPAKA_VERSION': version})

    # the baseimage of xeus-cling-cuda is Ubuntu 16.04 with CUDA 8
    if not ap_gn.add_alpaka_dep_layer(stage, '16.04', True, []):
        print('adding the alpaka dependencies layer failed', file=sys.stderr)
        exit(1)

    install_alpaka(stage)

    build_jupyter_kernel(stage)

    # baseimage support nothing  else than dockerhub
    # so, manually add the baseimage command to the recipe
    recipe = stage.__str__()
    recipe = 'Bootstrap: library\nFrom: sehrig/default/xeus-cling-cuda-cxx:2.2\n\n' + recipe

    return recipe
Beispiel #3
0
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
Beispiel #5
0
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
Beispiel #7
0
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
Beispiel #8
0
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
Beispiel #9
0
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
Beispiel #10
0
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
Beispiel #11
0
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
Beispiel #12
0
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
Beispiel #13
0
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
Beispiel #15
0
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
Beispiel #16
0
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
Beispiel #17
0
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',
          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
Beispiel #19
0
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
Beispiel #20
0
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
Beispiel #21
0
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
Beispiel #22
0
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
Beispiel #23
0
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
Beispiel #26
0
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
Beispiel #27
0
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
Stage0 += shell(commands=[
    "mkdir -p /opt/resmap", "cd /opt/resmap",
    "wget https://downloads.sourceforge.net/project/resmap/ResMap-1.1.4-linux64",
    "chmod +x ResMap-1.1.4-linux64"
])

###############################################################################
# Release stage
###############################################################################
Stage1.name = 'final'
Stage1 += baseimage(image="ubuntu:18.04", _as=Stage1.name)
Stage1 += Stage0.runtime(_from=Stage0.name)

Stage0 += label(metadata={
    "MAINTAINER": "*****@*****.**",
    "HARDWARE": "gpu"
})

# Setting up post environment vars. _export=False indicates these are only setup for container runtime
Stage1 += environment(
    variables={
        "CUDABINPATH":
        "/usr/local/cuda-10.1/bin",
        "CUDALIBPATH":
        "/usr/local/cuda-10.1/lib64/stubs:/usr/local/cuda-10.1/lib64/:/usr/local/cuda-10.1/lib",
        "MOTIONCOR2BINPATH":
        "/opt/MotionCor2_1.2.6",
        "GCTFBINPATH":
        "/opt/Gctf_v1.06/bin",
        "CTFFINDBINPATH":
        "/opt/ctffind-4.1.13/bin",
def main():
    parser = argparse.ArgumentParser(
        description=
        'Simple script for generating a singularity recipe for the GOL example.'
    )
    parser.add_argument(
        '--build_prefix',
        type=str,
        default='/tmp/GOL_example',
        help=
        'Define the path in which all projects will be built (default: /tmp/GOL_example).'
    )
    parser.add_argument('-v ',
                        '--version',
                        action='store_true',
                        help='print version of the container')
    args = parser.parse_args()

    if args.version:
        print(container_version)
        sys.exit(0)

    hpccm.config.set_container_format('singularity')
    hpccm.config.set_singularity_version('3.3')
    stage = hpccm.Stage()

    stage += label(metadata={'GOL_MAINTAINER': 'Simeon Ehrig'})
    stage += label(metadata={'GOL_EMAIL': '*****@*****.**'})
    stage += label(metadata={'GOL_Version': str(container_version)})

    # copy example inside container
    stage += copy(src='notebook', dest='/')
    stage += copy(src='jupyter_notebook_config.py', dest='/')

    # copy and build the pnwriter library
    stage += packages(ospackages=['libpng-dev'])
    png = []

    png_git = git()
    png.append(
        png_git.clone_step(
            repository='https://github.com/pngwriter/pngwriter.git',
            branch='dev',
            path='/opt/'))

    png_cmake = CMakeBuild(prefix='/notebook/pngwriter')
    png.append(
        png_cmake.configure_step(directory='/opt/pngwriter',
                                 opts=['-DBUILD_SHARED_LIBS=ON']))
    png.append(png_cmake.build_step(target='install'))
    png.append('rm -rf /opt/pngwriter')

    stage += shell(commands=png)

    # Copy notebook examples and pngwriter lib to the host's /tmp file system to obtain a writable file system.
    stage += runscript(commands=[
        'if [ ! -d /tmp/GOL-xeus-cling-cuda ]; then \n'
        ' mkdir /tmp/GOL-xeus-cling-cuda &&'
        ' cp -r /notebook/ /tmp/GOL-xeus-cling-cuda &&'
        ' ln -s /tmp/GOL-xeus-cling-cuda/notebook/pngwriter'
        '  /tmp/GOL-xeus-cling-cuda/notebook/GTC_presentations/simulation/ \n fi',
        'cd /tmp/GOL-xeus-cling-cuda/notebook',
        'jupyter-notebook --config=/jupyter_notebook_config.py'
    ])

    # Add the bootstrap manually because hpccm does not support .sregistry,
    recipe = stage.__str__()
    recipe = 'Bootstrap: library\nFrom: sehrig/default/xeus-cling-cuda:2.3\n\n' + recipe

    print(recipe)
Beispiel #30
0
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