Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 13, 2023
1 parent f11b824 commit 2eda5c2
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 101 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Setting up a dev environment


### Setting up `minikube`

Currently, these instructions only work with [minikube](https://minikube.sigs.k8s.io/docs/start/)
Expand Down Expand Up @@ -61,4 +60,4 @@ but can be adapted to work with any other local kubernetes setup.

```bash
jupyterhub
```
```
3 changes: 1 addition & 2 deletions binderhub_config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

c.BinderHub.debug = True

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

c.BinderHub.base_url = "/services/binder/"

c.BinderHub.enable_api_only_mode = True
c.BinderHub.enable_api_only_mode = True
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
git+https://github.com/jupyterhub/binderhub.git@main
jupyterhub
jupyterhub-kubespawner
git+https://github.com/jupyterhub/binderhub.git@main
192 changes: 97 additions & 95 deletions jupyterhub_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import socket
import os
import socket

c = get_config() # noqa

from jupyterhub.auth import DummyAuthenticator
Expand All @@ -10,6 +11,7 @@
# c.DummyAuthenticator.password = "your_password"

from kubespawner.spawner import KubeSpawner

c.JupyterHub.spawner_class = KubeSpawner

c.Spawner.cmd = ["jupyterhub-singleuser"]
Expand All @@ -18,13 +20,13 @@
# the hub to be able to restart without losing user containers
c.JupyterHub.cleanup_servers = False
c.JupyterHub.services = [
{
"name": "binder",
"url": "http://localhost:8585",
"command": ["python", "-m", "binderhub", "-f", "binderhub_config.py"],
# Pass on environment variables required for binderhub to find where the docker image is
"environment": os.environ.copy()
}
{
"name": "binder",
"url": "http://localhost:8585",
"command": ["python", "-m", "binderhub", "-f", "binderhub_config.py"],
# Pass on environment variables required for binderhub to find where the docker image is
"environment": os.environ.copy(),
}
]

# Find the IP of the machine that minikube is most likely able to talk to
Expand All @@ -37,97 +39,97 @@
c.JupyterHub.hub_connect_ip = host_ip

from jupyterhub_fancy_profiles import setup_ui

setup_ui(c)

c.KubeSpawner.profile_list = [
{
"display_name": "Small",
"description": "~2 CPU, ~2G RAM",
"profile_options": {
"image": {
"display_name": "Image",
"unlisted_choice": {
"enabled": True,
"display_name": "Custom image",
"validation_regex": "^.+:.+$",
"validation_message": "Must be a publicly available docker image, of form <image-name>:<tag>",
"display_name_in_choices": "Specify an existing docker image",
"description_in_choices": "Use a pre-existing docker image from a public docker registry (dockerhub, quay, etc)",
"kubespawner_override": {
"image": "{value}"
}
},
"choices": {
"pangeo": {
"display_name": "Pangeo Notebook Image", "description": "Python image with scientific, dask and geospatial tools",
"kubespawner_override": {
"image": "pangeo/pangeo-notebook:2023.09.11"
}
},
"geospatial": {
"display_name": "Rocker Geospatial",
"description": "R image with RStudio, the tidyverse & Geospatial tools",
"default": True,
"slug": "geospatial",
"kubespawner_override": {
"image": "rocker/binder:4.3",
"default_url": "/rstudio",
"working_dir": "/home/rstudio",
}
},
"scipy": {
"display_name": "Jupyter SciPy Notebook",
"slug": "scipy",
"kubespawner_override": {
"image": "jupyter/scipy-notebook:2023-06-26"
}
}
}
},
"resources": {
"display_name": "Resource Allocation",
"choices": {
"mem_2_7": {
"display_name": "2.7 GB RAM, upto 3.479 CPUs",
"description": "Use this for the workshop on 2023 September",
"kubespawner_override": {
"mem_guarantee": 1024,
"mem_limit": 2904451072,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479,
{
"display_name": "Small",
"description": "~2 CPU, ~2G RAM",
"profile_options": {
"image": {
"display_name": "Image",
"unlisted_choice": {
"enabled": True,
"display_name": "Custom image",
"validation_regex": "^.+:.+$",
"validation_message": "Must be a publicly available docker image, of form <image-name>:<tag>",
"display_name_in_choices": "Specify an existing docker image",
"description_in_choices": "Use a pre-existing docker image from a public docker registry (dockerhub, quay, etc)",
"kubespawner_override": {"image": "{value}"},
},
"choices": {
"pangeo": {
"display_name": "Pangeo Notebook Image",
"description": "Python image with scientific, dask and geospatial tools",
"kubespawner_override": {
"image": "pangeo/pangeo-notebook:2023.09.11"
},
},
"geospatial": {
"display_name": "Rocker Geospatial",
"description": "R image with RStudio, the tidyverse & Geospatial tools",
"default": True,
"slug": "geospatial",
"kubespawner_override": {
"image": "rocker/binder:4.3",
"default_url": "/rstudio",
"working_dir": "/home/rstudio",
},
},
"scipy": {
"display_name": "Jupyter SciPy Notebook",
"slug": "scipy",
"kubespawner_override": {
"image": "jupyter/scipy-notebook:2023-06-26"
},
},
},
},
"default": True
},
"mem_5_4": {
"display_name": "5.4 GB RAM, upto 3.479 CPUs",
"kubespawner_override": {
"mem_guarantee":1024,
"mem_limit": 5808902144,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479,
}
},
"mem_10_8": {
"display_name": "10.8 GB RAM, upto 3.479 CPUs",
"kubespawner_override": {
"mem_guarantee": 1024,
"mem_limit": 11617804288,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479,
}
},
"mem_21_6": {
"display_name": "21.6 GB RAM, upto 3.479 CPUs",
"description": "Large amount of RAM, might start slowly",
"kubespawner_override": {
"mem_guarantee": 1024,
"mem_limit": 23235608576,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479
"resources": {
"display_name": "Resource Allocation",
"choices": {
"mem_2_7": {
"display_name": "2.7 GB RAM, upto 3.479 CPUs",
"description": "Use this for the workshop on 2023 September",
"kubespawner_override": {
"mem_guarantee": 1024,
"mem_limit": 2904451072,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479,
},
"default": True,
},
"mem_5_4": {
"display_name": "5.4 GB RAM, upto 3.479 CPUs",
"kubespawner_override": {
"mem_guarantee": 1024,
"mem_limit": 5808902144,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479,
},
},
"mem_10_8": {
"display_name": "10.8 GB RAM, upto 3.479 CPUs",
"kubespawner_override": {
"mem_guarantee": 1024,
"mem_limit": 11617804288,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479,
},
},
"mem_21_6": {
"display_name": "21.6 GB RAM, upto 3.479 CPUs",
"description": "Large amount of RAM, might start slowly",
"kubespawner_override": {
"mem_guarantee": 1024,
"mem_limit": 23235608576,
"cpu_guarantee": 0.1,
"cpu_limit": 3.479,
},
},
},
},
}
}
}
},
}
}
]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ classifiers = [
]

[tool.setuptools_scm]
version_file = "jupyterhub_fancy_profiles/_version.py"
version_file = "jupyterhub_fancy_profiles/_version.py"

0 comments on commit 2eda5c2

Please sign in to comment.