-
Notifications
You must be signed in to change notification settings - Fork 14
110 lines (99 loc) · 4.09 KB
/
modify-vm-resources.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
name: Modify VM Resources CI
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'charts/modify-vm-resources/**'
- .github/workflows/modify-vm-resources.yaml
jobs:
run-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: 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: 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: Deploy MTA serverless workflow and its components
run: |
TARGET_NS=sonataflow-infra
cd charts
helm install modify-vm-resources modify-vm-resources -n "${TARGET_NS}"
WORKFLOW_NAME=modify-vm-resources
kubectl -n sonataflow-infra patch secret "${WORKFLOW_NAME}-creds" --type merge -p '{
"data":{
"NOTIFICATIONS_BEARER_TOKEN":"'$(kubectl get secrets -n rhdh-operator backstage-backend-auth-secret -o go-template='{{ .data.BACKEND_SECRET }}')'"
},
"stringData":{
"JIRA_API_TOKEN":"DUMB_TOKEN",
"OCP_API_SERVER_TOKEN":"DUMB_TOKEN"
}
}'
kubectl -n sonataflow-infra patch sonataflow modify-vm-resources --type merge -p '{
"spec": {
"podTemplate": {
"container": {
"env": [
{
"name": "BACKSTAGE_NOTIFICATIONS_URL",
"value": "http://backstage-backstage.rhdh-operator"
},
{
"name": "JIRA_URL",
"value": "DUMB_VALUE"
},
{
"name": "JIRA_USERNAME",
"value": "DUMB_VALUE"
},
{
"name": "OCP_API_SERVER_URL",
"value": "DUMB_VALUE"
},
{
"name": "OCP_CONSOLE_URL",
"value": "DUMB_VALUE"
}
]
}
}
}
}
'
kubectl -n ${TARGET_NS} wait --for=condition=Ready=true pods -l app="${WORKFLOW_NAME}" --timeout=1m
- uses: actions/checkout@v4
- name: Test workflow is responsive
run: |
kubectl expose "$(kubectl get pod -o name | grep modify-vm-resources-analysis)" --type="NodePort" --port=8080 --name=modify-vm-resources-svc
kubectl port-forward svc/modify-vm-resources-svc 8080:8080 &
status_code=$(curl s -o /dev/null -w '%{http_code}' -XGET --location 'http://localhost:8080/modify-vm-resources' --header 'Accept: application/json, text/plain, */*' --header 'Content-Type: application/json')
if [ "$status_code" -ne 200 ]; then;
echo "$status_code"
exit 1
fi
- 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/