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: added ability to deploy more than one NIM model. #3453

Merged
merged 9 commits into from
Nov 13, 2024

Conversation

olavtar
Copy link
Contributor

@olavtar olavtar commented Nov 7, 2024

https://issues.redhat.com/browse/NVPE-15

Description

Ability to deploy more than one NIM model.

How Has This Been Tested?

Tested locally.

Test Impact

  • Manually tested the UI to confirm that multiple deployed models display accurately.
  • Verified the Deploy button appears on the Model Serving screen.
  • Verified the Deploy button appears on the Models tab under Data Science Project
  • Ensured that Secrets are not getting deleted if more than 1 deployment is present within the same namespace
  • Ensured that PVC does get deleted regardless of how many deployments are present within the same namespace

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.
image image

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 needs-ok-to-test The openshift bot needs to label PRs from non members to avoid strain on the CI label Nov 7, 2024
Copy link
Contributor

openshift-ci bot commented Nov 7, 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.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 69.86301% with 22 lines in your changes missing coverage. Please review.

Project coverage is 85.61%. Comparing base (6f439e5) to head (f6d2c37).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...rc/pages/modelServing/screens/projects/nimUtils.ts 60.00% 12 Missing ⚠️
...ing/screens/global/DeleteInferenceServiceModal.tsx 77.77% 4 Missing ⚠️
...projects/NIMServiceModal/ManageNIMServingModal.tsx 78.57% 3 Missing ⚠️
...d/src/pages/modelServing/screens/projects/utils.ts 66.66% 2 Missing ⚠️
...lServing/screens/projects/ModelServingPlatform.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3453      +/-   ##
==========================================
- Coverage   85.65%   85.61%   -0.04%     
==========================================
  Files        1347     1347              
  Lines       30676    30704      +28     
  Branches     8554     8554              
==========================================
+ Hits        26275    26287      +12     
- Misses       4401     4417      +16     
Files with missing lines Coverage Δ
...lServing/screens/projects/ModelServingPlatform.tsx 99.08% <80.00%> (-0.02%) ⬇️
...d/src/pages/modelServing/screens/projects/utils.ts 94.33% <66.66%> (-0.69%) ⬇️
...projects/NIMServiceModal/ManageNIMServingModal.tsx 86.92% <78.57%> (+0.03%) ⬆️
...ing/screens/global/DeleteInferenceServiceModal.tsx 86.48% <77.77%> (-1.52%) ⬇️
...rc/pages/modelServing/screens/projects/nimUtils.ts 84.94% <60.00%> (-11.93%) ⬇️

... and 3 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 6f439e5...f6d2c37. Read the comment docs.

@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 Nov 8, 2024
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.

Code-level changes/questions -- testing it out.

Comment on lines 134 to 137
const count = await fetchInferenceServiceCount(projectName);
if (count === 0) {
return resourcesToDelete;
}
Copy link
Member

Choose a reason for hiding this comment

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

Since you updated the logic to throw an error -- instead of returning 0 -- the only way to get into this block is if you don't have the resources... did we want to try and delete the PVC still? Or... not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the if (count === 0) condition has been removed.

andrewballantyne

This comment was marked as resolved.

@@ -123,3 +124,59 @@ export const updateServingRuntimeTemplate = (
}
return updatedServingRuntime;
};

