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

feat: integrating NIM model UI #3156

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

olavtar
Copy link
Contributor

@olavtar olavtar commented Sep 5, 2024

Description

Adding NIM UI changes.
image
image

How Has This Been Tested?

Tested locally.

Test Impact

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Sep 5, 2024
Copy link
Contributor

openshift-ci bot commented Sep 5, 2024

Hi @olavtar. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@openshift-ci openshift-ci bot added the needs-ok-to-test The openshift bot needs to label PRs from non members to avoid strain on the CI label Sep 5, 2024
@olavtar olavtar force-pushed the nim-ui branch 3 times, most recently from b9d775e to ebdb88a Compare September 11, 2024 19:37
@olavtar olavtar marked this pull request as ready for review September 11, 2024 19:43
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Sep 11, 2024
@andrewballantyne
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test The openshift bot needs `ok-to-test` to allow non member PRs to run the tests. and removed needs-ok-to-test The openshift bot needs to label PRs from non members to avoid strain on the CI labels Sep 11, 2024
@olavtar olavtar force-pushed the nim-ui branch 3 times, most recently from 8d37e31 to 7746d92 Compare September 12, 2024 16:11
Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

I've ran out of time to do a review... but one final comment is to look into feature flags; unfortunately this is semi poorly documented. But we have arch docs & a series of flags existing today (initial defaults) -- basically you'll need to ask the forum channel of the Dashboard for help and/or follow one of the existing flags and dupe it for NIM overall.

This should allow you to control things like disabling the metrics link & in general hiding all your UI code (don't worry about the manifests) -- so the API can be available but not the UI (sometimes this is hugely beneficial to our customers).

Also, we do want to get Mocked Cypress Tests into this work asap -- but it doesn't need to be this PR. Have you had a chance to look at the existing ones around KServe?

frontend/.env Outdated Show resolved Hide resolved
frontend/src/api/k8s/servingRuntimes.ts Outdated Show resolved Hide resolved
frontend/src/api/k8s/servingRuntimes.ts Outdated Show resolved Hide resolved
Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Okay, a much more through review... testing this out on clusters not enabled with NIMs to see what happens & I'll test it out on you cluster after that.

Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Additional comments we discussed in DM -- putting them in code comment threads for ease of replying.

Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Closing in -- let me do some testing and get you that flag to hide the metrics link

@olavtar olavtar force-pushed the nim-ui branch 2 times, most recently from f3a6920 to 136a5c3 Compare September 20, 2024 07:44
Comment on lines 52 to 66
const isNIMModelServingAvailable = useIsAreaAvailable(SupportedArea.NIM_MODEL).status;
const [isNIMAPIKeyValid, setIsNIMAPIKeyValid] = useState<boolean>(false);
const dashboardNamespace = useDashboardNamespace();

useEffect(() => {
const checkAPIKey = async () => {
try {
const valid = await isNIMAPIKeyEnabled(dashboardNamespace);
setIsNIMAPIKeyValid(valid);
} catch (error) {
setIsNIMAPIKeyValid(false);
}
};
checkAPIKey();
}, [dashboardNamespace]);
Copy link
Member

Choose a reason for hiding this comment

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

Alright, this is a NIT -- we may need to swing back for this as we are trying to do this today.

Please make this a custom hook so logic is repeatable and reusable.

@@ -197,6 +218,11 @@ const ModelServingPlatform: React.FC = () => {
<GalleryItem>
<EmptyMultiModelServingCard />
</GalleryItem>
{isNIMModelServingAvailable && isNIMAPIKeyValid && (
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, you should have this down to isNIMAvailable -- avoid unnecessarily unravelled logic whenever possible. Neither of these values have unique purpose on their own.

@olavtar olavtar force-pushed the nim-ui branch 2 times, most recently from 0826dbf to 31c5287 Compare September 20, 2024 17:05
Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

There is more to do here -- but this is a good foundation. Approving. We'll follow up with additional PRs next week.

@openshift-ci openshift-ci bot added the lgtm label Sep 20, 2024
Copy link
Contributor

openshift-ci bot commented Sep 20, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 34.50479% with 205 lines in your changes missing coverage. Please review.

Project coverage is 84.93%. Comparing base (4cec257) to head (ce486ae).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...projects/NIMServiceModal/DeployNIMServiceModal.tsx 8.08% 91 Missing ⚠️
...s/projects/NIMServiceModal/NIMModelListSection.tsx 1.92% 51 Missing ⚠️
...ving/screens/projects/EmptyNIMModelServingCard.tsx 10.34% 26 Missing ⚠️
...rc/pages/modelServing/screens/projects/nimUtils.ts 51.35% 18 Missing ⚠️
.../NIMServiceModal/NIMModelDeploymentNameSection.tsx 16.66% 5 Missing ⚠️
...d/src/pages/modelServing/screens/projects/utils.ts 85.18% 4 Missing ⚠️
...lServing/screens/projects/ModelServingPlatform.tsx 83.33% 2 Missing ⚠️
...ens/projects/NIMServiceModal/NIMPVCSizeSection.tsx 33.33% 2 Missing ⚠️
...ns/detail/overview/serverModels/AddModelFooter.tsx 75.00% 2 Missing ⚠️
...il/overview/serverModels/PlatformSelectSection.tsx 87.50% 2 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3156      +/-   ##
==========================================
- Coverage   85.50%   84.93%   -0.57%     
==========================================
  Files        1280     1287       +7     
  Lines       28190    28529     +339     
  Branches     7535     7642     +107     
==========================================
+ Hits        24103    24232     +129     
- Misses       4087     4297     +210     
Files with missing lines Coverage Δ
frontend/src/api/k8s/inferenceServices.ts 98.80% <100.00%> (+0.05%) ⬆️
frontend/src/api/k8s/pvcs.ts 100.00% <100.00%> (ø)
frontend/src/concepts/areas/const.ts 100.00% <ø> (ø)
frontend/src/concepts/areas/types.ts 100.00% <100.00%> (ø)
frontend/src/k8sTypes.ts 100.00% <ø> (ø)
...erving/screens/global/InferenceServiceTableRow.tsx 97.14% <ø> (ø)
frontend/src/pages/modelServing/screens/types.ts 100.00% <ø> (ø)
...tend/src/pages/projects/components/PVSizeField.tsx 100.00% <100.00%> (ø)
.../serverModels/deployedModels/DeployedModelCard.tsx 93.33% <100.00%> (+1.02%) ⬆️
frontend/src/pages/projects/types.ts 100.00% <100.00%> (ø)
... and 12 more

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4cec257...ce486ae. Read the comment docs.

@openshift-merge-bot openshift-merge-bot bot merged commit 9f1608a into opendatahub-io:main Sep 20, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test The openshift bot needs `ok-to-test` to allow non member PRs to run the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants