-
Notifications
You must be signed in to change notification settings - Fork 6
A working state of the testrun controller #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
t-persson
merged 42 commits into
eiffel-community:main
from
t-persson:etos-controller-almost-finished
Sep 18, 2024
Merged
A working state of the testrun controller #246
t-persson
merged 42 commits into
eiffel-community:main
from
t-persson:etos-controller-almost-finished
Sep 18, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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.
andmat900
reviewed
Aug 19, 2024
There was a problem hiding this 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
fredjn
reviewed
Sep 10, 2024
fredjn
reviewed
Sep 10, 2024
fredjn
approved these changes
Sep 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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