fix: update addworker command for dtk

This commit is contained in:
jialin
2026-06-08 15:43:21 +08:00
committed by jialin
parent 09821aab85
commit 2b6f26e6c8
12 changed files with 76 additions and 20 deletions
+1
View File
@@ -72,6 +72,7 @@ export default {
'clusters.addworker.selectGPU.multiTag': 'Multi-select',
'clusters.addworker.checkEnv': 'Check Environment',
'clusters.addworker.specifyArgs': 'Specify Arguments',
'clusters.addworker.dtkVersion': 'DTK Version',
'clusters.addworker.runCommand': 'Run Command',
'clusters.addworker.specifyWorkerIP': 'Worker IP',
'clusters.addworker.detectWorkerIP': 'Auto-detect Worker IP',
+1
View File
@@ -72,6 +72,7 @@ export default {
'clusters.addworker.selectGPU.multiTag': 'Multi-select',
'clusters.addworker.checkEnv': 'Check Environment',
'clusters.addworker.specifyArgs': 'Specify Arguments',
'clusters.addworker.dtkVersion': 'DTK バージョン',
'clusters.addworker.runCommand': 'Run Command',
'clusters.addworker.specifyWorkerIP': 'Worker IP',
'clusters.addworker.detectWorkerIP': 'Worker IP を自動検出',
+1
View File
@@ -72,6 +72,7 @@ export default {
'clusters.addworker.selectGPU.multiTag': 'Multi-select',
'clusters.addworker.checkEnv': 'Проверить окружение',
'clusters.addworker.specifyArgs': 'Указать аргументы',
'clusters.addworker.dtkVersion': 'Версия DTK',
'clusters.addworker.runCommand': 'Выполнить команду',
'clusters.addworker.specifyWorkerIP': 'Указать IP воркера',
'clusters.addworker.detectWorkerIP': 'Автоматически определить IP воркера',
+1
View File
@@ -72,6 +72,7 @@ export default {
'clusters.addworker.selectGPU.multiTag': 'Multi-select',
'clusters.addworker.checkEnv': 'Ortamı Kontrol Et',
'clusters.addworker.specifyArgs': 'Argümanları Belirle',
'clusters.addworker.dtkVersion': 'DTK Sürümü',
'clusters.addworker.runCommand': 'Komutu Çalıştır',
'clusters.addworker.specifyWorkerIP': "İşçi Düğüm IP'si",
'clusters.addworker.detectWorkerIP': "İşçi Düğüm IP'sini Otomatik Algıla",
+1
View File
@@ -70,6 +70,7 @@ export default {
'clusters.addworker.selectGPU.multiTag': '可多选',
'clusters.addworker.checkEnv': '检查环境',
'clusters.addworker.specifyArgs': '指定参数',
'clusters.addworker.dtkVersion': 'DTK 版本',
'clusters.addworker.runCommand': '运行指令',
'clusters.addworker.specifyWorkerIP': '节点 IP',
'clusters.addworker.detectWorkerIP': '自动检测节点 IP',
@@ -10,6 +10,7 @@ type ViewModalProps = {
containerName?: string;
gpustackDataVolume?: string;
advertisAddress?: string;
dtkVersion?: string;
registrationInfo: {
token: string;
image: string;
@@ -26,7 +27,8 @@ const AddWorkerCommand: React.FC<ViewModalProps> = ({
cacheDir,
currentGPU,
containerName,
gpustackDataVolume
gpustackDataVolume,
dtkVersion
}) => {
const code = React.useMemo(() => {
const commandCode = addWorkerGuide['all'];
@@ -42,6 +44,7 @@ const AddWorkerCommand: React.FC<ViewModalProps> = ({
cacheDir: cacheDir,
containerName: containerName,
gpustackDataVolume: gpustackDataVolume,
dtkVersion: dtkVersion,
image: registrationInfo.image,
token: registrationInfo.token || '${token}'
})
@@ -56,7 +59,8 @@ const AddWorkerCommand: React.FC<ViewModalProps> = ({
cacheDir,
containerName,
gpustackDataVolume,
advertisAddress
advertisAddress,
dtkVersion
]);
return (
@@ -67,7 +67,6 @@ const AddWorkerSteps: React.FC<AddWorkerProps> = (props) => {
);
const { update, summary, register } = useSummaryStatus();
const { addedCount, createModelsChunkRequest } = useAddWorkerMessage();
console.log('addedCount=========', addedCount);
const onToggle = (open: boolean, key: string) => {
setCollapseKey(open ? new Set([key]) : new Set());
@@ -82,7 +81,6 @@ const AddWorkerSteps: React.FC<AddWorkerProps> = (props) => {
setCollapseKey(new Set([stepList[0]]));
}, [stepList]);
console.log('actionSource=========', actionSource, registrationInfo);
React.useEffect(() => {
// this effect is only triggered when used in cluster create page inner
if (actionSource === 'page' && registrationInfo?.cluster_id) {
@@ -36,6 +36,7 @@ export interface SummaryDataKeys {
selectedGPUs: string[];
cluster_id: number;
clusterName: string;
dtkVersion: string;
workerCommand: {
label: string;
link: string;
@@ -41,6 +41,8 @@ const DockerRunCommand: React.FC<AddWorkerStepProps> = ({ disabled }) => {
const currentGPU = summary.get('currentGPU') || '';
const dtkVersion = summary.get('dtkVersion') || '25.04';
const stepIndex = stepList.indexOf(StepNamesMap.RunCommand) + 1;
return (
@@ -80,6 +82,7 @@ const DockerRunCommand: React.FC<AddWorkerStepProps> = ({ disabled }) => {
gpustackDataVolumeConfig.enable ? gpustackDataVolumeConfig.path : ''
}
currentGPU={currentGPU}
dtkVersion={dtkVersion}
/>
</StepCollapse>
);
@@ -1,7 +1,11 @@
import { GPUDriverMap } from '@/pages/resources/config/gpu-driver';
import { ExclamationCircleFilled } from '@ant-design/icons';
import { AlertBlockInfo as AlertInfoBlock } from '@gpustack/core-ui';
import {
AlertBlockInfo as AlertInfoBlock,
SwitchCard
} from '@gpustack/core-ui';
import { useIntl } from '@umijs/max';
import { Input, Switch, Typography } from 'antd';
import { Input, Radio, Switch, Typography } from 'antd';
import React, { useEffect } from 'react';
import styled from 'styled-components';
import { useAddWorkerContext } from './add-worker-context';
@@ -111,6 +115,14 @@ const SpecifyArguments: React.FC<AddWorkerStepProps> = ({ disabled }) => {
path: 'gpustack-data'
};
const selectedGPUs = summary.get('selectedGPUs') || [];
const dtkVersion = summary.get('dtkVersion') || '25.04';
// The DTK version selector only applies to Hygon DCUs, so only surface it
// when Hygon ('dtk') is among the selected vendors.
const showDtkVersion = selectedGPUs.includes(GPUDriverMap.HYGON);
const setWorkerIPConfig = (config: {
enable: boolean;
ip?: string;
@@ -166,12 +178,14 @@ const SpecifyArguments: React.FC<AddWorkerStepProps> = ({ disabled }) => {
const unregisterGpustackDataVolume = registerField(
'gpustackDataVolumeConfig'
);
const unregisterVersion = registerField('dtkVersion');
return () => {
unregisterWorkerIP();
unregisterModelDir();
unregisterCacheDir();
unregisterContainerName();
unregisterGpustackDataVolume();
unregisterVersion();
};
}, []);
@@ -207,6 +221,7 @@ const SpecifyArguments: React.FC<AddWorkerStepProps> = ({ disabled }) => {
ip: '',
required: false
});
updateField('dtkVersion', '25.04');
}, []);
return (
@@ -229,6 +244,30 @@ const SpecifyArguments: React.FC<AddWorkerStepProps> = ({ disabled }) => {
marginBottom: 8
}}
>
{showDtkVersion && (
<SwitchCard
label={intl.formatMessage({
id: 'clusters.addworker.dtkVersion'
})}
defaultValue={true}
showSwitch={false}
styles={{
wrapper: {
borderRadius: 4
}
}}
>
<Radio.Group
defaultValue={dtkVersion}
value={dtkVersion}
onChange={(e) => updateField('dtkVersion', e.target.value)}
style={{ marginTop: 8, display: 'flex', gap: 12 }}
>
<Radio value="25.04">25.04</Radio>
<Radio value="26.04">26.04</Radio>
</Radio.Group>
</SwitchCard>
)}
{/* worker IP config */}
<SwitchSetting
label={
@@ -111,10 +111,8 @@ const useInstancesColumns = (options: {
style={{ fontSize: 12, position: 'relative', top: 2 }}
/>
<span className="text-quaternary">
{record?.backend || record?.backend || ''}
{record.backend_version || record?.backend_version
? `(${record.backend_version || record?.backend_version})`
: ''}
{record?.backend || ''}
{record.backend_version ? `(${record.backend_version})` : ''}
</span>
</div>
</>
+18 -10
View File
@@ -36,14 +36,6 @@ export const manfacturerValueMap = {
THEAD: 'thead'
};
// 'vendor.ascend': '昇腾',
// 'vendor.hygon': '海光',
// 'vendor.moorthreads': '摩尔线程',
// 'vendor.iluvatar': '天数智芯',
// 'vendor.metax': '沐曦',
// 'vendor.cambricon': '寒武纪',
// 'vendor.thead': '平头哥 PPU'
export const GPUsConfigs: Record<
string,
{
@@ -229,6 +221,7 @@ interface AddWorkerCommandParams {
containerName?: string;
gpustackDataVolume?: string;
cacheDir?: string;
dtkVersion?: string;
}
const generateEnvArgs = (params: any) => {
@@ -361,12 +354,27 @@ const registerTHeadWorker = (params: AddWorkerCommandParams) => {
const registerHygonWorker = (params: AddWorkerCommandParams) => {
const config = GPUsConfigs[params.gpu];
const commonArgs = setNormalArgs(params);
// DTK 26.04 relocates the ROCm runtime under /opt/dtk/.hyhal and needs the
// mirrored-deployment seam to leave ROCM_PATH untouched; DTK 25.04 keeps the
// classic /opt/dtk layout.
const isDTK2604 = params.dtkVersion === '26.04';
const rocmPath = isDTK2604 ? '/opt/dtk/.hyhal' : '/opt/dtk';
const commonArgs = setNormalArgs(
isDTK2604
? {
...params,
extraEnv: {
GPUSTACK_RUNTIME_DEPLOY_MIRRORED_DEPLOYMENT_IGNORE_ENVIRONMENTS:
'ROCM_PATH'
}
}
: params
);
const imageArgs = setImageArgs(params);
return `${commonArgs}
--volume /opt/hyhal:/opt/hyhal:ro \\
--volume /opt/dtk:/opt/dtk:ro \\
--env ROCM_PATH=/opt/dtk \\
--env ROCM_PATH=${rocmPath} \\
--env ROCM_SMI_LIB_PATH=/opt/hyhal/lib \\
${imageArgs}
${setWorkerIPArg(params)}`;