Deploying Jupyterhub on AWS EKS using Docker

I am looking to deploy JupyterHub on an AWS EKS instance. The team would like to deploy it using Docker rather than Helm.

I pulled the git repo from (GitHub - jupyterhub/jupyterhub: Multi-user server for Jupyter notebooks) and I am configuring the provided Dockerfile and creating the jupyterhub_config.py file.

I have set up the authentication using OAuthenticator (Azure).

Where I would like assistance is with the user’s environment. The git repository contains a directory singleuser/Dockerfile and I am wondering if the JupyerHub Dockerfile itself uses the singleuser/Dockerfile to set to environment for the user notebooks.

If so, I assume I can modify the singleuser/Dockerfile to add more python packages for the users.
If not, how can i customize the users environments in the notebooks and also what must be done in the jupyterhub_config.py file in order to set this up.

Thanks!

1 Like

I’m a little confused about what deploying Docker on EKS means. EKS means a Kubernetes cluster, so presumably you are creating Kubernetes Deployment/Service resources? Or do you mean a single EC2 VM with docker?

If it is with docker, you probably want to use DockerSpawner which puts each user in a separate container.

1 Like

Sorry let me clarify. We are using the jupyterhub dockerfile to deploy jupyerhub on AWS EKS.

We got the Hub’s dockerfile & supporting files from the official git repo linked above. The dockerfile contains the multi-stage builds required to setup the Hub and we added a few things to configure it to our needs.

Within the git repo, there is a directory “singleuser/Dockerfile” that shows the dockerfile for the singleuser environments. My question is whether this dockerfile is actually used for the singleuser environements or if it is irrelevant.

1 Like

Got it. JupyterHub does not use the files in singleuser/ at runtime. I can’t answer your question about user environments more thoroughly until you specify which Spawner you are using, and setting up user environments is highly dependent on the Spawner. Two key points:

  1. if you aren’t using a container-based Spawner, no image is used for singleuser environments
  2. when using a container-based spawner, you control the image that is used via configuration (e.g. KubeSpawner.image = "my/image:tag")

It’s not clear what your goal is, but approximately all JupyterHub deployments on kubernetes use the jupyterhub helm chart, which I would highly recommend if you are using EKS and want users to be outside the Hub container. You can also check the docs on setting up user environments and spawners in general.

3 Likes