Merge pull request #8 from jtyberg/hub_script

Remove hub.sh script.
This commit is contained in:
Carol Willing 2016-05-09 18:21:02 -07:00
commit aa204d2f9f
4 changed files with 14 additions and 35 deletions

View File

@ -149,10 +149,11 @@ Configure JupyterHub and build it into a Docker image.
The admin user will have the ability to add more users in the JupyterHub admin console.
1. Build the JupyterHub Docker image. For convenience, this repo provides a `hub.sh` script that wraps [docker-compose](https://docs.docker.com/compose/reference/), so you can run it with the docker-compose [command line arguments](https://docs.docker.com/compose/reference/overview/). To build the JupyterHub image on the active Docker machine host, run:
1. Use [docker-compose](https://docs.docker.com/compose/reference/) to build the
JupyterHub Docker image on the active Docker machine host:
```
./hub.sh build
docker-compose build
```
## Create a JupyterHub Data Volume
@ -190,7 +191,7 @@ Run the JupyterHub container on the host.
To run the JupyterHub container in detached mode:
```
./hub.sh up -d
docker-compose up -d
```
Once the container is running, you should be able to access the JupyterHub console at
@ -202,7 +203,7 @@ https://myhost.mydomain
To bring down the JupyterHub container:
```
./hub.sh down
docker-compose down
```
## FAQ
@ -245,8 +246,9 @@ image in the environment where you launch JupyterHub. For example, the
following setting would be used to spawn single-user `pyspark` notebook servers:
```
DOCKER_NOTEBOOK_IMAGE=jupyterhub/pyspark-notebook:2d878db5cbff \
./hub.sh up -d
export DOCKER_NOTEBOOK_IMAGE=jupyterhub/pyspark-notebook:2d878db5cbff
docker-compose up -d
```
### If I change the name of the Notebook server image to spawn, do I need to restart JupyterHub?

View File

@ -24,8 +24,8 @@ when you run the JupyterHub container. For example, run the following
export DOCKER_NOTEBOOK_IMAGE=my-custom-notebook
# bring down the JupyterHub container, if running
./hub.sh down
docker-compose down
# bring it back up
./hub.sh up -d
docker-compose up -d
```

View File

@ -39,9 +39,10 @@ eval "$(docker-machine env jupyterhub)"
## Run JupyterHub container
To run the JupyterHub container using the configuration in this directory, run the `hub.sh` script **from the root directory** of this repository and specify the `docker-compose.yml` file in this directory. Set the `SECRETS_VOLUME` environment variable to the name of the Docker volume containing the TLS certificate and key files.
To run the JupyterHub container using the Let's Encrypt certificate and key, set the `SECRETS_VOLUME` environment variable to the name of the Docker volume containing the certificate and key files, and run `docker-compose` **from the root directory** of this repository while specifying the `docker-compose.yml` configuration in this directory:
```
SECRETS_VOLUME=jupyterhub-secrets \
./hub.sh -f examples/letsencrypt/docker-compose.yml up -d
export SECRETS_VOLUME=jupyterhub-secrets
docker-compose -f examples/letsencrypt/docker-compose.yml up -d
```

24
hub.sh
View File

@ -1,24 +0,0 @@
#!/bin/bash
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# Wrapper script around docker-compose
set -e
for i in "$@" ; do
if [[ "$i" == "up" ]]; then
# Check for required environment variables on startup
if [ -z ${GITHUB_CLIENT_ID:+x} ]; then
echo "ERROR: Must set GITHUB_CLIENT_ID environment variable"; exit 1;
fi
if [ -z ${GITHUB_CLIENT_SECRET:+x} ]; then
echo "ERROR: Must set GITHUB_CLIENT_SECRET environment variable"; exit 1;
fi
if [ -z ${OAUTH_CALLBACK_URL:+x} ]; then
echo "ERROR: Must set OAUTH_CALLBACK_URL environment variable"; exit 1;
fi
fi
done
exec docker-compose "$@"