File tree Expand file tree Collapse file tree 4 files changed +69
-1
lines changed
manifests/opendatahub/overlays/metadata-store-mariadb Expand file tree Collapse file tree 4 files changed +69
-1
lines changed Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : CronJob
3
+ metadata :
4
+ labels :
5
+ application-crd-id : data-science-pipelines
6
+ name : mariadb-backup
7
+ spec :
8
+ schedule : " 0 0 * * *"
9
+ concurrencyPolicy : " Replace"
10
+ startingDeadlineSeconds : 200
11
+ suspend : false
12
+ successfulJobsHistoryLimit : 3
13
+ failedJobsHistoryLimit : 1
14
+ jobTemplate :
15
+ spec :
16
+ template :
17
+ metadata :
18
+ labels :
19
+ parent : " mariadb-backup"
20
+ spec :
21
+ containers :
22
+ - name : mariadb-backup
23
+ image : mysql
24
+ command :
25
+ - /bin/sh
26
+ - ' -c'
27
+ - >
28
+ mysqldump -h mysql -u $MYSQL_USER --password=$MYSQL_PASSWORD
29
+ --all-databases > mariadb-backup.sql
30
+ env :
31
+ - name : MYSQL_USER
32
+ valueFrom :
33
+ secretKeyRef :
34
+ name : $(database_secret)
35
+ key : username
36
+ - name : MYSQL_PASSWORD
37
+ valueFrom :
38
+ secretKeyRef :
39
+ name : $(database_secret)
40
+ key : password
41
+ - name : MYSQL_DATABASE
42
+ valueFrom :
43
+ configMapKeyRef :
44
+ key : pipelineDb
45
+ name : $(pipeline_install_configuration)
46
+ - name : MYSQL_ALLOW_EMPTY_PASSWORD
47
+ value : " true"
48
+ serviceAccountName : mysql
49
+ restartPolicy : Never
Original file line number Diff line number Diff line change @@ -18,9 +18,15 @@ resources:
18
18
# Services
19
19
- ./services/mysql.yaml
20
20
21
+ # CronJobs
22
+ - ./cronjobs/mariadb-backup.yaml
23
+
21
24
generatorOptions :
22
25
disableNameSuffixHash : true
23
26
27
+ configurations :
28
+ - params.yaml
29
+
24
30
images :
25
31
- name : mysql
26
32
newName : registry.redhat.io/rhel8/mariadb-103
Original file line number Diff line number Diff line change
1
+ ---
2
+ varReference :
3
+ - path : spec/jobTemplate/spec/template/spec/containers[]/env[]/valueFrom/secretKeyRef/name
4
+ kind : CronJob
5
+ - path : spec/jobTemplate/spec/template/spec/containers[]/env[]/valueFrom/configMapKeyRef/name
6
+ kind : CronJob
Original file line number Diff line number Diff line change @@ -12,12 +12,18 @@ os::test::junit::declare_suite_start "$MY_SCRIPT"
12
12
function check_resources() {
13
13
header " Testing Data Science Pipelines installation"
14
14
os::cmd::expect_success " oc project ${ODHPROJECT} "
15
- os::cmd::try_until_text " oc get crd pipelineruns.tekton.dev " " pipelineruns.tekton.dev" $odhdefaulttimeout $odhdefaultinterval
15
+ os::cmd::try_until_text " oc get crd pipelineruns.tekton.dev" " pipelineruns.tekton.dev" $odhdefaulttimeout $odhdefaultinterval
16
16
os::cmd::try_until_text " oc get pods -l application-crd-id=data-science-pipelines --field-selector='status.phase!=Running,status.phase!=Completed' -o jsonpath='{$.items[*].metadata.name}' | wc -w" " 0" $odhdefaulttimeout $odhdefaultinterval
17
17
running_pods=$( oc get pods -l application-crd-id=data-science-pipelines --field-selector=' status.phase=Running' -o jsonpath=' {$.items[*].metadata.name}' | wc -w)
18
18
os::cmd::expect_success " if [ " $running_pods " -gt " 0" ]; then exit 0; else exit 1; fi"
19
19
}
20
20
21
+ function check_mariadb_backup() {
22
+ header " Check if MariaDB backup comes up correctly"
23
+ os::cmd::expect_success " oc get cronjob mariadb-backup"
24
+ os::cmd::expect_success " oc create job --from=cronjob/mariadb-backup mariadb-backup"
25
+ }
26
+
21
27
function check_ui_overlay() {
22
28
header " Checking UI overlay Kfdef deploys the UI"
23
29
os::cmd::try_until_text " oc get pods -l app=ds-pipeline-ui --field-selector='status.phase=Running' -o jsonpath='{$.items[*].metadata.name}' | wc -w" " 1" $odhdefaulttimeout $odhdefaultinterval
@@ -85,6 +91,7 @@ function delete_pipeline() {
85
91
}
86
92
87
93
check_resources
94
+ check_mariadb_backup
88
95
check_ui_overlay
89
96
create_pipeline
90
97
list_pipelines
You can’t perform that action at this time.
0 commit comments