-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalues.yaml
More file actions
349 lines (342 loc) · 10.6 KB
/
Copy pathvalues.yaml
File metadata and controls
349 lines (342 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
hub:
# Inject OAuth and AWS credentials from K8s secrets into environment
extraEnv:
GITHUB_CLIENT_ID:
valueFrom:
secretKeyRef:
name: jupyter-oauth-secret
key: GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET:
valueFrom:
secretKeyRef:
name: jupyter-oauth-secret
key: GITHUB_CLIENT_SECRET
CILOGON_CLIENT_ID:
valueFrom:
secretKeyRef:
name: jupyter-oauth-secret
key: CILOGON_CLIENT_ID
CILOGON_CLIENT_SECRET:
valueFrom:
secretKeyRef:
name: jupyter-oauth-secret
key: CILOGON_CLIENT_SECRET
PROXY_SECRET_TOKEN:
valueFrom:
secretKeyRef:
name: jupyter-proxy-secret
key: PROXY_SECRET_TOKEN
AWS_ACCESS_KEY_ID:
valueFrom:
secretKeyRef:
name: jupyter-aws-secret
key: AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
valueFrom:
secretKeyRef:
name: jupyter-aws-secret
key: AWS_SECRET_ACCESS_KEY
OPENAI_API_KEY:
valueFrom:
secretKeyRef:
name: nrp-llm-secret
key: NRP_LLM_API_KEY
extraConfig:
# Read OAuth credentials from environment variables (set via extraEnv from K8s secret)
configure-oauth-from-env: |
import os
c.GitHubOAuthenticator.client_id = os.environ.get('GITHUB_CLIENT_ID')
c.GitHubOAuthenticator.client_secret = os.environ.get('GITHUB_CLIENT_SECRET')
c.CILogonOAuthenticator.client_id = os.environ.get('CILOGON_CLIENT_ID')
c.CILogonOAuthenticator.client_secret = os.environ.get('CILOGON_CLIENT_SECRET')
# Read proxy secret token from environment variable
configure-proxy-from-env: |
import os
c.ConfigurableHTTPProxy.auth_token = os.environ.get('PROXY_SECRET_TOKEN')
# Pass secrets from hub env into singleuser pods via KubeSpawner
configure-singleuser-secrets: |
import os
c.KubeSpawner.environment.update({
'AWS_ACCESS_KEY_ID': os.environ.get('AWS_ACCESS_KEY_ID'),
'AWS_SECRET_ACCESS_KEY': os.environ.get('AWS_SECRET_ACCESS_KEY'),
'OPENAI_API_KEY': os.environ.get('OPENAI_API_KEY'),
})
c.KubeSpawner.lifecycle_hooks = {
"postStart": {
"exec": {
"command": ["bash", "-c",
# RStudio 2026.05.0 (rocker/ml rebuild 2026-05-31) bakes a
# root-owned 0600 session-rpc-key; rootless rserver (via
# jupyter-rsession-proxy) can't read it. Make it readable.
"sudo chmod a+r /var/lib/rstudio-server/session-rpc-key 2>/dev/null || true; "
# Write secrets to ~/.Renviron so RStudio sees them.
# Use > (truncate) not >> to avoid appending duplicates on every spawn.
"for v in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY OPENAI_API_KEY OPENAI_BASE_URL; do echo \"$v=${!v}\"; done > /home/jovyan/.Renviron"
]
}
}
}
config:
GitHubOAuthenticator:
allowed_organizations:
- espm-157
- espm-288
- boettiger-lab
- SchmidtDSE
- berkeley-espm
scope:
- read:org
oauth_callback_url: https://espm.nrp-nautilus.io/hub/oauth_callback
CILogonOAuthenticator:
oauth_callback_url: https://espm.nrp-nautilus.io/hub/oauth_callback
admin_users:
- cboettig@berkeley.edu
# NRP-required admin users (per https://nrp.ai/documentation/userdocs/jupyter/jupyterhub/)
- mfsada@ucsd.edu
- d4diaz@ucsd.edu
- dmishin@ucsd.edu
# IDP Lookup: https://cilogon.org/idplist/
allowed_idps:
urn:mace:incommon:berkeley.edu:
allowed_domains:
- berkeley.edu
username_derivation:
username_claim: email
# UCSD required so NRP admins can authenticate
urn:mace:incommon:ucsd.edu:
allowed_domains:
- ucsd.edu
username_derivation:
username_claim: email
JupyterHub:
admin_access: true
admin_users:
- "cboettig@berkeley.edu"
# NRP-required admin users
- "mfsada@ucsd.edu"
- "d4diaz@ucsd.edu"
- "dmishin@ucsd.edu"
authenticator_class: cilogon
KubeSpawner:
environment:
SHELL: /usr/bin/bash
GH_SCOPED_CREDS_CLIENT_ID: "Iv1.8d384d9612c2ecc3"
GH_SCOPED_CREDS_APP_URL: "https://github.com/apps/jupyterhub-gh-creds"
OPENAI_BASE_URL: "https://ellm.nrp-nautilus.io/v1"
LANG: "C.UTF-8"
LC_ALL: "C.UTF-8"
service:
type: ClusterIP
annotations: {}
ports:
nodePort:
loadBalancerIP:
deploymentStrategy:
type: Recreate
db:
type: sqlite-pvc
pvc:
# TEMPORARY PVC SWAP to unblock deployment, 2026-01-25
# Old PVC hub-db-dir is stuck in ContainerCreating due to Ceph mount issue.
# DO NOT DELETE the old volume; data not migrated. To revert: return size to 10Gi below.
accessModes:
- ReadWriteOnce
storage: 11Gi
storageClassName: rook-ceph-block
resources:
limits:
cpu: 2
memory: 4Gi
requests:
cpu: 2
memory: 512Mi
networkPolicy:
enabled: false
proxy:
service:
type: ClusterIP
chp:
resources:
limits:
cpu: "10"
memory: 10Gi
requests:
cpu: "2"
memory: 512Mi
singleuser:
allowPrivilegeEscalation: true
startTimeout: 3600
fsGid: 100
extraPodConfig:
securityContext:
fsGroupChangePolicy: "OnRootMismatch"
fsGroup: 100
extraNodeAffinity:
required:
- matchExpressions:
- key: topology.kubernetes.io/region
operator: In
values: ["us-west"]
cloudMetadata:
blockWithIptables: false
networkPolicy:
enabled: false
storage:
type: dynamic
extraLabels: {}
capacity: 15Gi
homeMountPath: /home/jovyan
dynamic:
storageClass: rook-ceph-block
pvcNameTemplate: claim-{username}{servername}
volumeNameTemplate: volume-{username}{servername}
storageAccessModes: [ReadWriteOnce]
extraVolumeMounts:
- name: shm-volume
mountPath: /dev/shm
extraVolumes:
- name: shm-volume
emptyDir:
medium: Memory
extraFiles:
jupyter_server_config.json:
mountPath: /usr/local/etc/jupyter/jupyter_server_config.json
data:
ContentsManager:
allow_hidden: true
FileContentsManager:
always_delete_dir: true
image:
name: gitlab-registry.nrp-nautilus.io/cboettig/images
pullPolicy: IfNotPresent
cpu:
limit: 10
guarantee: 1
memory:
limit: 10G
guarantee: 10G
profileList:
- display_name: "Choose your environment and resources"
default: true
profile_options:
interface:
display_name: Interface
choices:
vscode:
display_name: VS Code
kubespawner_override:
default_url: "/vscode"
rstudio:
display_name: RStudio
default: true
kubespawner_override:
default_url: "/rstudio"
lab:
display_name: JupyterLab
kubespawner_override:
default_url: "/lab"
image:
display_name: Environment
unlisted_choice:
enabled: True
display_name: "Custom image"
display_name_in_choices: "Specify an existing docker image"
description_in_choices: "Use a pre-existing docker image from a public docker registry"
description: "Specify your own docker image (must have jupyterhub-singleuser installed)"
validation_regex: "^.+:.+$"
validation_message: "Must be a publicly available docker image, of form <image-name>:<tag>"
kubespawner_override:
image: "{value}"
choices:
01-rocker-ml:
display_name: rocker/ml (CPU)
description: Machine Learning environment for R & python (rocker/ml)
kubespawner_override:
image: "ghcr.io/boettiger-lab/k8s@sha256:c0fe49ad472e0a96803a7ad5085b7b0a61b44050ddcae9ae69aa1cdf60d06b72"
default: true
02-speciesnet:
display_name: SpeciesNet (GPU)
description: CV/ML for ecology
kubespawner_override:
image: "ghcr.io/boettiger-lab/speciesnet:latest"
extra_resource_limits:
nvidia.com/gpu: "1"
03-rocker-cuda:
display_name: rocker/cuda (GPU)
description: Machine Learning environment for R & python
kubespawner_override:
image: "ghcr.io/rocker-org/cuda:latest"
extra_resource_limits:
nvidia.com/gpu: "1"
04-geospatial:
display_name: Rocker ML spatial
description: Geospatial environment for R & python (rocker/ml-spatial)
kubespawner_override:
image: "ghcr.io/rocker-org/ml-spatial:latest"
resource_allocation:
display_name: Resource Allocation
choices:
mem_8:
display_name: 8 GB RAM
kubespawner_override:
mem_guarantee: 8G
mem_limit: 8G
cpu_guarantee: 1
cpu_limit: 1
default: true
mem_16:
display_name: 16 GB RAM
kubespawner_override:
mem_guarantee: 16G
mem_limit: 16G
cpu_guarantee: 2
cpu_limit: 2
mem_32:
display_name: 32 GB RAM
kubespawner_override:
mem_guarantee: 32G
mem_limit: 32G
cpu_guarantee: 4
cpu_limit: 4
mem_64:
display_name: 64 GB RAM
kubespawner_override:
mem_guarantee: 64G
mem_limit: 64G
cpu_guarantee: 10
cpu_limit: 10
mem_128:
display_name: 128 GB RAM
kubespawner_override:
mem_guarantee: 128G
mem_limit: 128G
cpu_guarantee: 10
cpu_limit: 10
scheduling:
userScheduler:
enabled: false
userPlaceholder:
enabled: false
# prePuller relates to the hook|continuous-image-puller DaemonsSets
prePuller:
hook:
enabled: false
continuous:
enabled: false
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: haproxy
hosts: ["espm.nrp-nautilus.io"]
pathSuffix: ''
tls:
- hosts:
- espm.nrp-nautilus.io
cull:
enabled: true
users: false
removeNamedServers: true
timeout: 3600
every: 600
concurrency: 10
maxAge: 0