From 3ffe68732bdff2176a24481f5b8a0f4cf551caf6 Mon Sep 17 00:00:00 2001 From: diwrajchitoor Date: Fri, 11 Dec 2020 21:52:40 +0000 Subject: [PATCH] Enable CI for Vino * Install Dependency packages like docker,make,wget,debconf and snapd * Deploy Kubernetes and Vino * Setup roles for Docker and for firewall Change-Id: I6734cd86b0560438c5b9caacf2567b0c595558e1 --- Makefile | 2 -- playbooks/deploy-k8s.yaml | 23 +++++++++++++++++++++++ tools/deployment/deploy-vino.sh | 11 +++++++++++ zuul.d/jobs.yaml | 5 +++++ zuul.d/projects.yaml | 5 +++-- 5 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 playbooks/deploy-k8s.yaml create mode 100755 tools/deployment/deploy-vino.sh diff --git a/Makefile b/Makefile index 23904b8..391008c 100644 --- a/Makefile +++ b/Makefile @@ -47,9 +47,7 @@ uninstall: manifests # Deploy controller in the configured Kubernetes cluster in ~/.kube/config deploy: manifests - cd config/manager && kustomize edit set image controller=${IMG} kustomize build config/default | kubectl apply -f - - # Generate manifests e.g. CRD, RBAC etc. manifests: controller-gen $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases diff --git a/playbooks/deploy-k8s.yaml b/playbooks/deploy-k8s.yaml new file mode 100644 index 0000000..d199e91 --- /dev/null +++ b/playbooks/deploy-k8s.yaml @@ -0,0 +1,23 @@ +- hosts: ubuntu-bionic + tasks: + - name: Run ensure-docker + include_role: + name: ensure-docker + - name: Install Dependent Packages + apt: + pkg: + - docker + - debconf + - make + - wget + - snapd + become: yes + - name: Set up requirements for kubernetes + include_role: + name: clear-firewall + - name: Install kubernetes and Deploy Vino + shell: | + set -xe; + ./tools/deployment/deploy-vino.sh + args: + chdir: "{{ zuul.project.src_dir }}" \ No newline at end of file diff --git a/tools/deployment/deploy-vino.sh b/tools/deployment/deploy-vino.sh new file mode 100755 index 0000000..3db5e37 --- /dev/null +++ b/tools/deployment/deploy-vino.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -xe +curl -s -L https://opendev.org/airship/charts/raw/branch/master/tools/gate/deploy-k8s.sh | bash +sudo snap install kustomize && sudo snap install go --classic +#Wait for all pods to be ready before starting Vino Image build. +kubectl wait --for=condition=Ready pods --all -A --timeout=180s +make docker-build +kustomize build config/default | kubectl apply -f - +kubectl get po -A +#Wait for vino controller manager Pod. +kubectl wait -n vino-system pod -l control-plane=controller-manager --for=condition=ready --timeout=240s \ No newline at end of file diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 2ab0f91..0c8511e 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -8,3 +8,8 @@ - name: git_mirror_credentials secret: airship_vino_airshipit_github_secret pass-to-parent: true +- job: + name: airship-deploy-vino + run: playbooks/deploy-k8s.yaml + description: Deploys kubernetes and vino + timeout: 9600 diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 65b7903..294b247 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -1,10 +1,11 @@ - project: check: jobs: - - noop + - airship-deploy-vino gate: jobs: - - noop + - airship-deploy-vino post: jobs: - airship-vino-upload-git-mirror + - airship-deploy-vino