-
Notifications
You must be signed in to change notification settings - Fork 3
174 lines (148 loc) · 4.86 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
162
163
164
165
166
167
168
169
170
171
172
173
174
# 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:
- katib-controller
- katib-db-manager
- katib-ui
uses: canonical/charmed-kubeflow-workflows/.github/workflows/_quality-checks.yaml@main
secrets: inherit
with:
charm-path: ./charms/${{ matrix.charm }}
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install dependencies
run: |
set -eux
sudo apt update
sudo apt install python3-setuptools
sudo pip3 install black flake8
- name: Check black
run: black --check charms/*/src
- name: Check flake8
run: flake8 ./charms/*/src
unit:
name: Unit tests
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
charm:
- katib-controller
- katib-db-manager
steps:
- uses: actions/checkout@v3
- run: python3 -m pip 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:
- katib-controller
- katib-db-manager
- katib-ui
with:
charm-path: ./charms/${{ matrix.charm }}
charm-integration:
name: Integration tests (microk8s)
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
charm:
- katib-controller
- katib-db-manager
steps:
- uses: actions/checkout@v3
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.29-strict/stable
juju-channel: 3.6/stable
charmcraft-channel: 3.x/stable
- run: |
sg snap_microk8s -c "tox -e ${{ matrix.charm }}-integration -- -- --model testing"
# Collect debug logs if failed
- name: Dump Juju/k8s logs on failure
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
if: failure()
- name: Dump logs
if: failure()
uses: canonical/charming-actions/dump-logs@2.6.3
test-bundle:
name: Test the bundle
runs-on: ubuntu-20.04
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, which will liberate around 60 GB of storage
# distributed in 40GB for root and around 20 for a mnt point.
- name: Maximise GH runner space
uses: easimon/maximize-build-space@v7
with:
root-reserve-mb: 29696
remove-dotnet: 'true'
remove-haskell: 'true'
remove-android: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Check out code
uses: actions/checkout@v3
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.29-strict/stable
juju-channel: 3.6/stable
microk8s-addons: "dns storage rbac"
- name: Run test
run: |
# Requires the model to be called kubeflow due to kfp-viewer
juju add-model kubeflow --config default-series=focal
sg snap_microk8s -c "tox -e bundle-integration -- --model kubeflow"
- name: Get pod statuses
run: kubectl get all -A
if: failure()
- name: Get juju status
run: juju status
if: failure()
- name: Get katib-controller workload logs
run: kubectl logs --tail 100 -nkubeflow -lapp.kubernetes.io/name=katib-controller
if: failure()
- name: Get katib-controller operator logs
run: kubectl logs --tail 100 -nkubeflow -loperator.juju.is/name=katib-controller
if: failure()
- name: Get katib-ui workload logs
run: kubectl logs --tail 100 -nkubeflow -lapp.kubernetes.io/name=katib-ui
if: failure()
- name: Get katib-ui operator logs
run: kubectl logs --tail 100 -nkubeflow -loperator.juju.is/name=katib-ui
if: failure()
- name: Get katib-db-manager workload logs
run: kubectl logs --tail 100 -nkubeflow -lapp.kubernetes.io/name=katib-db-manager
if: failure()
- name: Get katib-db-manager operator logs
run: kubectl logs --tail 100 -nkubeflow -loperator.juju.is/name=katib-db-manager
if: failure()
- name: Upload charmcraft logs
uses: actions/upload-artifact@v3
with:
name: charmcraft-logs
path: /tmp/charmcraft-log-*
if: failure()