@@ -14,92 +14,90 @@ prereq() {
14
14
oc apply -f pre-requisites.yaml
15
15
oc create -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/bundle.yaml
16
16
oc process -f ../../resources/crds/observatorium-logs-crds-template.yaml | oc apply -f -
17
+ }
17
18
19
+ ns () {
20
+ oc create ns minio || true
21
+ oc create ns dex || true
22
+ oc create ns observatorium-metrics || true
23
+ oc create ns observatorium || true
24
+ oc create ns telemeter || true
25
+ oc create ns observatorium-logs || true
26
+ oc create ns observatorium-mst || true
18
27
}
19
28
20
29
minio () {
21
- oc create ns minio || true
22
30
oc wait --for=jsonpath=' {.status.phase}=Active' namespace/minio --timeout=5s
23
- oc process -f ../minio-template.yaml \
24
- -p MINIO_CPU_REQUEST=30m \
25
- -p MINIO_CPU_LIMITS=50m \
26
- -p MINIO_MEMORY_REQUEST=50Mi \
27
- -p MINIO_MEMORY_LIMITS=100Mi \
28
- --local -o yaml | \
29
- sed -e ' s/storage: [0-9].Gi/storage: 0.25Gi/g' | \
31
+ oc process --param-file=minio.test.ci.env -f ../minio-template.yaml | \
30
32
oc apply -n minio -f -
31
- check_status deployment/minio minio
32
33
}
33
34
34
35
dex () {
35
- oc create ns dex || true
36
36
oc wait --for=jsonpath=' {.status.phase}=Active' namespace/dex --timeout=5s
37
- oc process -f ../dex-template.yaml \
38
- -p DEX_CPU_REQUEST=30m \
39
- -p DEX_CPU_LIMITS=50m \
40
- -p DEX_MEMORY_REQUEST=50Mi \
41
- -p DEX_MEMORY_LIMITS=100Mi \
42
- --local -o yaml | \
43
- sed -e ' s/storage: [0-9].Gi/storage: 0.25Gi/g' | \
37
+ oc process --param-file=dex.test.ci.env -f ../dex-template.yaml | \
44
38
oc apply -n dex -f -
45
- check_status deployment/dex dex
46
39
}
47
40
48
41
observatorium_metrics () {
49
- oc create ns observatorium-metrics || true
50
42
oc wait --for=jsonpath=' {.status.phase}=Active' namespace/observatorium-metrics --timeout=5s
51
- oc process -f ../observatorium-metrics-thanos-objectstorage-secret-template.yaml | oc apply --namespace observatorium-metrics -f -
43
+ oc process -f ../observatorium-metrics-thanos-objectstorage-secret-template.yaml | \
44
+ oc apply --namespace observatorium-metrics -f -
52
45
oc apply -f ../observatorium-alertmanager-config-secret.yaml --namespace observatorium-metrics
53
46
oc apply -f ../observatorium-cluster-role.yaml
54
47
oc apply -f ../observatorium-cluster-role-binding.yaml
55
48
oc apply --namespace observatorium-metrics -f ../observatorium-service-account.yaml
56
49
oc process --param-file=observatorium-metrics.ci.env \
57
50
-f ../../resources/services/observatorium-metrics-template.yaml | \
58
51
oc apply --namespace observatorium-metrics -f -
59
- resources=$(
60
- oc get statefulsets -o name -n observatorium-metrics
61
- oc get deployments -o name -n observatorium-metrics
62
- )
63
- for res in $resources ; do
64
- check_status $res observatorium-metrics
65
- done
52
+ oc process --param-file=observatorium-metric-federation-rule.test.ci.env \
53
+ -f ../../resources/services/metric-federation-rule-template.yaml| \
54
+ oc apply --namespace observatorium-metrics -f -
66
55
}
67
56
68
57
observatorium () {
69
- oc create ns observatorium || true
70
58
oc wait --for=jsonpath=' {.status.phase}=Active' namespace/observatorium --timeout=5s
71
59
oc apply -f ../observatorium-rules-objstore-secret.yaml --namespace observatorium
72
60
oc apply -f ../observatorium-rhobs-tenant-secret.yaml --namespace observatorium
61
+ oc apply --namespace observatorium -f ../observatorium-service-account.yaml
62
+ oc apply -f ../observatorium-parca-secret.yaml --namespace observatorium
63
+ oc process -f ../../resources/services/parca-observatorium-remote-ns-rbac-template.yaml | \
64
+ oc apply -f -
73
65
oc process --param-file=observatorium.test.ci.env \
74
66
-f ../../resources/services/observatorium-template.yaml | \
75
67
oc apply --namespace observatorium -f -
76
- resources=$(
77
- oc get statefulsets -o name -n observatorium
78
- oc get deployments -o name -n observatorium
79
- )
80
- for res in $resources ; do
81
- check_status $res observatorium
82
- done
83
-
68
+ oc process --param-file=observatorium-parca.test.ci.env \
69
+ -f ../../resources/services/parca-template.yaml| \
70
+ oc apply --namespace observatorium -f -
71
+ oc process --param-file=observatorium-jaeger.test.ci.env \
72
+ -f ../../resources/services/jaeger-template.yaml| \
73
+ oc apply --namespace observatorium -f -
84
74
}
85
75
86
76
telemeter () {
87
- oc create ns telemeter || true
88
77
oc wait --for=jsonpath=' {.status.phase}=Active' namespace/telemeter --timeout=5s
89
78
oc apply --namespace telemeter -f ../telemeter-token-refersher-oidc-secret.yaml
90
79
oc process --param-file=telemeter.ci.env \
91
80
-f ../../resources/services/telemeter-template.yaml | \
92
81
oc apply --namespace telemeter -f -
93
- resources= $(
94
- oc get statefulsets -o name -n telemeter
95
- oc get deployments -o name -n telemeter
96
- )
97
- for res in $resources ; do
98
- check_status $res telemeter
99
- done
82
+ }
83
+
84
+ observatorium_logs () {
85
+ oc apply --namespace observatorium-logs -f ../observatorium-logs-secret.yaml
86
+ oc process --param-file=observatorium-logs.test.ci.env -f \
87
+ ../../resources/services/observatorium-logs-template.yaml | \
88
+ oc apply --namespace observatorium-logs -f -
100
89
}
101
90
102
91
run_test () {
92
+ for namespace in minio dex observatorium observatorium-metrics observatorium-logs telemeter ; do
93
+ resources=$(
94
+ oc get statefulsets -o name -n $namespace
95
+ oc get deployments -o name -n $namespace
96
+ )
97
+ for res in $resources ; do
98
+ check_status $res $namespace
99
+ done
100
+ done
103
101
oc apply -n observatorium -f test-tenant.yaml
104
102
oc apply -n observatorium -f rbac.yaml
105
103
oc rollout restart deployment/observatorium-observatorium-api -n observatorium
@@ -110,14 +108,12 @@ run_test() {
110
108
must_gather " $ARTIFACT_DIR "
111
109
exit 1
112
110
}
113
- for namespace in minio dex observatorium observatorium-metrics telemeter; do
114
-
115
- out=$( oc get pods -n $namespace -o jsonpath=' {.items[?(@.status.containerStatuses[].restartCount>=3)].metadata.name}' )
116
- if [ -n " $out " ]; then
117
- must_gather " $ARTIFACT_DIR "
118
- exit 1
119
- fi
120
- done
111
+ oc apply -n observatorium-logs -f observatorium-up-logs.yaml
112
+ oc wait --for=condition=complete --timeout=5m \
113
+ -n observatorium-logs job/observatorium-up-logs || {
114
+ must_gather " $ARTIFACT_DIR "
115
+ exit 1
116
+ }
121
117
}
122
118
123
119
must_gather () {
@@ -148,24 +144,19 @@ must_gather() {
148
144
oc get endpoints --all-namespaces > " $artifact_dir /endpoints"
149
145
}
150
146
151
- ci.metrics () {
147
+ ci.deploy () {
152
148
prereq
149
+ ns
153
150
minio
154
151
dex
155
- observatorium_metrics
156
152
observatorium
157
- run_test
153
+ observatorium_metrics
158
154
telemeter
155
+ observatorium_logs
159
156
}
160
157
161
- ci.logs () {
162
- # TODO
163
- :
164
- }
165
-
166
- ci.traces (){
167
- # TODO
168
- :
158
+ ci.tests () {
159
+ run_test
169
160
}
170
161
171
162
ci.help () {
@@ -198,4 +189,3 @@ main() {
198
189
return $?
199
190
}
200
191
main " $@ "
201
-
0 commit comments