2020-04-01 11:31:17 +00:00
|
|
|
# Continuous Integration Jobs for the CentOS CI
|
|
|
|
|
2020-05-27 11:37:16 +00:00
|
|
|
- [dedicated Jenkins instance][ceph_csi_ci] for Ceph-CSI
|
|
|
|
- Jenkins is hosted on [OpenShift in the CentOS CI][app_ci_centos_org]
|
2020-04-01 11:31:17 +00:00
|
|
|
- scripts and Jenkins jobs are hosted in the Ceph-CSI repository (ci/centos
|
|
|
|
branch)
|
2020-04-01 11:49:29 +00:00
|
|
|
- a Jenkins Pipeline is used to reserve bare metal system(s), and run jobs on
|
|
|
|
those systems
|
|
|
|
|
2020-05-26 15:18:43 +00:00
|
|
|
## Repository/Branch Structure
|
2020-04-01 11:49:29 +00:00
|
|
|
|
|
|
|
This is the `ci/centos` branch, where all the scripts for the Jenkins jobs are
|
|
|
|
maintained. The tests that are executed by the jobs are part of the normal
|
|
|
|
projects branches.
|
|
|
|
|
2020-05-25 14:25:15 +00:00
|
|
|
As an example, the `containerized-tests` Jenkins job consists out of the
|
2020-04-01 11:49:29 +00:00
|
|
|
following files:
|
|
|
|
|
2020-05-27 11:37:16 +00:00
|
|
|
- `jobs/containerized-tests.yaml` is a [Jenkins Job Builder][jjb] configuration
|
2020-04-01 11:49:29 +00:00
|
|
|
that describes the events when the job should get run and fetches the
|
|
|
|
`.groovy` file from the git repository/branch
|
2020-05-27 11:37:16 +00:00
|
|
|
- `containerized-tests.groovy` is the [Jenkins Pipeline][pipeline] that
|
2020-04-01 11:49:29 +00:00
|
|
|
contains the stages for the Jenkins Job itself. In order to work with [the
|
2020-05-27 11:37:16 +00:00
|
|
|
bare-metal machines from the CentOS CI][centos_ci_hw], it executes the
|
|
|
|
following stages:
|
2020-04-01 11:49:29 +00:00
|
|
|
|
|
|
|
1. dynamically allocate a Jenkins Slave (`node('cico-workspace')`) with tools
|
|
|
|
and configuration to request a bare-metal machine
|
|
|
|
1. checkout the `centos/ci` branch of the repository, which contains scripts
|
|
|
|
for provisioning and preparing the environment for running tests
|
2023-01-13 09:14:14 +00:00
|
|
|
1. reserve a bare-metal machine with `duffy` (configured on the Jenkins
|
|
|
|
Slave)
|
2020-04-01 11:49:29 +00:00
|
|
|
1. provision the reserved bare-metal machine with additional tools and
|
|
|
|
dependencies to run the test (see `prepare.sh` below)
|
2020-05-25 14:25:15 +00:00
|
|
|
1. run `make containerized-tests` and `make containerized-build` in parallel
|
2020-04-01 11:49:29 +00:00
|
|
|
1. as final step, return the bare-metal machine to the CentOS CI for other
|
|
|
|
users (it will be re-installed with a minimal CentOS environment again)
|
|
|
|
|
|
|
|
- `prepare.sh` installs dependencies for the test, and checks out the git
|
|
|
|
repository and branch (or Pull Request) that contains the commits to be
|
|
|
|
tested (and the test itself)
|
|
|
|
|
|
|
|
## Deploying the Jenkins Jobs
|
|
|
|
|
|
|
|
The Jenkins Jobs are described in Jenkins Job Builder configuration files and
|
|
|
|
Jenkins Pipelines. These need to be imported in the Jenkins instance before
|
|
|
|
they can be run. Importing is done with the `jenkins-jobs` command, which runs
|
|
|
|
in a `jjb` container. To build the container, and provide the configuration for
|
|
|
|
Jenkins Job Builder, see the [documentation in the `deploy/`
|
|
|
|
directory](deploy/README.md).
|
2020-04-01 11:31:17 +00:00
|
|
|
|
2020-07-24 12:40:46 +00:00
|
|
|
[ceph_csi_ci]: https://jenkins-ceph-csi.apps.ocp.ci.centos.org
|
|
|
|
[app_ci_centos_org]: https://console-openshift-console.apps.ocp.ci.centos.org/k8s/cluster/projects/ceph-csi
|
2020-04-01 11:49:29 +00:00
|
|
|
[jjb]: https://jenkins-job-builder.readthedocs.io/en/latest/index.html
|
|
|
|
[pipeline]: https://docs.openstack.org/infra/jenkins-job-builder/project_pipeline.html
|
|
|
|
[centos_ci_hw]: https://wiki.centos.org/QaWiki/PubHardware
|