Phase 2: Volume Wizard, GPU & device passthrough (0.2.0)
Backend: - gpu_service: detect NVIDIA (nvidia-smi) + AMD/Intel (/dev/dri, sysfs); inject helpers (nvidia deploy.reservations, /dev/dri + groups + LIBVA) - volume_service: list/orphaned/prune volumes; NFS/SMB/named/bind/tmpfs YAML generation (generate-yaml) - device_service: USB/TTY/DRI detection + sandboxed host path browser - compose_edit_service: server-side merge of volume/gpu/device fragments - routers: volumes (+host paths), editor (services/add-volume/set-gpu/ add-device/remove-device/set-privileged), system gpus+devices - compose: bind-mount /dev:ro for detection Frontend: - split-pane StackEditor with helper panel (service picker + tabs) - VolumeWizard (bind/named/nfs/smb/tmpfs) + HostPathBrowser - GPUSelector, DevicePanel; api clients for volumes/editor/system Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
7775128c07
commit
b553c1b861
@@ -0,0 +1,33 @@
|
||||
import api from "./client";
|
||||
|
||||
export const editorApi = {
|
||||
services: (yaml: string) =>
|
||||
api
|
||||
.post<{ services: string[] }>("/api/editor/services", { yaml })
|
||||
.then((r) => r.data.services),
|
||||
addVolume: (yaml: string, service: string, spec: Record<string, unknown>) =>
|
||||
api
|
||||
.post<{ yaml: string }>("/api/editor/add-volume", { yaml, service, spec })
|
||||
.then((r) => r.data.yaml),
|
||||
setGpu: (yaml: string, service: string, config: Record<string, unknown>) =>
|
||||
api
|
||||
.post<{ yaml: string }>("/api/editor/set-gpu", { yaml, service, config })
|
||||
.then((r) => r.data.yaml),
|
||||
addDevice: (yaml: string, service: string, host_path: string, target?: string) =>
|
||||
api
|
||||
.post<{ yaml: string }>("/api/editor/add-device", {
|
||||
yaml,
|
||||
service,
|
||||
host_path,
|
||||
target,
|
||||
})
|
||||
.then((r) => r.data.yaml),
|
||||
setPrivileged: (yaml: string, service: string, value: boolean) =>
|
||||
api
|
||||
.post<{ yaml: string }>("/api/editor/set-privileged", {
|
||||
yaml,
|
||||
service,
|
||||
value,
|
||||
})
|
||||
.then((r) => r.data.yaml),
|
||||
};
|
||||
@@ -1,8 +1,10 @@
|
||||
import api from "./client";
|
||||
import type { AuditEntry, SystemInfo } from "@/types";
|
||||
import type { AuditEntry, DeviceList, GPUInfo, SystemInfo } from "@/types";
|
||||
|
||||
export const systemApi = {
|
||||
info: () => api.get<SystemInfo>("/api/system/info").then((r) => r.data),
|
||||
audit: (limit = 10) =>
|
||||
api.get<AuditEntry[]>(`/api/audit?limit=${limit}`).then((r) => r.data),
|
||||
gpus: () => api.get<GPUInfo[]>("/api/system/gpus").then((r) => r.data),
|
||||
devices: () => api.get<DeviceList>("/api/system/devices").then((r) => r.data),
|
||||
};
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import api from "./client";
|
||||
import type { HostPathResult, VolumeInfo } from "@/types";
|
||||
|
||||
export const volumesApi = {
|
||||
list: () => api.get<VolumeInfo[]>("/api/volumes").then((r) => r.data),
|
||||
orphaned: () =>
|
||||
api.get<VolumeInfo[]>("/api/volumes/orphaned").then((r) => r.data),
|
||||
remove: (name: string, force = false) =>
|
||||
api.delete(`/api/volumes/${name}?force=${force}`).then((r) => r.data),
|
||||
prune: () => api.post("/api/volumes/prune").then((r) => r.data),
|
||||
generateYaml: (spec: Record<string, unknown>) =>
|
||||
api
|
||||
.post<{ yaml: string }>("/api/volumes/generate-yaml", spec)
|
||||
.then((r) => r.data.yaml),
|
||||
hostPaths: (path: string, showHidden = false) =>
|
||||
api
|
||||
.get<HostPathResult>(
|
||||
`/api/host/paths?path=${encodeURIComponent(path)}&show_hidden=${showHidden}`
|
||||
)
|
||||
.then((r) => r.data),
|
||||
};
|
||||
Reference in New Issue
Block a user