Skip to content

Commit 5377e92

Browse files
authored
Merge pull request #6 from mtholyoke/fix-data-volume-location
Fix `data/` directory mapping
2 parents f4e03d9 + 9a36c0f commit 5377e92

5 files changed

Lines changed: 19 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ Data to be shared between docker container and local machine.
1919
### `environment/`
2020

2121
Docker related files and package lists for Python and R as well as JupyterLab plug-ins.
22+
23+
### `jupyterlab/`
24+
25+
This is the root directory for the JupyterLab UI. By default, it will include the `analysis/` and `data/` directories via a symlink. This keeps the JupyterLab UI clean – `environment/` and other top-level files will not appear in the left rail.

environment/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44
FROM jupyter/datascience-notebook:9e63909e0317
55

66
# Volumes aren't in place yet
7-
COPY --chown=${NB_UID}:${NB_GID} environment/ .
7+
WORKDIR /home/jovyan/
8+
COPY --chown=${NB_UID}:${NB_GID} . .
9+
10+
# Set up jupyterlab/ for UI to use
11+
RUN mkdir jupyterlab
12+
WORKDIR /home/jovyan/jupyterlab
13+
RUN ln -s ../analysis analysis
14+
RUN ln -s ../data data
815

916
# Install Python packages from requirements.txt file
17+
WORKDIR /home/jovyan/environment
1018
RUN pip install --quiet --no-cache-dir --requirement ./requirements.txt && \
1119
fix-permissions "${CONDA_DIR}" && \
1220
fix-permissions "/home/${NB_USER}"
@@ -16,3 +24,6 @@ RUN ./r-packages.R
1624

1725
# Install JupyterLab extensions
1826
RUN ./install-jupyter-extensions.sh
27+
28+
29+
WORKDIR /home/jovyan/

environment/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ This script installs the JupyterLab extensions, and is run by the `Dockerfile`.
8787
8888
### `jupyter_server_config.py`
8989
90-
This is where you can make changes to the Jupyter server configuration. By default, it sets the JupyterLab UI to launch in the `analysis` folder of the main project and removes server authentication since this project is only meant to be run on a researcher's computer and not in a shared or production environment.
90+
This is where you can make changes to the Jupyter server configuration. By default, it sets the JupyterLab UI to launch in the `jupyterlab` folder of the main project and removes server authentication since this project is only meant to be run on a researcher's computer and not in a shared or production environment.
9191
9292

environment/compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ services:
1313
# This connects the Jupyter notebook directory to the host machine so
1414
# that can all be checked into version control.
1515
volumes:
16-
# Link the analysis directory into the container
16+
# Link the analysis and data directories into the container
1717
- '../analysis:/home/jovyan/analysis'
18-
# Link the data directory into the container so it can be made visible in
19-
# the JupyterLab UI
2018
- '../data:/home/jovyan/data'
2119
# Make the server config file available in the correct place
2220
- '../environment/jupyter_server_config.py:/home/jovyan/.jupyter/jupyter_server_config.py'

environment/jupyter_server_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@
492492

493493
## The directory to use for notebooks and kernels.
494494
# Default: ''
495-
c.ServerApp.root_dir = 'analysis'
495+
c.ServerApp.root_dir = 'jupyterlab'
496496

497497
## The session manager class to use.
498498
# Default: 'builtins.object'

0 commit comments

Comments
 (0)