Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add singleuser build dir from dockerspawner
- Loading branch information
Showing
7 changed files
with
88 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,7 @@ jupyterhub_cookie_secret | |
jupyterhub.sqlite | ||
jupyterhub_config.py | ||
node_modules | ||
docs | ||
.git | ||
dist | ||
build |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ node_modules | |
*~ | ||
.cache | ||
.DS_Store | ||
build | ||
/build | ||
dist | ||
docs/_build | ||
docs/source/_static/rest-api | ||
|
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,9 @@ | ||
# Build as jupyterhub/singleuser | ||
# Run with the DockerSpawner in JupyterHub | ||
|
||
FROM jupyter/base-notebook:5ded1de07260 | ||
MAINTAINER Project Jupyter <jupyter@googlegroups.com> | ||
|
||
ADD install_jupyterhub /tmp/install_jupyterhub | ||
ARG JUPYTERHUB_VERSION=master | ||
RUN python /tmp/install_jupyterhub |
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 @@ | ||
# jupyterhub/singleuser | ||
|
||
Built from the `jupyter/base-notebook` base image. | ||
|
||
This image contains a single user notebook server for use with | ||
[JupyterHub](https://github.com/jupyterhub/jupyterhub). In particular, it is meant | ||
to be used with the | ||
[DockerSpawner](https://github.com/jupyterhub/dockerspawner/blob/master/dockerspawner/dockerspawner.py) | ||
class to launch user notebook servers within docker containers. | ||
|
||
|
||
This particular server runs (within the container) as the `jovyan` user, with | ||
home directory at `/home/jovyan`, and the IPython example notebooks at | ||
`/home/jovyan/examples`. | ||
|
||
## Note on persistence | ||
|
||
This home directory, `/home/jovyan`, is *not* persistent by default, | ||
so some configuration is required unless the directory is to be used | ||
with temporary or demonstration JupyterHub deployments. |
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,11 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
stable=0.7 | ||
|
||
for V in master 0.7; do | ||
docker build --build-arg JUPYTERHUB_VERSION=$V -t $DOCKER_REPO:$V . | ||
done | ||
|
||
echo "tagging $IMAGE_NAME" | ||
docker tag $DOCKER_REPO:$stable $IMAGE_NAME |
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,23 @@ | ||
#!/bin/bash | ||
|
||
for V in master 0.7; do | ||
docker push $DOCKER_REPO:$V | ||
done | ||
|
||
function get_hub_version() { | ||
rm -f hub_version | ||
V=$1 | ||
docker run --rm -v $PWD:/version -u $(id -u) -i $DOCKER_REPO:$V sh -c 'jupyterhub --version > /version/hub_version' | ||
hub_xyz=$(cat hub_version) | ||
split=( ${hub_xyz//./ } ) | ||
hub_xy="${split[0]}.${split[1]}" | ||
} | ||
# tag e.g. 0.7.2 with 0.7 | ||
get_hub_version 0.7 | ||
docker tag $DOCKER_REPO:0.7 $DOCKER_REPO:$hub_xyz | ||
docker push $DOCKER_REPO:$hub_xyz | ||
|
||
# tag e.g. 0.8 with master | ||
get_hub_version master | ||
docker tag $DOCKER_REPO:master $DOCKER_REPO:$hub_xy | ||
docker push $DOCKER_REPO:$hub_xy |
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 @@ | ||
#!/usr/bin/env python | ||
import os | ||
from subprocess import check_call | ||
|
||
V = os.environ['JUPYTERHUB_VERSION'] | ||
|
||
pip_install = [ | ||
'pip', 'install', '--no-cache', '--upgrade', | ||
'--upgrade-strategy', 'only-if-needed', | ||
] | ||
if V == 'master': | ||
req = 'https://github.com/jupyterhub/jupyterhub/archive/master.tar.gz' | ||
else: | ||
version_info = [ int(part) for part in V.split('.') ] | ||
version_info[-1] += 1 | ||
upper_bound = '.'.join(map(str, version_info)) | ||
vs = '>=%s,<%s' % (V, upper_bound) | ||
req = 'jupyterhub%s' % vs | ||
|
||
check_call(pip_install + [req]) |