Files
Memoh/assets/zh_getting-started_container.md.D8xPCDfk.js
2026-04-24 06:37:27 +00:00

2 lines
5.3 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as t,o as r,c as e,ag as o}from"./chunks/framework.CAXxHpAX.js";const u=JSON.parse('{"title":"容器","description":"","frontmatter":{},"headers":[],"relativePath":"zh/getting-started/container.md","filePath":"zh/getting-started/container.md","lastUpdated":1777012567000}'),n={name:"zh/getting-started/container.md"};function i(l,a,s,d,c,h){return r(),e("div",null,[...a[0]||(a[0]=[o('<h1 id="容器" tabindex="-1">容器 <a class="header-anchor" href="#容器" aria-label="Permalink to &quot;容器&quot;"></a></h1><p>每个机器人在<strong>自己的</strong>容器里跑,文件系统、网络边界都隔开,互不影响,也跟宿主机隔离。</p><h2 id="是什么" tabindex="-1">是什么 <a class="header-anchor" href="#是什么" aria-label="Permalink to &quot;是什么&quot;"></a></h2><p>可以把它想成机器人私用的一台小电脑:能存文件、装包、跑脚本、跨会话留状态。</p><hr><h2 id="操作" tabindex="-1">操作 <a class="header-anchor" href="#操作" aria-label="Permalink to &quot;操作&quot;"></a></h2><p>在 <strong>Container</strong> tab。</p><h3 id="生命周期" tabindex="-1">生命周期 <a class="header-anchor" href="#生命周期" aria-label="Permalink to &quot;生命周期&quot;"></a></h3><ul><li><strong>Create</strong>:没有就按镜像建;拉镜像、建实例时会有 SSE 进度。</li><li><strong>Start</strong>:要跑文件工具、终端等,多半要先起来。</li><li><strong>Stop</strong>:省资源,优雅停。</li><li><strong>Delete</strong>:删实例(数据行为视版本与设置而定,以界面为准)。</li></ul><hr><h2 id="信息" tabindex="-1">信息 <a class="header-anchor" href="#信息" aria-label="Permalink to &quot;信息&quot;"></a></h2><p>会显示如:容器 id、状态、用的镜像、宿主机/容器路径、后台任务数、若配了 <strong>CDI 设备</strong>(常见 GPU)也会列出来。</p><hr><h2 id="进阶-cdi-设备" tabindex="-1">进阶:CDI 设备 <a class="header-anchor" href="#进阶-cdi-设备" aria-label="Permalink to &quot;进阶:CDI 设备&quot;"></a></h2><p>要把宿主机通过 <strong>CDI</strong>(常见是 GPU)透进容器,在 <strong>Container</strong> → <strong>Advanced</strong> 里配。一般只有确实要在里面跑 CUDA/ROCm 等才要动。</p><h3 id="配法" tabindex="-1">配法 <a class="header-anchor" href="#配法" aria-label="Permalink to &quot;配法&quot;"></a></h3><ol><li>打开 <strong>Container</strong>。</li><li>没有容器先 <strong>Create</strong>;要改 GPU 类设置往往要<strong>重建</strong>容器。</li><li>展开 <strong>Advanced</strong>。</li><li>开 <strong>GPU</strong>,在 <strong>CDI devices</strong> 里写设备名。</li></ol><p>可每行一个或逗号分隔,例如:</p><ul><li><code>nvidia.com/gpu=0</code></li><li><code>nvidia.com/gpu=all</code></li><li><code>amd.com/gpu=0</code></li><li><code>amd.com/gpu=all</code></li></ul><h3 id="宿主要求" tabindex="-1">宿主要求 <a class="header-anchor" href="#宿主要求" aria-label="Permalink to &quot;宿主要求&quot;"></a></h3><p>宿主机上驱动、厂商工具、CDI spec 要已就绪。通常意味着:</p><ul><li>宿主机上 GPU 本来就能用</li><li><code>/etc/cdi</code> 或 <code>/var/run/cdi</code> 里有 spec</li><li>你填的名字和运行时看见的一致</li></ul><p>查本机名:</p><ul><li>NVIDIA<code>nvidia-ctk cdi list</code></li><li>AMD<code>amd-ctk cdi list</code></li></ul><p>若报 <code>unresolvable CDI devices</code>,多半是名字对不上。</p><h3 id="注意" tabindex="-1">注意 <a class="header-anchor" href="#注意" aria-label="Permalink to &quot;注意&quot;"></a></h3><ul><li>CDI 在<strong>创建</strong>时生效,改配置后常要<strong>重建</strong>容器;只停再起<strong>不会</strong>换已挂设备。</li><li>镜像里仍要装对的用户态库,才能真跑算子。</li><li>建好后 <strong>Container</strong> tab 会显示当前挂上的设备,便于核对。</li></ul><hr><h2 id="快照" tabindex="-1">快照 <a class="header-anchor" href="#快照" aria-label="Permalink to &quot;快照&quot;"></a></h2><p><strong>Create Snapshot</strong> 把当前环境状态勾下来,方便回滚、试大改。<br><strong>Restore</strong> 按某个快照回退。可删不要的快照。</p><hr><h2 id="导入导出" tabindex="-1">导入导出 <a class="header-anchor" href="#导入导出" aria-label="Permalink to &quot;导入导出&quot;"></a></h2><ul><li><strong>Export Data</strong>:把容器内数据打成包下载。</li><li><strong>Import Data</strong>:从本地上传打进文件系统。</li></ul><h3 id="restore-数据侧" tabindex="-1">Restore(数据侧) <a class="header-anchor" href="#restore-数据侧" aria-label="Permalink to &quot;Restore(数据侧)&quot;"></a></h3><p><strong>Restore</strong> 在数据目录侧做「清到干净再灌」,适合盘坏了或想从零来而又不删容器实例时,以界面说明为准。</p><hr><h2 id="版本" tabindex="-1">版本 <a class="header-anchor" href="#版本" aria-label="Permalink to &quot;版本&quot;"></a></h2><p>会跟 <strong>Current Version</strong>、<strong>Version History</strong> 等,方便审计环境何时、因何变过。</p>',38)])])}const p=t(n,[["render",i]]);export{u as __pageData,p as default};