You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/tutorials/pages/jupyterhub.adoc
+122-1Lines changed: 122 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -352,10 +352,131 @@ If the default file is not overwritten, but is mounted to a new file in the same
352
352
353
353
=== Endpoints
354
354
355
-
=== Driver Service
355
+
The Helm chart for JupyterHub allows us to augment the standard configuration with one or more scripts.
356
+
As mentioned in an earlier section, we want to define the endpoints dynamically - by making use of the ConfigMap written out by the Keycloak Deployment - and we can do this by adding a script under `extraConfig`:
357
+
358
+
[source,yaml]
359
+
----
360
+
extraConfig:
361
+
...
362
+
03-set-endpoints: |
363
+
import os
364
+
from oauthenticator.generic import GenericOAuthenticator
NOTE: when using Spark, please the `Provisos` section below.
378
+
379
+
In the same way, we can use another script to define a driver service for each user.
380
+
This is essential when using Spark from within a JupyterHUb notebook so that executor pods can be spawned from the user's kernel in a user-specific way.
381
+
This script instructs JupyterHub to use `KubeSpawner` to create a service referenced by the UID of the parent Pod.
382
+
383
+
[source,yaml]
384
+
----
385
+
extraConfig:
386
+
...
387
+
02-create-spark-driver-service-hook: |
388
+
# Thanks to https://github.com/jupyterhub/kubespawner/pull/644
389
+
from jupyterhub.utils import exponential_backoff
390
+
from kubespawner import KubeSpawner
391
+
from kubespawner.objects import make_owner_reference
392
+
from kubernetes_asyncio.client.models import V1ServicePort
The `singleuser.profileList` section of the Helm chart values allows us to define notebook profiles by setting the CPU, Memory and Image combinations that can be selected. For instance, the profiles below allows to select 2/4/... CPUs, 4/8/... GB RAM and between two images.
0 commit comments