-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: ensure notebook endpoints do their job #388
feat: ensure notebook endpoints do their job #388
Conversation
bb70ba7
to
0ed563d
Compare
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.
Thank you for adding this Samuel. It looks really good! Just a few changes.
.../renku_data_services/message_queue/avro_models/io/renku/events/v2/reprovisioning_finished.py
Outdated
Show resolved
Hide resolved
...s/renku_data_services/message_queue/avro_models/io/renku/events/v2/reprovisioning_started.py
Outdated
Show resolved
Hide resolved
try: | ||
await self.nb_config.k8s_client.delete_server(server_name, safe_username=user.id) | ||
except MissingResourceError as err: | ||
raise exceptions.NotFound(message=err.message) |
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.
suggestion: Just supress a missing resource error for deletion. I.e. we want the server to not be there so if the resource is not there we can just return a 204. This is what we do in most other endpoints.
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.
I was wondering whether there should be a trace left for the admin if there was at some point too many tentative to delete a server.
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.
Sure if you want log a warning instead of fully suppressing.
) | ||
return json(ServerLogs().dump(logs)) | ||
except MissingResourceError as err: | ||
raise exceptions.NotFound(message=err.message) |
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.
suggestion: just use MissingResourceError
from errors.errors
- when we raise errors we should be using these exceptions. Then our centralized error handler properly formats these. Not sure why you have even added this try/except because the k8s client will already raise the proper error and message if the server does not exist. So you dont have to catch and reraise here at all.
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.
I did this because the MissingResourceError
exception would trigger a 500 error and not the NotFound
from sanic
.
If I understand things correctly, k8s_client
should use the one from errors.errors
rather than notebook.errors.user
.
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.
If I understand things correctly, k8s_client should use the one from errors.errors rather than notebook.errors.user.
Yes that is exactly right. We should just fully eliminate the errors from notebook.errors
9e88bad
to
1a44f2e
Compare
8b164c0
to
8878712
Compare
chore: filter environments by owner type squashme: address comments feat!: expand environment specification This is a breaking change in the API. chore: add tests and minor fixes chore: test the global environments migration chore: fix tests chore: minor improvements to db session handling squashme: minor fix squashme: fixups for conflict resolutuion after merge squashme: fix failing tests chore: address comments
This includes major edits to the notebooks code to work with the data service.
The gitlab credentials header from the notebooks is really complicated. We used it here just to get the access token expiry. I modified the gateway to now pass in an extra header value to indicate the gitlab token expiry.
The query args retrieval was incorrect and the log retrieval needed to be waited on. Slight refactor to ensure mypy is happy with int conversion
The returned values must be tested more thoroughly as for example the hibernation status is not in the returned json.
The manifest being now validated, it looks like the v2 variant does not provide some of the fields. The question is the following: should the manifest definition reflect that or the code adapted to provide the values. Currently the second option is used.
Squash and merge please when you merge this. |
We should fix the tests before we merge.
This configuration forces the use of ipv4 which is required to be able to start on GitHub's runner which do not provide ipv6.
It's a leftover of the original API and note used in the current implementation.
The message shown during the CI run on error is not fully visible so it's hard to understand what is going wrong.
The cluster creation in the CI fails with kind however k3d was successfully used in renku-notebooks for the same kind of tests.
16eeb93
to
e6a20b8
Compare
The exit method will not be called and the cluster will thus not be properly deleted.
This ensures that each of them get its own cluster in case one of them is not properly deleted.
This allows to use the same tool in development and CI.
a9ee8de
to
7a0f8e3
Compare
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
This work brings the notebook related endpoints to a working state to serve as replacement for the renku-notebooks external service. Short summary: - API tests have been added - Code has been fixed to answer / handle exception - Automated test cluster creation has been added using k3d --------- Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
Describe your changes
This PR ensure that the notebook API part correctly answers and acts on the requests sent to make it on par with the renku- notebook implementation.
Issue ticket number and link
Part of #303