fix: check driver command for adding worker
This commit is contained in:
@@ -30,7 +30,7 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
|
||||
e.target.src = fallbackImg;
|
||||
};
|
||||
|
||||
const renderTag = (sItem: any) => {
|
||||
const renderTag = useCallback((sItem: any) => {
|
||||
return (
|
||||
<ThemeTag
|
||||
key={sItem}
|
||||
@@ -50,7 +50,7 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
|
||||
{sItem}B
|
||||
</ThemeTag>
|
||||
);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -72,10 +72,15 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
// voxbox is not support multi gpu
|
||||
const updateGPUSelector = (backend: string) => {
|
||||
const gpuids = form.getFieldValue(['gpu_selector', 'gpu_ids']) || [];
|
||||
const gpusPerReplicas =
|
||||
form.getFieldValue(['gpu_selector', 'gpus_per_replica']) || null;
|
||||
|
||||
if (backend === backendOptionsMap.voxBox && gpuids.length > 0) {
|
||||
return {
|
||||
gpu_selector: { gpu_ids: [gpuids[0]] }
|
||||
gpusCountType: gpusCountTypeMap.Auto,
|
||||
gpu_selector: {
|
||||
gpu_ids: [gpuids[0]]
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
@@ -131,9 +136,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
getGPUOptionList({ clusterId: value });
|
||||
getBackendOptions({ cluster_id: value });
|
||||
if (scheduleType === ScheduleValueMap.Manual) {
|
||||
form.setFieldsValue({
|
||||
gpu_selector: { gpu_ids: [] }
|
||||
});
|
||||
form.setFieldValue(['gpu_selector', 'gpu_ids'], []);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ const ScheduleTypeForm: React.FC = () => {
|
||||
const form = Form.useFormInstance();
|
||||
const scheduleType = Form.useWatch('scheduleType', form);
|
||||
const gpusCountType = Form.useWatch('gpusCountType', form);
|
||||
const gpuSelectorIds = Form.useWatch(['gpu_selector', 'gpu_ids'], form);
|
||||
|
||||
const handleScheduleTypeChange = (value: string) => {
|
||||
if (value === ScheduleValueMap.Auto) {
|
||||
@@ -61,9 +60,10 @@ const ScheduleTypeForm: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleGpusCountTypeChange = (val: string) => {
|
||||
if (val === 'custom') {
|
||||
form.setFieldValue(['gpu_selector', 'gpus_per_replica'], 2);
|
||||
if (val === gpusCountTypeMap.Custom) {
|
||||
form.setFieldValue(['gpu_selector', 'gpus_per_replica'], 1);
|
||||
}
|
||||
|
||||
onValuesChange?.({}, form.getFieldsValue());
|
||||
};
|
||||
|
||||
@@ -91,6 +91,12 @@ const ScheduleTypeForm: React.FC = () => {
|
||||
onValuesChange?.({}, form.getFieldsValue());
|
||||
};
|
||||
|
||||
const handleOnStepReplica = (value: number | null) => {
|
||||
if (value === null) {
|
||||
form.setFieldValue(['gpu_selector', 'gpus_per_replica'], 1);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Form.Item name="scheduleType">
|
||||
@@ -187,6 +193,7 @@ const ScheduleTypeForm: React.FC = () => {
|
||||
})}
|
||||
min={1}
|
||||
step={1}
|
||||
onChange={handleOnStepReplica}
|
||||
onStep={handleOnStepReplicaStep}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user