-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Don't create PVCs if no default StorageClass is set #2679
Don't create PVCs if no default StorageClass is set #2679
Conversation
If no default StorageClass is provided, then we don't let the users create new Volumes. Neither Workspace nor Data Volumes. Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Function for * Loading the rok secret * Decoding the parameterized ROK_SECRET_NAME with a user value The user value will currently always be 'user' Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Instead of using hand-made dicts for pvcs, use client classes for kubernetes objects. Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
@avdaredevil Could you review this please? |
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.
Made a few comments. In general, I am looking at this for the very first time so I don't know how useful my context is. I just saw a few things that I thought looked like they might be confusing if I were going to try to come in and make subsequent changes in this module.
return | ||
|
||
|
||
def create_datavol_pvc(body, i): |
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.
Ideally I think there would be some kind of definition for the shape of the body dict being passed in, but since I have almost no context of looking at this I'm not going to be picky.
@@ -60,5 +133,5 @@ def create_notebook(body): | |||
|
|||
|
|||
def create_pvc(body): | |||
ns = body['metadata']['namespace'] | |||
ns = body.metadata.namespace |
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.
So in this case body has actually changed from a dict to an object. Again, having no context it may be helpful to have some kind of comment or change the name of the param to reflect that it's not a deserialized JSON response as a dict but is not a typed object.
try: | ||
create_pvc(pvc) | ||
create_workspace_pvc(body) |
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.
The code here looks very similar to components/jupyter-web-app/default/kubeflow/jupyter/server.py. Again, I wouldn't want to request any significant changes with so little context but it does seem like it would advantageous to factor out this code into a single shared module.
* Create baseui module to reduce code duplication * Edit Makefile to run the webapps Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* Add more comments to make the code more descriptive * Replace single quotes with double ones * Add readme for baseui module Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
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 reviewing it @prodonjs, I also added you and @avdaredevil as reviewers
Reviewable status: 0 of 28 files reviewed, 3 unresolved discussions (waiting on @prodonjs and @vkoukis)
components/jupyter-web-app/rok/kubeflow/rokui/routes.py, line 52 at r1 (raw file):
Previously, prodonjs (Jason Prodonovich) wrote…
The code here looks very similar to components/jupyter-web-app/default/kubeflow/jupyter/server.py. Again, I wouldn't want to request any significant changes with so little context but it does seem like it would advantageous to factor out this code into a single shared module.
Sure! I reorganized the structure of the code and put the repetitive code in a module.
components/jupyter-web-app/default/kubeflow/jupyter/server.py, line 56 at r1 (raw file):
Previously, prodonjs (Jason Prodonovich) wrote…
Ideally I think there would be some kind of definition for the shape of the body dict being passed in, but since I have almost no context of looking at this I'm not going to be picky.
Do you mean to add a definition to the backend or have it in a README/spec, for example, to make it clear?
components/jupyter-web-app/default/kubeflow/jupyter/server.py, line 136 at r1 (raw file):
Previously, prodonjs (Jason Prodonovich) wrote…
So in this case body has actually changed from a dict to an object. Again, having no context it may be helpful to have some kind of comment or change the name of the param to reflect that it's not a deserialized JSON response as a dict but is not a typed object.
Done.
Added some relative comments in other places to provide more context to the viewer
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.
Looks good otherwise!
@@ -3,3 +3,5 @@ approvers: | |||
- kimwnasptd | |||
reviewers: | |||
- vkoukis | |||
- prodonjs | |||
- avdaredevil |
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.
Please alphabetically sort
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.
Done.
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.
Great! lgtm-ing
Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
/hold cancel |
/lgtm |
/lgtm |
@lluunn could you please approve this PR? |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lluunn, prodonjs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Check for default StorageClass If no default StorageClass is provided, then we don't let the users create new Volumes. Neither Workspace nor Data Volumes. Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Use client for creating pvcs Instead of using hand-made dicts for pvcs, use client classes for kubernetes objects. Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Fix sharp corners Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add helper functions Function for * Loading the rok secret * Decoding the parameterized ROK_SECRET_NAME with a user value The user value will currently always be 'user' Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Handle the token from the html Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Refactor code. Cleanup post_notebook() Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add permissions to list storage classes Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add logging Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Reorganize code * Create baseui module to reduce code duplication * Edit Makefile to run the webapps Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Update the Dockerfile Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add prodonjs and avdaredevil as Reviewers Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add comments * Add more comments to make the code more descriptive * Replace single quotes with double ones * Add readme for baseui module Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Sort OWNERS Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
* Check for default StorageClass If no default StorageClass is provided, then we don't let the users create new Volumes. Neither Workspace nor Data Volumes. Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Use client for creating pvcs Instead of using hand-made dicts for pvcs, use client classes for kubernetes objects. Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Fix sharp corners Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add helper functions Function for * Loading the rok secret * Decoding the parameterized ROK_SECRET_NAME with a user value The user value will currently always be 'user' Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Handle the token from the html Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Refactor code. Cleanup post_notebook() Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add permissions to list storage classes Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add logging Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Reorganize code * Create baseui module to reduce code duplication * Edit Makefile to run the webapps Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Update the Dockerfile Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add prodonjs and avdaredevil as Reviewers Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Add comments * Add more comments to make the code more descriptive * Replace single quotes with double ones * Add readme for baseui module Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com> * Sort OWNERS Signed-off-by: Kimonas Sotirchos <kimwnasptd@arrikto.com>
closes #2157
If no default StorageClass is set, then the user won't be able to create
New
PVCs for the Notebooks using the Jupyter UI./assign @jlewi
/hold
wait for #2671
This change is