-
Notifications
You must be signed in to change notification settings - Fork 184
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(serving): add "Model URI" field to deployment modal #3807
base: main
Are you sure you want to change the base?
feat(serving): add "Model URI" field to deployment modal #3807
Conversation
export const isS3Connection = (connection?: Connection): boolean => | ||
!!( | ||
connection?.data?.AWS_ACCESS_KEY_ID && | ||
connection.data.AWS_ACCESS_KEY_ID && | ||
connection.data.AWS_S3_ENDPOINT && | ||
connection.data.AWS_S3_BUCKET | ||
) || | ||
!!( | ||
connection?.stringData?.AWS_ACCESS_KEY_ID && | ||
connection.stringData.AWS_ACCESS_KEY_ID && | ||
connection.stringData.AWS_S3_ENDPOINT && | ||
connection.stringData.AWS_S3_BUCKET | ||
); | ||
export const isUriConnection = (connection?: Connection): boolean => | ||
!!connection?.data?.URI || !!connection?.stringData?.URI; | ||
export const isOciConnection = (connection?: Connection): boolean => | ||
!!connection?.data?.OCI_HOST || !!connection?.stringData?.OCI_HOST; |
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.
idk if there is a less verbose way to do this.
Otherwise you need to getConnectionModelServingCompatibleTypes(selectedConnectionType)[0] === ModelServingCompatibleTypes.S3ObjectStorage
(or includes(...) instead of [0]) everytime
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.
for the URI and OCI connection you're only checking one property, can you do the same for S3 or do we need to check all fields?
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 overloaded the isModelServingTypeCompatible()
function to work for Connections too so there are less imports / exports needed and it reuses the existing URIConnectionTypeKeys
variables with the latest commit
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3807 +/- ##
==========================================
- Coverage 84.67% 84.66% -0.01%
==========================================
Files 1517 1519 +2
Lines 35134 35252 +118
Branches 9836 9882 +46
==========================================
+ Hits 29748 29846 +98
- Misses 5386 5406 +20
... and 11 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
/lgtm
Tested on my cluster and works as expected!
export const isS3Connection = (connection?: Connection): boolean => | ||
!!( | ||
connection?.data?.AWS_ACCESS_KEY_ID && | ||
connection.data.AWS_ACCESS_KEY_ID && | ||
connection.data.AWS_S3_ENDPOINT && | ||
connection.data.AWS_S3_BUCKET | ||
) || | ||
!!( | ||
connection?.stringData?.AWS_ACCESS_KEY_ID && | ||
connection.stringData.AWS_ACCESS_KEY_ID && | ||
connection.stringData.AWS_S3_ENDPOINT && | ||
connection.stringData.AWS_S3_BUCKET | ||
); | ||
export const isUriConnection = (connection?: Connection): boolean => | ||
!!connection?.data?.URI || !!connection?.stringData?.URI; | ||
export const isOciConnection = (connection?: Connection): boolean => | ||
!!connection?.data?.OCI_HOST || !!connection?.stringData?.OCI_HOST; |
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.
for the URI and OCI connection you're only checking one property, can you do the same for S3 or do we need to check all fields?
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Griffin-Sullivan 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 |
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.
/lgtm
I'll hold off on approving until others have a chance to look.
getConnectionTypeModelServingCompatibleTypes(selectedConnectionType)[0] === | ||
ModelServingCompatibleTypes.S3ObjectStorage && ( |
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.
Is it maybe worth factoring out a function so you could do something like:
isModelServingConnectionType(selectedConnectionType, ModelServingCompatibleTypes.S3ObjectStorage)
(not sure on the best name here or whether this is worth it)
existingUriOption={ | ||
editInfo?.inferenceServiceEditInfo?.spec.predictor.model?.storageUri | ||
} |
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.
Ah - @manaswinidas for https://issues.redhat.com/browse/RHOAIENG-19258 this is where we could pass our URI when prefilling from model registry if it is a RH registry URI (starts with oci://registry.redhat.io/
). We probably want that logic encapsulated somewhere MR specific but we can maybe lift out an optional existingUriOption
to be passed into ManageKServeModal and use it if present instead of this one from editInfo
.
New changes are detected. LGTM label has been removed. |
7766033
to
4203b83
Compare
https://issues.redhat.com/browse/RHOAIENG-19881
Description
Prompt the user for the OCI Model URI when selecting a OCI connection for model deployment.
<...>://...
it will remove the prefixExisting connection:

New connection:

How Has This Been Tested?
Test Impact
Added jest test for the ConnectionSection.tsx
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
@simrandhaliw
After the PR is posted & before it merges:
main