Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MTA v6.2.2/v7.02 workflows #224

Merged
merged 68 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
d8a1b49
Initial commit to add MTA v6.2.2 workflow
rhkp May 2, 2024
28ef4f8
Initial commit to add MTA v7.0.2 workflow
rhkp May 6, 2024
2c1d82b
Merge branch 'parodos-dev:main' into flpath751
rhkp May 6, 2024
4c6139a
Reinstate original mta files
rhkp May 6, 2024
bce1029
Minor updates to mta e2e yaml files.
rhkp May 7, 2024
d69ae74
Update mtav6.2.2-e2e.yaml with file names with correct workflow id.
rhkp May 7, 2024
d6f9aa3
Update mtav7.0.2-e2e.yaml with file names with correct workflow id.
rhkp May 7, 2024
1d9701f
Update manifest filenames in mta e2e yaml files
rhkp May 7, 2024
f7f33ae
Update deployment names in e2e yaml files
rhkp May 7, 2024
ecabc0e
Increase timeouts to avoid timeout errors
rhkp May 7, 2024
03006cf
Update application properties
rhkp May 7, 2024
e13d173
Adjust deploy workflow timeouts
rhkp May 7, 2024
2c90de9
Add experimental CI on VM
rhkp May 7, 2024
2305912
Merge branch 'parodos-dev:main' into flpath751
rhkp May 7, 2024
3b19b55
Update vm setup
rhkp May 7, 2024
268860b
Update experimental ci scripts
rhkp May 8, 2024
68f3eb8
Further update the local ci test
rhkp May 8, 2024
7d1baed
Further update the local ci test
rhkp May 8, 2024
99c0626
Update the Makefile
rhkp May 8, 2024
e432c77
Update makefile and workflow file
rhkp May 8, 2024
831047a
Add notifications.json instead of extension to see if workflow pod bu…
rhkp May 8, 2024
73c707a
Updates for testing in cluster
rhkp May 8, 2024
a599d9c
Update URL for cluster tests
rhkp May 8, 2024
e140404
Further code local ci
rhkp May 9, 2024
3609a2c
Rename directory
rhkp May 9, 2024
dca57d5
Remove unwanted code
rhkp May 9, 2024
f2f3406
Add readme for experimental ci
rhkp May 9, 2024
d5e2e93
Initial local ci version for MTAv7.0.2
rhkp May 9, 2024
9910a45
Address java.nio.file.NoSuchFileException in ci test for notifications
rhkp May 9, 2024
b8282bc
Update readme and mtav7.0.2 e2e test
rhkp May 9, 2024
b346e92
Minor improvements to local ci
rhkp May 9, 2024
a59e2f6
Merge branch 'parodos-dev:main' into flpath751
rhkp May 9, 2024
baeeb87
Adjust timeout
rhkp May 9, 2024
f45a649
Minor changes while testing
rhkp May 9, 2024
fd0ba78
Refactor to avoid duplicate code
rhkp May 10, 2024
f74e348
Rename directory name
rhkp May 10, 2024
93912a2
Minor correction to readme
rhkp May 10, 2024
f6a3db4
Update gh actions e2e mta yaml files
rhkp May 10, 2024
f9e69e5
Address pipeline issues and minor changes
rhkp May 10, 2024
36a58e0
Address pipeline issues
rhkp May 10, 2024
2476ac7
Minor changes to test to see results
rhkp May 11, 2024
b075d33
Debug why mtav7.0.2 times out in CI pipeline
rhkp May 11, 2024
9b22bad
Experiment to see if low resources can be used
rhkp May 13, 2024
233fcb7
Address pipeline issue
rhkp May 14, 2024
788e0fb
Address pipeline issues
rhkp May 14, 2024
6fe14a6
Further changes to local ci
rhkp May 14, 2024
0134a7d
Update e2e github action workflows
rhkp May 14, 2024
4a31fb2
Fix paths in GH Actions workflow
rhkp May 14, 2024
db8eb27
Fix paths in GH Actions workflow
rhkp May 14, 2024
c92b2b4
Minor refactor and reorder steps
rhkp May 14, 2024
9156ab5
Update postgresql values path
rhkp May 14, 2024
46dc6d6
Instead of local path try from raw GH content
rhkp May 14, 2024
141b8cf
Update file names
rhkp May 14, 2024
a2ee381
Add debug logs why workflow fails
rhkp May 14, 2024
741cf36
Rearrange installation steps
rhkp May 14, 2024
fab228a
Add debug info Jobs Service and Data Index Service
rhkp May 14, 2024
156f360
Test after adding Jobs Service Resource limits
rhkp May 15, 2024
3b814ca
Explicitly expose mta wf pod and use that
rhkp May 15, 2024
3f4ea45
Use specific psql helm chart version as given in orchestrator helm re…
rhkp May 15, 2024
c608a73
Add minikube support for local tests
rhkp May 15, 2024
934cd03
Minor changes to github workflows
rhkp May 15, 2024
66189ef
Fix MTA version
rhkp May 15, 2024
d9dda5c
Use latest action for Kind
rhkp May 16, 2024
677cd1f
Disable trace for a moment
rhkp May 16, 2024
6bb3da5
As decided for now let the tests go normally
rhkp May 21, 2024
c725ec9
Address review comments - pass 1
rhkp May 22, 2024
cf24e6e
Minor changes to experimental VM tests
rhkp May 22, 2024
27da82f
Minor fix to e2e test for VM
rhkp May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/mta-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,3 @@ jobs:
with:
name: kind-logs
path: ./kind_logs/

