fix: update command of adding worker
This commit is contained in:
@@ -68,8 +68,12 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
|
|||||||
'clusters.addworker.checkEnv': 'Check Environment',
|
'clusters.addworker.checkEnv': 'Check Environment',
|
||||||
'clusters.addworker.specifyArgs': 'Specify Arguments',
|
'clusters.addworker.specifyArgs': 'Specify Arguments',
|
||||||
'clusters.addworker.runCommand': 'Run Command',
|
'clusters.addworker.runCommand': 'Run Command',
|
||||||
'clusters.addworker.specifyWorkerIP': 'Specify Worker IP',
|
'clusters.addworker.specifyWorkerIP':
|
||||||
'clusters.addworker.detectWorkerIP': 'Auto-detect Worker IP',
|
'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': 'Enter worker IP',
|
||||||
'clusters.addworker.enterWorkerIP.error': 'Please enter the worker IP.',
|
'clusters.addworker.enterWorkerIP.error': 'Please enter the worker IP.',
|
||||||
'clusters.addworker.extraVolume': 'Additional Volume Mount',
|
'clusters.addworker.extraVolume': 'Additional Volume Mount',
|
||||||
@@ -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.',
|
'If you want to customize the model cache directory, you can specify the path to mount it.',
|
||||||
'clusters.addworker.configSummary': 'Configuration Summary',
|
'clusters.addworker.configSummary': 'Configuration Summary',
|
||||||
'clusters.addworker.gpuVendor': 'GPU Vendor',
|
'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.notSpecified': 'Not Specified',
|
||||||
'clusters.addworker.autoDetect': 'Auto-detect',
|
'clusters.addworker.autoDetect': 'Auto-detect',
|
||||||
'clusters.addworker.extraVolume.holder':
|
'clusters.addworker.extraVolume.holder':
|
||||||
|
|||||||
@@ -68,8 +68,12 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
|
|||||||
'clusters.addworker.checkEnv': 'Check Environment',
|
'clusters.addworker.checkEnv': 'Check Environment',
|
||||||
'clusters.addworker.specifyArgs': 'Specify Arguments',
|
'clusters.addworker.specifyArgs': 'Specify Arguments',
|
||||||
'clusters.addworker.runCommand': 'Run Command',
|
'clusters.addworker.runCommand': 'Run Command',
|
||||||
'clusters.addworker.specifyWorkerIP': 'Specify Worker IP',
|
'clusters.addworker.specifyWorkerIP':
|
||||||
'clusters.addworker.detectWorkerIP': 'Auto-detect Worker IP',
|
'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': 'Enter worker IP',
|
||||||
'clusters.addworker.enterWorkerIP.error': 'Please enter the worker IP.',
|
'clusters.addworker.enterWorkerIP.error': 'Please enter the worker IP.',
|
||||||
'clusters.addworker.extraVolume': 'Additional Volume Mount',
|
'clusters.addworker.extraVolume': 'Additional Volume Mount',
|
||||||
@@ -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.',
|
'If you want to customize the model cache directory, you can specify the path to mount it.',
|
||||||
'clusters.addworker.configSummary': 'Configuration Summary',
|
'clusters.addworker.configSummary': 'Configuration Summary',
|
||||||
'clusters.addworker.gpuVendor': 'GPU Vendor',
|
'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.notSpecified': 'Not Specified',
|
||||||
'clusters.addworker.autoDetect': 'Auto-detect',
|
'clusters.addworker.autoDetect': 'Auto-detect',
|
||||||
'clusters.addworker.extraVolume.holder':
|
'clusters.addworker.extraVolume.holder':
|
||||||
@@ -171,7 +176,7 @@ Same applies to the <span class="bold-text">/opt/dtk</span> directory.`,
|
|||||||
// 61. 'clusters.addworker.extraVolume': 'Additional Volume Mount',
|
// 61. 'clusters.addworker.extraVolume': 'Additional Volume Mount',
|
||||||
// 62. 'clusters.addworker.configSummary': 'Configuration Summary',
|
// 62. 'clusters.addworker.configSummary': 'Configuration Summary',
|
||||||
// 63. 'clusters.addworker.gpuVendor': 'GPU Vendor',
|
// 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',
|
// 65. 'clusters.addworker.notSpecified': 'Not Specified',
|
||||||
// 66. 'clusters.addworker.autoDetect': 'Auto-detect',
|
// 66. 'clusters.addworker.autoDetect': 'Auto-detect',
|
||||||
// 67. 'clusters.addworker.extraVolume.holder': 'e.g. /data/models (path must start with /)'
|
// 67. 'clusters.addworker.extraVolume.holder': 'e.g. /data/models (path must start with /)'
|
||||||
@@ -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.',
|
// 78. 'clusters.addworker.dataVolume.tips': 'Specify a data storage path for GPUStack.',
|
||||||
// 79. 'clusters.table.ip.internal': 'Internal',
|
// 79. 'clusters.table.ip.internal': 'Internal',
|
||||||
// 80. 'clusters.table.ip.external': 'External',
|
// 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 ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -68,8 +68,12 @@ export default {
|
|||||||
'clusters.addworker.checkEnv': 'Проверить окружение',
|
'clusters.addworker.checkEnv': 'Проверить окружение',
|
||||||
'clusters.addworker.specifyArgs': 'Указать аргументы',
|
'clusters.addworker.specifyArgs': 'Указать аргументы',
|
||||||
'clusters.addworker.runCommand': 'Выполнить команду',
|
'clusters.addworker.runCommand': 'Выполнить команду',
|
||||||
'clusters.addworker.specifyWorkerIP': 'Указать IP воркера',
|
'clusters.addworker.specifyWorkerIP':
|
||||||
'clusters.addworker.detectWorkerIP': 'Автоопределение IP воркера',
|
'Указать 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': 'Введите IP воркера',
|
||||||
'clusters.addworker.enterWorkerIP.error': 'Пожалуйста, введите IP воркера.',
|
'clusters.addworker.enterWorkerIP.error': 'Пожалуйста, введите IP воркера.',
|
||||||
'clusters.addworker.extraVolume': 'Дополнительное монтирование тома',
|
'clusters.addworker.extraVolume': 'Дополнительное монтирование тома',
|
||||||
@@ -78,7 +82,8 @@ export default {
|
|||||||
'If you want to customize the model cache directory, you can specify the path to mount it.',
|
'If you want to customize the model cache directory, you can specify the path to mount it.',
|
||||||
'clusters.addworker.configSummary': 'Сводка конфигурации',
|
'clusters.addworker.configSummary': 'Сводка конфигурации',
|
||||||
'clusters.addworker.gpuVendor': 'Производитель GPU',
|
'clusters.addworker.gpuVendor': 'Производитель GPU',
|
||||||
'clusters.addworker.workerIP': 'IP воркера',
|
'clusters.addworker.workerIP':
|
||||||
|
'IP воркера <span class="text-tertiary">{type}</span>',
|
||||||
'clusters.addworker.notSpecified': 'Не указано',
|
'clusters.addworker.notSpecified': 'Не указано',
|
||||||
'clusters.addworker.autoDetect': 'Автоопределение',
|
'clusters.addworker.autoDetect': 'Автоопределение',
|
||||||
'clusters.addworker.extraVolume.holder':
|
'clusters.addworker.extraVolume.holder':
|
||||||
@@ -123,4 +128,5 @@ export default {
|
|||||||
// 10. 'clusters.table.ip.internal': 'Internal',
|
// 10. 'clusters.table.ip.internal': 'Internal',
|
||||||
// 11. 'clusters.table.ip.external': 'External',
|
// 11. 'clusters.table.ip.external': 'External',
|
||||||
// 12. 'clusters.form.serverUrl.tips': 'Specify the server URL accessible from your cloud provider.'
|
// 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>',
|
||||||
// ================================================================
|
// ================================================================
|
||||||
|
|||||||
@@ -66,8 +66,12 @@ export default {
|
|||||||
'clusters.addworker.checkEnv': '检查环境',
|
'clusters.addworker.checkEnv': '检查环境',
|
||||||
'clusters.addworker.specifyArgs': '指定参数',
|
'clusters.addworker.specifyArgs': '指定参数',
|
||||||
'clusters.addworker.runCommand': '运行指令',
|
'clusters.addworker.runCommand': '运行指令',
|
||||||
'clusters.addworker.specifyWorkerIP': '指定 Worker IP',
|
'clusters.addworker.specifyWorkerIP':
|
||||||
'clusters.addworker.detectWorkerIP': '自动检测 Worker IP',
|
'指定 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': '输入节点 IP',
|
||||||
'clusters.addworker.enterWorkerIP.error': '请输入节点 IP',
|
'clusters.addworker.enterWorkerIP.error': '请输入节点 IP',
|
||||||
'clusters.addworker.extraVolume': '额外卷挂载',
|
'clusters.addworker.extraVolume': '额外卷挂载',
|
||||||
@@ -76,7 +80,8 @@ export default {
|
|||||||
'如果你想自定义模型缓存目录,可以指定路径进行挂载。',
|
'如果你想自定义模型缓存目录,可以指定路径进行挂载。',
|
||||||
'clusters.addworker.configSummary': '配置摘要',
|
'clusters.addworker.configSummary': '配置摘要',
|
||||||
'clusters.addworker.gpuVendor': 'GPU 厂商',
|
'clusters.addworker.gpuVendor': 'GPU 厂商',
|
||||||
'clusters.addworker.workerIP': '节点 IP',
|
'clusters.addworker.workerIP':
|
||||||
|
'节点 IP <span class="text-tertiary">{type}</span>',
|
||||||
'clusters.addworker.notSpecified': '未指定',
|
'clusters.addworker.notSpecified': '未指定',
|
||||||
'clusters.addworker.autoDetect': '自动检测',
|
'clusters.addworker.autoDetect': '自动检测',
|
||||||
'clusters.addworker.extraVolume.holder':
|
'clusters.addworker.extraVolume.holder':
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ const ClusterCreate = () => {
|
|||||||
image: string;
|
image: string;
|
||||||
server_url: string;
|
server_url: string;
|
||||||
cluster_id: number;
|
cluster_id: number;
|
||||||
|
[key: string]: any;
|
||||||
}>({
|
}>({
|
||||||
token: '',
|
token: '',
|
||||||
image: '',
|
image: '',
|
||||||
|
|||||||
@@ -9,15 +9,18 @@ type ViewModalProps = {
|
|||||||
cacheDir?: string;
|
cacheDir?: string;
|
||||||
containerName?: string;
|
containerName?: string;
|
||||||
gpustackDataVolume?: string;
|
gpustackDataVolume?: string;
|
||||||
|
advertisAddress?: string;
|
||||||
registrationInfo: {
|
registrationInfo: {
|
||||||
token: string;
|
token: string;
|
||||||
image: string;
|
image: string;
|
||||||
server_url: string;
|
server_url: string;
|
||||||
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const AddWorkerCommand: React.FC<ViewModalProps> = ({
|
const AddWorkerCommand: React.FC<ViewModalProps> = ({
|
||||||
registrationInfo,
|
registrationInfo,
|
||||||
|
advertisAddress,
|
||||||
workerIP,
|
workerIP,
|
||||||
modelDir,
|
modelDir,
|
||||||
cacheDir,
|
cacheDir,
|
||||||
@@ -29,9 +32,11 @@ const AddWorkerCommand: React.FC<ViewModalProps> = ({
|
|||||||
const commandCode = addWorkerGuide['all'];
|
const commandCode = addWorkerGuide['all'];
|
||||||
return commandCode
|
return commandCode
|
||||||
?.registerWorker({
|
?.registerWorker({
|
||||||
|
registrationInfo,
|
||||||
gpu: currentGPU || '',
|
gpu: currentGPU || '',
|
||||||
server: registrationInfo.server_url || origin,
|
server: registrationInfo.server_url || origin,
|
||||||
tag: '',
|
tag: '',
|
||||||
|
advertisAddress: advertisAddress,
|
||||||
workerIP: workerIP,
|
workerIP: workerIP,
|
||||||
modelDir: modelDir,
|
modelDir: modelDir,
|
||||||
cacheDir: cacheDir,
|
cacheDir: cacheDir,
|
||||||
@@ -50,7 +55,8 @@ const AddWorkerCommand: React.FC<ViewModalProps> = ({
|
|||||||
modelDir,
|
modelDir,
|
||||||
cacheDir,
|
cacheDir,
|
||||||
containerName,
|
containerName,
|
||||||
gpustackDataVolume
|
gpustackDataVolume,
|
||||||
|
advertisAddress
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ type AddWorkerProps = {
|
|||||||
image: string;
|
image: string;
|
||||||
server_url: string;
|
server_url: string;
|
||||||
cluster_id: number;
|
cluster_id: number;
|
||||||
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ export interface SummaryDataKeys {
|
|||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
path: string;
|
path: string;
|
||||||
};
|
};
|
||||||
|
externalWorkerIPConfig: {
|
||||||
|
enable: boolean;
|
||||||
|
ip: string;
|
||||||
|
required: boolean;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SummaryDataMap = {
|
export type SummaryDataMap = {
|
||||||
|
|||||||
@@ -9,13 +9,17 @@ import VendorNotes from './vendor-notes';
|
|||||||
|
|
||||||
const DockerRunCommand = () => {
|
const DockerRunCommand = () => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const { registrationInfo, stepList, summary, clusterList } =
|
const { registrationInfo, stepList, summary } = useAddWorkerContext();
|
||||||
useAddWorkerContext();
|
|
||||||
const workerIPConfig = summary.get('workerIPConfig') || {
|
const workerIPConfig = summary.get('workerIPConfig') || {
|
||||||
enable: false,
|
enable: false,
|
||||||
ip: '',
|
ip: '',
|
||||||
required: false
|
required: false
|
||||||
};
|
};
|
||||||
|
const externalWorkerIPConfig = summary.get('externalWorkerIPConfig') || {
|
||||||
|
enable: false,
|
||||||
|
ip: '',
|
||||||
|
required: false
|
||||||
|
};
|
||||||
const modelDirConfig = summary.get('modelDirConfig') || {
|
const modelDirConfig = summary.get('modelDirConfig') || {
|
||||||
enable: false,
|
enable: false,
|
||||||
path: '',
|
path: '',
|
||||||
@@ -62,6 +66,9 @@ const DockerRunCommand = () => {
|
|||||||
</Tips>
|
</Tips>
|
||||||
<AddWorkerCommand
|
<AddWorkerCommand
|
||||||
registrationInfo={registrationInfo}
|
registrationInfo={registrationInfo}
|
||||||
|
advertisAddress={
|
||||||
|
externalWorkerIPConfig.enable ? externalWorkerIPConfig.ip : ''
|
||||||
|
}
|
||||||
workerIP={workerIPConfig.enable ? workerIPConfig.ip : ''}
|
workerIP={workerIPConfig.enable ? workerIPConfig.ip : ''}
|
||||||
modelDir={modelDirConfig.enable ? modelDirConfig.path : ''}
|
modelDir={modelDirConfig.enable ? modelDirConfig.path : ''}
|
||||||
cacheDir={cacheDirConfig.enable ? cacheDirConfig.path : ''}
|
cacheDir={cacheDirConfig.enable ? cacheDirConfig.path : ''}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const ButtonWrapper = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const SwitchSetting: React.FC<{
|
const SwitchSetting: React.FC<{
|
||||||
label: string;
|
label: React.ReactNode;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
value?: string;
|
value?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
@@ -88,6 +88,13 @@ const SpecifyArguments = () => {
|
|||||||
ip: '',
|
ip: '',
|
||||||
required: false
|
required: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const externalWorkerIPConfig = summary.get('externalWorkerIPConfig') || {
|
||||||
|
enable: false,
|
||||||
|
ip: '',
|
||||||
|
required: false
|
||||||
|
};
|
||||||
|
|
||||||
const modelDirConfig = summary.get('modelDirConfig') || {
|
const modelDirConfig = summary.get('modelDirConfig') || {
|
||||||
enable: false,
|
enable: false,
|
||||||
path: ''
|
path: ''
|
||||||
@@ -143,6 +150,15 @@ const SpecifyArguments = () => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (externalWorkerIPConfig.enable && !externalWorkerIPConfig.ip) {
|
||||||
|
updateField('externalWorkerIPConfig', {
|
||||||
|
...externalWorkerIPConfig,
|
||||||
|
required: true
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -189,6 +205,12 @@ const SpecifyArguments = () => {
|
|||||||
enable: true,
|
enable: true,
|
||||||
path: 'gpustack-data'
|
path: 'gpustack-data'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateField('externalWorkerIPConfig', {
|
||||||
|
enable: false,
|
||||||
|
ip: '',
|
||||||
|
required: false
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -213,13 +235,27 @@ const SpecifyArguments = () => {
|
|||||||
{/* worker IP config */}
|
{/* worker IP config */}
|
||||||
<SwitchSetting
|
<SwitchSetting
|
||||||
label={
|
label={
|
||||||
workerIPConfig.enable
|
<span
|
||||||
? intl.formatMessage({
|
dangerouslySetInnerHTML={{
|
||||||
id: 'clusters.addworker.specifyWorkerIP'
|
__html: workerIPConfig.enable
|
||||||
})
|
? intl.formatMessage(
|
||||||
: intl.formatMessage({
|
{
|
||||||
id: 'clusters.addworker.detectWorkerIP'
|
id: 'clusters.addworker.specifyWorkerIP'
|
||||||
})
|
},
|
||||||
|
{
|
||||||
|
type: ` (${intl.formatMessage({ id: 'clusters.table.ip.internal' })})`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
: intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: 'clusters.addworker.detectWorkerIP'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: ` (${intl.formatMessage({ id: 'clusters.table.ip.internal' })})`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
></span>
|
||||||
}
|
}
|
||||||
placeholder={intl.formatMessage({
|
placeholder={intl.formatMessage({
|
||||||
id: 'clusters.addworker.enterWorkerIP'
|
id: 'clusters.addworker.enterWorkerIP'
|
||||||
@@ -274,6 +310,83 @@ const SpecifyArguments = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
></SwitchSetting>
|
></SwitchSetting>
|
||||||
|
{/* external worker ip config */}
|
||||||
|
<SwitchSetting
|
||||||
|
label={
|
||||||
|
<span
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: externalWorkerIPConfig.enable
|
||||||
|
? intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: 'clusters.addworker.specifyWorkerIP'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: ` (${intl.formatMessage({ id: 'clusters.table.ip.external' })})`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
: intl.formatMessage(
|
||||||
|
{
|
||||||
|
id: 'clusters.addworker.detectWorkerIP'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: ` (${intl.formatMessage({ id: 'clusters.table.ip.external' })})`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
></span>
|
||||||
|
}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: 'clusters.addworker.enterWorkerIP'
|
||||||
|
})}
|
||||||
|
value={externalWorkerIPConfig.ip}
|
||||||
|
checked={externalWorkerIPConfig.enable}
|
||||||
|
errorMessage={
|
||||||
|
externalWorkerIPConfig.required &&
|
||||||
|
!externalWorkerIPConfig.ip &&
|
||||||
|
intl.formatMessage({
|
||||||
|
id: 'clusters.addworker.enterWorkerIP.error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onChange={(checked) =>
|
||||||
|
updateField('externalWorkerIPConfig', {
|
||||||
|
...externalWorkerIPConfig,
|
||||||
|
enable: checked,
|
||||||
|
required: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onInputChange={(value) =>
|
||||||
|
updateField('externalWorkerIPConfig', {
|
||||||
|
...externalWorkerIPConfig,
|
||||||
|
ip: value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
extra={
|
||||||
|
!externalWorkerIPConfig.enable && (
|
||||||
|
<AlertInfoBlock
|
||||||
|
maxHeight={200}
|
||||||
|
contentStyle={{
|
||||||
|
paddingLeft: 0
|
||||||
|
}}
|
||||||
|
type="warning"
|
||||||
|
icon={<ExclamationCircleFilled />}
|
||||||
|
message={
|
||||||
|
<NotesWrapper>
|
||||||
|
<li
|
||||||
|
style={{
|
||||||
|
marginLeft: '0 !important',
|
||||||
|
listStyleType: 'none'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{intl.formatMessage({
|
||||||
|
id: 'clusters.addworker.externalIP.tips'
|
||||||
|
})}
|
||||||
|
</li>
|
||||||
|
</NotesWrapper>
|
||||||
|
}
|
||||||
|
></AlertInfoBlock>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
></SwitchSetting>
|
||||||
{/* cache directory config */}
|
{/* cache directory config */}
|
||||||
<SwitchSetting
|
<SwitchSetting
|
||||||
label={intl.formatMessage({ id: 'clusters.addworker.cacheVolume' })}
|
label={intl.formatMessage({ id: 'clusters.addworker.cacheVolume' })}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ interface DataItemProps {
|
|||||||
enable: boolean;
|
enable: boolean;
|
||||||
value: string;
|
value: string;
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
label: string;
|
label: React.ReactNode;
|
||||||
tips?: string;
|
tips?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +99,11 @@ const SummaryData: React.FC = () => {
|
|||||||
path: ''
|
path: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const externalWorkerIPConfig = summary.get('externalWorkerIPConfig') || {
|
||||||
|
enable: false,
|
||||||
|
ip: ''
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigWrapper>
|
<ConfigWrapper>
|
||||||
<Title>
|
<Title>
|
||||||
@@ -120,7 +125,18 @@ const SummaryData: React.FC = () => {
|
|||||||
></DataItem>
|
></DataItem>
|
||||||
|
|
||||||
<DataItem
|
<DataItem
|
||||||
label={intl.formatMessage({ id: 'clusters.addworker.workerIP' })}
|
label={
|
||||||
|
<span
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: intl.formatMessage(
|
||||||
|
{ id: 'clusters.addworker.workerIP' },
|
||||||
|
{
|
||||||
|
type: `(${intl.formatMessage({ id: 'clusters.table.ip.internal' })})`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
></span>
|
||||||
|
}
|
||||||
tips={
|
tips={
|
||||||
workerIPConfig.enable
|
workerIPConfig.enable
|
||||||
? workerIPConfig.ip
|
? workerIPConfig.ip
|
||||||
@@ -133,6 +149,31 @@ const SummaryData: React.FC = () => {
|
|||||||
required={true}
|
required={true}
|
||||||
></DataItem>
|
></DataItem>
|
||||||
|
|
||||||
|
<DataItem
|
||||||
|
label={
|
||||||
|
<span
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: intl.formatMessage(
|
||||||
|
{ id: 'clusters.addworker.workerIP' },
|
||||||
|
{
|
||||||
|
type: `(${intl.formatMessage({ id: 'clusters.table.ip.external' })})`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
></span>
|
||||||
|
}
|
||||||
|
tips={
|
||||||
|
externalWorkerIPConfig.enable
|
||||||
|
? externalWorkerIPConfig.ip
|
||||||
|
? ''
|
||||||
|
: intl.formatMessage({ id: 'clusters.addworker.notSpecified' })
|
||||||
|
: intl.formatMessage({ id: 'clusters.addworker.autoDetect' })
|
||||||
|
}
|
||||||
|
enable={externalWorkerIPConfig.enable}
|
||||||
|
value={externalWorkerIPConfig.ip}
|
||||||
|
required={true}
|
||||||
|
></DataItem>
|
||||||
|
|
||||||
<DataItem
|
<DataItem
|
||||||
label={intl.formatMessage({ id: 'clusters.addworker.extraVolume' })}
|
label={intl.formatMessage({ id: 'clusters.addworker.extraVolume' })}
|
||||||
enable={modelDirConfig.enable}
|
enable={modelDirConfig.enable}
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ const usePoolsColumns = (
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
data={{
|
data={{
|
||||||
vendor: record.instance_spec.vendor,
|
vendor: record.instance_spec?.vendor,
|
||||||
description: record.instance_spec.description,
|
description: record.instance_spec?.description,
|
||||||
specInfo: _.omit(record.instance_spec, [
|
specInfo: _.omit(record.instance_spec, [
|
||||||
'label',
|
'label',
|
||||||
'vendor',
|
'vendor',
|
||||||
@@ -83,11 +83,11 @@ const usePoolsColumns = (
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
showTitle
|
SHOWTITLE
|
||||||
ghost
|
ghost
|
||||||
minWidth={20}
|
minWidth={20}
|
||||||
>
|
>
|
||||||
{record.instance_spec.description || record.instance_spec.label}
|
{record.instance_spec?.description || record.instance_spec?.label}
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -143,9 +143,23 @@ interface AddWorkerCommandParams {
|
|||||||
cacheDir?: string;
|
cacheDir?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const generateEnvArgs = (params: any) => {
|
||||||
|
const registrationInfo = params.registrationInfo || {};
|
||||||
|
// generate environment variables args from registrationInfo.env
|
||||||
|
let envArgs = '';
|
||||||
|
if (registrationInfo.env && typeof registrationInfo.env === 'object') {
|
||||||
|
Object.keys(registrationInfo.env).forEach((key) => {
|
||||||
|
const value = registrationInfo.env[key];
|
||||||
|
envArgs += `-e "${key}=${value}" \\\n `;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return envArgs;
|
||||||
|
};
|
||||||
|
|
||||||
const setNormalArgs = (params: any) => {
|
const setNormalArgs = (params: any) => {
|
||||||
return `sudo docker run -d --name ${params.containerName || 'gpustack-worker'} \\
|
return `sudo docker run -d --name ${params.containerName || 'gpustack-worker'} \\
|
||||||
-e "GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME=${params.containerName || 'gpustack-worker'}" \\
|
-e "GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME=${params.containerName || 'gpustack-worker'}" \\
|
||||||
|
${generateEnvArgs(params)}
|
||||||
--restart=unless-stopped \\
|
--restart=unless-stopped \\
|
||||||
--privileged \\
|
--privileged \\
|
||||||
--network=host \\
|
--network=host \\
|
||||||
@@ -155,6 +169,11 @@ const setNormalArgs = (params: any) => {
|
|||||||
${params.cacheDir ? `--volume ${params.cacheDir}:/var/lib/gpustack/cache \\` : ''}`;
|
${params.cacheDir ? `--volume ${params.cacheDir}:/var/lib/gpustack/cache \\` : ''}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const setWorkerIPArg = (params: any) => {
|
||||||
|
return `${params.workerIP ? `--worker-ip ${params.workerIP} \\` : ''}
|
||||||
|
${params.advertisAddress ? `--advertise-address ${params.advertisAddress} \\` : ''}`;
|
||||||
|
};
|
||||||
|
|
||||||
const setImageArgs = (params: any) => {
|
const setImageArgs = (params: any) => {
|
||||||
return `${params.image} \\
|
return `${params.image} \\
|
||||||
--server-url ${params.server} \\
|
--server-url ${params.server} \\
|
||||||
@@ -171,7 +190,7 @@ const registerWorker = (params: AddWorkerCommandParams) => {
|
|||||||
return `${commonArgs}
|
return `${commonArgs}
|
||||||
--runtime ${config.runtime} \\
|
--runtime ${config.runtime} \\
|
||||||
${imageArgs}
|
${imageArgs}
|
||||||
${params.workerIP ? `--advertise-address ${params.workerIP} \\` : ''}`;
|
${setWorkerIPArg(params)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// avaliable for AMD
|
// avaliable for AMD
|
||||||
@@ -184,7 +203,7 @@ const registerAMDWorker = (params: AddWorkerCommandParams) => {
|
|||||||
--volume /opt/rocm:/opt/rocm:ro \\
|
--volume /opt/rocm:/opt/rocm:ro \\
|
||||||
--runtime ${config.runtime} \\
|
--runtime ${config.runtime} \\
|
||||||
${imageArgs}
|
${imageArgs}
|
||||||
${params.workerIP ? `--advertise-address ${params.workerIP} \\` : ''}`;
|
${setWorkerIPArg(params)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
// avaliable for Ascend
|
// avaliable for Ascend
|
||||||
@@ -196,7 +215,7 @@ const registerAscendWorker = (params: AddWorkerCommandParams) => {
|
|||||||
--env "ASCEND_VISIBLE_DEVICES=$(sudo ls /dev/davinci* | head -1 | grep -o '[0-9]\\+' || echo "0")" \\
|
--env "ASCEND_VISIBLE_DEVICES=$(sudo ls /dev/davinci* | head -1 | grep -o '[0-9]\\+' || echo "0")" \\
|
||||||
--runtime ${config.runtime} \\
|
--runtime ${config.runtime} \\
|
||||||
${imageArgs}
|
${imageArgs}
|
||||||
${params.workerIP ? `--advertise-address ${params.workerIP} \\` : ''}`;
|
${setWorkerIPArg(params)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerHygonWorker = (params: AddWorkerCommandParams) => {
|
const registerHygonWorker = (params: AddWorkerCommandParams) => {
|
||||||
@@ -209,7 +228,7 @@ const registerHygonWorker = (params: AddWorkerCommandParams) => {
|
|||||||
--env ROCM_PATH=/opt/dtk \\
|
--env ROCM_PATH=/opt/dtk \\
|
||||||
--env ROCM_SMI_LIB_PATH=/opt/hyhal/lib \\
|
--env ROCM_SMI_LIB_PATH=/opt/hyhal/lib \\
|
||||||
${imageArgs}
|
${imageArgs}
|
||||||
${params.workerIP ? `--advertise-address ${params.workerIP} \\` : ''}`;
|
${setWorkerIPArg(params)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerIluvatarWorker = (params: AddWorkerCommandParams) => {
|
const registerIluvatarWorker = (params: AddWorkerCommandParams) => {
|
||||||
@@ -222,7 +241,7 @@ const registerIluvatarWorker = (params: AddWorkerCommandParams) => {
|
|||||||
--volume /usr/bin/ixsmi:/usr/bin/ixsmi \\
|
--volume /usr/bin/ixsmi:/usr/bin/ixsmi \\
|
||||||
--runtime ${config.runtime} \\
|
--runtime ${config.runtime} \\
|
||||||
${imageArgs}
|
${imageArgs}
|
||||||
${params.workerIP ? `--advertise-address ${params.workerIP} \\` : ''}`;
|
${setWorkerIPArg(params)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerMetaXWorker = (params: AddWorkerCommandParams) => {
|
const registerMetaXWorker = (params: AddWorkerCommandParams) => {
|
||||||
@@ -233,7 +252,7 @@ const registerMetaXWorker = (params: AddWorkerCommandParams) => {
|
|||||||
--volume /opt/mxdriver:/opt/mxdriver:ro \\
|
--volume /opt/mxdriver:/opt/mxdriver:ro \\
|
||||||
--volume /opt/maca:/opt/maca:ro \\
|
--volume /opt/maca:/opt/maca:ro \\
|
||||||
${imageArgs}
|
${imageArgs}
|
||||||
${params.workerIP ? `--advertise-address ${params.workerIP} \\` : ''}`;
|
${setWorkerIPArg(params)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerCambriconWorker = (params: AddWorkerCommandParams) => {
|
const registerCambriconWorker = (params: AddWorkerCommandParams) => {
|
||||||
@@ -244,7 +263,7 @@ const registerCambriconWorker = (params: AddWorkerCommandParams) => {
|
|||||||
--volume /usr/local/neuware:/usr/local/neuware:ro \\
|
--volume /usr/local/neuware:/usr/local/neuware:ro \\
|
||||||
--volume /usr/bin/cnmon:/usr/bin/cnmon \\
|
--volume /usr/bin/cnmon:/usr/bin/cnmon \\
|
||||||
${imageArgs}
|
${imageArgs}
|
||||||
${params.workerIP ? `--advertise-address ${params.workerIP} \\` : ''}`;
|
${setWorkerIPArg(params)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const registerAddWokerCommandMap = {
|
export const registerAddWokerCommandMap = {
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ export const addWorkerGuide: Record<string, any> = {
|
|||||||
token: string;
|
token: string;
|
||||||
image: string;
|
image: string;
|
||||||
gpu: string;
|
gpu: string;
|
||||||
|
[key: string]: any;
|
||||||
}) {
|
}) {
|
||||||
return registerAddWokerCommandMap[params.gpu]?.(params);
|
return registerAddWokerCommandMap[params.gpu]?.(params);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user