zuul-operator/.zuul.yaml
James E. Blair eff9f360f7 Use kopf operator framework
This switches from the ansible/dhall operator framework to kopf,
an operator framework written in pure Python.  This allows us to:

* Build the operator application as a Python app.
* Build the operator image using the opendev python builder images.
* Run the operator as a Python CLI program "zuul-operator".
* Write procedural Python code to handle operator tasks (such as
  creating new nodepool launchers when providers are added).
* Use Jinja for templating config files and k8s resource files
  (direct pythonic manipulation of resources is an option too).

The new CR nearly matches the existing one, with some minor differences.

Some missing features and documentation are added in the commits
immediately following; they should be reviewed and merged as a unit.

Also, fx waiting for scheduler to settle in functional test since
we changed this log line in Zuul.

Change-Id: Ib37b67e3444b7cd44692d48eee77775ee9049e9f

Change-Id: I70ec31ecd8fe264118215944022b2e7b513dced9
2021-07-20 13:16:07 -07:00

112 lines
3.8 KiB
YAML

- job:
description: Operator integration tests
name: zuul-operator-functional
abstract: true
run:
- playbooks/zuul-operator-functional/run.yaml
- playbooks/zuul-operator-functional/test.yaml
post-run: playbooks/zuul-operator-functional/post.yaml
vars:
# We disable userland-proxy to enable scheduler deployement to connect to the gearman service
# see: https://github.com/eclipse/che/issues/8134
docker_userland_proxy: false
container_runtime: docker
- job:
description: Operator integration tests with Kubernetes
name: zuul-operator-functional-k8s
parent: zuul-operator-functional
pre-run: playbooks/zuul-operator-functional/pre-k8s.yaml
nodeset: ubuntu-bionic
vars:
namespace: 'default'
- job:
description: Image and buildset registry job
name: zuul-operator-build-image
parent: opendev-build-docker-image
allowed-projects: zuul/zuul-operator
requires:
- zuul-container-image
- zuul-registry-container-image
- nodepool-container-image
provides:
- zuul-operator-container-image
vars: &image_vars
zuul_work_dir: "{{ zuul.projects['opendev.org/zuul/zuul-operator'].src_dir }}"
docker_images:
- context: .
dockerfile: build/Dockerfile
repository: zuul/zuul-operator
tags:
# If zuul.tag is defined: [ '3', '3.19', '3.19.0' ]. Only works for 3-component tags.
# Otherwise: ['latest']
"{{ zuul.tag is defined | ternary([zuul.get('tag', '').split('.')[0], '.'.join(zuul.get('tag', '').split('.')[:2]), zuul.get('tag', '')], ['latest']) }}"
- secret:
name: zuul-operator-dockerhub
data:
username: zuulzuul
password: !encrypted/pkcs1-oaep
- QVrNMxcxfu35rLxt2m/ZGWPRHDm0rbw/rybpkbuL8B7v0CvJjgsLxfZ2uonMRINk53gex
TN9Y6vdM3YUu/Bdu4Z7cTKV+ohBRdCbEzJAVHJGclYRAFVzAMLDgKWZRFNrJVY1/0U9AZ
a4F32AS8hWAdH03Ntv77cK+NX/y0pSAySin7o45XrHAA21vAASp9PSGLCSCB5pVfHELyR
lgpu4+NMh2ocbbDwzQFAJbYgb60OYRYlsvI4ECCvDDm2Jxma6iOYnSe62E8v/K7fhFzVr
orBystkKaOy1154aGYTajtR0vebTGw6XJt4SYID3dHKS9XTwjpTEJySfFtSRDHDi0lhdN
gSS7ZojBlOrj1/a/Oddca9iGgjqLaC2iOJGsABXXP14WambZNvDG07/eEaS2dhV745k06
HPdapriUCuTBqivSkItighYYB8eh9LkqwVxXJ/feyewMERasWkKPDkT/mX5+R1KJCTnwS
xmEvngPk5gLwpDexLL+nmNahYNbz7alzFUGCSR7jTLORZUgimGDzfaguTHZNhzb4jE9kU
0s5nzOti9LdQNCkKVAvRCsOyp7+U9zvf6LHQhO35ivW3vrSmEfyqQqUVdJMBHhBE8M0jj
AYLhYdFc748RTCVJzka6uAQ69QJuv0wSP0+MHKy39OrnOSDZUGm1dkeTQwqpWA=
- job:
description: Build Docker images and upload to Docker Hub.
name: zuul-operator-upload-image
parent: opendev-upload-docker-image
allowed-projects: zuul/zuul-operator
secrets:
name: docker_credentials
secret: zuul-operator-dockerhub
pass-to-parent: true
requires:
- zuul-container-image
- zuul-registry-container-image
- nodepool-container-image
provides:
- zuul-operator-container-image
vars: *image_vars
- job:
description: Promote previously uploaded images.
name: zuul-operator-promote-image
parent: opendev-promote-docker-image
allowed-projects: zuul/zuul-operator
secrets:
name: docker_credentials
secret: zuul-operator-dockerhub
pass-to-parent: true
nodeset:
nodes: []
vars: *image_vars
- project:
check:
jobs:
- zuul-operator-build-image
- zuul-operator-functional-k8s:
dependencies: zuul-operator-build-image
gate:
jobs:
- zuul-operator-upload-image
- zuul-operator-functional-k8s:
dependencies: zuul-operator-upload-image
promote:
jobs:
- zuul-operator-promote-image
release:
jobs:
- zuul-operator-upload-image:
vars:
<<: *image_vars
upload_docker_image_promote: false