-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github Actions CI for charm operators
Builds images locally with `latest` tag, and includes new bundle for testing purposes that sets operator docker images to `latest` as well instead of a particular revision.
- Loading branch information
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
|
||
- name: Install dependencies | ||
run: | | ||
set -eux | ||
sudo snap install microk8s --classic | ||
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: Set up dependencies | ||
run: | | ||
set -eux | ||
sudo usermod -a -G microk8s $USER | ||
sudo microk8s enable dns storage rbac | ||
- name: Build Docker images | ||
run: | | ||
set -eux | ||
./scripts/v1beta1/build.sh -r docker.io/kubeflowkatib -t latest | ||
for image in katib-ui katib-controller katib-db-manager; do | ||
sudo docker save docker.io/kubeflowkatib/$image > $image.tar | ||
sudo 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 | ||
sudo juju bootstrap microk8s uk8s | ||
sudo juju add-model katib | ||
sudo juju bundle deploy -b bundle-edge.yaml --build | ||
sudo juju wait -wvt 300 | ||
- name: Test Katib | ||
run: | | ||
set -eux | ||
sudo microk8s 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: sudo microk8s kubectl get all -A | ||
if: failure() | ||
|
||
- name: Get juju status | ||
run: sudo juju status | ||
if: failure() | ||
|
||
- name: Get katib-controller logs | ||
run: sudo microk8s kubectl logs --tail 100 -nkatib -ljuju-app=katib-controller | ||
if: failure() | ||
|
||
- name: Get katib-ui logs | ||
run: sudo microk8s kubectl logs --tail 100 -nkatib -ljuju-app=katib-ui | ||
if: failure() | ||
|
||
- name: Get katib-manager logs | ||
run: sudo microk8s kubectl logs --tail 100 -nkatib -ljuju-app=katib-manager | ||
if: failure() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
bundle: kubernetes | ||
applications: | ||
katib-controller: | ||
charm: katib-controller | ||
scale: 1 | ||
resources: | ||
oci-image: docker.io/kubeflowkatib/katib-controller:latest | ||
katib-db: | ||
charm: cs:~charmed-osm/mariadb-k8s | ||
scale: 1 | ||
options: | ||
database: katib | ||
katib-db-manager: | ||
charm: katib-db-manager | ||
scale: 1 | ||
resources: | ||
oci-image: docker.io/kubeflowkatib/katib-db-manager:latest | ||
katib-ui: | ||
charm: katib-ui | ||
scale: 1 | ||
resources: | ||
oci-image: docker.io/kubeflowkatib/katib-ui:latest | ||
relations: | ||
- [katib-db-manager, katib-db] |