-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdaskhub.yaml
262 lines (251 loc) · 7.76 KB
/
daskhub.yaml
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
dask-gateway:
enabled: true
traefik:
service:
type: ClusterIP
additionalArguments:
- "--providers.kubernetescrd.allowcrossnamespace=false"
- "--providers.kubernetescrd.namespaces=c-scale-pangeo-dask"
- "--providers.kubernetesgateway.namespaces=c-scale-pangeo-dask"
- "--providers.kubernetesingress.namespaces=c-scale-pangeo-dask"
gateway:
# loglevel: DEBUG
extraConfig:
# https://gateway.dask.org/resource-limits.html
dasklimits: |
# see https://github.com/dask/dask-gateway/issues/315
c.ClusterConfig.cluster_max_cores = 40 # instead of "32"
c.ClusterConfig.cluster_max_memory = "140 G" # instead of "128 G"
c.ClusterConfig.cluster_max_workers = 4
c.ClusterConfig.idle_timeout = 1800
optionHandler: |
from dask_gateway_server.options import Options, Integer, Float, String
def options_handler(options):
if ":" not in options.image:
raise ValueError("When specifying an image you must also provide a tag")
return {
"worker_cores": options.worker_cores,
"worker_memory": int(options.worker_memory * 2 ** 30),
"image": options.image,
}
c.Backend.cluster_options = Options(
Integer("worker_cores", default=1, min=1, max=8, label="Worker Cores"),
Float("worker_memory", default=2, min=2, max=32, label="Worker Memory (GiB)"),
String("image", default="quay.io/pangeo/pangeo-notebook:2024.08.18", label="Image"),
handler=options_handler,
)
prefix: /services/dask-gateway
backend:
scheduler:
extraPodConfig:
securityContext:
fsGroupChangePolicy: OnRootMismatch
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
extraContainerConfig:
securityContext:
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
cores:
request: 1
limit: 1
memory:
request: 8G
limit: 8G
worker:
extraPodConfig:
securityContext:
fsGroupChangePolicy: OnRootMismatch
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
extraContainerConfig:
securityContext:
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
dask-kubernetes:
enabled: false
rbac:
enabled: true
jupyterhub:
hub:
initContainers:
- name: git-clone-templates
image: alpine/git
args:
- clone
- --single-branch
- --branch=main
- --depth=1
- --
- https://github.com/pangeo-data/pangeo-eosc.git
- /etc/jupyterhub/custom
securityContext:
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- name: custom-templates
mountPath: /etc/jupyterhub/custom
- name: git-clone-static
image: alpine/git
args:
- clone
- --single-branch
- --branch=main
- --depth=1
- --
- https://github.com/pangeo-data/pangeo-eosc.git
- /usr/local/share/jupyterhub/static/custom
securityContext:
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- name: custom-static
mountPath: /usr/local/share/jupyterhub/static/custom
extraVolumes:
- name: custom-templates
emptyDir: {}
- name: custom-static
emptyDir: {}
extraVolumeMounts:
- name: custom-templates
mountPath: /etc/jupyterhub/custom
- name: custom-static
mountPath: /usr/local/share/jupyterhub/static/custom
extraConfig:
templates: |
c.JupyterHub.template_paths = ['/etc/jupyterhub/custom/templates']
# 01-add-message: |
# c.JupyterHub.template_vars = {'announcement_login': 'Pangeo@EOSC: scheduled maintenance window ' +
# 'on 7th May, 2.30pm - 3.30pm CEST. ' +
# 'Backup your data!'
# }
pre-spawn-hook: |
async def bootstrap_pre_spawn(spawner):
spawner.container_security_context = {"capabilities": {"drop": ["ALL"]}}
c.KubeSpawner.pre_spawn_hook = bootstrap_pre_spawn
networkPolicy:
interNamespaceAccessLabels: "accept"
containerSecurityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
podSecurityContext:
fsGroupChangePolicy: OnRootMismatch
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
ingress:
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/proxy-body-size: "1g"
enabled: true
hosts:
- pangeo-eosc.vm.fedcloud.eu # replace this with your DNS name
tls:
- hosts:
- pangeo-eosc.vm.fedcloud.eu # replace this with your DNS name
secretName: pangeo-eosc.vm.fedcloud.eu # replace this with your DNS name
proxy:
service:
type: ClusterIP
chp:
containerSecurityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
extraPodSpec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
singleuser:
extraFiles:
jupyter_notebook_config.json:
mountPath: /etc/jupyter/jupyter_notebook_config.json
data:
MappingKernelManager:
cull_idle_timeout: 3600
cull_interval: 300
cull_connected: true
cull_busy: false
networkPolicy:
enabled: false
cloudMetadata:
blockWithIptables: false
cpu:
guarantee: 1
limit: 8
defaultUrl: /lab
image:
name: quay.io/pangeo/pangeo-notebook
tag: 2024.08.18
profileList:
- display_name: "pangeo-notebook"
description: "Pangeo stack"
default: true
- display_name: "ml-notebook"
description: "pangeo-notebook + GPU-enabled tensorflow2"
kubespawner_override:
image: quay.io/pangeo/ml-notebook:2024.08.18
extra_resource_guarantees:
nvidia.com/gpu: 1
extra_resource_limits:
nvidia.com/gpu: 1
- display_name: "pytorch-notebook"
description: "pangeo-notebook + GPU-enabled pytorch"
kubespawner_override:
image: quay.io/pangeo/pytorch-notebook:2024.08.18
extra_resource_guarantees:
nvidia.com/gpu: 1
extra_resource_limits:
nvidia.com/gpu: 1
- display_name: "datascience-notebook"
description: "Python, R, and Julia."
kubespawner_override:
image: quay.io/jupyter/datascience-notebook:2024-09-02
memory:
guarantee: 2G
limit: 32G
startTimeout: 600
storage:
capacity: 10Gi
dynamic:
storageClass: nfs-csi-backup
allowPrivilegeEscalation: false
extraPodConfig:
securityContext:
fsGroupChangePolicy: OnRootMismatch
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
scheduling:
userScheduler:
enabled: false
userPlaceholder:
enabled: false
prePuller:
hook:
enabled: false
continuous:
enabled: false