-
Notifications
You must be signed in to change notification settings - Fork 167
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 connection type to model serving create modal #3356
Add connection type to model serving create modal #3356
Conversation
Skipping CI for Draft Pull Request. |
2409ca4
to
2162712
Compare
const secrets = await fetchConnectionTypes(); | ||
|
||
let connectionTypes = secrets; |
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.
const secrets = await fetchConnectionTypes(); | |
let connectionTypes = secrets; | |
let connectionTypes = await fetchConnectionTypes(); |
if (modelServingCompatible) { | ||
connectionTypes = connectionTypes.filter((type) => { | ||
const compatibleTypes = getCompatibleTypes( | ||
type.data?.fields?.filter(isConnectionTypeDataField).map((field) => field.envVar) ?? [], | ||
); | ||
|
||
return compatibleTypes.includes(CompatibleTypes.ModelServing); |
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.
With the changes UX wants to do to the Compatibility
column, I'm going to rework how these checks are made...
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.
okay. yeah I was looking at this for connections as well, it's a little tricky to accommodate the different data structures the env variables can be represented as. And for connections the values need to be checked to be truthy as well
@@ -110,6 +113,10 @@ const ManageKServeModal: React.FC<ManageKServeModalProps> = ({ | |||
registeredModelDeployInfo, | |||
); | |||
|
|||
const isConnectionTypesEnabled = useConnectionTypesEnabled(); | |||
const [connection, setConnection] = React.useState<Connection>(); | |||
const [isConnectionValid, setIsConnectionvalid] = React.useState(false); |
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.
const [isConnectionValid, setIsConnectionvalid] = React.useState(false); | |
const [isConnectionValid, setIsConnectionValid] = React.useState(false); |
data: CreatingInferenceServiceObject; | ||
setData: UpdateObjectAtPropAndValue<CreatingInferenceServiceObject>; | ||
setConnection: (connection?: Connection) => void; | ||
setIsConnectionvalid: (isValid: boolean) => void; |
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.
setIsConnectionvalid: (isValid: boolean) => void; | |
setIsConnectionValid: (isValid: boolean) => void; |
setSelectedConnectionType( | ||
withRequiredFields( | ||
connectionTypes.find((t) => getResourceNameFromK8sResource(t) === type), | ||
['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_S3_ENDPOINT', 'AWS_S3_BUCKET'], |
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.
Should be a const set of env vars that is shared with isModelServingCompatibility
.
): ConnectionTypeConfigMapObj | undefined => { | ||
for (const field of connectionType?.data?.fields ?? []) { | ||
if (isConnectionTypeDataField(field) && envVars?.includes(field.envVar)) { | ||
field.required = true; |
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.
This should not mutate the original value.
export const assembleConnectionSecret = ( | ||
project: ProjectKind, | ||
project: ProjectKind | string, |
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.
Change to projectName: string
and all callers.
b5a1d16
to
27d60f3
Compare
27d60f3
to
aaad986
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt 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 |
https://issues.redhat.com/browse/RHOAIENG-13139
Description
Replaces the data connections section in the model serving modals with connection types. The existing connection has fairly similar behavior. The new connection options has the ability to create a new connection inline,
Updated the single kserving modal and the modelmesh multi model modals.
How Has This Been Tested?
/modelServing
which is the "Model Serving" on the left nav barTest Impact
Jest tests added
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main