-
Notifications
You must be signed in to change notification settings - Fork 21
166 lines (144 loc) · 6.52 KB
/
mta-v7.x-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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: MTA v7.x Workflow end to end tests
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'workflows/mta-v7.x/**'
- 'pipeline/**'
- '!e2e/mta-v7.x.sh'
- '!workflows/mta-v7.x/*.svg'
- .github/workflows/mta-v7.x-e2e.yaml
- .github/workflows/main.yml
jobs:
build:
uses: ./.github/workflows/main.yml
secrets: inherit
with:
workflow_id: mta-v7.x
it_mode: true
run-e2e:
runs-on: ubuntu-24.04
needs: build
steps:
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
cluster_name: kind
- name: Install Operators Support
run: |
kubectl apply -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/crds.yaml
# give the apiserver time
sleep 5s
kubectl apply -f https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/olm.yaml
- name: Install Konveyor 0.3 (MTA upstream equivalent to 7.0)
run: |
# install konveyor operator
# version 0.2 is MTA 6.2 and 0.3 is 7.x
kubectl create -f https://operatorhub.io/install/konveyor-0.3/konveyor-operator.yaml
# give the apiserver time
echo "sleeping 300 seconds to give time for the operator to pull images and start"
sleep 300s
kubectl get csv -A
# TODO its a bit smelly that the csv name is coded here.
kubectl wait --for=jsonpath='{.status.phase}=Succeeded' -n my-konveyor-operator csv/konveyor-operator.v0.3.2
kubectl get pods -A
kubectl wait --for=condition=Ready=true pods -l "name=tackle-operator" -n my-konveyor-operator --timeout=240s
kubectl get crds
kubectl create -f - << EOF
kind: Tackle
apiVersion: tackle.konveyor.io/v1alpha1
metadata:
name: tackle
namespace: my-konveyor-operator
spec:
feature_auth_required: false
hub_database_volume_size: 1Gi
hub_bucket_volume_size: 1Gi
EOF
kubectl get pods -n my-konveyor-operator
sleep 60s
kubectl get tackle -n my-konveyor-operator -o yaml
echo "wait for tackle ui to be ready"
kubectl get pods -n my-konveyor-operator
sleep 300s
kubectl wait --for=condition=Ready=true pods -l "app.kubernetes.io/name=tackle-ui" -n my-konveyor-operator --timeout=240s
# now MTA workflow can execute agains tackle-ui.my-konveyor-operator.svc:8080
- 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: Download sonataflow artifacts generated manifests
uses: actions/download-artifact@v4
with:
name: serverless-workflow-mta-v7.x-manifests
path: manifests
- name: Download serverless workflows mta image
uses: actions/download-artifact@v4
with:
name: serverless-workflow-mta-v7.x-${{ github.sha }}.tar
- name: Load mta workflow image to Kind
run: |
kind load image-archive serverless-workflow-mta-v7.x-${{ github.sha }}.tar
- name: Deploy MTA serverless workflow
run: |
# Set the endpoint to the tackle-ui service
yq --inplace '.spec.podTemplate.container.env |= ( . + [{"name": "QUARKUS_REST_CLIENT_MTA_JSON_URL", "value": "http://tackle-ui.my-konveyor-operator.svc:8080"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://orchestrator-backstage.default.svc.cluster.local:7007/"}] )' manifests/04-sonataflow_mta-analysis-v7.yaml
# reuse orchestrator psql persistence for e2e tests
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\": \"mta\"
}
}
}
)" manifests/0?-sonataflow_mta-analysis-v7.yaml
echo "manifests/01-configmap_mta-analysis-v7-props.yaml"
cat manifests/01-configmap_mta-analysis-v7-props.yaml
echo "---"
echo "manifests/04-sonataflow_mta-analysis-v7.yaml"
cat manifests/04-sonataflow_mta-analysis-v7.yaml
echo "---"
# Set notification external access token
echo " Set notification external access token"
BACKEND_SECRET=$(kubectl get secret orchestrator-auth -o jsonpath={.data.backend-secret})
yq --inplace ".data.NOTIFICATIONS_BEARER_TOKEN=\"$BACKEND_SECRET\"" manifests/0?-secret_mta-analysis-v7.yaml # notsecret
cat manifests/0?-secret_mta-analysis-v7.yaml
# deploy the manifests created by the ${{ steps.build-image.outputs.image }} image
kubectl apply -f manifests/
sleep 5
kubectl get deployment mta-analysis-v7 -o jsonpath='{.spec.template.spec.containers[]}'
# give the pod time to start
sleep 15
kubectl get pods -o wide
kubectl wait --for=condition=Ready=true pods -l "app=mta-analysis-v7" --timeout=10m
- uses: actions/checkout@v4
- name: Run e2e script
run: |
export BACKEND_SECRET=$(kubectl get secret orchestrator-auth -o jsonpath={.data.backend-secret} | base64 -d)
e2e/mta-v7.x.sh
- name: Export kind Logs
if: always()
run: kind export logs ./kind_logs
- name: Upload Kind Logs
uses: actions/upload-artifact@v4
# Always run this, even if one of the previous steps failed.
if: always()
with:
name: kind-logs
path: ./kind_logs/