Any code changes in this repository** are verified using oVirt CI System.
All configurtion and script files required
by oVirt CI are located in the automation
directory. In addition, there is the stdci.yaml
configuration file.
According to oVirt CI specification all incoming patches
are verified at the check-patch
stage. Once a new PR is submitted to this repository,
the oVirt CI System triggers
Jenkins job which executes the automation/check-patch.sh
script.
This script runs the Ansible playbook
./playbooks/automation/check-patch.yml
which wraps the entire testing flow.
Note: Any KubeVirt component or related project can be automated using oVirt-CI and oVirt CI Team will be happy to help.
The ./playbooks/automation/check-patch.yml
Ansible playbook is composed of the following steps:
- provision testing environment: playbooks/provider/lago/config.yml
- deploy OpenShift: playbooks/cluster/openshift/config.yml
- install KubeVirt: playbooks/kubevirt.yml
This playbook is executed inside of CentOS 7.5 mock. The required packages specified in automation/check-patch.packages are installed.
The usage and parameters of this playbook are described at Deploy new Kubernetes or OpenShift cluster and KubeVirt with Lago.
The Testing environment is populated by
Lago project according to requirements defined
in the Lago configuration file LagoInitFile.yml
.
The testing environment consists of three virtual machines with CentOS 7.5, namely:
- 1x master node
- 2x compute nodes
For any details regarding these virtual machines, for example memory,
number of CPUs, disks alocation and et cetera, see
LagoInitFile.yml
.
The testing environment can be populated with different versions of an OpenShift cluster.
It defines a testing matrix. The substage
section of the stdci.yaml
configuration file contains the currenly used matrix or matrices.
Files describing various matrices and labeled by the OpenShift version are located in
the automation
directory.
The KubeVirt version is constant and not changed for a testing matrix.
It's possible to reproduce the CI process on a local machine, for example to experiment with KubeVirt or to debug errors.
- 8GB RAM memory
- 7GB Free Disk space
- Centos 7+ or Fedora 26+ OS
- Libvirt installed and running
- Nested virtualization enabled
- the
/var/lib/lago
directory, which is used by Lago to cache VM images - Docker installed and running
In order to avoid dependencies issues, the entire flow should run inside a mock environment with automatically installed dependencies.
Follow the steps in Setting up mock_runner to configure a wrapper for mock.
Use the following steps in order to trigger the CI flow:
-
Create the mock environment
From the root of kubevirt-ansible repository run the following command and replace the following variables:
-
jenkins
- the directory containing the jenkins repository (see Setting up mock_runner) -
cluster_version
- the CI flow to run, for exampleopenshift_3-10.sh
$ ${jenkins}/mock_configs/mock_runner.sh \ --mock-confs-dir ${jenkins}/mock_configs/ \ -e automation/check-patch.${cluster_version}.sh \ -s \ el7
-
-
Navigate into kubevirt-ansible repository
The
mock_runner
tool bind mounts the current directory into the$HOME
directory inside the mock environment.$ cd
-
Provision and deploy the environment
$ ./automation/check-patch.${cluster_version}.sh
By default the environment is removed when the script finishes. In order to keep it, use the
--skip-cleanup
flag. The environment can be removed by calling the same script with the--only-cleanup
flag.