-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_resources.yaml
201 lines (201 loc) · 7.12 KB
/
test_resources.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
apiVersion: template.openshift.io/v1
kind: Template
parameters:
- name: NOTEBOOK_NAME
required: true
- name: TEST_RUN_NAME
required: true
- name: USERNAME
required: true
- name: IMAGE_NAME
required: true
- name: NAMESPACE
required: true
- name: PVC_SIZE
required: true
value: "0.5Gi"
objects:
- apiVersion: kubeflow.org/v1beta1
kind: Notebook
metadata:
annotations:
notebooks.opendatahub.io/inject-oauth: 'true'
notebooks.opendatahub.io/last-image-selection: ${IMAGE_NAME}
notebooks.opendatahub.io/last-size-selection: X Small
notebooks.opendatahub.io/oauth-logout-url: >-
https://rhods-dashboard-redhat-ods-applications.apps.shift.nerc.mghpcc.org/projects/${NAMESPACE}?notebookLogout=${NOTEBOOK_NAME}
opendatahub.io/username: ${USERNAME}
openshift.io/description: ''
openshift.io/display-name: ${NOTEBOOK_NAME}
name: ${NOTEBOOK_NAME}
labels:
ope-test-run: ${TEST_RUN_NAME}
app: ${NOTEBOOK_NAME}
opendatahub.io/dashboard: 'true'
opendatahub.io/odh-managed: 'true'
opendatahub.io/user: ${USERNAME}
spec:
template:
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: nvidia.com/gpu.present
# set the value to 'true' to use nodes with GPUs
operator: In
values:
- 'true'
weight: 1
containers:
- resources:
limits:
cpu: '1'
memory: 2Gi
# remove this line if no GPU is needed
nvidia.com/gpu: '1'
requests:
cpu: '1'
memory: 2Gi
# remove this line if no GPU is needed
nvidia.com/gpu: '1'
readinessProbe:
failureThreshold: 3
httpGet:
path: /notebook/${NAMESPACE}/${NOTEBOOK_NAME}/api
port: notebook-port
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
name: ${NOTEBOOK_NAME}
livenessProbe:
failureThreshold: 3
httpGet:
path: /notebook/${NAMESPACE}/${NOTEBOOK_NAME}/api
port: notebook-port
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
env:
- name: NOTEBOOK_ARGS
value: |-
--ServerApp.port=8888
--ServerApp.token=''
--ServerApp.password=''
--ServerApp.base_url=/notebook/${NAMESPACE}/${NOTEBOOK_NAME}
--ServerApp.quit_button=False
--ServerApp.tornado_settings={"user":"${USERNAME}","hub_host":"https://rhods-dashboard-redhat-ods-applications.apps.shift.nerc.mghpcc.org","hub_prefix":"/projects/${NAMESPACE}"}
- name: JUPYTER_IMAGE
value: >-
image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/${IMAGE_NAME}
ports:
- containerPort: 8888
name: notebook-port
protocol: TCP
imagePullPolicy: Always
volumeMounts:
- mountPath: /opt/app-root/src
name: ${NOTEBOOK_NAME}
- mountPath: /dev/shm
name: shm
image: >-
image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/${IMAGE_NAME}
workingDir: /opt/app-root/src
- resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 100m
memory: 64Mi
readinessProbe:
failureThreshold: 3
httpGet:
path: /oauth/healthz
port: oauth-proxy
scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
name: oauth-proxy
livenessProbe:
failureThreshold: 3
httpGet:
path: /oauth/healthz
port: oauth-proxy
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- containerPort: 8443
name: oauth-proxy
protocol: TCP
imagePullPolicy: Always
volumeMounts:
- mountPath: /etc/oauth/config
name: oauth-config
- mountPath: /etc/tls/private
name: tls-certificates
image: >-
registry.redhat.io/openshift4/ose-oauth-proxy@sha256:4bef31eb993feb6f1096b51b4876c65a6fb1f4401fee97fa4f4542b6b7c9bc46
args:
- '--provider=openshift'
- '--https-address=:8443'
- '--http-address='
- '--openshift-service-account=${NOTEBOOK_NAME}'
- '--cookie-secret-file=/etc/oauth/config/cookie_secret'
- '--cookie-expire=24h0m0s'
- '--tls-cert=/etc/tls/private/tls.crt'
- '--tls-key=/etc/tls/private/tls.key'
- '--upstream=http://localhost:8888'
- '--upstream-ca=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt'
- '--email-domain=*'
- '--skip-provider-button'
- >-
--openshift-sar={"verb":"get","resource":"notebooks","resourceAPIGroup":"kubeflow.org","resourceName":"${NOTEBOOK_NAME}","namespace":"$(NAMESPACE)"}
- >-
--logout-url=https://rhods-dashboard-redhat-ods-applications.apps.shift.nerc.mghpcc.org/projects/${NAMESPACE}?notebookLogout=${NOTEBOOK_NAME}
enableServiceLinks: false
serviceAccountName: ${NOTEBOOK_NAME}
volumes:
- name: ${NOTEBOOK_NAME}
persistentVolumeClaim:
claimName: ${NOTEBOOK_NAME}
- emptyDir:
medium: Memory
name: shm
- name: oauth-config
secret:
defaultMode: 420
secretName: ${NOTEBOOK_NAME}-oauth-config
- name: tls-certificates
secret:
defaultMode: 420
secretName: ${NOTEBOOK_NAME}-tls
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${NOTEBOOK_NAME}
labels:
app: ${NOTEBOOK_NAME}
notebook-name: ${NOTEBOOK_NAME}
ope-test-run: ${TEST_RUN_NAME}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "${PVC_SIZE}"