Skip to content

Commit 428d83d

Browse files
committed
CH-110 jupyterhub update wip
1 parent cff3c6b commit 428d83d

9 files changed

Lines changed: 6050 additions & 299 deletions

File tree

applications/jupyterhub/Dockerfile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
ARG CLOUDHARNESS_BASE
22
FROM $CLOUDHARNESS_BASE as base
33

4-
FROM jupyterhub/k8s-hub:1.1.3
4+
FROM quay.io/jupyterhub/k8s-hub:3.2.1
55
USER root
66

77

88
COPY --from=base libraries/models/requirements.txt /libraries/models/requirements.txt
9-
RUN pip install -r /libraries/models/requirements.txt
9+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
10+
pip install -r /libraries/models/requirements.txt
1011
COPY --from=base libraries/cloudharness-common/requirements.txt /libraries/cloudharness-common/requirements.txt
11-
RUN pip install -r /libraries/cloudharness-common/requirements.txt
12+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
13+
pip install -r /libraries/cloudharness-common/requirements.txt
1214
COPY --from=base libraries/client/cloudharness_cli/requirements.txt /libraries/client/cloudharness_cli/requirements.txt
13-
RUN pip install -r /libraries/client/cloudharness_cli/requirements.txt
15+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
16+
pip install -r /libraries/client/cloudharness_cli/requirements.txt
1417

1518
COPY --from=base libraries/models /libraries/models
16-
RUN pip install -e /libraries/models
19+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
20+
pip install -e /libraries/models
1721

1822
COPY --from=base libraries/cloudharness-common /libraries/cloudharness-common
1923
COPY --from=base libraries/client/cloudharness_cli /libraries/client/cloudharness_cli
2024

2125
#
2226

23-
RUN pip install -e /libraries/cloudharness-common
24-
RUN pip install -e /libraries/client/cloudharness_cli
27+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
28+
pip install -e /libraries/cloudharness-common
29+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
30+
pip install -e /libraries/client/cloudharness_cli
2531

2632

2733
COPY src src
28-
RUN pip install ./src/harness_jupyter
29-
RUN pip install ./src/chauthenticator
34+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
35+
pip install ./src/harness_jupyter
36+
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
37+
pip install ./src/chauthenticator
3038

3139
USER jovyan

applications/jupyterhub/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ TODO: remember to implement/revise this code after you have updated/changed the
3737
The helm chart is based on the [zero-to-jupyterhub](https://github.com/jupyterhub/zero-to-jupyterhub-k8s/) helm chart.
3838

3939
1. Run update.sh [TAG] # Do not use latest!
40-
2. Restore from the diff files with EDIT: CLOUDHARNESS
40+
2. Restore from the diff files with EDIT: CLOUDHARNESS. Use update.patch as a reference
41+
3. 3. Update Dockerfile to use the same base image you see on values.yaml: hub/image
4142

4243
Customize notebook image: quay.io/jupyterhub/k8s-singleuser-sample:[TAG]
4344

applications/jupyterhub/deploy/resources/hub/jupyterhub_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ def camelCaseify(s):
537537
c.Authenticator.auto_login = True
538538
c.OAuthenticator.client_id = client_id
539539
c.OAuthenticator.client_secret = client_secret
540+
c.OAuthenticator.allow_all = True
540541

541542
c.GenericOAuthenticator.login_service = "CH"
542543
c.GenericOAuthenticator.username_key = "email"

applications/jupyterhub/deploy/resources/hub/z2jh.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def get_config(key, default=None):
119119
value = value[level]
120120

121121
# EDIT: CLOUDHARNESS START
122+
import re
122123
if value and isinstance(value, str):
123124
replace_var = re.search("{{.*?}}", value)
124125
if replace_var:

applications/jupyterhub/deploy/templates/_helpers-auth-rework.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ ldap.dn.user.useLookupName: LDAPAuthenticator.use_lookup_dn_username
178178
representing the old z2jh config, output the result
179179
in $c.
180180
*/}}
181-
{{- include "jupyterhub.authDep.remapOldToNew.mappable" (list $c .Values.apps.jupyterhub.apps.jupyterhub.global.safeToSho.Values.apps.jupyterhub. }}
181+
{{- include "jupyterhub.authDep.remapOldToNew.mappable" (list $c .Values.apps.jupyterhub.apps.jupyterhub.global.safeToSho.Values.apps.jupyterhub) }}
182182

183183
{{- $class_old_config_key := .Values.apps.jupyterhub.apps.jupyterhub.auth.type | default "" }} {{- /* ldap - github */}}
184184
{{- $class_new_entrypoint := "" }} {{- /* ldapauthenticator.LDAPAuthenticator - github */}}
@@ -191,7 +191,7 @@ ldap.dn.user.useLookupName: LDAPAuthenticator.use_lookup_dn_username
191191
{{- /* UPDATE c dict explicitly with auth.custom.config */}}
192192
{{- if .Values.apps.jupyterhub.apps.jupyterhub.auth.custom.config }}
193193
{{- $custom_config := merge (dict) .Values.apps.jupyterhub.apps.jupyterhub.auth.custom.config }}
194-
{{- if not .Values.apps.jupyterhub.apps.jupyterhub.global.safeToSho.Values.apps.jupyterhub.}}
194+
{{- if not .Values.apps.jupyterhub.apps.jupyterhub.global.safeToSho.Values.apps.jupyterhub }}
195195
{{- range $key, $val := $custom_config }}
196196
{{- $_ := set $custom_config $key "***" }}
197197
{{- end }}

applications/jupyterhub/deploy/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ component: {{ include "jupyterhub.componentLabel" . }}
194194
using "toYaml | fromYaml" in order to be able to use normal helm
195195
template functions on it.
196196
*/}}
197-
{{- $jupyterhub_values := .root.Values.apps.jupyterhub.}}
197+
{{- $jupyterhub_values := .root.Values.apps.jupyterhub }}
198198
{{- if ne .root.Chart.Name "jupyterhub" }}
199199
{{- if .root.Values.apps.jupyterhub.jupyterhub }}
200200
{{- $jupyterhub_values = .root.Values.apps.jupyterhub.jupyterhub }}

0 commit comments

Comments
 (0)