small tweaks.

This commit is contained in:
mathematicalmichael 2019-02-15 20:41:47 -07:00
parent a01578197a
commit ae9513d7a9
3 changed files with 17 additions and 13 deletions

View File

@ -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' }

View File

@ -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:

View File

@ -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.