diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b3960aad5e6544edbb9c452b5693ed3abfdd9b17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,152 @@ +FROM nvidia/cuda:9.2-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 + +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.12/cmake-3.12.0.tar.gz && \ + tar -xf cmake-3.12.0.tar.gz && \ + cd cmake-3.12.0 && \ + ./configure --prefix=/usr/local && \ + make install -j$(nproc --all) && \ + cd .. && \ + rm -rf cmake-3.12.0* + +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 + +RUN cd /opt && \ + curl -sSLO https://github.com/apache/incubator-mxnet/releases/download/1.2.1/apache-mxnet-src-1.2.1-incubating.tar.gz && \ + tar -xf apache-mxnet-src-1.2.1-incubating.tar.gz && \ + rm -f apache-mxnet-src-1.2.1-incubating.tar.gz && \ + mv apache-mxnet-src-1.2.1-incubating mxnet-1.2.1 && \ + cd mxnet-1.2.1 && \ + cmake -Bbuild -H. \ + -DCMAKE_CXX_STANDARD=14 -DUSE_CXX14_IF_AVAILABLE=ON \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DUSE_CUDA=ON -DUSE_CUDNN=ON -DUSE_NCCL=ON \ + -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=ON \ + -DBUILD_CPP_EXAMPLES=OFF \ + -DUSE_GPERFTOOLS=OFF \ + -DUSE_JEMALLOC=OFF \ + -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.3.tar.gz && \ + tar -xf v2.2.3.tar.gz && \ + cd pybind11-2.2.3 && \ + 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.3.tar.gz && \ + rm -rf pybind11-2.2.3 + +RUN apt-get install -y \ + libepoxy-dev \ + libglm-dev \ + libegl1-mesa-dev \ + libcgal-dev \ + libcgal-qt5-dev \ + qtbase5-dev \ + qtmultimedia5-dev \ + libqt5charts5-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 + +COPY jupyter_notebook_config.py /root/.jupyter/ +ADD mxnet_profile.sh /etc/profile.d/mxnet.sh +COPY launch.sh /sbin +COPY sshd_config /etc/ssh/sshd_config + +RUN apt-get clean + +WORKDIR "/root" +ENTRYPOINT [ "/sbin/launch.sh" ] +CMD [ "sshd" ] + +EXPOSE 22 +EXPOSE 8080 \ No newline at end of file diff --git a/hdf5-1.10.2-no-trailing-attributes.patch b/hdf5-1.10.2-no-trailing-attributes.patch new file mode 100644 index 0000000000000000000000000000000000000000..5da079e5d8308591b225f07adfb187b3addfad72 --- /dev/null +++ b/hdf5-1.10.2-no-trailing-attributes.patch @@ -0,0 +1,113 @@ +Attributes must preceed function declarator +--- a/src/H5detect.c ++++ b/src/H5detect.c +@@ -1360,8 +1360,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C89_integers(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C89_integers(void) + { + DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++; + DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++; +@@ -1388,8 +1388,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C89_floats(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C89_floats(void) + { + DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; + DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; +@@ -1410,8 +1410,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C99_integers8(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C99_integers8(void) + { + #if H5_SIZEOF_INT8_T>0 + #if H5_SIZEOF_INT8_T==1 +@@ -1472,8 +1472,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C99_integers16(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C99_integers16(void) + { + #if H5_SIZEOF_INT16_T>0 + DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; +@@ -1510,8 +1510,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C99_integers32(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C99_integers32(void) + { + #if H5_SIZEOF_INT32_T>0 + DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; +@@ -1548,8 +1548,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C99_integers64(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C99_integers64(void) + { + #if H5_SIZEOF_INT64_T>0 + DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; +@@ -1599,8 +1599,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C99_integers(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C99_integers(void) + { + /* break it down to more subroutines so that each module subroutine */ + /* is smaller and takes less time to compile with optimization on. */ +@@ -1625,8 +1625,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_C99_floats(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_C99_floats(void) + { + #if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE + /* +@@ -1656,8 +1656,8 @@ + * + *------------------------------------------------------------------------- + */ +-static void +-detect_alignments(void) HDF_NO_UBSAN ++static void HDF_NO_UBSAN ++detect_alignments(void) + { + /* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */ + DETECT_M(void *, POINTER, m_g[na_g]); na_g++; +@@ -1744,8 +1744,8 @@ + * + *------------------------------------------------------------------------- + */ +-int +-main(void) HDF_NO_UBSAN ++int HDF_NO_UBSAN ++main(void) + { + + #if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) diff --git a/jupyter_notebook_config.py b/jupyter_notebook_config.py new file mode 100644 index 0000000000000000000000000000000000000000..28a350467104e82edfd182aebfb107ab4681fe4b --- /dev/null +++ b/jupyter_notebook_config.py @@ -0,0 +1,5 @@ +c.NotebookApp.ip = '*' +c.NotebookApp.port = 8080 +c.NotebookApp.open_browser = False +c.NotebookApp.token = '' +c.NotebookApp.password = '' diff --git a/launch.sh b/launch.sh new file mode 100755 index 0000000000000000000000000000000000000000..f55914b75f80165b4c6c84c166193e00b05a0c4e --- /dev/null +++ b/launch.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +set -e + +case "$1" in +sshd) + exec /usr/sbin/sshd -D + ;; +*) + exec "$@" + ;; +esac \ No newline at end of file diff --git a/mxnet_profile.sh b/mxnet_profile.sh new file mode 100755 index 0000000000000000000000000000000000000000..adab9e70613dbc8efffd2e4bdbac5be0688ca073 --- /dev/null +++ b/mxnet_profile.sh @@ -0,0 +1,2 @@ +#! /bin/sh +export MXNet_DIR=/opt/mxnet-1.2.1 \ No newline at end of file diff --git a/sshd_config b/sshd_config new file mode 100644 index 0000000000000000000000000000000000000000..90dff332d35b1d54ea7fcaafbe9b6985c1154784 --- /dev/null +++ b/sshd_config @@ -0,0 +1,17 @@ +Port 22 + +PubkeyAuthentication yes +PasswordAuthentication no +PermitRootLogin prohibit-password +PermitEmptyPasswords no +UsePAM yes + +X11Forwarding yes +X11UseLocalhost no + +PrintMotd no +PrintLastLog no + +Subsystem sftp /usr/lib64/misc/sftp-server + +AcceptEnv LANG LC_* \ No newline at end of file