Skip to content
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

Updated to use ETCD database instead of redis #85

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

t-persson
Copy link
Collaborator

Applicable Issues

eiffel-community/etos#205

Description of the Change

Start using the ETCD database instead of redis.
Also cleaned up a few deprecated things.
Removed the SubSuite endpoint since it's no longer used. Added type-hints to everything.
Removed copyright year from all files.

Alternate Designs

We could've set up the ETCDPath as a database instead of using it as a path-ish object. I really did enjoy using the path-ish object since it really represents the representation in ETCD.
I added a few compatibility layers in the database, these could've been avoided but then I would've had to sync a change in the ESR at the same time which is prone to failures. Instead we should have the compatibility layers now and remove them when the ESR has been updated.
The ETCDPath object should also be added to the ETOS library. I wanted to use the object "for real" before making big changes to the library though, so moving it should be done in the future.

Benefits

We are now using a database that's intended as a database and we have now put more thought into the structure of the database. Something that we did not have when the redis-hack was implemented.

Possible Drawbacks

We are now running both redis and etcd in the cluster for a single service. We are looking into moving over from python to golang and that change may remove the need for redis since it's used by celery.

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 [email protected]

@t-persson t-persson requested a review from a team as a code owner January 10, 2024 10:50
@t-persson t-persson requested review from fredjn and removed request for a team January 10, 2024 10:50
task_result.forget()
failure = release_environment(etos, jsontas, registry, sub_suite)
ETCDPath(metadata.get("key")).delete()
registry.testrun.delete_all()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This delete_all should be done by the ESR, just before shutting down.

Also cleaned up a few deprecated things.
Removed the SubSuite endpoint since it's no longer used.
Added type-hints to everything.
Removed copyright year from all files.
src/environment_provider/lib/database.py Show resolved Hide resolved
src/environment_provider/lib/database.py Show resolved Hide resolved
src/environment_provider_api/backend/configure.py Outdated Show resolved Hide resolved
src/environment_provider_api/backend/configure.py Outdated Show resolved Hide resolved
src/environment_provider_api/backend/environment.py Outdated Show resolved Hide resolved
failure = None
for suite in task_result.result.get("suites", {}):
registry = ProviderRegistry(etos, jsontas, suite_id)
for suite, metadata in registry.testrun.join("suite").read_all():
Copy link
Member

Choose a reason for hiding this comment

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

If for some reason suite or metadata is malformed or missing, the exceptions will be thrown all the way up to on_get in the webserver. I'm not sure how this is handeled by falcon.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Falcon will return a server error which, in my opinion, is correct since we are reading from the database and not receiving the problematic values from the user.

src/iut_provider/iut.py Outdated Show resolved Hide resolved
src/environment_provider/lib/config.py Show resolved Hide resolved
src/iut_provider/utilities/jsontas_provider.py Outdated Show resolved Hide resolved
@t-persson t-persson requested a review from fredjn January 22, 2024 07:38
@t-persson t-persson merged commit bbdb2a8 into eiffel-community:main Feb 7, 2024
3 checks passed
@t-persson t-persson deleted the etcd-database branch February 7, 2024 07:54
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.

2 participants