rhkp marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion .github/workflows/mta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ jobs:
with:
workflow_id: mta
secrets: inherit

rhkp marked this conversation as resolved.
Show resolved Hide resolved
148 changes: 148 additions & 0 deletions .github/workflows/mtav6.2.2-e2e.yaml
rhkp marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: MTA v6.2.2 Workflow end to end tests

on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'mtav6.2.2/**'
- 'pipeline/**'
- 'e2e/mtav6.2.2.sh'
rhkp marked this conversation as resolved.
Show resolved Hide resolved
- '!mtav6.2.2/*.svg'
- .github/workflows/mtav6.2.2-e2e.yaml
- .github/workflows/main.yml

jobs:
build:
uses: ./.github/workflows/main.yml
secrets: inherit
with:
workflow_id: mtav6.2.2
rhkp marked this conversation as resolved.
Show resolved Hide resolved
it_mode: true
run-e2e:
runs-on: ubuntu-latest
needs: build
steps:
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
cluster_name: kind
- name: Install Konveyor 0.2 (MTA upstream equivalent to 6.2)
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

# 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.2/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.2.1
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 Janus-idp-workflow-helm (janus + sonataflow-opertor)
run: |
helm repo add janus-idp-workflows https://rgolangh.github.io/janus-idp-workflows-helm/
helm install janus-idp-workflows janus-idp-workflows/janus-idp-workflows \
--set backstage.upstream.backstage.image.tag=1.1 \
-f https://raw.githubusercontent.com/rgolangh/janus-idp-workflows-helm/main/charts/kubernetes/orchestrator/values-k8s.yaml

echo "sleep bit long till the PV for data index and kaniko cache is ready. its a bit slow. TODO fixit"
kubectl get pv
sleep 3m
kubectl get sfp -A
kubectl wait --for=condition=Ready=true pods -l "app.kubernetes.io/name=backstage" --timeout=600s
kubectl get pods -o wide
kubectl wait --for=condition=Ready=true pods -l "app=sonataflow-platform" --timeout=600s

- name: Download sonataflow artifacts generated manifests
uses: actions/download-artifact@v4
with:
name: serverless-workflow-mtav6.2.2-manifests
path: manifests

- name: Download serverless workflows mta image
uses: actions/download-artifact@v4
with:
name: serverless-workflow-mtav6.2.2-${{ github.sha }}.tar

- name: Load mta workflow image to Kind
run: |
kind load image-archive serverless-workflow-mtav6.2.2-${{ github.sha }}.tar


- name: Deploy MTA serverless workflow
run: |
###### workaround till https://issues.redhat.com/browse/FLPATH-892 is solved
# yq --inplace '.spec.podTemplate.container |= ( . + {"imagePullPolicy": "IfNotPresent"} )' manifests/01-sonataflow_mta-analysis.yaml
###### end workfaround

# 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": "MTA_HUB_TOKEN", "value": "TEST_TOKEN_VALUE"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://janus-idp-workflows-backstage.default.svc.cluster.local:7007/api/notifications/"}] )' manifests/01-sonataflow_mta-analysis.yaml

# Disable persistence for e2e tests
yq e '.spec.persistence = {}' -i manifests/01-sonataflow_mta-analysis.yaml
sed -i '/quarkus\.flyway\.migrate-at-start=true/d' manifests/03-configmap_mta-analysis-props.yaml

echo "manifests/03-configmap_mta-analysis-props.yaml"
cat manifests/03-configmap_mta-analysis-props.yaml
echo "---"

echo "manifests/01-sonataflow_mta-analysis.yaml"
cat manifests/01-sonataflow_mta-analysis.yaml
echo "---"

# deploy the manifests created by the ${{ steps.build-image.outputs.image }} image
kubectl apply -f manifests/
sleep 5
kubectl get deployment mta-analysis -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" --timeout=10m

- uses: actions/checkout@v4
- name: Run e2e script
run: |
e2e/mtav6.2.2.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/

19 changes: 19 additions & 0 deletions .github/workflows/mtav6.2.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: MTA v6.2.2 workflow container image and manifest push

on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'mtav6.2.2/**'
- 'pipeline/**'
- .github/workflows/mtav6.2.2.yml
- .github/workflows/main.yml

jobs:
call-main-workflow:
uses: ./.github/workflows/main.yml
with:
workflow_id: mtav6.2.2
secrets: inherit

