Skip to content

Conversation

t-persson
Copy link
Collaborator

@t-persson t-persson commented Jul 26, 2024

Applicable Issues

#242

Description of the Change

This implements the controller for testrun, environment and providers. Environment is used for storing the sub suite information and the provider implementation will only check if external providers respond properly on a healthcheck endpoint.

The testrun controller can run a suite runner if an environment reports that it is ready and it will wait for the suite runner to complete and delete it and environment after execution. The testrun controller is quite hard-coded though and does not deploy the log listener sidecar or any logstash sidecars for the suite runner.

This change should be seen as a PoC and not to be used in production.

The first commit is boilerplate code that is created by kubebuilder, the second is my implementation.

We now have a working testrun controller and cluster controller. Together with the changes in the API, suite runner, library & environment provider we can now spin up an ETOS cluster and run tests.
First part of the poc is now finished. I will continue on to demonstrate how this is actually better when it comes to the handling of environments.

Alternate Designs

Too many to list. I believe a discussion will be required instead of me listing a ton of stuff here.

Possible Drawbacks

I don't actually see any real drawbacks. This is just better than what we have now.

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Tobias Persson tobias.persson@axis.com

This implements the controller for testrun, environment and providers.
Environment is only used for checking that providers are available and
the provider implementation will only check if external providers
respond properly on a healthcheck endpoint.

The testrun controller can run a suite runner if an environment reports
that it is ready and it will wait for the suite runner to complete and
delete it and environment after execution.
The testrun controller is quite hard-coded though and does not deploy
the log listener sidecar or any logstash sidecars for the suite runner.
The cluster resource will create all the services needed for an
ETOS deployment, including extra infrastructure needs if needed.
It is designed to make it a lot easier to get an ETOS cluster up
and running, especially when running ETOS in a local kubernetes
cluster.
Note that this cluster resource is not complete yet. It does not,
for example, deploy any providers for an ETOS testrun.
It does not read secrets that can be added in the cluster custom
resource.
It does not deploy a logstash instance for ETOS logging.
The cluster parameters is used by the testrun controller
to determine which rabbitmq, messagebus and configuration
to use when launching a suite runner.
Rename Environment to EnvironmentRequest
Environment is now created by the environment provider
In the future an EnvironmentRequest shall spawn an
environment provider
Set up the Environment CRD resource
Centralize the status condition types
Add imagePullPolicy
Add information to the testrun resource on ESR failure
@t-persson t-persson requested a review from a team as a code owner July 26, 2024 12:51
@t-persson t-persson requested review from fredjn and andmat900 and removed request for a team July 26, 2024 12:51
t-persson added 17 commits July 29, 2024 13:00
The testrunner code is made a lot simpler by leaning into the
reconciliation concept and not stopping reconciliations unless
it requires it.
Stopped communicating using the status fields and actually look
at the world to make decisions.
Added a check for Environment objects to set StatusEnvironment.
This flag will make the cli use the new v1alpha endpoint
of the ETOS API to start ETOS.
The mutating webhook will take a jsontas source, which is either
a configmap or secret, parse it and set it as the jsontas spec.
The validating webhook will validate that only one of jsontas
or jsontasSource are set.
Added a webhook that adds cluster if there is one in the
namespace and uses that cluster for the images if they
are not set.
Copy link
Contributor

@andmat900 andmat900 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of TODOs. Please fix those that are easy to fix. The rest maybe should have linked issues.

- Add more logging on errors
- Remove a few TODOs and clarify docs
- Added documentation to structs
- Fix a few log messages
@t-persson t-persson requested a review from andmat900 August 26, 2024 05:58
@t-persson t-persson requested a review from fredjn September 10, 2024 12:17
@t-persson t-persson merged commit 64b7ddf into eiffel-community:main Sep 18, 2024
@t-persson t-persson deleted the etos-controller-almost-finished branch September 18, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants