fix: check driver command for adding worker

This commit is contained in:
jialin
2025-10-20 19:11:02 +08:00
parent 9b843151fe
commit 3a7a4ccf30
12 changed files with 162 additions and 61 deletions
+7 -4
View File
@@ -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'], []);
}
};
+10 -3
View File
@@ -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>