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
This change fixes an issue where zuul services can't create
a lockfile.
Another issue happening with older operator-framework and newer
kubernetes version is being fixed by updating the operator-framework
following this migration documentation:
https://sdk.operatorframework.io/docs/building-operators/ansible/migration/
Change-Id: I6adfb907184112f0b7debb050975f76cd1dd4b01
This change updates the dhall code to the latest version.
* Support for record pun where `{ x = x }` can now be written as `{ x }`
* Indentation and function definitions are more compact
This change has been generated after installing dhall v1.33 using this
command: find . -name "*.dhall" -exec dhall --ascii format --inplace {} \;
Change-Id: I3b6560f26e28622aa51150dc8083d127d89a8a7b
This change update the kubernetes binding to use the new
Optional types. The main consequence is that all the fields that
are optional needs to be prefixed with Some. This let us remove
the `--omit-empty` parameter resulting in cleaner resources where
we don't need to set a dummy emptyDir medium value.
See this issue for the details:
https://github.com/dhall-lang/dhall-kubernetes/issues/86
Change-Id: I23a0a028909208cd58f57a6f07ee93090b3f3a1a
This change adds zuul scheduler reconfiguration when the tenant config
changes.
Depends-On: https://review.opendev.org/715418
Change-Id: Ib405f5508f513b41f6167e86bf9abe83640d8a18
This change updates the dhall code to the latest version, resulting
in two changes:
* Support for dotted notation, where `{ x = { y = 1 } }` can now be
written as `{ x.y = 1 }`
* Use merge to access Optional value, where:
`Optional/fold value-type optional-value value default-value`
can now be written as:
`merge { None = default-value, Some = value } optional-value`
(value is actually a function that takes the value as an argument)
See the full changelog here:
https://github.com/dhall-lang/dhall-lang/releases/
This change also uses Dockerfile ARG instruction to manage
versions numbers.
Change-Id: I9600ebe5811e0f369f47feec392abf5b6a8af3ba
This change replaces the existing tasks with a dhall function to
generates all the kubernetes objects. The operator nows converts
the CR spec to a dhall `Input`, then it applies the function
output to the cluster. Follow-up changes demonstrate how
runtime operations can be performed around that function.
This change updates the zuul-ci_v1alpha1_zuul_cr.yaml file with
the actual CR defined in the zuul specification so that it can
be used in the functional tests.
Depends-On: https://review.opendev.org/702753
Change-Id: Iea51bccf90def6e827d2c5846ad6a7e4c86a5bc1
This change setups external dhall packages needed by the operator.
The packages are also cached in the operator image to speed up runtime.
Change-Id: Ib6c5774870324224e86b7966f0c720783635df10
This change adds a couple of new tools in the operator image.
This change also disables the CI job and the follow-up changes
will re-active it step by step.
Change-Id: I106b34a5e11aec5e88ca2f491c69c82527551952