Add CI for all workflow charts #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MTA v7.x Workflow end to end tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'charts/mta-v7.x/**' | |
- .github/workflows/mta-v7.x-e2e.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: 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 MTA serverless workflow | |
run: | | |
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\" | |
} | |
} | |
} | |
)" charts/mta-v7.x/templates/0?-sonataflow_mta-analysis-v7.yaml | |
# we are on k8s, not OCP, some resources are not available | |
rm -rf charts/mta-v7.x/templates/00-mta-operator.yaml | |
rm -rf charts/mta-v7.x/templates/00-tackle-resources.yaml | |
K8S_INSTALL=1 MTA_HELM_REPO=charts/mta-v7.x/ TARGET_NS=default ./docs/main/mta-v7.x/install-mta-v7.sh | |
- name: Test workflow is responsive | |
run: | | |
kubectl expose deploy mta-analysis-v7 --type="NodePort" --port=8080 --name=mta-svc | |
kubectl port-forward svc/mta-svc 8080:8080 & | |
sleep 3 | |
status_code=$(curl s -o /dev/null -w '%{http_code}' -XGET --location 'http://localhost:8080/mta-analysis-v7' --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: | | |
kubectl get pod -A | |
kubectl get deploy -A | |
kubectl get sonataflow -A | |
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/ | |