export const getNIMResourcesToDelete = async (
Copy link
Member

@andrewballantyne andrewballantyne Nov 12, 2024

Choose a reason for hiding this comment

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

Anyway we can get a unit test for this? It seems the logic is not working as expected (at least on the cluster)

@olavtar

This comment was marked as 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.

Works as expected.

Couldn't reproduce the two model PVC issue & the secrets get cleaned up.

/hold

@olavtar Can you let me know what issue it is for the unit test or push it to this PR? I want to make sure we have that covered in the backlog or in this PR itself. Thanks!

@openshift-ci openshift-ci bot added do-not-merge/hold This PR is hold for some reason lgtm labels Nov 13, 2024
Copy link
Contributor

openshift-ci bot commented Nov 13, 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

@andrewballantyne
Copy link
Member

Discussed with Olga -- tests are done but have an issue -- unholding to wrap up one more thing in the NIM space.

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold This PR is hold for some reason label Nov 13, 2024
@olavtar
Copy link
Contributor Author

olavtar commented Nov 13, 2024

Jira for unit test: https://issues.redhat.com/browse/NVPE-33

@openshift-merge-bot openshift-merge-bot bot merged commit 01165de into opendatahub-io:main Nov 13, 2024
6 checks passed
andrewballantyne pushed a commit to andrewballantyne/odh-dashboard that referenced this pull request Nov 15, 2024
…o#3453)

* feat: added ability to deploy more than one NIM model.

Signed-off-by: Olga Lavtar <[email protected]>

* feat: refactored NIM related logic to nimUtils

Signed-off-by: Olga Lavtar <[email protected]>

* feat: changes to the error handling

Signed-off-by: Olga Lavtar <[email protected]>

* feat: changes to the error handling

Signed-off-by: Olga Lavtar <[email protected]>

* feat: changes .some for .forEach

Signed-off-by: Olga Lavtar <[email protected]>

* feat: deleting secrets fix

Signed-off-by: Olga Lavtar <[email protected]>

* feat: deploying the same model pvc fix

Signed-off-by: Olga Lavtar <[email protected]>

* feat: added a unit test for getNIMResourcesToDelete

Signed-off-by: Olga Lavtar <[email protected]>

* feat: will add a unit test for getNIMResourcesToDelete later

Signed-off-by: Olga Lavtar <[email protected]>

---------

Signed-off-by: Olga Lavtar <[email protected]>
openshift-merge-bot bot pushed a commit that referenced this pull request Nov 15, 2024
* feat: added ability to deploy more than one NIM model. (#3453)

* feat: added ability to deploy more than one NIM model.

Signed-off-by: Olga Lavtar <[email protected]>

* feat: refactored NIM related logic to nimUtils

Signed-off-by: Olga Lavtar <[email protected]>

* feat: changes to the error handling

Signed-off-by: Olga Lavtar <[email protected]>

* feat: changes to the error handling

Signed-off-by: Olga Lavtar <[email protected]>

* feat: changes .some for .forEach

Signed-off-by: Olga Lavtar <[email protected]>

* feat: deleting secrets fix

Signed-off-by: Olga Lavtar <[email protected]>

* feat: deploying the same model pvc fix

Signed-off-by: Olga Lavtar <[email protected]>

* feat: added a unit test for getNIMResourcesToDelete

Signed-off-by: Olga Lavtar <[email protected]>

* feat: will add a unit test for getNIMResourcesToDelete later

Signed-off-by: Olga Lavtar <[email protected]>

---------

Signed-off-by: Olga Lavtar <[email protected]>

* feat: Modify NIM enablement process (#3455)

* Modify NIM enablement process

* Clean up code and remove unnecessary manifests

* Add logic to check the conditions of the odh-nim-account CR

* Added more check for enabled integration apps

* If failed to fetch integration app status, should show error on the related tile in the enable application page, should not remove the tile

* check integration app status in explore application page

* Fix lint issue

* Fix lint issue

* add annotations to the secret and the account CR

* Update backend/src/routes/api/integrations/nim/index.ts

Co-authored-by: Andrew Ballantyne <[email protected]>

* Update backend/src/routes/api/components/list.ts

Co-authored-by: Andrew Ballantyne <[email protected]>

* clean up

* feat: listing all NIM accounts in the namespace, returning the first one.

Signed-off-by: Olga Lavtar <[email protected]>

* Avoid mutating object in useWatchIntegrationComponents

* Clean up

* feat: added logic for displaying the tile correctly

Signed-off-by: Olga Lavtar <[email protected]>

* feat: changes for enabling

Signed-off-by: Olga Lavtar <[email protected]>

* feat: updated mock component with the new properties.

Signed-off-by: Olga Lavtar <[email protected]>

* feat: addressed PR comments with updates and improvements

Signed-off-by: Olga Lavtar <[email protected]>

* feat: backend bug fix

Signed-off-by: Olga Lavtar <[email protected]>

* feat: Missed change from previous commit

Signed-off-by: Olga Lavtar <[email protected]>

* feat: fix for the enabled page and enabled.cy.ts

Signed-off-by: Olga Lavtar <[email protected]>

---------

Signed-off-by: Olga Lavtar <[email protected]>
Co-authored-by: Andrew Ballantyne <[email protected]>
Co-authored-by: Olga Lavtar <[email protected]>

* Fix NIM selection issue (#3482)

* Fix NIM selection issue

* Switch back to using a numerical value

---------

Signed-off-by: Olga Lavtar <[email protected]>
Co-authored-by: olavtar <[email protected]>
Co-authored-by: yu zhao <[email protected]>
Co-authored-by: Olga Lavtar <[email protected]>
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.

2 participants