-
Notifications
You must be signed in to change notification settings - Fork 17
161 lines (142 loc) · 5.15 KB
/
integrate.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
# reusable workflow triggered by other actions
name: CI
on:
workflow_call:
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
jobs:
lib-check:
name: Check libraries
strategy:
matrix:
charm:
- istio-gateway
- istio-pilot
uses: canonical/charmed-kubeflow-workflows/.github/workflows/_quality-checks.yaml@main
secrets: inherit
with:
charm-path: ./charms/${{ matrix.charm }}
lint:
name: Lint Code
runs-on: ubuntu-20.04
strategy:
matrix:
charm: [pilot, gateway]
steps:
- uses: actions/checkout@v4
- run: sudo apt update && sudo apt install tox
- run: tox -e ${{ matrix.charm }}-lint
unit:
name: Unit Test
runs-on: ubuntu-20.04
strategy:
matrix:
charm: [pilot, gateway]
steps:
- uses: actions/checkout@v4
- run: sudo apt update && sudo apt install tox
- run: tox -e ${{ matrix.charm }}-unit
terraform-checks:
name: Terraform
uses: canonical/charmed-kubeflow-workflows/.github/workflows/terraform-checks.yaml@main
strategy:
matrix:
charm: [gateway, pilot]
with:
charm-path: ./charms/istio-${{ matrix.charm }}
integration:
name: Integration Test
runs-on: ubuntu-20.04
strategy:
matrix:
microk8s-versions:
- 1.27-strict/stable
- 1.30-strict/stable
integration-types:
- integration
- integration-tls-provider
- integration-tls-secret
steps:
# Ideally we'd use self-hosted runners, but this effort is still not stable
# This action will remove unused software (dotnet, haskell, android libs, codeql,
# and docker images) from the GH runner.
# This leaves ~45GB free as of 2024-04-10, but this amount has varied as GH changed their
# runners
- name: Maximise GH runner space
uses: jlumbroso/[email protected]
- name: Check out repo
uses: actions/checkout@v4
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: ${{ matrix.microk8s-versions }}
microk8s-addons: "dns hostpath-storage rbac metallb:10.64.140.43-10.64.140.49"
juju-channel: 3.4/stable
# Pinned to 3.x/stable due to https://github.com/canonical/charmcraft/issues/1845
charmcraft-channel: 3.x/stable
- name: Run integration tests
run: |
juju add-model test-istio
tox -e ${{ matrix.integration-types }} -- --model test-istio
timeout-minutes: 80
- name: Setup Debug Artifact Collection
run: mkdir tmp
if: failure()
- name: Collect charmcraft logs
if: failure()
run: |
cat /home/runner/.local/state/charmcraft/log/charmcraft-*.log | tee tmp/charmcraft.log
- name: Collect Juju status
if: failure()
run: juju status | tee tmp/juju-status.txt
- name: Collect Juju log
if: failure()
run: juju debug-log --replay --no-tail | tee tmp/juju-status.txt
- name: Collect Kube status
if: failure()
run: |
kubectl get all -A | tee tmp/kube-summary.txt
kubectl describe virtualservices -A | tee tmp/kube-virtualservices.txt
kubectl describe gateways -A | tee tmp/kube-gateways.txt
kubectl describe deployments -A | tee tmp/kube-deployments.txt
kubectl describe replicasets -A | tee tmp/kubectl-replicasets.txt
kubectl exec -n test-istio istio-pilot-0 --container charm -- agents/unit-istio-pilot-0/charm/istioctl analyze -n test-istio | tee tmp/istioctl-analyze.txt
- name: Collect Kube logs
if: failure()
run: |
kubectl logs -n test-istio --tail 1000 -lapp.kubernetes.io/name=istio-pilot -c charm | tee tmp/istio-pilot.log
kubectl logs -n test-istio --tail 1000 -lapp.kubernetes.io/name=istio-ingressgateway-operator -c charm | tee tmp/istio-ingressgateway-operator.log
- name: Upload debug artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-run-artifacts
path: tmp
integration-observability:
name: Observability Integration Test
runs-on: ubuntu-20.04
strategy:
matrix:
microk8s-versions:
- 1.25-strict/stable
- 1.26-strict/stable
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: ${{ matrix.microk8s-versions }}
microk8s-addons: "dns hostpath-storage rbac metallb:10.64.140.43-10.64.140.49"
juju-channel: 3.4/stable
# Pinned to 3.x/stable due to https://github.com/canonical/charmcraft/issues/1845
charmcraft-channel: 3.x/stable
- name: Run observability integration tests
run: |
juju add-model cos-test
tox -vve cos-integration -- --model cos-test
- run: kubectl get pod/prometheus-k8s-0 -n knative-test -o=jsonpath='{.status}'
if: failure()