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

Validation for model names and disabled NIM metrics hyperlink #3314

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

olavtar
Copy link
Contributor

@olavtar olavtar commented Oct 8, 2024

https://issues.redhat.com/browse/RHOAIENG-13881
https://issues.redhat.com/browse/RHOAIENG-14044

Description

Added validation for model names and disabled the NIM models metrics hyperlink on the Models tab

How Has This Been Tested?

Tested locally.

Test Impact

Tested functionality: Verified that KServe still displays the metrics link.
NIM validation: Confirmed that NIM does not display the metrics link.

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 requested review from pnaik1 and ppadti October 8, 2024 21:03
Copy link
Contributor

openshift-ci bot commented Oct 8, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign manosnoam for approval. For more information see the Kubernetes Code Review Process.

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

@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 Oct 8, 2024
Copy link
Contributor

openshift-ci bot commented Oct 8, 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 Oct 8, 2024

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 84.78%. Comparing base (6ec1b1b) to head (e1e8c6f).

Files with missing lines Patch % Lines
.../NIMServiceModal/NIMModelDeploymentNameSection.tsx 0.00% 3 Missing ⚠️
...erving/screens/global/InferenceServiceTableRow.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3314      +/-   ##
==========================================
- Coverage   84.79%   84.78%   -0.01%     
==========================================
  Files        1315     1315              
  Lines       29491    29492       +1     
  Branches     8056     8054       -2     
==========================================
- Hits        25006    25005       -1     
- Misses       4485     4487       +2     
Files with missing lines Coverage Δ
...erving/screens/global/InferenceServiceTableRow.tsx 94.73% <50.00%> (-0.27%) ⬇️
.../NIMServiceModal/NIMModelDeploymentNameSection.tsx 11.11% <0.00%> (-5.56%) ⬇️

... and 5 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 6ec1b1b...e1e8c6f. 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 Oct 11, 2024
</FormGroup>
);
const ProjectSection: React.FC<ProjectSectionType> = ({ projectName }) => {
const [translatedName] = translateDisplayNameForK8sAndReport(projectName);
Copy link
Member

Choose a reason for hiding this comment

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

The project is not the problem -- it's the name used for the inference service and/or servingruntime, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

>
{displayName}
</Link>
) : kserveMetricsSupported ? (
Copy link
Member

Choose a reason for hiding this comment

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

Curious why you didn't just update the kserveMetricsSupported to include "not NIM"?

Although this code block we have looks very weird lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did in the beginning but then I saw that modelMeshMetricsSupported and kserveMetricsSupported had duplicated logic, so I chose to add the isKServeNIMEnabled check separately for clarity and to make the logic explicit. I can update the kserveMetricsSupported to handle the "not NIM" case if you think it would make it cleaner.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I noticed that -- the more you change the longer it takes for me to verify and approve. I'll try to get this before my PTO -- but typically stay short and to the point unless the logic is not compatible. Every cleanup you do for us has me testing more to make sure we don't have some other brittle aspect that can slip out in non NIM ways. In the end it's likely a net positive, just expressing how I look at everything.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @olavtar pardon me cause I don't have all the context, but shouldn't this produce the same result?

        <ResourceNameTooltip resource={inferenceService}>
          {modelMeshMetricsSupported || kserveMetricsSupported ? (
            <Link
              data-testid={`metrics-link-${displayName}`}
              to={
                isGlobal
                  ? `/modelServing/${inferenceService.metadata.namespace}/metrics/${inferenceService.metadata.name}`
                  : `/projects/${inferenceService.metadata.namespace}/metrics/model/${inferenceService.metadata.name}`
              }
            >
              {displayName}
            </Link>
          ) : (
            displayName
          )}
        </ResourceNameTooltip>

There's value on refactoring duplicate code, but how NIM is going to affect this component if the fallback is the same as having the feature selected? Maybe for readability, but in case we wanna add later metrics, we can add a comment explaining that nim will be enabled when we support metrics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @lucferbux, the isKServeNIMEnabled check is important because we don’t want to show a link when NIM Metrics isn't enabled, even if other metrics conditions are met. So, removing this condition would change the behavior, as it would allow the link to be displayed when NIM Metrics are not enabled, which is not the intended outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants