forked from kubeflow/katib
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (69 loc) · 2.15 KB
/
test-charmed-katib.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
name: Charmed Katib
on:
- push
- pull_request
jobs:
build:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v2
- uses: balchua/microk8s-actions@v0.2.2
with:
channel: '1.19/stable'
addons: '["dns", "storage", "rbac"]'
- name: Install dependencies
run: |
set -eux
sudo snap install charm --classic
sudo snap install juju --classic
sudo snap install juju-helpers --classic
sudo snap install juju-wait --classic
sudo apt update
- name: Build Docker images
run: |
set -eux
for image in katib-ui katib-controller katib-db-manager; do
docker build . \
-t docker.io/kubeflowkatib/$image:latest \
-f cmd/katib-controller/v1beta1/Dockerfile
docker save docker.io/kubeflowkatib/$image > $image.tar
microk8s ctr image import $image.tar
done
- name: Deploy Katib
run: |
set -eux
cd operators/
git clone git://git.launchpad.net/canonical-osm
cp -r canonical-osm/charms/interfaces/juju-relation-mysql mysql
sg microk8s -c 'juju bootstrap microk8s uk8s'
juju add-model katib
juju bundle deploy -b bundle-edge.yaml --build
juju wait -wvt 300
- name: Test Katib
run: |
set -eux
kubectl run \
--rm \
-i \
--restart=Never \
--image=ubuntu \
katib-check \
-- \
bash -c "apt update && apt install -y curl && curl -f http://katib-ui.katib.svc.cluster.local:8080/katib/"
- name: Get pod statuses
run: kubectl get all -A
if: failure()
- name: Get juju status
run: juju status
if: failure()
- name: Get katib-controller logs
run: kubectl logs --tail 100 -nkatib -ljuju-app=katib-controller
if: failure()
- name: Get katib-ui logs
run: kubectl logs --tail 100 -nkatib -ljuju-app=katib-ui
if: failure()
- name: Get katib-manager logs
run: kubectl logs --tail 100 -nkatib -ljuju-app=katib-manager
if: failure()