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

add model serving compatible select to connection type form #3396

Merged

Conversation

christianvogt
Copy link
Contributor

@christianvogt christianvogt commented Oct 29, 2024

https://issues.redhat.com/browse/RHOAIENG-14813

Description

Adds a dropdown to the connection type creation page to add model serving compatible fields.
All OOTB types are present in the dropdown.
Selecting one of the types inserts a new section field along with all other fields found in the connection type.

When the connection type is found to be compatible (ie it has the same env vars), then we show an alert. Currently this is based strictly on the env var name and not of the field type or other properties such as required, name or description.

cc @simrandhaliw

image
image
image
image
image

How Has This Been Tested?

Ensure your cluster has the OOTB connection types applied. #3335
You can manually add them to your cluster with oc apply -f .... They are found in the manifests/common/connection-types directory of the git repo. Note that if they are not present, then the dropdown menu will not show up.

  • enable the connection type feature flag disableConnectionTypes
  • Navigate to Settings -> Connection types as an admin
  • Create a connection type
  • Observe the menu shows up to select a compatible model serving type
  • Select an option
  • observe a new section and field(s) are added to the connection type along with an alert
  • Delete one of the newly added fields and observe the alert disappears

Test Impact

Added cypress test.

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

@simrandhaliw
Copy link

LGTM!

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 98.14815% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.93%. Comparing base (4842b35) to head (416e7ad).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...onnectionTypes/manage/ManageConnectionTypePage.tsx 94.11% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3396      +/-   ##
==========================================
+ Coverage   85.14%   85.93%   +0.78%     
==========================================
  Files        1338     1338              
  Lines       30122    30178      +56     
  Branches     8270     8290      +20     
==========================================
+ Hits        25648    25934     +286     
+ Misses       4474     4244     -230     
Files with missing lines Coverage Δ
frontend/src/components/SimpleMenuActions.tsx 96.00% <100.00%> (+2.66%) ⬆️
frontend/src/concepts/connectionTypes/utils.ts 90.53% <100.00%> (+1.12%) ⬆️
frontend/src/utilities/string.ts 96.82% <100.00%> (+0.46%) ⬆️
...onnectionTypes/manage/ManageConnectionTypePage.tsx 94.02% <94.11%> (+1.72%) ⬆️

... and 29 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 4842b35...416e7ad. Read the comment docs.

@christianvogt christianvogt force-pushed the ct-model-serving-select branch 2 times, most recently from 80266ff to 2e00de8 Compare October 29, 2024 20:40
Comment on lines 290 to 302
export const isCompatibleWithConnectionType = (
fields: ConnectionTypeField[],
connectionType: ConnectionTypeConfigMapObj,
): boolean => {
const compatibleDataFields = connectionType.data?.fields?.filter(isConnectionTypeDataField);
const dataFields = fields.filter(isConnectionTypeDataField);
if (compatibleDataFields) {
return compatibleDataFields
.filter(isConnectionTypeDataField)
.every((cf) => dataFields.find((f) => cf.envVar === f.envVar));
}
return false;
};
Copy link
Contributor

@emilys314 emilys314 Oct 30, 2024

Choose a reason for hiding this comment

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

Do we need to only check the data fields that are required when checking compatibility? Because if region is missing from the new connection type, it says it's not compatible with s3, but I believe it still is.

Although the bucket isn't required, but it still needed for model serving

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@emilys314 ya there's this discrepancy between compatible with model serving and compatible with the connection type ¯_(ツ)_/¯

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After discussion in slack, we're going to make the dropdown represent the spirit of what each OOTB connection type represents but not specifically the OOTB connection type.

What this means is that the dropdown labels need to change and we will also ignore optional fields when comparing compatibility.

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

@christianvogt
Copy link
Contributor Author

updated with latest changes to labels and compatibility checks

@emilys314
Copy link
Contributor

/lgtm

Copy link
Contributor

openshift-ci bot commented Oct 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@openshift-merge-bot openshift-merge-bot bot merged commit 591f87b into opendatahub-io:main Oct 31, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants