diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 429aa6a7dc0df3e88ea1c5e62677fb9b569fadcd..81b81966a563c89966c2724226cc85ba72dbb1f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,8 +12,14 @@ build ubuntu-18.04: - CACHE_FILE="/var/lib/gitlab-runner/.local/share/robofish-docker-gpu-driver-version" - if [[ -f $CACHE_FILE ]] && [[ "$(cat $CACHE_FILE)" == "$GPU_DRIVER_VERSION" ]]; then OPTS=''; else OPTS='--no-cache'; fi - echo -n $GPU_DRIVER_VERSION > $CACHE_FILE + - docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:base-ubuntu18.04" -f ubuntu18.04/base/Dockerfile ubuntu18.04/base + - docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:base-ubuntu18.04" + - docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:devel-ubuntu18.04" -f ubuntu18.04/devel/Dockerfile ubuntu18.04 + - docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:devel-ubuntu18.04" - docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:cuda-devel-ubuntu18.04" -f ubuntu18.04/cuda-devel/Dockerfile ubuntu18.04 - docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:cuda-devel-ubuntu18.04" + - docker build $OPTS --pull -t "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:jupyter-ubuntu18.04" -f ubuntu18.04/jupyter/Dockerfile ubuntu18.04/jupyter + - docker push "${CI_REGISTRY}/${CI_PROJECT_PATH,,}:jupyter-ubuntu18.04" after_script: - docker logout "${CI_REGISTRY}" diff --git a/ubuntu18.04/base/Dockerfile b/ubuntu18.04/base/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..49c5964cc5697c5bb295ebcbb573414554ee0856 --- /dev/null +++ b/ubuntu18.04/base/Dockerfile @@ -0,0 +1,108 @@ +FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 + +LABEL maintainer="Moritz Maxeiner <moritz.maxeiner@fu-berlin.de>" +LABEL authors="Moritz Maxeiner <moritz.maxeiner@fu-berlin.de>" + +ENV TZ=Europe/Berlin +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y --no-install-recommends software-properties-common && \ + add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ + apt-get update + +RUN apt-get install -y locales && \ + locale-gen en_US.UTF-8 && \ + echo $TZ > /etc/timezone && \ + apt-get install -y tzdata && \ + rm /etc/localtime && \ + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ + dpkg-reconfigure -f noninteractive tzdata + +RUN apt-get install -y --no-install-recommends \ + build-essential \ + pkg-config \ + gcc-8 g++-8 \ + ninja-build \ + curl \ + git \ + p7zip-full \ + file + +RUN apt-get install -y \ + libgfortran3 \ + protobuf-compiler \ + graphviz \ + qt5-default \ + qtbase5-dev \ + qtmultimedia5-dev \ + libqt5charts5-dev \ + libboost-all-dev \ + libopenblas-dev \ + liblapack-dev \ + libcurl4-openssl-dev \ + libzmq3-dev \ + libprotobuf-dev \ + libepoxy-dev \ + libglm-dev \ + libegl1-mesa-dev \ + libcgal-dev \ + libcgal-qt5-dev \ + libjsoncpp-dev \ + libwebsocketpp-dev + +RUN apt-get install -y \ + python3 \ + python3-dev \ + python3-pip \ + python3-setuptools \ + python3-distutils + +RUN python3.6 -m pip --no-cache-dir install \ + graphviz \ + opencv-python \ + nose \ + nose-timer \ + pylint \ + requests \ + Pillow \ + wheel \ + twine \ + h5py \ + joblib \ + psutil + +RUN cd /tmp && \ + curl -sSLO https://cmake.org/files/v3.13/cmake-3.13.1.tar.gz && \ + tar -xf cmake-3.13.1.tar.gz && \ + cd cmake-3.13.1 && \ + ./configure --prefix=/usr/local && \ + make install -j$(nproc --all) && \ + cd .. && \ + rm -rf cmake-3.13.1* + +COPY hdf5-1.10.2-no-trailing-attributes.patch /tmp +RUN cd /tmp && \ + curl -sSLO https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.2/src/hdf5-1.10.2.tar.bz2 && \ + tar -xf hdf5-1.10.2.tar.bz2 && \ + cd hdf5-1.10.2 && \ + patch -p1 -i /tmp/hdf5-1.10.2-no-trailing-attributes.patch && \ + cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -G Ninja && \ + ninja -C build install && \ + cd .. && \ + rm -rf hdf5-1.10.2* + +RUN cd /tmp && \ + curl -sSLO https://github.com/pybind/pybind11/archive/v2.2.4.tar.gz && \ + tar -xf v2.2.4.tar.gz && \ + cd pybind11-2.2.4 && \ + cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DPYBIND11_TEST=off -G Ninja && \ + ninja -C build install && \ + cd .. && \ + rm -f v2.2.4.tar.gz && \ + rm -rf pybind11-2.2.4 + +ADD agki-nas01.imp.fu-berlin.de-ca-cert.crt /usr/local/share/ca-certificates/agki-nas01.imp.fu-berlin.de-ca-cert.crt +RUN update-ca-certificates + +RUN apt-get clean diff --git a/ubuntu18.04/agki-nas01.imp.fu-berlin.de-ca-cert.crt b/ubuntu18.04/base/agki-nas01.imp.fu-berlin.de-ca-cert.crt similarity index 100% rename from ubuntu18.04/agki-nas01.imp.fu-berlin.de-ca-cert.crt rename to ubuntu18.04/base/agki-nas01.imp.fu-berlin.de-ca-cert.crt diff --git a/ubuntu18.04/hdf5-1.10.2-no-trailing-attributes.patch b/ubuntu18.04/base/hdf5-1.10.2-no-trailing-attributes.patch similarity index 100% rename from ubuntu18.04/hdf5-1.10.2-no-trailing-attributes.patch rename to ubuntu18.04/base/hdf5-1.10.2-no-trailing-attributes.patch diff --git a/ubuntu18.04/cuda-devel/Dockerfile b/ubuntu18.04/cuda-devel/Dockerfile index 89886d77b544b481cff5fd68222a29974ebc5918..90cc58f3adafb445a8dc449b770568817c7492b1 100644 --- a/ubuntu18.04/cuda-devel/Dockerfile +++ b/ubuntu18.04/cuda-devel/Dockerfile @@ -1,76 +1,8 @@ -FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 - -LABEL maintainer="Moritz Maxeiner <moritz.maxeiner@fu-berlin.de>" -LABEL authors="Moritz Maxeiner <moritz.maxeiner@fu-berlin.de>" - -ENV TZ=Europe/Berlin -ENV DEBIAN_FRONTEND=noninteractive +FROM git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:base-ubuntu18.04 RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - software-properties-common - -RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y - -RUN apt-get update - -RUN echo $TZ > /etc/timezone && \ - apt-get install -y tzdata && \ - rm /etc/localtime && \ - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ - dpkg-reconfigure -f noninteractive tzdata - -RUN apt-get install -y --no-install-recommends \ - build-essential \ - pkg-config \ - gcc-8 g++-8 \ - ninja-build \ - curl \ - git \ - libboost-all-dev - -RUN apt-get install -y \ - python3 \ - python3-dev \ - python3-pip \ - python3-setuptools \ - python3-distutils - -RUN cd /tmp && \ - curl -sSLO https://cmake.org/files/v3.13/cmake-3.13.1.tar.gz && \ - tar -xf cmake-3.13.1.tar.gz && \ - cd cmake-3.13.1 && \ - ./configure --prefix=/usr/local && \ - make install -j$(nproc --all) && \ - cd .. && \ - rm -rf cmake-3.13.1* - -RUN apt-get install -y \ - libopenblas-dev \ - liblapack-dev \ - libopencv-dev \ - libcurl4-openssl-dev \ - libzmq3-dev \ - libprotobuf-dev \ - protobuf-compiler \ - python-opencv \ - libgfortran3 \ - graphviz - -RUN python3.6 -m pip --no-cache-dir install \ - graphviz \ - nose \ - nose-timer \ - pylint \ - requests \ - Pillow \ - wheel \ - twine \ - h5py \ - joblib \ - psutil - -RUN cd /opt && \ + apt-get install -y libopencv-dev \ + cd /opt && \ curl -sSLO https://github.com/apache/incubator-mxnet/releases/download/1.3.1/apache-mxnet-src-1.3.1.rc0-incubating.tar.gz && \ tar -xf apache-mxnet-src-1.3.1.rc0-incubating.tar.gz --owner root --group root --no-same-owner && \ rm -f apache-mxnet-src-1.3.1.rc0-incubating.tar.gz && \ @@ -92,76 +24,6 @@ RUN cd /opt && \ -G Ninja && \ ninja -C build && \ cd python && \ - python3 setup.py install - -COPY hdf5-1.10.2-no-trailing-attributes.patch /tmp -RUN cd /tmp && \ - curl -sSLO https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.2/src/hdf5-1.10.2.tar.bz2 && \ - tar -xf hdf5-1.10.2.tar.bz2 && \ - cd hdf5-1.10.2 && \ - patch -p1 -i /tmp/hdf5-1.10.2-no-trailing-attributes.patch && \ - cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -G Ninja && \ - ninja -C build install && \ - cd .. && \ - rm -rf hdf5-1.10.2* - -RUN cd /tmp && \ - curl -sSLO https://github.com/pybind/pybind11/archive/v2.2.4.tar.gz && \ - tar -xf v2.2.4.tar.gz && \ - cd pybind11-2.2.4 && \ - cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DPYBIND11_TEST=off -G Ninja && \ - ninja -C build install && \ - cd .. && \ - rm -f v2.2.4.tar.gz && \ - rm -rf pybind11-2.2.4 - -RUN apt-get install -y \ - qt5-default \ - qtbase5-dev \ - qtmultimedia5-dev \ - libqt5charts5-dev \ - libepoxy-dev \ - libglm-dev \ - libegl1-mesa-dev \ - libcgal-dev \ - libcgal-qt5-dev \ - libjsoncpp-dev \ - libwebsocketpp-dev - -RUN python3.6 -m pip --no-cache-dir install \ - numpy \ - scipy \ - matplotlib \ - pandas \ - jupyterlab - - -RUN apt-get install -y openssh-server && \ - mkdir -p /var/run/sshd && \ - mkdir /root/.ssh && \ - chmod 700 /root/.ssh && \ - touch /root/.ssh/authorized_keys - -RUN apt-get install -y locales && \ - locale-gen en_US.UTF-8 en_GB.UTF-8 - -RUN apt-get install -y \ - file \ - p7zip-full - -COPY jupyter_notebook_config.py /root/.jupyter/ + python3 setup.py install && \ + apt-get clean ADD mxnet_profile.sh /etc/profile.d/mxnet.sh -COPY launch.sh /sbin -COPY sshd_config /etc/ssh/sshd_config - -ADD agki-nas01.imp.fu-berlin.de-ca-cert.crt /usr/local/share/ca-certificates/agki-nas01.imp.fu-berlin.de-ca-cert.crt -RUN update-ca-certificates - -RUN apt-get clean - -WORKDIR "/root" -ENTRYPOINT [ "/sbin/launch.sh" ] -CMD [ "sshd" ] - -EXPOSE 22 -EXPOSE 8080 diff --git a/ubuntu18.04/devel/Dockerfile b/ubuntu18.04/devel/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..78c76850598de4ccd4171a90d684b727d3936ac6 --- /dev/null +++ b/ubuntu18.04/devel/Dockerfile @@ -0,0 +1,29 @@ +FROM git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:base-ubuntu18.04 + +RUN apt-get update && \ + apt-get install -y libopencv-dev \ + cd /opt && \ + curl -sSLO https://github.com/apache/incubator-mxnet/releases/download/1.3.1/apache-mxnet-src-1.3.1.rc0-incubating.tar.gz && \ + tar -xf apache-mxnet-src-1.3.1.rc0-incubating.tar.gz --owner root --group root --no-same-owner && \ + rm -f apache-mxnet-src-1.3.1.rc0-incubating.tar.gz && \ + mv apache-mxnet-src-1.3.1.rc0-incubating mxnet-1.3.1 && \ + cd mxnet-1.3.1 && \ + cmake -Bbuild -H. \ + -DCMAKE_CXX_STANDARD=14 -DUSE_CXX14_IF_AVAILABLE=ON \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DUSE_CUDA=OFF -DUSE_CUDNN=OFF -DUSE_NCCL=OFF \ + -DUSE_OPENCV=ON -DUSE_OPENMP=ON \ + -DUSE_LAPACK=ON -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_DIST_KVSTORE=ON \ + -DUSE_CPP_PACKAGE=ON \ + -DUSE_SIGNAL_HANDLER=ON \ + -DENABLE_CUDA_RTC=OFF \ + -DBUILD_CPP_EXAMPLES=OFF \ + -DUSE_GPERFTOOLS=OFF \ + -DUSE_JEMALLOC=OFF \ + -G Ninja && \ + ninja -C build && \ + cd python && \ + python3 setup.py install && \ + apt-get clean +ADD mxnet_profile.sh /etc/profile.d/mxnet.sh diff --git a/ubuntu18.04/jupyter/Dockerfile b/ubuntu18.04/jupyter/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..5e548a248cb604d430a64c1488e838108c43dfb9 --- /dev/null +++ b/ubuntu18.04/jupyter/Dockerfile @@ -0,0 +1,28 @@ +FROM git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:cuda-devel-ubuntu18.04 + +RUN python3.6 -m pip --no-cache-dir install \ + numpy \ + scipy \ + matplotlib \ + pandas \ + jupyterlab + +RUN apt-get update && \ + apt-get install -y openssh-server && \ + mkdir -p /var/run/sshd && \ + mkdir /root/.ssh && \ + chmod 700 /root/.ssh && \ + touch /root/.ssh/authorized_keys && \ + apt-get clean + +COPY jupyter_notebook_config.py /root/.jupyter/ +COPY launch.sh /sbin +COPY sshd_config /etc/ssh/sshd_config + + +WORKDIR "/root" +ENTRYPOINT [ "/sbin/launch.sh" ] +CMD [ "sshd" ] + +EXPOSE 22 +EXPOSE 8080 diff --git a/ubuntu18.04/jupyter_notebook_config.py b/ubuntu18.04/jupyter/jupyter_notebook_config.py similarity index 100% rename from ubuntu18.04/jupyter_notebook_config.py rename to ubuntu18.04/jupyter/jupyter_notebook_config.py diff --git a/ubuntu18.04/launch.sh b/ubuntu18.04/jupyter/launch.sh similarity index 100% rename from ubuntu18.04/launch.sh rename to ubuntu18.04/jupyter/launch.sh diff --git a/ubuntu18.04/sshd_config b/ubuntu18.04/jupyter/sshd_config similarity index 100% rename from ubuntu18.04/sshd_config rename to ubuntu18.04/jupyter/sshd_config