chore: docker add worker command

This commit is contained in:
jialin
2024-11-28 23:19:31 +08:00
parent 849150c9ab
commit 0cc2a40f26
18 changed files with 549 additions and 434 deletions
@@ -62,6 +62,11 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
theme="dark"
code={addWorkerGuide.win.registerWorker(origin)}
></HighlightCode>
<h4>Docker </h4>
<HighlightCode
theme="dark"
code={addWorkerGuide.docker.registerWorker(origin)}
></HighlightCode>
<h3>3. {intl.formatMessage({ id: 'resources.worker.add.step3' })}</h3>
</div>
</Modal>
+7
View File
@@ -28,5 +28,12 @@ export const addWorkerGuide = {
registerWorker(server: string) {
return `Invoke-Expression "& { $((Invoke-WebRequest -Uri "https://get.gpustack.ai" -UseBasicParsing).Content) } --server-url ${server} --token mytoken"`;
}
},
docker: {
getToken:
'Get-Content -Path (Join-Path -Path $env:APPDATA -ChildPath "gpustack\\token") -Raw',
registerWorker(server: string) {
return `docker run -d --gpus all --ipc=host --network=host gpustack/gpustack --server-url ${server} --token mytoken`;
}
}
};