-
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
feat: modify behaviours for the enable button for NIM. #3558
base: main
Are you sure you want to change the base?
feat: modify behaviours for the enable button for NIM. #3558
Conversation
Hi @yzhao583. 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-sigs/prow repository. |
39448bd
to
97e4f94
Compare
1bed0fd
to
7043b7e
Compare
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3558 +/- ##
==========================================
+ Coverage 85.01% 85.06% +0.05%
==========================================
Files 1404 1406 +2
Lines 32239 32332 +93
Branches 9038 9085 +47
==========================================
+ Hits 27407 27503 +96
+ Misses 4832 4829 -3
... and 18 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
… show success banner, if it is false, show error banner
…/github.com/yzhao583/odh-dashboard into NVPE-37-fix-the-enable-button-loading-issue
/lgtm |
New changes are detected. LGTM label has been removed. |
setEnableStatus({ | ||
status: | ||
response.variablesValidationStatus === 'True' | ||
? EnableApplicationStatus.SUCCESS | ||
: EnableApplicationStatus.FAILED, | ||
error: | ||
response.variablesValidationStatus === 'True' ? '' : 'Variables are not valid', | ||
}); | ||
dispatchResults( | ||
response.variablesValidationStatus === 'True' | ||
? undefined | ||
: 'Variables are not valid', | ||
); |
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.
Also the first time I enabled NIM with the modal by entering a key, it will tell me it failed with "Variables are not valid". I believe this is because the response.variablesValidationStatus
is 'Unknown'
But this code will think it failed unless it's True
. So we should update this part to account for Unknown
somehow
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.
@emilys314 The logic here is to check if response.variablesValidationStatus
is true. If yes, dispatchResults
. If the response.variablesValidationStatus
is Unknown
, it should loop again to check the status of the application.
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.
Oh okay so it depends on how you test it. If I just delete the nvidia-nim-access
your PR will work fine and not give an error.
But if the key is invalid (deleted/incorrect/expired) then it will say it's erroring when I submit
The response I get back is {isInstalled: true, isEnabled: false, variablesValidationStatus: 'False', canInstall: true, error: ''}
That's because the getIntegrationAppEnablementStatus()
is polling the existing secret which is invalid via the GET. Meanwhile the initial pending value of the POST enableIntegrationApp()
quickly gets overwritten by the poller to invalid
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.
@emilys314 Good catch! I am having hard time fixing this.... Do you have any suggestion?
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.
@emilys314 I have a solution but it is not very ideal.
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.
@emilys314
Yes the conditions status will be reset.
There are two conditions for this to work:
- The secrest should be managed by ODH, indicated by a target label. See here.
- The secret is referenced by an Account. See here.
As long as these conditions stand, a reconcialtion will start with the initial "Unknown" status. See here.
cc: @swati-kale @yzhao583
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 see thank you for the info Tomer, so I guess the issue is there will be a delay when the new api key is set and the validation status in the account. And this is pretty hard to get rid of.
@yzhao583 I think there is a solution we can implement in the UI to work around this. When we start polling the status, we can also return a variablesValidationTimestamp
to check if we have a new value. So on submit, we store a timestamp in the UI, and while polling we will only update the status if the variablesValidationTimestamp
is newer than the onSubmit timestamp one. I think you can also revert / replace your latest commit with this
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.
@emilys314
We're also working on a way to speed up the status reporting. Currently, we report it at the end of the reconciliation; we'll change this behaviour to report more frequently while the reconciliation is still running. Regardless, this will remain an async operation. While it will be faster, checking the timestamp is better, as you suggested.
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.
@emilys314 @TomerFi Thanks for the suggestions, I will implement the workaround to compare the time stamp.
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.
@emilys314 @TomerFi @swati-kale Implemented the Timestamp workaround, please review again, thanks!
frontend/src/pages/exploreApplication/useIntegratedAppStatus.ts
Outdated
Show resolved
Hide resolved
…/github.com/yzhao583/odh-dashboard into NVPE-37-fix-the-enable-button-loading-issue
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…account is changed, and remove the interval to check the enablement status of the app in useIntegratedAppStatus hook
It looks like there is a typescript error with the most recent rebasing to include Olga's pr in I think we may want to make the properties |
@emilys314 I changed variablesValidationTimestamp and variablesValidationStatus to optional |
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.
Also make sure to run the linter / formatter
if (shouldContinueWatching(response)) { | ||
watchHandle = setTimeout(watchStatus, 10 * 1000); | ||
return; | ||
} | ||
if (response.isInstalled) { | ||
setEnableStatus({ | ||
status: EnableApplicationStatus.SUCCESS, | ||
error: '', | ||
}); | ||
dispatchResults(undefined); | ||
} | ||
setLastVariablesValidationTimestamp(response.variablesValidationTimestamp || 'Unknown'); | ||
setEnableStatus({ | ||
status: | ||
response.variablesValidationStatus === VariablesValidationStatus.SUCCESS | ||
? EnableApplicationStatus.SUCCESS | ||
: EnableApplicationStatus.FAILED, | ||
error: | ||
response.variablesValidationStatus === VariablesValidationStatus.SUCCESS | ||
? '' | ||
: 'Variables are not valid', |
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'm facing an issue where the first time I submit the api key, it will say it's invalid.
- Delete the nim secret or change it to be invalid
- Reload the page (important! otherwise the modal is saving the timestamp state after being closed because this modal isn't great)
- Enter and submit new key
- See invalid error
I believe this is happening because the initial value of the timestamp is set to Unknown
, after the onSubmit POST, it will return the last timestamp which is stale. The watcher sees the timestamp changes and will check the status and see the stale invalid one.
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.
@emilys314 Thanks! Fixed it.
variablesValidationStatus: VariablesValidationStatus.UNKNOWN, | ||
variablesValidationTimestamp: 'Unknown', |
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.
Nitpick: I'm not sure how I feel about having "Unknown" as the return value for the timestamp. It looks a little strange next to the other enum, and timestamp can have many values, not different enum states, also passing in "Unknown" is a magic string. In my opinion returning an empty value or no timestamp is a more universal sign that there is no timestamp
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.
@emilys314 Thanks for your suggestion. Are you suggesting replacing Unknown
with ''
?
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.
@emilys314 Replaced Unknow
to ''
…idationTimestamp to empty string
Jira: https://issues.redhat.com/browse/NVPE-37
Jira: https://issues.redhat.com/browse/NVPE-72
Description
How Has This Been Tested?
Test Impact
Explore
page, select theNVIDIA NIM
tile, and should see the Skeletonwhen loading. If NIM is enabled, theEnable
button should be hidden, if NIM is disabled but can be enabled, theEnable
button should be displayed, if NIM cannot be enabled, theEnable
button should be displayed but the button should be disabled, hover the button, the tooltip should be displayed.Enable
button, and the modal to enable NIM should be displayed. If no API key is provided, theSubmit
button should be disabled, otherwise, it should be enabled.Submit
button. If validation success, the modal should be closed and theEnable
button on theExplore
page should be hidden.Enable
page -> click thedisable
on the top-right corner of the NIM tile, the link to remove NIM from this page should NOT be seen.Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main