From ae9513d7a908c51fb38974849b2b423c3243a6c2 Mon Sep 17 00:00:00 2001 From: mathematicalmichael Date: Fri, 15 Feb 2019 20:41:47 -0700 Subject: [PATCH] small tweaks. --- jupyterhub_config.py | 16 +++++++++++----- makefile | 2 +- singleuser/Dockerfile | 12 +++++------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/jupyterhub_config.py b/jupyterhub_config.py index cba288f..678b1c5 100755 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -38,11 +38,17 @@ class MyDockerSpawner(DockerSpawner): if self.user.name in self.group_map: group_list = self.group_map[self.user.name] # add team volume to volumes - for group_id in group_list: - self.volumes['shared-{}'.format(group_id)] = { - 'bind': '/home/jovyan/%s'%(group_id), - 'mode': 'rw', # or ro for read-only - } + for group_id in group_list: # one superuser gets upload rights. + if self.user.name == 'hub-admin': + self.volumes['shared-{}'.format(group_id)] = { + 'bind': '/home/jovyan/%s'%(group_id), + 'mode': 'rw', # or ro for read-only + } + else: # this "shared-" is part of the naming convention + self.volumes['shared-{}'.format(group_id)] = { + 'bind': '/home/jovyan/%s'%(group_id), + 'mode': 'ro', + } if self.user.name == 'hub-admin': # if admin, allow userlist access self.volumes['%s/userlist'%(os.environ['HUB_LOC'])] = { 'bind': '/home/jovyan/userlist', 'mode': 'rw' } diff --git a/makefile b/makefile index 1c9149c..2b2536a 100755 --- a/makefile +++ b/makefile @@ -17,7 +17,7 @@ secrets/postgres.env: @echo "POSTGRES_PASSWORD=$(shell openssl rand -hex 32)" > $@ secrets/oauth.env: - @echo "Generating postgres password in $@" + @echo "Generating hash key in $@" @echo "HASH_SECRET_KEY=$(shell openssl rand -hex 32)" > $@ login: diff --git a/singleuser/Dockerfile b/singleuser/Dockerfile index 5ae993c..64ce801 100755 --- a/singleuser/Dockerfile +++ b/singleuser/Dockerfile @@ -13,27 +13,25 @@ RUN apt-get update && \ htop \ fonts-dejavu \ tzdata \ - gfortran - -RUN apt-get install -y gcc + gfortran \ + gcc # finish off with MPI dependencies -RUN sudo apt-get install mpich libmpich-dev -y && \ - rm -rf /var/lib/apt/lists/* +RUN sudo apt-get install mpich libmpich-dev -y && rm -rf /var/lib/apt/lists/* +RUN conda update --all && conda install fenics USER jovyan RUN python3 -m pip install --no-cache jupyterhub==$JUPYTERHUB_VERSION nbresuse -#RUN conda install -c conda-forge fenics RUN python3 -m pip install ipyparallel mpi4py RUN ipython profile create --parallel --profile=mpi RUN echo "c.IPClusterEngines.engine_launcher_class = 'MPIEngineSetLauncher'" >> /home/jovyan/.ipython/profile_mpi/ipcluster_config.py +USER root RUN conda create --quiet --yes -p $CONDA_DIR/envs/python2 python=2.7 ipython ipykernel kernda numpy pandas matplotlib ipywidgets yaml ipyparallel mpi4py RUN /opt/conda/envs/python2/bin/ipython profile create --parallel --profile=mpi -USER root # Create a global kernelspec in the image and modify it so that it properly activates # the python2 conda environment.