-
Notifications
You must be signed in to change notification settings - Fork 11
/
example-jupyter.yaml
executable file
·74 lines (64 loc) · 2.1 KB
/
example-jupyter.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
apiVersion: v1
kind: Pod
metadata:
name: username-example-jupyter
labels:
user: set-your-username
spec:
restartPolicy: Never
containers:
- name: jupyter-server
image: ic-registry.epfl.ch/cvlab/lis/lab-python-ml:py38src
imagePullPolicy: Always # load the newest version of the image
#command: ["/opt/lab/setup_and_wait.sh"]
# this one will do nothing and wait, so you can enter the container yourself with
# kubectl exec -it pod_name /bin/bash
command:
- "/opt/lab/setup_and_run_command.sh"
- "timeout 4h jupyter lab --ip=0.0.0.0 --no-browser --notebook-dir=/cvlabdata2/home/lis/kubernetes_example"
# runs the command on the 2nd line
# timeout will ensure this dies after some time, so we don't risk leaving it running forever
env:
- name: CLUSTER_USER
value: "username" # set this
- name: CLUSTER_USER_ID
# set this, run `id` on cvlab cluster to get the number, it will print among other things:
# uid=number(yourname)
value: "12345"
- name: CLUSTER_GROUP_NAME
value: "CVLAB-unit"
- name: CLUSTER_GROUP_ID
value: "11166"
- name: JUPYTER_CONFIG_DIR
value: "/cvlabdata2/home/lis/kubernetes_example/.jupyter"
ports:
- containerPort: 8888
name: jupyter
volumeMounts:
- mountPath: /cvlabsrc1
name: cvlabsrc1
- mountPath: /cvlabdata1
name: cvlabdata1
- mountPath: /cvlabdata2
name: cvlabdata2
- mountPath: /dev/shm
name: dshm
# specify that it uses a GPU!
# resources:
# limits:
# nvidia.com/gpu: 1 # requesting 1 GPU
volumes:
- name: cvlabsrc1
persistentVolumeClaim:
claimName: pv-cvlabsrc1
- name: cvlabdata1
persistentVolumeClaim:
claimName: pv-cvlabdata1
- name: cvlabdata2
persistentVolumeClaim:
claimName: pv-cvlabdata2
# shared memory, often needed by PyTorch dataloaders
- name: dshm
emptyDir:
medium: Memory
sizeLimit: 4Gi