29 Commits

Author SHA1 Message Date
James E. Blair
182a563a9e Add allowUnsafeConfig database setting
We overrode the PXC resource values in order for functional tests
in minikube to work.  Restore the defaults and set an override in
the functional tests.

Change-Id: Id0560d9089f03ddcb116dccec0b424b811186d65
2021-07-23 10:27:07 -07:00
James E. Blair
e448c52b79 Remove extra 2 minute wait from tests
This doesn't seem to be necessary any more.

Change-Id: I02d4c417bdf9574cd61577044b80fdc8bdd3a779
2021-07-23 10:27:06 -07:00
James E. Blair
d87ea64c06 Add support for zuul-registry
Change-Id: Ie206f8f7c48da3cfaabb33d16f2a339b35db4e5e
2021-07-23 10:27:06 -07:00
James E. Blair
6e0fb7fe1b Support zuul-preview
The test is moved from run.yaml to test.yaml to benefit from the cluster_ip
variable that is set at the start of test.yaml.

Change-Id: Ia0d1cbac94b6b638b6f410d9647ee1822751a767
2021-07-23 10:27:05 -07:00
James E. Blair
5358c6dc0e Support imagePrefix and versions
Allow the user to specify an image prefix and a version tag.

This updates the functional test to account for a recent change
in Zuul which returns incomplete builds on the API endpoint.

Change-Id: I49e82c790a518c1c9f5a463250b5b785eacde55a
2021-07-23 09:47:08 -07:00
James E. Blair
b6d8f1eb53 Move ingress to functional test
The operator currently creates an ingress object, but this was really
just to aid testing.  The operator probably shouldn't really create one
since doing so may be site-specific.

Having the ingress greatly aids local and functional testing though, so
move it to the functional test playbook.

Change-Id: Ic6296120f8c107ecc29556fdab4d6cddb5216a50
2021-07-20 13:20:07 -07:00
James E. Blair
1b699279a4 Run a git server in k8s for functional tests
To make the functional tests easier to run locally, run a git server
in k8s instead of on the local machine.

Also, update the secret creation to work with kind as well as minikube.

Change-Id: I4c00129c7105405b0f6256e769486e79c0b173fe
2021-07-20 13:19:59 -07:00
James E. Blair
e5879666bd Bump API version to v1alpha2
To accomodate the CR syntax changes.

Change-Id: Ie646a9c58655b0987a8fb0d4c914cd8b93190b1b
2021-07-20 13:16:58 -07:00
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
Tristan Cacqueray
ee8a7b2cfb Remove command args override and update operator-framework to v1.4.2
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
2021-04-06 17:23:56 +00:00
Daniel Pawlik
2c367363e8 Replace Fedora 31 with Fedora 32 in zuul-operator-functional
Fedora 31 is EOL and it should be replaced to new version.

Change-Id: Ib51035850528666ece39a1c3f689d73bce29b802
2020-12-17 09:37:52 +01:00
Tristan Cacqueray
0fbffe66f2 Use ensure-pip role to unblock the CI
This change ensures the pip tool is installed as it is no longer
provided by the OpenDev test instance.

Change-Id: Ie9ebf946fbf847f5574c3e140f43bdb1c9949137
2020-07-07 15:00:36 +00:00
Zuul
f9c29acef3 Merge "test: refactor run tasks to include file" 2020-05-05 16:51:47 +00:00
Zuul
d1213e97ff Merge "Add zuul-preview service" 2020-05-05 16:41:51 +00:00
Zuul
e0d6b03dad Merge "Add registry tls secret provided by cert-manager" 2020-05-05 16:40:58 +00:00
Zuul
82a277abc3 Merge "Add initial withCertManager input toggle" 2020-05-05 16:35:20 +00:00
vass
4f182cf2b6 Use ensure-* roles
The install-* roles in zuul-jobs have been renamed to ensure-*, follow
the rename.

Change-Id: I1089398b91b9f26aeb876584256e0309aa36fb25
2020-04-27 21:53:47 +02:00
Tristan Cacqueray
344a0b763b test: refactor run tasks to include file
This change move tasks to dedicated files to
improve the readability of the run playbooks.