161 changes: 161 additions & 0 deletions .github/workflows/mtav7.0.2-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: MTA v7.0.2 Workflow end to end tests
rhkp marked this conversation as resolved.
Show resolved Hide resolved

on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'mtav7.0.2/**'
- 'pipeline/**'
- 'e2e/mtav7.0.2.sh'
rhkp marked this conversation as resolved.
Show resolved Hide resolved
- '!mtav7.0.2/*.svg'
- .github/workflows/mtav7.0.2-e2e.yaml
- .github/workflows/main.yml

jobs:
build:
uses: ./.github/workflows/main.yml
secrets: inherit
with:
workflow_id: mtav7.0.2
it_mode: true
run-e2e:
runs-on: ubuntu-latest
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: |
# Namespace for Sonataflow
kubectl create namespace sonataflow-infra

# PostgreSQL installation
kubectl create secret generic sonataflow-psql-postgresql --from-literal=postgres-username=postgres --from-literal=postgres-password=postgres -n sonataflow-infra
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install sonataflow-psql bitnami/postgresql --version 12.12.10 \
-f https://raw.githubusercontent.com/rgolangh/orchestrator-helm-chart/main/postgresql/values.yaml \
-n sonataflow-infra
sleep 60s
kubectl wait --for=jsonpath='{.status.phase}'=Running "$(kubectl get pod -o name -n sonataflow-infra | grep sonataflow-psql-postgresql)" --timeout=300s -n sonataflow-infra

# Sonataflow operator
kubectl create -f https://raw.githubusercontent.com/kiegroup/kogito-serverless-operator/main/operator.yaml
kubectl apply -f https://raw.githubusercontent.com/rhkp/sonataflow-cluster-resources/main/sonata-flow-operator.yaml
kubectl wait --for=jsonpath='{.status.phase}'=Running "$(kubectl get pod -o name -n sonataflow-operator-system | grep sonataflow-operator-controller-manager)" -n sonataflow-operator-system --timeout=300s

# Core services of Sonataflow
kubectl apply -f https://raw.githubusercontent.com/rhkp/sonataflow-cluster-resources/main/sonata-flow-platform.yaml
sleep 60s
kubectl wait --for=jsonpath='{.status.phase}'=Running "$(kubectl get pod -o name -n sonataflow-infra | grep sonataflow-platform-jobs-service)" -n sonataflow-infra --timeout=300s
kubectl wait --for=jsonpath='{.status.phase}'=Running "$(kubectl get pod -o name -n sonataflow-infra | grep sonataflow-platform-data-index-service)" -n sonataflow-infra --timeout=300s

- name: Download sonataflow artifacts generated manifests
uses: actions/download-artifact@v4
with:
name: serverless-workflow-mtav7.0.2-manifests
path: manifests

- name: Download serverless workflows mta image
uses: actions/download-artifact@v4
with:
name: serverless-workflow-mtav7.0.2-${{ github.sha }}.tar

- name: Load mta workflow image to Kind
run: |
kind load image-archive serverless-workflow-mtav7.0.2-${{ github.sha }}.tar


- name: Deploy MTA serverless workflow
run: |
###### workaround till https://issues.redhat.com/browse/FLPATH-892 is solved
# yq --inplace '.spec.podTemplate.container |= ( . + {"imagePullPolicy": "IfNotPresent"} )' manifests/01-sonataflow_mta-analysis.yaml
###### end workfaround

# 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": "MTA_HUB_TOKEN", "value": "TEST_TOKEN_VALUE"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://janus-idp-workflows-backstage.default.svc.cluster.local:7007/api/notifications/"}] )' manifests/01-sonataflow_mta-analysis.yaml

# Disable persistence for e2e tests
yq e '.spec.persistence = {}' -i manifests/01-sonataflow_mta-analysis.yaml
sed -i '/quarkus\.flyway\.migrate-at-start=true/d' manifests/03-configmap_mta-analysis-props.yaml

echo "manifests/03-configmap_mta-analysis-props.yaml"
cat manifests/03-configmap_mta-analysis-props.yaml
echo "---"

echo "manifests/01-sonataflow_mta-analysis.yaml"
cat manifests/01-sonataflow_mta-analysis.yaml
echo "---"

# deploy the manifests created by the ${{ steps.build-image.outputs.image }} image
kubectl apply -f manifests/
sleep 5
kubectl get deployment mta-analysis -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" --timeout=10m

- uses: actions/checkout@v4
- name: Run e2e script
run: |
e2e/mtav7.0.2.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/

19 changes: 19 additions & 0 deletions .github/workflows/mtav7.0.2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: MTA v7.0.2 workflow container image and manifest push

on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- 'mtav7.0.2/**'
- 'pipeline/**'
- .github/workflows/mtav7.0.2.yml
- .github/workflows/main.yml

jobs:
call-main-workflow:
uses: ./.github/workflows/main.yml
with:
workflow_id: mtav7.0.2
secrets: inherit

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ nb-configuration.xml
# Plugin directory
/.quarkus/cli/plugins/

kn
kn

temp
*.tar
Loading
Loading