From 91a5e54d1b0e5934ad6e9d5da5ae55194496130b Mon Sep 17 00:00:00 2001 From: Justin Tyberg Date: Mon, 9 May 2016 19:20:05 -0400 Subject: [PATCH] Remove hub.sh script. The script was meant to facilitate hub build and run operations while shielding new Docker users from `docker-compose`. It now provides very little functionality, and even gets in the way if specifying GITHUB oauth environment variables in the .env file. (c) Copyright IBM Corp. 2016 --- README.md | 14 +++++++------ examples/custom-notebook-server/README.md | 4 ++-- examples/letsencrypt/README.md | 7 ++++--- hub.sh | 24 ----------------------- 4 files changed, 14 insertions(+), 35 deletions(-) delete mode 100755 hub.sh diff --git a/README.md b/README.md index a3fc478..4d5f9e6 100644 --- a/README.md +++ b/README.md @@ -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? diff --git a/examples/custom-notebook-server/README.md b/examples/custom-notebook-server/README.md index 90f85b9..b70edbb 100644 --- a/examples/custom-notebook-server/README.md +++ b/examples/custom-notebook-server/README.md @@ -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 ``` diff --git a/examples/letsencrypt/README.md b/examples/letsencrypt/README.md index be71a7e..6f45352 100644 --- a/examples/letsencrypt/README.md +++ b/examples/letsencrypt/README.md @@ -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 ``` diff --git a/hub.sh b/hub.sh deleted file mode 100755 index 6c80daf..0000000 --- a/hub.sh +++ /dev/null @@ -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 "$@"