Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from bird-house/add-jupyterhub-user-data-dir
Add JupyterHub user data directories and integrate with Magpie for authentication. * **JupyterHub authentication is integrated with Magpie** * Adding new user and password management is done via Magpie * User public/public needs to exist on Magpie for the demo account to work * **Since user "public" exists on Magpie, any "secure" folder on Thredds that needs authentication will be visible to that user !** Probably okay for now since everything on Thredds is public but we have to keep that in mind. We will need that fine grained permission capabilities soon. * **Each user have their own private workspace and Jupyter server** * Can only see and modify/delete their own files * Can only restart their own Jupyter server so can not kill other people running jobs * Of course this **do not apply to the demo public/public user account** * **Login banner changed with `SUPPORT_EMAIL` from `env.local` for users to request private account/workspace** * Review wording please * Is this a good email to use? For Ouranos it is pavics@ouranos.ca * **New persistence on disk: `/data/jupyterhub_user_data`** * To include in backup * **Other features** * User's preferences (theme, ...) are also persisted * Update JupyterHub version * **Regressions** * Can not live update the JupyterHub anymore without killing all the user jupyter container and consequently killing their running jobs, might relate to the JupyterHub version update
- Loading branch information
Showing
16 changed files
with
182 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
# All env this common.env can be overridden by env.local. | ||
|
||
# dupe with backup-juputerhub-notebooks.sh | ||
export DOCKER_JUPYTERHUB_USER_PERSISTENCE_VOLUME=jupyterhub_user_persistence | ||
|
||
export DOCKER_NOTEBOOK_IMAGE="pavics/workflow-tests:200120" | ||
export JUPYTERHUB_USER_DATA_DIR="/data/jupyterhub_user_data" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
login.html |
26 changes: 26 additions & 0 deletions
26
birdhouse/config/jupyterhub/custom_templates/login.html.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "templates/login.html" %} {% set announcement_login = ' | ||
|
||
<p><strong>Public login:</strong> public/public</p> | ||
<p> | ||
Given this public nature, anyone can tamper with your notebooks so please | ||
<strong>export your valuable notebooks elsewhere</strong> if you want to | ||
preverve them. | ||
</p> | ||
<p> | ||
Contact <strong>${SUPPORT_EMAIL}</strong> for information on how to | ||
<strong>get an account and a private workspace</strong>. | ||
</p> | ||
<p> | ||
The only writable folder is <strong>writable-workspace</strong> | ||
(/notebook_dir/writable-workspace in the terminal) and it is persisted | ||
between sessions. | ||
</p> | ||
<p> | ||
Please <strong>be considerate</strong> with the amount of | ||
<strong>disk space usage</strong> on this Jupyter instance. | ||
</p> | ||
<p> | ||
This Jupyter instance can restart every day. | ||
<strong>Long running processes will be killed without notice.</strong> | ||
</p> | ||
' %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh -x | ||
# Backup to /tmp/jupyterhub_user_persistence.tgz with default values. | ||
|
||
if [ -z "$BACKUP_OUT_DIR" ]; then | ||
BACKUP_OUT_DIR=/tmp | ||
fi | ||
|
||
if [ -z "$JUPYTERHUB_USER_DATA_DIR" ]; then | ||
JUPYTERHUB_USER_DATA_DIR=/data/jupyterhub_user_data | ||
fi | ||
|
||
docker run --rm \ | ||
--name backup_jupyterhub_data \ | ||
-u root \ | ||
-v "$BACKUP_OUT_DIR":/backups \ | ||
-v "$JUPYTERHUB_USER_DATA_DIR":/data_vol_to_backup:ro \ | ||
bash \ | ||
tar czvf /backups/jupyterhub_user_data.tgz -C /data_vol_to_backup . | ||
|
||
# vi: tabstop=8 expandtab shiftwidth=4 softtabstop=4 |
Oops, something went wrong.