-
Notifications
You must be signed in to change notification settings - Fork 14
142 lines (126 loc) · 5.11 KB
/
move2kube-e2e.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
name: Move2kube Workflow end to end tests
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'charts/move2kube/**'
- .github/workflows/move2kube-e2e.yaml
- e2e/move2kube.sh
jobs:
run-m2k-e2e:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
cluster_name: kind
- name: Create sonataflow-infra namespace
run: |
# Needs to knative events resources in this namespace as the broker url is hard coded at the moment
kubectl create ns sonataflow-infra
- name: Deploy kafka cluster
run: |
kubectl create namespace kafka
kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka
kubectl apply -f https://strimzi.io/examples/latest/kafka/kraft/kafka-single-node.yaml -n kafka
kubectl wait kafka/my-cluster --for=condition=Ready --timeout=300s -n kafka
- name: Deploy sonataflow-operator
run: |
helm repo add orchestrator https://parodos-dev.github.io/orchestrator-helm-chart
helm install orchestrator orchestrator/orchestrator-k8s
kubectl get sfp -A
kubectl wait --for=condition=Ready=true pods -l "app.kubernetes.io/name=backstage" --timeout=10m
kubectl get pods -o wide
kubectl wait --for=condition=Ready=true pods -l "app=sonataflow-platform" --timeout=180s
- name: Install knative components for kafka
run: |
kubectl apply --filename https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.14.5/eventing-kafka-controller.yaml
kubectl apply --filename https://github.com/knative-extensions/eventing-kafka-broker/releases/download/knative-v1.14.5/eventing-kafka-broker.yaml
kubectl patch cm kafka-broker-config -n knative-eventing \
--type merge \
-p '
{
"data": {
"default.topic.replication.factor": "1"
}
}'
kubectl wait --for condition=ready=true pod -l app=kafka-broker-receiver -n knative-eventing --timeout=60s
echo "apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
annotations:
# case-sensitive
eventing.knative.dev/broker.class: Kafka
name: kafka-broker
spec:
config:
apiVersion: v1
kind: ConfigMap
name: kafka-broker-config
namespace: knative-eventing" | kubectl apply -f -
kubectl -n orchestrator patch orchestrators.rhdh.redhat.com orchestrator-sample --type merge \
-p '
{
"spec": {
"orchestrator": {
"sonataflowPlatform": {
"eventing": {
"broker": {
"name": "kafka-broker",
"namespace": "default"
}
}
}
}
}
}'
- name: Deploy Move2kube serverless workflow and its components
env:
SSH_PUB_KEY: ${{secrets.SSH_PUB_KEY}}
SSH_PRIV_KEY: ${{secrets.SSH_PRIV_KEY}}
run: |
echo "${SSH_PUB_KEY}" >> id_rsa.pub
echo "${SSH_PRIV_KEY}" >> id_rsa
# we are not on OCP but on k8s, route does not exists
rm -rf charts/move2kube/templates/00-move2kube-instance-route.yaml
kubectl patch secret orchestrator-postgresql --patch='{"stringData": { "postgres-username": "postgres" }}'
yq --inplace ".spec.persistence = (
{
\"postgresql\": {
\"secretRef\": {
\"name\": \"orchestrator-postgresql\",
\"userKey\": \"postgres-username\",
\"passwordKey\": \"postgres-password\"
},
\"serviceRef\": {
\"name\": \"orchestrator-postgresql\",
\"port\": 5432,
\"databaseName\": \"postgres\",
\"databaseSchema\": \"m2k\"
}
}
}
)" charts/move2kube/templates/0?-sonataflow_m2k.yaml
K8S_INSTALL=1 PRIV_ID_RSA_PATH=id_rsa PUB_ID_RSA_PATH=id_rsa.pub M2K_HELM_REPO=charts/move2kube/ TARGET_NS=default ./docs/main/move2kube/install_m2k.sh
- name: Run e2e script
run: |
export BACKEND_SECRET=$(kubectl get secret orchestrator-auth -o jsonpath={.data.backend-secret} | base64 -d)
e2e/move2kube.sh
- name: Export kind Logs
if: always()
run: |
kubectl get pods
kubectl get pods -n sonataflow-infra
kubectl get broker
kubectl get triggers
kind export logs ./kind_logs
- name: Upload Kind Logs
uses: actions/upload-artifact@v4
# Always run this, even if one of th previous steps failed.
if: always()
with:
name: kind-logs
path: ./kind_logs/