Skip to content
Merged

Next #892

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/locales/en-US/clusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
'clusters.addworker.checkEnv': 'Check Environment',
'clusters.addworker.specifyArgs': 'Specify Arguments',
'clusters.addworker.runCommand': 'Run Command',
'clusters.addworker.specifyWorkerIP': 'Specify Worker IP',
'clusters.addworker.detectWorkerIP': 'Auto-detect Worker IP',
'clusters.addworker.specifyWorkerIP':
'Specify Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.detectWorkerIP':
'Auto-detect Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.externalIP.tips':
'Specify an external IP if the worker is in a VPC or private network.',
'clusters.addworker.enterWorkerIP': 'Enter worker IP',
'clusters.addworker.enterWorkerIP.error': 'Please enter the worker IP.',
'clusters.addworker.extraVolume': 'Additional Volume Mount',
Expand All @@ -78,7 +82,8 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
'If you want to customize the model cache directory, you can specify the path to mount it.',
'clusters.addworker.configSummary': 'Configuration Summary',
'clusters.addworker.gpuVendor': 'GPU Vendor',
'clusters.addworker.workerIP': 'Worker IP',
'clusters.addworker.workerIP':
'Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.notSpecified': 'Not Specified',
'clusters.addworker.autoDetect': 'Auto-detect',
'clusters.addworker.extraVolume.holder':
Expand Down
16 changes: 11 additions & 5 deletions src/locales/ja-JP/clusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
'clusters.addworker.checkEnv': 'Check Environment',
'clusters.addworker.specifyArgs': 'Specify Arguments',
'clusters.addworker.runCommand': 'Run Command',
'clusters.addworker.specifyWorkerIP': 'Specify Worker IP',
'clusters.addworker.detectWorkerIP': 'Auto-detect Worker IP',
'clusters.addworker.specifyWorkerIP':
'Specify Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.externalIP.tips':
'Specify an external IP if the worker is in a VPC or private network.',
'clusters.addworker.detectWorkerIP':
'Auto-detect Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.enterWorkerIP': 'Enter worker IP',
'clusters.addworker.enterWorkerIP.error': 'Please enter the worker IP.',
'clusters.addworker.extraVolume': 'Additional Volume Mount',
Expand All @@ -78,7 +82,8 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
'If you want to customize the model cache directory, you can specify the path to mount it.',
'clusters.addworker.configSummary': 'Configuration Summary',
'clusters.addworker.gpuVendor': 'GPU Vendor',
'clusters.addworker.workerIP': 'Worker IP',
'clusters.addworker.workerIP':
'Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.notSpecified': 'Not Specified',
'clusters.addworker.autoDetect': 'Auto-detect',
'clusters.addworker.extraVolume.holder':
Expand Down Expand Up @@ -171,7 +176,7 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
// 61. 'clusters.addworker.extraVolume': 'Additional Volume Mount',
// 62. 'clusters.addworker.configSummary': 'Configuration Summary',
// 63. 'clusters.addworker.gpuVendor': 'GPU Vendor',
// 64. 'clusters.addworker.workerIP': 'Worker IP',
// 64. 'clusters.addworker.workerIP': 'Worker IP <span class="text-tertiary">{type}</span>',
// 65. 'clusters.addworker.notSpecified': 'Not Specified',
// 66. 'clusters.addworker.autoDetect': 'Auto-detect',
// 67. 'clusters.addworker.extraVolume.holder': 'e.g. /data/models (path must start with /)'
Expand All @@ -191,5 +196,6 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
// 78. 'clusters.addworker.dataVolume.tips': 'Specify a data storage path for GPUStack.',
// 79. 'clusters.table.ip.internal': 'Internal',
// 80. 'clusters.table.ip.external': 'External',
// 81. 'clusters.form.serverUrl.tips': 'Specify the server URL accessible from your cloud provider.'
// 81. 'clusters.form.serverUrl.tips': 'Specify the server URL accessible from your cloud provider.',
// 82. 'clusters.addworker.externalIP.tips': 'Specify an external IP if the worker is in a VPC or private network.',
// ========== End of To-Do List ==========
12 changes: 9 additions & 3 deletions src/locales/ru-RU/clusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ export default {
'clusters.addworker.checkEnv': 'Проверить окружение',
'clusters.addworker.specifyArgs': 'Указать аргументы',
'clusters.addworker.runCommand': 'Выполнить команду',
'clusters.addworker.specifyWorkerIP': 'Указать IP воркера',
'clusters.addworker.detectWorkerIP': 'Автоопределение IP воркера',
'clusters.addworker.specifyWorkerIP':
'Указать IP воркера <span class="text-tertiary">{type}</span>',
'clusters.addworker.externalIP.tips':
'Specify an external IP if the worker is in a VPC or private network.',
'clusters.addworker.detectWorkerIP':
'Автоопределение IP воркера <span class="text-tertiary">{type}</span>',
'clusters.addworker.enterWorkerIP': 'Введите IP воркера',
'clusters.addworker.enterWorkerIP.error': 'Пожалуйста, введите IP воркера.',
'clusters.addworker.extraVolume': 'Дополнительное монтирование тома',
Expand All @@ -78,7 +82,8 @@ export default {
'If you want to customize the model cache directory, you can specify the path to mount it.',
'clusters.addworker.configSummary': 'Сводка конфигурации',
'clusters.addworker.gpuVendor': 'Производитель GPU',
'clusters.addworker.workerIP': 'IP воркера',
'clusters.addworker.workerIP':
'IP воркера <span class="text-tertiary">{type}</span>',
'clusters.addworker.notSpecified': 'Не указано',
'clusters.addworker.autoDetect': 'Автоопределение',
'clusters.addworker.extraVolume.holder':
Expand Down Expand Up @@ -123,4 +128,5 @@ export default {
// 10. 'clusters.table.ip.internal': 'Internal',
// 11. 'clusters.table.ip.external': 'External',
// 12. 'clusters.form.serverUrl.tips': 'Specify the server URL accessible from your cloud provider.'
// 13. 'clusters.addworker.specifyWorkerIP': 'Specify Worker IP <span class="text-tertiary">{type}</span>',
// ================================================================
11 changes: 8 additions & 3 deletions src/locales/zh-CN/clusters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ export default {
'clusters.addworker.checkEnv': '检查环境',
'clusters.addworker.specifyArgs': '指定参数',
'clusters.addworker.runCommand': '运行指令',
'clusters.addworker.specifyWorkerIP': '指定 Worker IP',
'clusters.addworker.detectWorkerIP': '自动检测 Worker IP',
'clusters.addworker.specifyWorkerIP':
'指定 Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.detectWorkerIP':
'自动检测 Worker IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.externalIP.tips':
'当 worker 位于 VPC 或私有网络时,需要指定外部 IP。',
'clusters.addworker.enterWorkerIP': '输入节点 IP',
'clusters.addworker.enterWorkerIP.error': '请输入节点 IP',
'clusters.addworker.extraVolume': '额外卷挂载',
Expand All @@ -76,7 +80,8 @@ export default {
'如果你想自定义模型缓存目录,可以指定路径进行挂载。',
'clusters.addworker.configSummary': '配置摘要',
'clusters.addworker.gpuVendor': 'GPU 厂商',
'clusters.addworker.workerIP': '节点 IP',
'clusters.addworker.workerIP':
'节点 IP <span class="text-tertiary">{type}</span>',
'clusters.addworker.notSpecified': '未指定',
'clusters.addworker.autoDetect': '自动检测',
'clusters.addworker.extraVolume.holder':
Expand Down
8 changes: 7 additions & 1 deletion src/pages/cluster-management/cluster-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const ClusterCreate = () => {
image: string;
server_url: string;
cluster_id: number;
[key: string]: any;
}>({
token: '',
image: '',
Expand Down Expand Up @@ -128,7 +129,12 @@ const ClusterCreate = () => {
resultsMap.set(formKeys[index], result.value);
}
});
const newValues = _.merge(formValues, Object.fromEntries(resultsMap));
const newValues = { ...formValues };

// update form values by the key from resultsMap
for (const [key, value] of resultsMap.entries()) {
newValues[key] = value;
}

setFormValues(newValues);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ type ViewModalProps = {
cacheDir?: string;
containerName?: string;
gpustackDataVolume?: string;
advertisAddress?: string;
registrationInfo: {
token: string;
image: string;
server_url: string;
[key: string]: any;
};
};

const AddWorkerCommand: React.FC<ViewModalProps> = ({
registrationInfo,
advertisAddress,
workerIP,
modelDir,
cacheDir,
Expand All @@ -29,9 +32,11 @@ const AddWorkerCommand: React.FC<ViewModalProps> = ({
const commandCode = addWorkerGuide['all'];
return commandCode
?.registerWorker({
registrationInfo,
gpu: currentGPU || '',
server: registrationInfo.server_url || origin,
tag: '',
advertisAddress: advertisAddress,
workerIP: workerIP,
modelDir: modelDir,
cacheDir: cacheDir,
Expand All @@ -50,7 +55,8 @@ const AddWorkerCommand: React.FC<ViewModalProps> = ({
modelDir,
cacheDir,
containerName,
gpustackDataVolume
gpustackDataVolume,
advertisAddress
]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type AddWorkerProps = {
image: string;
server_url: string;
cluster_id: number;
[key: string]: any;
};
};

Expand Down
5 changes: 5 additions & 0 deletions src/pages/cluster-management/components/add-worker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export interface SummaryDataKeys {
enabled: boolean;
path: string;
};
externalWorkerIPConfig: {
enable: boolean;
ip: string;
required: boolean;
};
}

export type SummaryDataMap = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ import VendorNotes from './vendor-notes';

const DockerRunCommand = () => {
const intl = useIntl();
const { registrationInfo, stepList, summary, clusterList } =
useAddWorkerContext();
const { registrationInfo, stepList, summary } = useAddWorkerContext();
const workerIPConfig = summary.get('workerIPConfig') || {
enable: false,
ip: '',
required: false
};
const externalWorkerIPConfig = summary.get('externalWorkerIPConfig') || {
enable: false,
ip: '',
required: false
};
const modelDirConfig = summary.get('modelDirConfig') || {
enable: false,
path: '',
Expand Down Expand Up @@ -62,6 +66,9 @@ const DockerRunCommand = () => {
</Tips>
<AddWorkerCommand
registrationInfo={registrationInfo}
advertisAddress={
externalWorkerIPConfig.enable ? externalWorkerIPConfig.ip : ''
}
workerIP={workerIPConfig.enable ? workerIPConfig.ip : ''}
modelDir={modelDirConfig.enable ? modelDirConfig.path : ''}
cacheDir={cacheDirConfig.enable ? cacheDirConfig.path : ''}
Expand Down
Loading
Loading