Change-Id: Iaf4829daf5f89f22b200d089ef8fd4eeee3e91bf
2020-04-15 18:05:22 +00:00
Tristan Cacqueray
9c53503051 Add zuul-preview service
This change adds an optional preview configuration to the spec:

  preview:
    image: docker.io/zuul/zuul-preview:latest
    count: 0

Change-Id: Id9d902b3b9f25b1bf3fa459634396d7520681417
2020-04-15 15:15:34 +00:00
Tristan Cacqueray
62b5ca9ad8 Add registry tls secret provided by cert-manager
This change adds a Cerficiate resource to manage
the registry tls secret with the cert-manager service.

This change also splits the registry rw user to a
dedicated secret to enable separate creation of the passwords.

Change-Id: I673ea8db31fd2926c82a4288fd9362f225794da8
2020-04-15 00:15:09 +00:00
Tristan Cacqueray
20f634230d Add initial withCertManager input toggle
This change adds a new input toggle to enable using a cert-manager service.
The operator currently only setup a selfSigned CA.

Change-Id: Ifc63768a87f9508c66e4414d5286bae2969985e7
2020-04-15 00:04:21 +00:00
Tristan Cacqueray
c6d35be4d6 Add zuul-registry deployment
This change adds an optional registry configuration to the spec:

  registry:
    image: docker.io/zuul/zuul-registry:latest
    count: 0
    storage-size: 20
    public-url: https://registry:9000

The operator expect a {{ cr_name }}-registry-tls secret to be provided
for tls and user configuration. If the secret is missing, the operator
creates self signed certificates and generates the user password.

Depends-On: https://review.opendev.org/710644
Change-Id: I0c054485b0ad01d53ddcff93f7bcbf34d1810325
2020-04-14 11:22:20 +00:00
Tristan Cacqueray
119090208b Increase scheduler wait timeout and improve logs collection
In some case, the test node needs more time to pull the
zuul image. This change increases the wait time to 8 minutes
to prevent false positive failure.

Thsi change also:
* adds a build artifact with the generated kubernetes resources.
* redirects post commands output to logfiles to unclutter the
  job-output console.
* replaces kubectl wait by rollout status.
* wait for operator and nodepool-launcher deployment.

Change-Id: I1c499bd11576f92b98511cd1ff180026b8aa70d8
2020-04-13 21:21:00 +00:00
Tristan Cacqueray
87ce71fd39 Update attributes to camelCase
This change updates the external_config and job_volumes attribute
name to be consistent with kubernetes definitions.

Depends-On: https://review.opendev.org/707190
Change-Id: I168128e543e03935c03ab9547f208f18e432e0fc
2020-04-06 20:59:48 +00:00
Tristan Cacqueray
16ac3334ea Add job_volumes CR spec attribute
This change implements https://review.opendev.org/706639
to support custom volume to be mounted in job context.

Change-Id: Ic4a6a27707205594910ad90a5577fbbe727e2352
2020-04-06 18:47:19 +00:00
Tristan Cacqueray
af310512cd Add nodepool kubernetes pod label to integration test
This change enables using real kubernetes pod label
for the integration tests.

Depends-On: https://review.opendev.org/715308
Change-Id: I24448bf1edb6c546475796a06cf8cbe456716c32
2020-03-31 16:27:03 +00:00
Tristan Cacqueray
28ea866426 Adapt the integration playbook to be usable locally
This change adds some utility files to help with
running the zuul job locally.

Change-Id: I427ca493e456f4d80350921212d3bbcccbf1c6be
2020-03-31 12:20:47 +00:00
Tristan Cacqueray
a6cda880b9 Add integration test playbook
This change adds a new run playbook to perform some integration
tests:
- add a config project with a periodic pipeline
- ensure the executor run a job
- ensure the job results are published in the db
- ensure the console-stream is working

Change-Id: I85187c741b376eaafdef1066452f13e2853caed7
2020-03-31 12:20:43 +00:00
Tristan Cacqueray
2937272624 Replace existing operator tasks with the new dhall function
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
2020-02-04 00:51:30 +00:00