-
Notifications
You must be signed in to change notification settings - Fork 9
157 lines (136 loc) · 4.29 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
# 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:
- jupyter-controller
- jupyter-ui
uses: canonical/charmed-kubeflow-workflows/.github/workflows/_quality-checks.yaml@main
secrets: inherit
with:
charm-path: ./charms/${{ matrix.charm }}
unit:
name: Unit Test
runs-on: ubuntu-20.04
strategy:
matrix:
charm: [controller, ui]
steps:
- uses: actions/checkout@v3
- run: sudo apt update
- run: sudo apt install tox
- run: tox -e ${{ matrix.charm }}-unit
charm-integration:
name: Individual charm's integration tests
runs-on: ubuntu-20.04
strategy:
matrix:
charm: [controller, ui]
steps:
- 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
charmcraft-channel: 3.x/stable
microk8s-addons: "dns storage rbac metallb:10.64.140.43-10.64.140.49"
juju-channel: 3.6/stable
- run: tox -e ${{ matrix.charm }}-integration
lint:
name: Lint Code
runs-on: ubuntu-20.04
strategy:
matrix:
charm: [controller, ui]
steps:
- uses: actions/checkout@v3
- run: sudo apt update
- run: sudo apt install tox
- run: tox -e ${{ matrix.charm }}-lint
terraform-checks:
name: Terraform
uses: canonical/charmed-kubeflow-workflows/.github/workflows/terraform-checks.yaml@main
strategy:
matrix:
charm: [controller, ui]
with:
charm-path: ./charms/jupyter-${{ matrix.charm }}
bundle-integration:
name: Bundle Integration
runs-on: ubuntu-20.04
steps:
- 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
charmcraft-channel: 3.x/stable
microk8s-addons: "dns storage rbac ingress metallb:10.64.140.43-10.64.140.49"
juju-channel: 3.6/stable
- name: Run test
run: |
sudo apt install tar wget
# Install firefox-geckodriver from source to avoid issues
wget https://github.com/mozilla/geckodriver/releases/download/v0.28.0/geckodriver-v0.28.0-linux64.tar.gz
tar xf geckodriver-v0.28.0-linux64.tar.gz
sudo mv geckodriver /usr/local/bin
juju add-model kubeflow
sg snap_microk8s -c "tox -e integration -- --model kubeflow"
- run: kubectl get all -A
if: failure()
- run: kubectl get notebooks -A
if: failure()
- run: kubectl get pods -A -oyaml
if: failure()
- run: juju status
if: failure()
- name: Get jupyter-controller workload logs
run: kubectl logs --tail 100 -nkubeflow -lapp.kubernetes.io/name=jupyter-controller
if: failure()
- name: Get jupyter-controller operator logs
run: kubectl logs --tail 100 -nkubeflow -loperator.juju.is/name=jupyter-controller
if: failure()
- name: Get jupyter-ui workload logs
run: kubectl logs --tail 100 -nkubeflow -lapp.kubernetes.io/name=jupyter-ui
if: failure()
- name: Get jupyter-ui operator logs
run: kubectl logs --tail 100 -nkubeflow -loperator.juju.is/name=jupyter-ui
if: failure()
- name: Generate inspect tarball
run: >
sg microk8s <<EOF
microk8s inspect | \
grep -Po "Report tarball is at \K.+" | \
xargs -I {} cp {} inspection-report-${{ strategy.job-index }}.tar.gz
EOF
if: failure()
- name: Upload inspect tarball
uses: actions/upload-artifact@v3
with:
name: inspection-reports
path: ./inspection-report-${{ strategy.job-index }}.tar.gz
if: failure()
- name: Upload selenium screenshots
uses: actions/upload-artifact@v3
with:
name: selenium-screenshots
path: /tmp/selenium-*.png
if: failure()
- name: Upload HAR logs
uses: actions/upload-artifact@v3
with:
name: selenium-har
path: /tmp/selenium-*.har
if: failure()