chore: add mutiple additional volume
This commit is contained in:
@@ -91,7 +91,7 @@ export default {
|
||||
'clusters.addworker.notSpecified': 'Not Specified',
|
||||
'clusters.addworker.autoDetect': 'Auto',
|
||||
'clusters.addworker.extraVolume.holder':
|
||||
'e.g. /data/models (path must start with /)',
|
||||
'e.g. /data/models (path must start with /). Use commas to separate multiple paths.',
|
||||
'clusters.addworker.cacheVolume.holder':
|
||||
'e.g. /data/cache (path must start with /)',
|
||||
'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device',
|
||||
|
||||
@@ -91,7 +91,7 @@ export default {
|
||||
'clusters.addworker.notSpecified': 'Not Specified',
|
||||
'clusters.addworker.autoDetect': 'Auto',
|
||||
'clusters.addworker.extraVolume.holder':
|
||||
'e.g. /data/models (path must start with /)',
|
||||
'e.g. /data/models (path must start with /). Use commas to separate multiple paths.',
|
||||
'clusters.addworker.cacheVolume.holder':
|
||||
'e.g. /data/cache (path must start with /)',
|
||||
'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device',
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
// 65. 'clusters.addworker.workerExternalIP': 'Worker External Address',
|
||||
// 65. 'clusters.addworker.notSpecified': 'Not Specified',
|
||||
// 66. 'clusters.addworker.autoDetect': 'Auto',
|
||||
// 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 /). Use commas to separate multiple paths.',
|
||||
// 68. 'clusters.addworker.vendorNotes.title': 'Notes for {vendor} Device',
|
||||
// 69. 'clusters.button.genToken': 'Need to create a new token? Click <a href="{link}" target="_blank">here</a>.',
|
||||
// 70. 'clusters.addworker.amdNotes-01': `If the <span class="bold-text">/opt/rocm</span> directory does not exist, please create a symbolic link pointing to the ROCm installed path: <span class="bold-text">ln -s /path/to/rocm /opt/rocm</span>.`,
|
||||
|
||||
@@ -91,9 +91,9 @@ export default {
|
||||
'clusters.addworker.notSpecified': 'Не указано',
|
||||
'clusters.addworker.autoDetect': 'Автоопределение',
|
||||
'clusters.addworker.extraVolume.holder':
|
||||
'напр. /data/models (путь должен начинаться с /)',
|
||||
'e.g. /data/models (path must start with /). Use commas to separate multiple paths.',
|
||||
'clusters.addworker.cacheVolume.holder':
|
||||
'напр. /data/cache (путь должен начинаться с /)',
|
||||
'e.g. /data/cache (path must start with /)',
|
||||
'clusters.addworker.vendorNotes.title': 'Примечания для устройств {vendor}',
|
||||
'clusters.button.genToken':
|
||||
'Нужен новый токен? Нажмите <a href="{link}" target="_blank">здесь</a>.',
|
||||
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
'clusters.addworker.notSpecified': '未指定',
|
||||
'clusters.addworker.autoDetect': '自动检测',
|
||||
'clusters.addworker.extraVolume.holder':
|
||||
'例如:/data/models(路径需以 / 开头)',
|
||||
'例如:/data/models(路径需以 / 开头),添加多个请用逗号分隔。',
|
||||
'clusters.addworker.cacheVolume.holder':
|
||||
'例如:/data/cache(路径需以 / 开头)',
|
||||
'clusters.addworker.vendorNotes.title': '{vendor}设备注意事项',
|
||||
|
||||
@@ -175,6 +175,19 @@ const generateEnvArgs = (params: any) => {
|
||||
return envArgs;
|
||||
};
|
||||
|
||||
const generateExtraModelDirArg = (modelDir: string) => {
|
||||
const pathList = modelDir
|
||||
?.split(',')
|
||||
.map((item) => item.trim())
|
||||
.filter((item) => item);
|
||||
if (pathList && pathList.length > 0) {
|
||||
return pathList
|
||||
.map((item) => `--volume ${item}:${item} \\`)
|
||||
.join('\n ');
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
const setNormalArgs = (params: any) => {
|
||||
return `sudo docker run -d --name ${params.containerName || 'gpustack-worker'} \\
|
||||
-e "GPUSTACK_RUNTIME_DEPLOY_MIRRORED_NAME=${params.containerName || 'gpustack-worker'}" \\
|
||||
@@ -184,7 +197,7 @@ const setNormalArgs = (params: any) => {
|
||||
--network=host \\
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock \\
|
||||
--volume ${params.gpustackDataVolume || 'gpustack-data'}:/var/lib/gpustack \\
|
||||
${params.modelDir ? `--volume ${params.modelDir}:${params.modelDir} \\` : ''}
|
||||
${generateExtraModelDirArg(params.modelDir)}
|
||||
${params.cacheDir ? `--volume ${params.cacheDir}:/var/lib/gpustack/cache \\` : ''}`;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user