-
Notifications
You must be signed in to change notification settings - Fork 178
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
first try at storageclasses get and promises #1740
first try at storageclasses get and promises #1740
Conversation
Hi @shalberd. Thanks for your PR. I'm waiting for a opendatahub-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
tests with a Rosa cluster and two storage classes worked.
today) tested with an without default annotation set to true on a storageclass. Working beautifully in all cases.
On every moving-in from other parts of the application to the New Workbench page, the api call logic for getting the storageclasses is executed exactly once. When no default storage class is set and the name from notebookController.storageClassName is not in the list of StorageClasses, the console error message appears and no storageClassName field is applied in the PVC. To be looked at: with dashboard running locally and communicating with an AWS Rosa Cluster, it takes about 2-3 seconds on first visit of the workbench / SpawnerFooter page for the list of storageClasses to be complete. Once done, though, no more API calls happen, so ok in terms of cluster traffic. For the console statements, there seems to be a 1-2 seconds tick interval, they keep repeating each other. |
bd8ef29
to
2a77c17
Compare
@andrewballantyne moved logic for getting the cluster's storageclasses from SpawnerFooter to App / AppContext, thereby making the list of storageclasses available across the board, not just in Data Science Projects New Workbench. List of storageclasses including their details is only fetched once at app start or on browser refresh. Test result still the same from manual tests, verified
PVC is created without storageClassName, which in this scenario leads to silent failure of the PVC not getting created, much like the first case, but with no console log entry.
note I had to do a browser refresh for AppContext and the info on StorageClasses to be reloaded.
Here, too, as I patched the storageclass to be non-default at cluster-level, I had to do a browser refresh to get a fresh list of all StorageClassKind array members in AppContext. Worked as expected as well.
For now, the decision logic is only placed in the assemblePVC logic of new frontend workbenches, not used in jupyter tile. |
Briefly after loading the app / refreshing the web page, the following message appears very briefly and then disappears I am checking whether the number of storage classes in the array fetched is 0 and then showing this message. It could be that it takes 1-2 seconds for the call to api storageclasses get to complete (async logic, promise-based). So maybe that error message is not even necessary, also in terms of what you all would require. I can remove that GUI message part, if so wished. It wasn't part of Andrew's original ticket scope. Also, on hard browser refresh and on first app load, the get request to api storageClasses shows up twice in the backend, a few seconds after each other, but then no more during the entire app lifecycle req-b3 not completed on first call, called second time as req-b4 which is then completed
|
7c93c04
to
1d395de
Compare
4f5b111
to
ae7c2fb
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.
Sorry for the prolonged delay @shalberd -- I got to this finally. I'll prioritize feedback cycles as this was smaller than I expected 😅
071fd45
to
0d1ecf9
Compare
will be testing the new changes and behavior with ROSA OpenShift: 4.12.34
|
109dbe3
to
a980f38
Compare
storageclassname gp3 automatically filled-in by cluster in pvc
test ok, expected as specified, default cluster storage class is what counts and overrules all, if set current logic:
@andrewballantyne We might talk about whether that is really wished, i.e. should odhDashBoardConfig storageClassName, if set, be able to override cluster default storageClass or not. basically, undefined is always returned when there is a cluster-level default storageClass set, leading to the cluster filling in its default storageClassName during PVC creation. notebookController.storageClassName currently cannot override the cluster default. @guimou once mentioned elsewhere and it went into P0 requirement of story
my suggestion to achieve that would be a logic manupulation to
Usually, application-set values are allowed to override cluster-level defaults. Simplest example: resource requests and limits in application container deployments :-)
unsetting cluster-level default storageclass
important: hitting enter on odh-dashboard application url, GET, application web page so that new details on cluster-level storageclasses get loaded into appContext (not just page refresh) so that api call to get the storageClasses into AppContext happens
We see no explicit storageClassName set, should lead to an event in openshift
behavior ok and just as expected. To be determined: why the console.error message appears multiple times and why it already appears before Create Workbech button is clicked, before PVC is even assembled. ok for me, just wondering in terms of application logic flow. It looks like the hook usePreferredStorageClass.ts is called at page load time, correct? What I don't understand is why the console message repeats itself.
working as expected, gp2 set as storageClassName of PVC
|
… AppContext and additional property. Storage classes info only gets loaded anew on app starts or hard browser page refresh. Custom hook usePreferredStorageClass for decision logic. StorageClassKind array of cluster storage classes. get logic in App / AppContext and additional property. Storage classes info only gets loaded anew on app starts or hard browser page refresh. Custom hook usePreferredStorageClass for decision logic.
48e9865
to
4eb9817
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.
Let me test it out, these should be fixed, but I think given the scenario we can probably go ahead without them and swing back with another tidying up PR.
frontend/src/pages/projects/screens/spawner/storage/usePreferredStorageClass.ts
Show resolved
Hide resolved
frontend/src/pages/projects/screens/spawner/storage/usePreferredStorageClass.ts
Show resolved
Hide resolved
frontend/src/pages/projects/screens/spawner/storage/usePreferredStorageClass.ts
Show resolved
Hide resolved
frontend/src/pages/projects/screens/spawner/storage/usePreferredStorageClass.ts
Show resolved
Hide resolved
This works as expected (see my last review comments). I'm going to approve this and get it into incubation. We should look to address those items (I'll create a follow up). |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne 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 |
I added some comments, the only one I 100% can agree with it the one regarding strict or loose equality comparison. I really think the other comments don't need to be adressed. See my comments in the code. |
Well you are looking at the wrong docs for It will need to be fixed, but it's not the end of the world given the small coverage you do today. |
first try at storageclasses get and promises
early stage ... runs and build without errors
related to #1701
Description
trying to get all storageclasses via api call, working nicely.
never mind any 404 on /notebooks routes in screenshots, for local tests together with remote AWS Rosa cluster, I did not bother to install kubeflow and odh notebook controller, which create the routes from kind: Notebook as well as the CRD for Notebook, as part of ODH on my test Rosa cluster. PVC creation by ODH dashboard can be checked with that setup, too.
Q: @andrewballantyne since storage classes of the cluster are not namespace-specific, would it make sense to put the cluster storage classes into the React JS appContext instead of the ProjectDetailsContext? I don't think we need to watch the cluster storage classes for changes, it is enough to load them at application startup or on hard browser refreshs
I did just that in this PR.
How Has This Been Tested?
npm run-script dev
Test Impact
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main