Skip to content

Commit c301b4e

Browse files
committed
Add MLMD Unit Test
1 parent e66c464 commit c301b4e

11 files changed

+802
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# When a minimal DSPA is deployed
2+
Images:
3+
ApiServer: api-server:test5
4+
Artifact: artifact-manager:test5
5+
PersistentAgent: persistenceagent:test5
6+
ScheduledWorkflow: scheduledworkflow:test5
7+
Cache: ubi-minimal:test5
8+
MoveResultsImage: busybox:test5
9+
MlPipelineUI: frontend:test5
10+
MariaDB: mariadb:test5
11+
Minio: minio:test5
12+
OAuthProxy: oauth-proxy:test5
13+
MlmdEnvoy: metadata-envoy:changeme
14+
MlmdGrpc: metadata-grpc:changeme
15+
MlmdWriter: metadata-grpc:changeme
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: datasciencepipelinesapplications.opendatahub.io/v1alpha1
2+
kind: DataSciencePipelinesApplication
3+
metadata:
4+
name: testdsp5
5+
spec:
6+
objectStorage:
7+
minio:
8+
image: minio:test5
9+
mlpipelineUI:
10+
image: frontend:test5
11+
mlmd:
12+
deploy: true
13+
envoy:
14+
image: metadata-envoy:test5
15+
grpc:
16+
image: metadata-grpc:test5
17+
port: "1337"
18+
writer:
19+
image: metadata-writer:test5
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: ds-pipeline-testdsp5
5+
namespace: default
6+
labels:
7+
app: ds-pipeline-testdsp5
8+
component: data-science-pipelines
9+
spec:
10+
selector:
11+
matchLabels:
12+
app: ds-pipeline-testdsp5
13+
component: data-science-pipelines
14+
template:
15+
metadata:
16+
labels:
17+
app: ds-pipeline-testdsp5
18+
component: data-science-pipelines
19+
spec:
20+
containers:
21+
- env:
22+
- name: POD_NAMESPACE
23+
value: "default"
24+
- name: DBCONFIG_USER
25+
value: "mlpipeline"
26+
- name: DBCONFIG_PASSWORD
27+
valueFrom:
28+
secretKeyRef:
29+
key: "password"
30+
name: "ds-pipeline-db-testdsp5"
31+
- name: DBCONFIG_DBNAME
32+
value: "mlpipeline"
33+
- name: DBCONFIG_HOST
34+
value: "mariadb-testdsp5.default.svc.cluster.local"
35+
- name: DBCONFIG_PORT
36+
value: "3306"
37+
- name: ARTIFACT_BUCKET
38+
value: "mlpipeline"
39+
- name: ARTIFACT_ENDPOINT
40+
value: "http://minio-testdsp5.default.svc.cluster.local:9000"
41+
- name: ARTIFACT_SCRIPT
42+
valueFrom:
43+
configMapKeyRef:
44+
key: "artifact_script"
45+
name: "ds-pipeline-artifact-script-testdsp5"
46+
- name: ARTIFACT_IMAGE
47+
value: "artifact-manager:test5"
48+
- name: ARCHIVE_LOGS
49+
value: "false"
50+
- name: TRACK_ARTIFACTS
51+
value: "true"
52+
- name: STRIP_EOF
53+
value: "true"
54+
- name: PIPELINE_RUNTIME
55+
value: "tekton"
56+
- name: DEFAULTPIPELINERUNNERSERVICEACCOUNT
57+
value: "pipeline-runner-testdsp5"
58+
- name: INJECT_DEFAULT_SCRIPT
59+
value: "true"
60+
- name: APPLY_TEKTON_CUSTOM_RESOURCE
61+
value: "true"
62+
- name: TERMINATE_STATUS
63+
value: "Cancelled"
64+
- name: AUTO_UPDATE_PIPELINE_DEFAULT_VERSION
65+
value: "true"
66+
- name: DBCONFIG_CONMAXLIFETIMESEC
67+
value: "120"
68+
- name: ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST
69+
value: "ds-pipeline-visualizationserver"
70+
- name: ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT
71+
value: "8888"
72+
- name: OBJECTSTORECONFIG_BUCKETNAME
73+
value: "mlpipeline"
74+
- name: OBJECTSTORECONFIG_ACCESSKEY
75+
valueFrom:
76+
secretKeyRef:
77+
key: "accesskey"
78+
name: "mlpipeline-minio-artifact"
79+
- name: OBJECTSTORECONFIG_SECRETACCESSKEY
80+
valueFrom:
81+
secretKeyRef:
82+
key: "secretkey"
83+
name: "mlpipeline-minio-artifact"
84+
- name: OBJECTSTORECONFIG_SECURE
85+
value: "false"
86+
- name: MINIO_SERVICE_SERVICE_HOST
87+
value: "minio-testdsp5.default.svc.cluster.local"
88+
- name: MINIO_SERVICE_SERVICE_PORT
89+
value: "9000"
90+
- name: CACHE_IMAGE
91+
value: "ubi-minimal:test5"
92+
- name: MOVERESULTS_IMAGE
93+
value: "busybox:test5"
94+
image: api-server:test5
95+
imagePullPolicy: Always
96+
name: ds-pipeline-api-server
97+
ports:
98+
- containerPort: 8888
99+
name: http
100+
protocol: TCP
101+
- containerPort: 8887
102+
name: grpc
103+
protocol: TCP
104+
livenessProbe:
105+
exec:
106+
command:
107+
- wget
108+
- -q
109+
- -S
110+
- -O
111+
- '-'
112+
- http://localhost:8888/apis/v1beta1/healthz
113+
initialDelaySeconds: 3
114+
periodSeconds: 5
115+
timeoutSeconds: 2
116+
readinessProbe:
117+
exec:
118+
command:
119+
- wget
120+
- -q
121+
- -S
122+
- -O
123+
- '-'
124+
- http://localhost:8888/apis/v1beta1/healthz
125+
initialDelaySeconds: 3
126+
periodSeconds: 5
127+
timeoutSeconds: 2
128+
resources:
129+
requests:
130+
cpu: 250m
131+
memory: 500Mi
132+
limits:
133+
cpu: 500m
134+
memory: 1Gi
135+
volumeMounts:
136+
- mountPath: /config/sample_config.json
137+
name: sample-config
138+
subPath: sample_config.json
139+
- mountPath: /samples/
140+
name: sample-pipeline
141+
- name: oauth-proxy
142+
args:
143+
- --https-address=:8443
144+
- --provider=openshift
145+
- --openshift-service-account=ds-pipeline-testdsp5
146+
- --upstream=http://localhost:8888
147+
- --tls-cert=/etc/tls/private/tls.crt
148+
- --tls-key=/etc/tls/private/tls.key
149+
- --cookie-secret=SECRET
150+
- '--openshift-delegate-urls={"/": {"group":"route.openshift.io","resource":"routes","verb":"get","name":"ds-pipeline-testdsp5","namespace":"default"}}'
151+
- '--openshift-sar={"namespace":"default","resource":"routes","resourceName":"ds-pipeline-testdsp5","verb":"get","resourceAPIGroup":"route.openshift.io"}'
152+
- --skip-auth-regex='(^/metrics|^/apis/v1beta1/healthz)'
153+
image: oauth-proxy:test5
154+
ports:
155+
- containerPort: 8443
156+
name: oauth
157+
protocol: TCP
158+
livenessProbe:
159+
httpGet:
160+
path: /oauth/healthz
161+
port: oauth
162+
scheme: HTTPS
163+
initialDelaySeconds: 30
164+
timeoutSeconds: 1
165+
periodSeconds: 5
166+
successThreshold: 1
167+
failureThreshold: 3
168+
readinessProbe:
169+
httpGet:
170+
path: /oauth/healthz
171+
port: oauth
172+
scheme: HTTPS
173+
initialDelaySeconds: 5
174+
timeoutSeconds: 1
175+
periodSeconds: 5
176+
successThreshold: 1
177+
failureThreshold: 3
178+
resources:
179+
limits:
180+
cpu: 100m
181+
memory: 256Mi
182+
requests:
183+
cpu: 100m
184+
memory: 256Mi
185+
volumeMounts:
186+
- mountPath: /etc/tls/private
187+
name: proxy-tls
188+
volumes:
189+
- name: proxy-tls
190+
secret:
191+
secretName: ds-pipelines-proxy-tls-testdsp5
192+
defaultMode: 420
193+
- configMap:
194+
defaultMode: 420
195+
name: sample-config-testdsp5
196+
name: sample-config
197+
- configMap:
198+
defaultMode: 420
199+
name: sample-pipeline-testdsp5
200+
name: sample-pipeline
201+
202+
serviceAccountName: ds-pipeline-testdsp5
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v1
2+
data:
3+
artifact_script: |-
4+
#!/usr/bin/env sh
5+
push_artifact() {
6+
if [ -f "$2" ]; then
7+
tar -cvzf $1.tgz $2
8+
aws s3 --endpoint http://minio-testdsp5.default.svc.cluster.local:9000 cp $1.tgz s3://mlpipeline/artifacts/$PIPELINERUN/$PIPELINETASK/$1.tgz
9+
else
10+
echo "$2 file does not exist. Skip artifact tracking for $1"
11+
fi
12+
}
13+
push_log() {
14+
cat /var/log/containers/$PODNAME*$NAMESPACE*step-main*.log > step-main.log
15+
push_artifact main-log step-main.log
16+
}
17+
strip_eof() {
18+
if [ -f "$2" ]; then
19+
awk 'NF' $2 | head -c -1 > $1_temp_save && cp $1_temp_save $2
20+
fi
21+
}
22+
kind: ConfigMap
23+
metadata:
24+
name: ds-pipeline-artifact-script-testdsp5
25+
namespace: default
26+
labels:
27+
app: ds-pipeline-testdsp5
28+
component: data-science-pipelines
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: mariadb-testdsp5
6+
namespace: default
7+
labels:
8+
app: mariadb-testdsp5
9+
component: data-science-pipelines
10+
spec:
11+
strategy:
12+
type: Recreate # Need this since backing PVC is ReadWriteOnce, which creates resource lock condition in default Rolling strategy
13+
selector:
14+
matchLabels:
15+
app: mariadb-testdsp5
16+
component: data-science-pipelines
17+
template:
18+
metadata:
19+
labels:
20+
app: mariadb-testdsp5
21+
component: data-science-pipelines
22+
spec:
23+
containers:
24+
- name: mariadb
25+
image: mariadb:test5
26+
ports:
27+
- containerPort: 3306
28+
protocol: TCP
29+
readinessProbe:
30+
exec:
31+
command:
32+
- /bin/sh
33+
- "-i"
34+
- "-c"
35+
- >-
36+
MYSQL_PWD=$MYSQL_PASSWORD mysql -h 127.0.0.1 -u $MYSQL_USER -D
37+
$MYSQL_DATABASE -e 'SELECT 1'
38+
failureThreshold: 3
39+
initialDelaySeconds: 5
40+
periodSeconds: 10
41+
successThreshold: 1
42+
timeoutSeconds: 1
43+
livenessProbe:
44+
failureThreshold: 3
45+
initialDelaySeconds: 30
46+
periodSeconds: 10
47+
successThreshold: 1
48+
tcpSocket:
49+
port: 3306
50+
timeoutSeconds: 1
51+
env:
52+
- name: MYSQL_USER
53+
value: "mlpipeline"
54+
- name: MYSQL_PASSWORD
55+
valueFrom:
56+
secretKeyRef:
57+
key: "password"
58+
name: "ds-pipeline-db-testdsp5"
59+
- name: MYSQL_DATABASE
60+
value: "mlpipeline"
61+
- name: MYSQL_ALLOW_EMPTY_PASSWORD
62+
value: "true"
63+
resources:
64+
requests:
65+
cpu: 300m
66+
memory: 800Mi
67+
limits:
68+
cpu: "1"
69+
memory: 1Gi
70+
volumeMounts:
71+
- name: mariadb-persistent-storage
72+
mountPath: /var/lib/mysql
73+
volumes:
74+
- name: mariadb-persistent-storage
75+
persistentVolumeClaim:
76+
claimName: mariadb-testdsp5

0 commit comments

Comments
 (0)