Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial version. #1

Merged
merged 4 commits into from
Apr 18, 2016
Merged

Initial version. #1

merged 4 commits into from
Apr 18, 2016

Conversation

jtyberg
Copy link
Collaborator

@jtyberg jtyberg commented Apr 14, 2016

An initial version.

A few points:

  • Intentionally using Docker Compose to build and run containers as an alternative to Makefiles and/or bash scripts, which would only duplicate what Compose does, and may not be compatible on all platforms (ehem, Windows).
  • Relying on Docker Machine because, as a regular Docker user, it's what I use. I like some of the features that Machine provides, and I really don't like logging into the remote machines to perform my docker operations. That said, I'm open to removing the Machine dependency, but it would force users to 1) install Docker daemon and Compose manually on host (as opposed to Machine doing it for them), 2) git clone this repo on the host, 3) login to the host to perform all operations. Like I said, this is not my preferred mode of operation.
  • Pinning JupyterHub dependencies to git commits. Currently relies on JupyterHub commits > 0.5.0, and I haven't quite figured out the release cadence of DockerSpawner or OAuthenticator.

Justin Tyberg added 2 commits April 14, 2016 15:17
(c) Copyright IBM Corp. 2016
(c) Copyright IBM Corp. 2016
## Prerequisites

* This deployment uses Docker for all the things. It assumes that you wiil be using [Docker Machine](https://docs.docker.com/machine/overview/) and [Docker Compose](https://docs.docker.com/compose/overview/) on a local workstation or laptop to create, build, and run Docker images on a remote host. It requires [Docker Toolbox](https://www.docker.com/products/docker-toolbox) 1.11.0 or higher. See the [installation instructions](https://docs.docker.com/engine/installation/) for your environment.
* This example configures JupyterHub for HTTPS connections (the default). As such, you must provide TLS certificate chain and key files to the JupyterHub server. If you do not have your own certificate chain and key, you can either create self-signed versions, or obtain real ones from [Let's Encrypt](https://letsencrypt.org) (see the [letsencrypt example](examples/letsencrypt/README.md) for instructions).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtyberg This is great content :D We have instructions on creating a self signed cert/key in the Notebook docs if you wish to link to it [https://jupyter-notebook.readthedocs.org/en/latest/public_server.html#using-ssl-for-encrypted-communication]

@jhamrick
Copy link

Thanks for putting this together, @jtyberg ! This is really awesome 🍰

@willingc
Copy link
Contributor

willingc commented Apr 14, 2016

I agree with @jhamrick. @jtyberg rocks 🍰 🍪 🍵

@jtyberg
Copy link
Collaborator Author

jtyberg commented Apr 14, 2016

@jhamrick, @willingc Appreciate the time you took to look through and provide feedback. I'll incorporate it.

@jtyberg
Copy link
Collaborator Author

jtyberg commented Apr 15, 2016

@jhamrick @willingc I incorporated all of your feedback into the README. Let me know what you think. Thanks again.

@willingc
Copy link
Contributor

Wow! That was quick @jtyberg. Thank you! I'll give it a proper review in the morning. 🌆

Justin Tyberg added 2 commits April 15, 2016 16:02
(c) Copyright IBM Corp. 2016
In Docker 1.10, including protocol in DOCKER_HOST caused failure
to connect to daemon on host machine.  Must have fixed in 1.11.

(c) Copyright IBM Corp. 2016
@jtyberg
Copy link
Collaborator Author

jtyberg commented Apr 15, 2016

FWIW, I just used these instructions to deploy JupyterHub to an AWS EC2 instance...from a Windows machine. Took me about 30 minutes, including the wait time for pulling images from Docker hub, and conquering the AWS EC2 learning curve (it was my first time).

It took me longer to find and upgrade the Windows machine.

cc/ @minrk @willingc @jhamrick

@willingc
Copy link
Contributor

@jtyberg That's great. Impressive since AWS learning curve and UI leave much to be desired. I got halfway through the tutorial on Digital Ocean Ubuntu server last night and on an IBM Softview instance.

@parente
Copy link
Member

parente commented Apr 17, 2016

@jtyberg Do you have any thoughts on how the JHub admin might upgrade the docker image(s) used over time? For example, when the all-spark-notebook image goes through a few revs, I'll want to deploy that as the basis for my notebook. Or, for example, when JHub itself gets improved, I might want to upgrade.

I'm hoping (fingers crossed) that the former is as easy as rebuilding the notebook image on the Docker host and letting the next spawn pick it up. If so, that might be worth documenting. I image the latter is harder and can be figured out in follow-on PRs.

@jtyberg
Copy link
Collaborator Author

jtyberg commented Apr 17, 2016

@parente Good question. I've actually changed the spawn image extensively during this exercise. In the best case scenario, where the notebook Docker image is tagged with the same tag, it simply requires rebuilding the notebook image.

However, if you tag the notebook image differently, then you need to let JHub know about the change. Unfortunately, this requires a restart of JHub. But even in this situation, that's not so bad. In this deployment, cookies are persisted to a Docker volume, so there would be a blip in service as JHub restarts, but users would not have to login again.

Updating the JHub image is another matter. The outage would depend on what's changed in JHub, and what effect those changes have on the spawned image, if any. For example, if there is little change to the command line args that startup a single-user notebook, then the notebook image would not need to change, and you would just need to rebuild the JHub image, and once again, restart JHub.

@minrk
Copy link
Member

minrk commented Apr 18, 2016

Great start, thanks @jtyberg!

@minrk minrk merged commit 07be477 into jupyterhub:master Apr 18, 2016
@minrk minrk mentioned this pull request May 11, 2016
cuihantao pushed a commit to cuihantao/jupyterhub-deploy-docker that referenced this pull request May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants