-
Notifications
You must be signed in to change notification settings - Fork 76
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: providing additional vfolder mounts and arbitrary model definition path in model service launcher #2437
add: providing additional vfolder mounts and arbitrary model definition path in model service launcher #2437
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
54d4865
to
34dea2a
Compare
90e9d76
to
d639592
Compare
592b941
to
30e94b3
Compare
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🔴 | Statements | 2.85% (-0.01% 🔻) |
140/4905 |
🔴 | Branches | 3.33% (-0.01% 🔻) |
110/3301 |
🔴 | Functions | 1.55% (-0.01% 🔻) |
25/1611 |
🔴 | Lines | 2.74% (-0.01% 🔻) |
132/4815 |
Test suite run success
48 tests passing in 5 suites.
Report generated by 🧪jest coverage report action from 1d25210
}} | ||
/> | ||
</> |
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.
You don't need an extra state to update some component based on the form's value. Instead of using an extra state, you can wrap the part you want to update using <Form.Item noStyle shouldUpdate ...>
. After that, you can delete the selectedModelFolder
state, updateSelectedModelFolder
, and the useEffect
for that.
Some like this(I have not tested below code.):
}} | |
/> | |
</> | |
<Form.Item noStyle shouldUpdate={(prev,cur)=>prev.vFolderName !== cur.vFolderName}> | |
{()=>{ | |
return <VFolderTableFormItem | |
rowKey={'id'} | |
label={t('modelService.AdditionalMounts')} | |
filter={(vf) => | |
vf.name !== formRef.current?.getFieldValue('vFolderName') && | |
vf.status === 'ready' && | |
vf.usage_mode !== 'model' | |
} | |
tableProps={{ | |
size: 'small', | |
}} | |
/> | |
}} | |
</Form.Item> |
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.
Please check below:
- When the user enters
Mount Destination For Model Folder
and then makes it empty again, the user gets an error when submitting:
{
"type": "https://api.backend.ai/probs/invalid-api-params",
"title": "Missing or invalid API parameters.",
"msg": "Alias name cannot be empty."
}
For now, there's no way to import alias of extra mounted vfolders, unless fetching from server. |
b8bcccc
to
94cddaa
Compare
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 feedback is also not resolved.
<VFolderTableFormItem | ||
rowKey={'id'} | ||
label={t('modelService.AdditionalMounts')} | ||
filter={(vf) => | ||
vf.name !== formRef.current?.getFieldValue('vFolderName') && | ||
vf.status === 'ready' && | ||
vf.usage_mode !== 'model' | ||
} | ||
tableProps={{ | ||
size: 'small', | ||
}} | ||
/> |
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.
If you do not wrap the <Form.Item noStyle shouldUpdate={...}>
, this part will not re-render when vFolderName
is changed. Please check my previous comment again.
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, but I'll merge this after reviewing the top of the stack. #2447
This PR adds two features in model service launcher, supporting arbitrary path of model definition file (previously set to
/models
andmodel-definition.yaml(or yml)
file, and providing additional mounts and aliasing on other vfolders.Test
model-definition.yml
file inside. (default model folder mount path would be/models
)/test
)Screenshot(s)
Creating model service
Modifying model service
Checklist: (if applicable)