Skip to content

Commit

Permalink
Merge pull request #7 from yuvipanda/doc
Browse files Browse the repository at this point in the history
Add some more inline comments
  • Loading branch information
yuvipanda authored Nov 14, 2023
2 parents a98c615 + 472867a commit 704d7a9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
5 changes: 5 additions & 0 deletions binderhub_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Placate our linters, which don't know c is traitlets' special sauce
c = get_config() # noqa

# Enable debug logs for binderhub itself
c.BinderHub.debug = True

# Just leave the built image in the node, so our hub can launch it
c.BinderHub.use_registry = False

# BinderHub is launched as a service by JupyterHub under /services/binder,
# and this is also where jupyterhub-fancy-profiles looks.
c.BinderHub.base_url = "/services/binder/"

# We only want to build, not launch
c.BinderHub.enable_api_only_mode = True
19 changes: 11 additions & 8 deletions jupyterhub_config.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
import os
import socket

from jupyterhub.auth import DummyAuthenticator
from kubespawner.spawner import KubeSpawner

from jupyterhub_fancy_profiles import setup_ui

c = get_config() # noqa

# Allow any username and any password to login
c.JupyterHub.authenticator_class = "dummy"

c.JupyterHub.authenticator_class = DummyAuthenticator


c.JupyterHub.spawner_class = KubeSpawner
# Launch into Kubernetes
c.JupyterHub.spawner_class = "kubespawner.KubeSpawner"

# Explicitly set the command to start, as repo2docker default is notebook,
# not the jupyterhub-singleuser
c.Spawner.cmd = ["jupyterhub-singleuser"]

# Don't try to cleanup servers on exit - since in general for k8s, we want
# the hub to be able to restart without losing user containers
c.JupyterHub.cleanup_servers = False

# Automatically start binderhub as a service, at the URL path that jupyterhub-fancy-profiles
# expects it to be at
c.JupyterHub.services = [
{
"name": "binder",
Expand All @@ -38,9 +40,10 @@

c.JupyterHub.hub_connect_ip = host_ip


# Setup jupyterhub_fancy_profiles
setup_ui(c)

# Provide an example profile with various options in use
c.KubeSpawner.profile_list = [
{
"display_name": "Small",
Expand Down
2 changes: 2 additions & 0 deletions jupyterhub_fancy_profiles/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

TEMPLATE_PATHS = [os.path.join(HERE, "templates")]

# FIXME: Handle JupyterHub's base_path here correctly, so we support
# running under prefixes
STATIC_HANDLER_TUPLE = (
"/fancy-profiles/static/(.*)",
StaticFileHandler,
Expand Down

0 comments on commit 704d7a9

Please sign in to comment.