Files
Memoh/assets/getting-started_container.md.CrcDm5m4.js
2026-04-23 13:02:42 +00:00

2 lines
9.5 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.
import{_ as t,o as a,c as o,ag as i}from"./chunks/framework.CAXxHpAX.js";const u=JSON.parse('{"title":"Bot Container Management","description":"","frontmatter":{},"headers":[],"relativePath":"getting-started/container.md","filePath":"getting-started/container.md","lastUpdated":1775803937000}'),n={name:"getting-started/container.md"};function r(s,e,l,c,h,d){return a(),o("div",null,[...e[0]||(e[0]=[i('<h1 id="bot-container-management" tabindex="-1">Bot Container Management <a class="header-anchor" href="#bot-container-management" aria-label="Permalink to &quot;Bot Container Management&quot;"></a></h1><p>Every Bot in Memoh operates within its own isolated container environment. This isolation ensures security, provides a dedicated filesystem, and allows the bot to execute code or commands without affecting other bots or the host system.</p><h2 id="concept-the-isolated-workspace" tabindex="-1">Concept: The Isolated Workspace <a class="header-anchor" href="#concept-the-isolated-workspace" aria-label="Permalink to &quot;Concept: The Isolated Workspace&quot;"></a></h2><p>The container acts as the bot&#39;s private &quot;computer.&quot; Within it, the bot can:</p><ul><li>Store and modify files</li><li>Install software via package managers</li><li>Execute scripts</li><li>Maintain state across multiple sessions</li></ul><hr><h2 id="operations" tabindex="-1">Operations <a class="header-anchor" href="#operations" aria-label="Permalink to &quot;Operations&quot;"></a></h2><p>Manage the lifecycle of your bot&#39;s environment from the <strong>Container</strong> tab in the Bot Detail page.</p><h3 id="lifecycle-actions" tabindex="-1">Lifecycle Actions <a class="header-anchor" href="#lifecycle-actions" aria-label="Permalink to &quot;Lifecycle Actions&quot;"></a></h3><ul><li><strong>Create</strong>: Initialize the container if it doesn&#39;t exist (using the configured image). Progress is shown via real-time SSE feedback during image pull and creation.</li><li><strong>Start</strong>: Launch the container. The bot must have a running container to perform many operations like file editing or executing tools.</li><li><strong>Stop</strong>: Gracefully shut down the container to save resources.</li><li><strong>Delete</strong>: Remove the container instance.</li></ul><hr><h2 id="container-information" tabindex="-1">Container Information <a class="header-anchor" href="#container-information" aria-label="Permalink to &quot;Container Information&quot;"></a></h2><p>The <strong>Container</strong> tab displays real-time data about the bot&#39;s runtime:</p><ul><li><strong>Container ID</strong>: Unique identifier for the instance.</li><li><strong>Status</strong>: Whether it&#39;s currently running, stopped, or creating.</li><li><strong>Image</strong>: The Docker/Containerd image used as the base.</li><li><strong>Paths</strong>: Host and container paths for data persistence.</li><li><strong>Tasks</strong>: Number of active background tasks running in the container.</li><li><strong>CDI Devices</strong>: The effective GPU CDI devices currently attached to the container, if any.</li></ul><hr><h2 id="advanced-provide-cdi-devices" tabindex="-1">Advanced: Provide CDI Devices <a class="header-anchor" href="#advanced-provide-cdi-devices" aria-label="Permalink to &quot;Advanced: Provide CDI Devices&quot;"></a></h2><p>Memoh can provide host devices to a bot container through CDI (Container Device Interface). This is an advanced capability for users who want to expose host-managed devices, most commonly GPUs, to the container runtime.</p><p>In the Web UI, this capability is placed under <strong>Advanced options</strong> in the <strong>Container</strong> tab. It is optional and only needs to be configured when the bot must access CDI-backed devices from the host.</p><h3 id="configure-cdi-devices" tabindex="-1">Configure CDI Devices <a class="header-anchor" href="#configure-cdi-devices" aria-label="Permalink to &quot;Configure CDI Devices&quot;"></a></h3><ol><li>Open the Bot&#39;s <strong>Container</strong> tab.</li><li>Click <strong>Create</strong> if the container does not exist, or recreate the container if you need to change GPU settings.</li><li>Expand <strong>Advanced options</strong>.</li><li>Enable <strong>GPU</strong>.</li><li>Enter one or more CDI device names in <strong>CDI devices</strong>.</li></ol><p>You can enter CDI device names one per line or separated with commas. Common GPU-related examples:</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="host-requirements" tabindex="-1">Host Requirements <a class="header-anchor" href="#host-requirements" aria-label="Permalink to &quot;Host Requirements&quot;"></a></h3><p>Before configuring CDI devices in Memoh, the host machine must already provide working device drivers, vendor toolkit support where required, and valid CDI specs. In practice, this usually means:</p><ul><li>the host GPU works normally outside the container</li><li>CDI spec files exist under <code>/etc/cdi</code> or <code>/var/run/cdi</code></li><li>the device name you enter in Memoh matches a real CDI device on the host</li></ul><p>To discover the exact CDI device names exposed by the host, use the vendor tool on the host machine:</p><ul><li>NVIDIA: <code>nvidia-ctk cdi list</code></li><li>AMD: <code>amd-ctk cdi list</code></li></ul><p>If Memoh reports an error such as <code>unresolvable CDI devices</code>, the configured device name does not match any CDI device visible to the container runtime.</p><h3 id="important-behavior" tabindex="-1">Important Behavior <a class="header-anchor" href="#important-behavior" aria-label="Permalink to &quot;Important Behavior&quot;"></a></h3><ul><li>CDI device settings are applied when the container is created. Updating the setting later requires recreating the container.</li><li>Stopping and starting an existing container does not change its attached CDI devices.</li><li>The container image still needs the appropriate user-space libraries and tools if you want to run CUDA or ROCm software inside the container.</li><li>After creation, the <strong>Container</strong> tab shows the effective attached CDI devices for verification.</li></ul><hr><h2 id="snapshots" tabindex="-1">Snapshots <a class="header-anchor" href="#snapshots" aria-label="Permalink to &quot;Snapshots&quot;"></a></h2><p>Snapshots allow you to capture the current state of the bot&#39;s container and restore it later. This is useful for:</p><ul><li>Saving a known good configuration</li><li>Versioning the bot&#39;s environment</li><li>Testing complex changes safely</li></ul><h3 id="creating-a-snapshot" tabindex="-1">Creating a Snapshot <a class="header-anchor" href="#creating-a-snapshot" aria-label="Permalink to &quot;Creating a Snapshot&quot;"></a></h3><ol><li>Ensure the container is stopped or in a stable state.</li><li>Click <strong>Create Snapshot</strong>.</li><li>Provide a name for the snapshot.</li></ol><h3 id="restoring-a-snapshot" tabindex="-1">Restoring a Snapshot <a class="header-anchor" href="#restoring-a-snapshot" aria-label="Permalink to &quot;Restoring a Snapshot&quot;"></a></h3><ul><li>Find the desired snapshot in the list and click <strong>Restore</strong>. This will reset the container to the captured state.</li></ul><h3 id="managing-snapshots" tabindex="-1">Managing Snapshots <a class="header-anchor" href="#managing-snapshots" aria-label="Permalink to &quot;Managing Snapshots&quot;"></a></h3><ul><li>View a list of existing snapshots with their creation timestamps and parent relationships.</li><li>Use the <strong>Delete</strong> button next to a snapshot to remove it.</li></ul><hr><h2 id="data-export-and-import" tabindex="-1">Data Export and Import <a class="header-anchor" href="#data-export-and-import" aria-label="Permalink to &quot;Data Export and Import&quot;"></a></h2><p>The Container tab supports exporting and importing container data for backup, migration, or sharing purposes.</p><h3 id="export" tabindex="-1">Export <a class="header-anchor" href="#export" aria-label="Permalink to &quot;Export&quot;"></a></h3><ol><li>Click <strong>Export Data</strong>.</li><li>The container&#39;s filesystem data is packaged into a downloadable archive.</li><li>Save the archive to your local machine.</li></ol><h3 id="import" tabindex="-1">Import <a class="header-anchor" href="#import" aria-label="Permalink to &quot;Import&quot;"></a></h3><ol><li>Click <strong>Import Data</strong>.</li><li>Select an archive file from your local machine.</li><li>The archive contents are extracted into the container&#39;s filesystem.</li></ol><h3 id="restore" tabindex="-1">Restore <a class="header-anchor" href="#restore" aria-label="Permalink to &quot;Restore&quot;"></a></h3><p>The <strong>Restore</strong> operation resets the container&#39;s data directory to a clean state. This is useful when the filesystem has become corrupted or you want to start fresh without recreating the container.</p><hr><h2 id="container-versioning" tabindex="-1">Container Versioning <a class="header-anchor" href="#container-versioning" aria-label="Permalink to &quot;Container Versioning&quot;"></a></h2><p>Memoh tracks container versions to manage the lifecycle of the bot&#39;s runtime environment. Version information includes:</p><ul><li><strong>Current Version</strong>: The active container version.</li><li><strong>Version History</strong>: A log of container version changes over time.</li></ul><p>This helps with auditing and understanding when container configurations were updated.</p>',54)])])}const g=t(n,[["render",r]]);export{u as __pageData,g as default};