diff --git a/jupyterhub_config.py b/jupyterhub_config.py index 740a019..4c2b124 100755 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -72,7 +72,7 @@ c.DockerSpawner.extra_create_kwargs.update({ 'command': spawn_cmd }) # Memory limit c.Spawner.mem_limit = '2G' # RAM limit -#c.Spawner.cpu_limit = 0.1 +c.Spawner.cpu_limit = 0.0001 # Connect containers to this Docker network network_name = '%s-network'%hub_name @@ -89,7 +89,6 @@ notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or '/home/jovyan/work' c.DockerSpawner.notebook_dir = notebook_dir # Mount the real user's Docker volume on the host to the notebook user's # notebook directory in the container - c.DockerSpawner.volumes = { 'hub-user-{username}': notebook_dir } # volume_driver is no longer a keyword argument to create_container() diff --git a/singleuser/Dockerfile b/singleuser/Dockerfile index dc4246a..4702e8e 100755 --- a/singleuser/Dockerfile +++ b/singleuser/Dockerfile @@ -6,17 +6,25 @@ ARG JUPYTERHUB_VERSION USER root RUN apt-get update && \ - apt-get install -y vim && \ - apt-get install -y gcc && \ + apt-get install -y --no-install-recommends \ + vim \ + htop \ + fonts-dejavu \ + tzdata \ + gfortran \ + gcc && \ rm -rf /var/lib/apt/lists/* USER jovyan -RUN python3 -m pip install --no-cache jupyterhub==$JUPYTERHUB_VERSION nbresuse jupyter-rsession-proxy +RUN python3 -m pip install --no-cache jupyterhub==$JUPYTERHUB_VERSION nbresuse RUN conda install -c conda-forge fenics -RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 ipython ipykernel kernda numpy pandas matplotlib ipywidgets yaml && \ - conda clean -tipsy +RUN python3 -m pip install ipyparallel +RUN ipython profile create --parallel --profile=mpi +RUN echo "c.IPClusterEngines.engine_launcher_class = 'MPIEngineSetLauncher'" >> /home/jovyan/.ipython/profile_mpi/ipcluster_config.py + +RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 ipython ipykernel kernda numpy pandas matplotlib ipywidgets yaml USER root @@ -25,45 +33,6 @@ USER root RUN $CONDA_DIR/envs/python2/bin/python -m ipykernel install && \ $CONDA_DIR/envs/python2/bin/kernda -o -y /usr/local/share/jupyter/kernels/python2/kernel.json - -# R pre-requisites -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - fonts-dejavu \ - tzdata \ - gfortran \ - gcc && \ - rm -rf /var/lib/apt/lists/* - -USER $NB_UID - -# R packages -RUN conda install --quiet --yes \ - 'r-base=3.5.1' \ - 'r-irkernel=0.8*' \ - 'r-plyr=1.8*' \ - 'r-devtools=1.13*' \ - 'r-tidyverse=1.2*' \ - 'r-shiny=1.2*' \ - 'r-rmarkdown=1.11*' \ - 'r-forecast=8.2*' \ - 'r-rsqlite=2.1*' \ - 'r-reshape2=1.4*' \ - 'r-nycflights13=1.0*' \ - 'r-caret=6.0*' \ - 'r-rcurl=1.95*' \ - 'r-crayon=1.3*' \ - 'r-randomforest=4.6*' \ - 'r-htmltools=0.3*' \ - 'r-sparklyr=0.9*' \ - 'r-htmlwidgets=1.2*' \ - 'r-hexbin=1.27*' && \ - conda clean -tipsy && \ - fix-permissions $CONDA_DIR - -RUN conda install rstudio && \ - fix-permissions $CONDA_DIR - USER root RUN apt-get update && \ @@ -81,16 +50,17 @@ ENV RSTUDIO_PKG=rstudio-server-1.0.136-amd64.deb RUN wget -q http://download2.rstudio.org/${RSTUDIO_PKG} RUN dpkg -i ${RSTUDIO_PKG} RUN rm ${RSTUDIO_PKG} +RUN conda install -c r r-shiny && conda clean -tipsy RUN apt-get clean && \ rm -rf /var/lib/apt/lists/* -RUN python3 -m pip install jupyterhub jupyter-rsession-proxy \ - && jupyter labextension install jupyterlab-server-proxy +USER $NB_USER +# The desktop package uses /usr/lib/rstudio/bin +RUN python3 -m pip install jupyter-rsession-proxy +RUN python3 -m pip install git+https://github.com/jupyterhub/jupyter-rsession-proxy +RUN jupyter labextension install jupyterlab-server-proxy +ENV PATH="${PATH}:/usr/lib/rstudio-server/bin" +ENV LD_LIBRARY_PATH="/usr/lib/R/lib:/lib:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server:/opt/conda/lib/R/lib" +#ENV LD_LIBRARY_PATH="/usr/lib/R/lib:/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server:/opt/conda/lib/R/lib" USER jovyan - -RUN python3 -m pip install git+https://github.com/jupyterhub/jupyter-rsession-proxy - -# The desktop package uses /usr/lib/rstudio/bin -ENV PATH="${PATH}:/usr/lib/rstudio-server/bin" -ENV LD_LIBRARY_PATH="/usr/lib/R/lib:/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server:/opt/conda/lib/R/lib"