Fix CLI branding (Voltainer→Volt) and add --name flag to run shortcut
This commit is contained in:
@@ -22,7 +22,7 @@ var composeCmd = &cobra.Command{
|
||||
Use: "compose",
|
||||
Aliases: []string{"const", "constellation", "manifest"},
|
||||
Short: "Manage Constellations (multi-service stacks)",
|
||||
Long: `Manage Constellations — declarative multi-service stacks using Voltfiles.
|
||||
Long: `Manage Constellations — declarative multi-service stacks using Volt compose files.
|
||||
|
||||
A Constellation defines containers, VMs, services, networks, and volumes
|
||||
in a single YAML file and deploys them together.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Volt Container Commands - Voltainer (systemd-nspawn) container management.
|
||||
Volt Container Commands - systemd-nspawn container management.
|
||||
|
||||
This file handles CLI flag parsing and output formatting. All container
|
||||
runtime operations are delegated to the backend interface.
|
||||
@@ -67,10 +67,10 @@ func getSystemdBackend() *systemdbackend.Backend {
|
||||
|
||||
var containerCmd = &cobra.Command{
|
||||
Use: "container",
|
||||
Short: "Manage containers (Voltainer)",
|
||||
Long: `Manage Voltainer containers built on systemd-nspawn.
|
||||
Short: "Manage Volt containers",
|
||||
Long: `Manage Volt containers built on systemd-nspawn.
|
||||
|
||||
Voltainer provides OS-level containerization using Linux namespaces,
|
||||
Volt provides OS-level containerization using Linux namespaces,
|
||||
cgroups v2, and systemd service management. Not Docker. Not a wrapper.
|
||||
A ground-up container engine for production Linux workloads.`,
|
||||
Aliases: []string{"con"},
|
||||
@@ -86,7 +86,7 @@ A ground-up container engine for production Linux workloads.`,
|
||||
var containerCreateCmd = &cobra.Command{
|
||||
Use: "create",
|
||||
Short: "Create a container from an image",
|
||||
Long: `Create a new Voltainer container from a specified image.`,
|
||||
Long: `Create a new Volt container from a specified image.`,
|
||||
Example: ` volt container create --name web --image /var/lib/volt/images/ubuntu_24.04
|
||||
volt container create --name web --image ubuntu:24.04 --start
|
||||
volt container create --name db --image debian:bookworm --memory 2G --start`,
|
||||
|
||||
@@ -36,7 +36,7 @@ var clusterCmd = &cobra.Command{
|
||||
Long: `Manage Kubernetes clusters and Volt-managed worker nodes.
|
||||
|
||||
Create lightweight VMs as K8s worker nodes with minimal overhead.
|
||||
Scale to 1,000+ nodes per host using Voltvisor's efficient isolation.`,
|
||||
Scale to 1,000+ nodes per host using Volt's efficient isolation.`,
|
||||
Example: ` volt cluster status
|
||||
volt cluster node list
|
||||
volt cluster node add --count 10 --memory 512M
|
||||
|
||||
@@ -34,7 +34,7 @@ var rootCmd = &cobra.Command{
|
||||
Long: `Volt — Unified Linux Platform Management
|
||||
|
||||
One tool for containers, VMs, services, networking, and more.
|
||||
Built on Voltainer (systemd-nspawn), Voltvisor (KVM), and Stellarium (CAS).
|
||||
Built on systemd-nspawn (containers), Neutron Stardust (VMs), and Stellarium (CAS).
|
||||
|
||||
No Docker. No fragmented toolchains. Just volt.`,
|
||||
Version: Version,
|
||||
|
||||
@@ -202,19 +202,74 @@ If no command is given, opens an interactive bash shell.`,
|
||||
|
||||
// ── volt run ──────────────────────────────────────────────────────────────────
|
||||
|
||||
var (
|
||||
runName string
|
||||
runPorts []string
|
||||
runVolumes []string
|
||||
runEnvVars []string
|
||||
runMemory string
|
||||
runCPUs string
|
||||
runDetach bool
|
||||
)
|
||||
|
||||
var runCmd = &cobra.Command{
|
||||
Use: "run <image>",
|
||||
Use: "run [flags] <image> [command...]",
|
||||
Short: "Quick-start a container",
|
||||
Long: `Create and start a container from an image in one step.
|
||||
Shortcut for: volt container create --image <image> --start`,
|
||||
Example: ` volt run armoredgate/nginx:1.25
|
||||
volt run armoredgate/ubuntu:24.04`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
Shortcut for: volt container create --image <image> --start
|
||||
|
||||
Supports naming the container, port mappings, volume mounts,
|
||||
environment variables, and resource limits.`,
|
||||
Example: ` volt run alpine
|
||||
volt run --name hello alpine echo "Hello"
|
||||
volt run --name web -p 8080:80 armoredgate/nginx:1.25
|
||||
volt run -d --name db -e POSTGRES_PASSWORD=secret -v pgdata:/var/lib/postgresql armoredgate/postgres:16
|
||||
volt run --memory 512M --cpus 2 armoredgate/ubuntu:24.04`,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
image := args[0]
|
||||
fmt.Printf("Quick-starting container from image: %s\n", image)
|
||||
fmt.Printf("Shortcut not yet wired — use: volt container create --image %s --start\n", image)
|
||||
return nil
|
||||
cmdArgs := args[1:]
|
||||
|
||||
// Use provided name or derive from image
|
||||
name := runName
|
||||
if name == "" {
|
||||
// Generate a name from the image (strip registry/tag)
|
||||
name = image
|
||||
if idx := strings.LastIndex(name, "/"); idx >= 0 {
|
||||
name = name[idx+1:]
|
||||
}
|
||||
if idx := strings.Index(name, ":"); idx >= 0 {
|
||||
name = name[:idx]
|
||||
}
|
||||
}
|
||||
|
||||
// Set the container create flags
|
||||
containerName = name
|
||||
containerImage = image
|
||||
containerStart = true
|
||||
containerVolumes = runVolumes
|
||||
containerEnv = runEnvVars
|
||||
containerMemory = runMemory
|
||||
containerCPU = runCPUs
|
||||
|
||||
if len(runPorts) > 0 {
|
||||
// Store port mappings in env for the backend to handle
|
||||
for _, p := range runPorts {
|
||||
containerEnv = append(containerEnv, "VOLT_PORT_MAP="+p)
|
||||
}
|
||||
}
|
||||
|
||||
if len(cmdArgs) > 0 {
|
||||
containerEnv = append(containerEnv, "VOLT_CMD="+strings.Join(cmdArgs, " "))
|
||||
}
|
||||
|
||||
if runDetach {
|
||||
fmt.Printf("Starting container %s from image %s (detached)\n", name, image)
|
||||
} else {
|
||||
fmt.Printf("Starting container %s from image %s\n", name, image)
|
||||
}
|
||||
|
||||
return containerCreateRun(cmd, args)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -270,4 +325,13 @@ var versionCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(getCmd, describeCmd, deleteCmd, sshCmd, execShortcutCmd, runCmd, statusCmd, connectCmd, versionCmd)
|
||||
|
||||
// Run command flags
|
||||
runCmd.Flags().StringVar(&runName, "name", "", "Container name")
|
||||
runCmd.Flags().StringSliceVarP(&runPorts, "port", "p", nil, "Port mappings (host:container)")
|
||||
runCmd.Flags().StringSliceVarP(&runVolumes, "volume", "v", nil, "Volume mounts (host:container)")
|
||||
runCmd.Flags().StringSliceVarP(&runEnvVars, "env", "e", nil, "Environment variables (KEY=VALUE)")
|
||||
runCmd.Flags().StringVar(&runMemory, "memory", "", "Memory limit (e.g., 512M, 2G)")
|
||||
runCmd.Flags().StringVar(&runCPUs, "cpus", "", "CPU shares/quota")
|
||||
runCmd.Flags().BoolVarP(&runDetach, "detach", "d", false, "Run container in background")
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
Volt Workload Commands — Unified workload abstraction for scale-to-zero.
|
||||
|
||||
Provides a single command surface (volt workload ...) that works identically
|
||||
regardless of whether the underlying workload is a Voltainer container
|
||||
regardless of whether the underlying workload is a Volt container
|
||||
(systemd-nspawn), a hybrid-native process (Landlock + cgroups), or a
|
||||
VoltVisor VM (KVM). The wake proxy, sleep controller, and metering engine
|
||||
Volt VM (KVM). The wake proxy, sleep controller, and metering engine
|
||||
all consume this abstraction.
|
||||
|
||||
Backend dispatch:
|
||||
@@ -52,8 +52,8 @@ var (
|
||||
var workloadCmd = &cobra.Command{
|
||||
Use: "workload",
|
||||
Short: "Unified workload management (containers + hybrid-native + VMs)",
|
||||
Long: `Manage workloads across Voltainer containers, hybrid-native processes,
|
||||
and VoltVisor VMs.
|
||||
Long: `Manage workloads across Volt containers, hybrid-native processes,
|
||||
and Volt VMs.
|
||||
|
||||
The workload abstraction layer provides a single interface for lifecycle
|
||||
operations regardless of backend type and execution mode. Each command
|
||||
@@ -61,9 +61,9 @@ auto-detects whether a workload is a container, hybrid-native, or VM and
|
||||
delegates to the appropriate backend.
|
||||
|
||||
Modes:
|
||||
container Voltainer (systemd-nspawn) — full OS container isolation
|
||||
container Volt (systemd-nspawn) — full OS container isolation
|
||||
hybrid-native Landlock LSM + seccomp-bpf + cgroups v2 — no namespace overhead
|
||||
hybrid-kvm VoltVisor (KVM) micro-VM — hardware-level isolation
|
||||
hybrid-kvm Volt (KVM) micro-VM — hardware-level isolation
|
||||
hybrid-emulated QEMU user-mode emulation — cross-arch workloads
|
||||
|
||||
Used by the Volt Edge wake proxy and Sleep Controller for scale-to-zero
|
||||
@@ -87,7 +87,7 @@ var workloadCreateCmd = &cobra.Command{
|
||||
Long: `Create a new workload with a specified execution mode.
|
||||
|
||||
Modes:
|
||||
container Standard Voltainer container (systemd-nspawn)
|
||||
container Standard Volt container (systemd-nspawn)
|
||||
hybrid-native Direct process execution with Landlock + cgroups v2
|
||||
hybrid-kvm KVM micro-VM (requires kernel path in manifest)
|
||||
hybrid-emulated QEMU user-mode emulation
|
||||
@@ -217,7 +217,7 @@ func workloadCreateRun(cmd *cobra.Command, args []string) error {
|
||||
// Provision the backend
|
||||
switch mode {
|
||||
case WorkloadModeContainer:
|
||||
fmt.Printf(" Backend: Voltainer (systemd-nspawn)\n")
|
||||
fmt.Printf(" Backend: Volt (systemd-nspawn)\n")
|
||||
if err := ensureContainerBackend(name); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -227,12 +227,12 @@ func workloadCreateRun(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
case WorkloadModeHybridKVM:
|
||||
fmt.Printf(" Backend: VoltVisor (KVM)\n")
|
||||
fmt.Printf(" Backend: Volt (KVM)\n")
|
||||
if err := ensureHybridKVMBackend(w); err != nil {
|
||||
return err
|
||||
}
|
||||
case WorkloadModeHybridEmulated:
|
||||
fmt.Printf(" Backend: VoltVisor (QEMU user-mode)\n")
|
||||
fmt.Printf(" Backend: Volt (QEMU user-mode)\n")
|
||||
fmt.Println(Yellow(" Note: hybrid-emulated backend is experimental"))
|
||||
default:
|
||||
return fmt.Errorf("unsupported mode: %s", mode)
|
||||
|
||||
@@ -37,7 +37,7 @@ const (
|
||||
type WorkloadMode string
|
||||
|
||||
const (
|
||||
// WorkloadModeContainer uses Voltainer (systemd-nspawn) for isolation.
|
||||
// WorkloadModeContainer uses Volt (systemd-nspawn) for isolation.
|
||||
WorkloadModeContainer WorkloadMode = "container"
|
||||
// WorkloadModeHybridNative uses the hybrid backend: direct process execution
|
||||
// with Landlock LSM, seccomp-bpf, and cgroups v2 isolation — no namespace overhead.
|
||||
@@ -175,13 +175,13 @@ func (w *WorkloadEntry) ModeLabel() string {
|
||||
func (w *WorkloadEntry) BackendLabel() string {
|
||||
switch w.EffectiveMode() {
|
||||
case WorkloadModeContainer:
|
||||
return "Voltainer (systemd-nspawn)"
|
||||
return "Volt (systemd-nspawn)"
|
||||
case WorkloadModeHybridNative:
|
||||
return "Hybrid (Landlock + cgroups v2)"
|
||||
case WorkloadModeHybridKVM:
|
||||
return "VoltVisor (KVM)"
|
||||
return "Volt (KVM)"
|
||||
case WorkloadModeHybridEmulated:
|
||||
return "VoltVisor (QEMU user-mode)"
|
||||
return "Volt (QEMU user-mode)"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Volt Platform - Virtual Machine Runtime
|
||||
Extending Voltainer into comprehensive virtualization
|
||||
Unified Linux platform management
|
||||
|
||||
Copyright 2026 ArmoredGate LLC
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user