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",
|
Use: "compose",
|
||||||
Aliases: []string{"const", "constellation", "manifest"},
|
Aliases: []string{"const", "constellation", "manifest"},
|
||||||
Short: "Manage Constellations (multi-service stacks)",
|
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
|
A Constellation defines containers, VMs, services, networks, and volumes
|
||||||
in a single YAML file and deploys them together.
|
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
|
This file handles CLI flag parsing and output formatting. All container
|
||||||
runtime operations are delegated to the backend interface.
|
runtime operations are delegated to the backend interface.
|
||||||
@@ -67,10 +67,10 @@ func getSystemdBackend() *systemdbackend.Backend {
|
|||||||
|
|
||||||
var containerCmd = &cobra.Command{
|
var containerCmd = &cobra.Command{
|
||||||
Use: "container",
|
Use: "container",
|
||||||
Short: "Manage containers (Voltainer)",
|
Short: "Manage Volt containers",
|
||||||
Long: `Manage Voltainer containers built on systemd-nspawn.
|
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.
|
cgroups v2, and systemd service management. Not Docker. Not a wrapper.
|
||||||
A ground-up container engine for production Linux workloads.`,
|
A ground-up container engine for production Linux workloads.`,
|
||||||
Aliases: []string{"con"},
|
Aliases: []string{"con"},
|
||||||
@@ -86,7 +86,7 @@ A ground-up container engine for production Linux workloads.`,
|
|||||||
var containerCreateCmd = &cobra.Command{
|
var containerCreateCmd = &cobra.Command{
|
||||||
Use: "create",
|
Use: "create",
|
||||||
Short: "Create a container from an image",
|
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
|
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 web --image ubuntu:24.04 --start
|
||||||
volt container create --name db --image debian:bookworm --memory 2G --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.
|
Long: `Manage Kubernetes clusters and Volt-managed worker nodes.
|
||||||
|
|
||||||
Create lightweight VMs as K8s worker nodes with minimal overhead.
|
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
|
Example: ` volt cluster status
|
||||||
volt cluster node list
|
volt cluster node list
|
||||||
volt cluster node add --count 10 --memory 512M
|
volt cluster node add --count 10 --memory 512M
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ var rootCmd = &cobra.Command{
|
|||||||
Long: `Volt — Unified Linux Platform Management
|
Long: `Volt — Unified Linux Platform Management
|
||||||
|
|
||||||
One tool for containers, VMs, services, networking, and more.
|
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.`,
|
No Docker. No fragmented toolchains. Just volt.`,
|
||||||
Version: Version,
|
Version: Version,
|
||||||
|
|||||||
@@ -202,19 +202,74 @@ If no command is given, opens an interactive bash shell.`,
|
|||||||
|
|
||||||
// ── volt run ──────────────────────────────────────────────────────────────────
|
// ── volt run ──────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
var (
|
||||||
|
runName string
|
||||||
|
runPorts []string
|
||||||
|
runVolumes []string
|
||||||
|
runEnvVars []string
|
||||||
|
runMemory string
|
||||||
|
runCPUs string
|
||||||
|
runDetach bool
|
||||||
|
)
|
||||||
|
|
||||||
var runCmd = &cobra.Command{
|
var runCmd = &cobra.Command{
|
||||||
Use: "run <image>",
|
Use: "run [flags] <image> [command...]",
|
||||||
Short: "Quick-start a container",
|
Short: "Quick-start a container",
|
||||||
Long: `Create and start a container from an image in one step.
|
Long: `Create and start a container from an image in one step.
|
||||||
Shortcut for: volt container create --image <image> --start`,
|
Shortcut for: volt container create --image <image> --start
|
||||||
Example: ` volt run armoredgate/nginx:1.25
|
|
||||||
volt run armoredgate/ubuntu:24.04`,
|
Supports naming the container, port mappings, volume mounts,
|
||||||
Args: cobra.ExactArgs(1),
|
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 {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
image := args[0]
|
image := args[0]
|
||||||
fmt.Printf("Quick-starting container from image: %s\n", image)
|
cmdArgs := args[1:]
|
||||||
fmt.Printf("Shortcut not yet wired — use: volt container create --image %s --start\n", image)
|
|
||||||
return nil
|
// 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() {
|
func init() {
|
||||||
rootCmd.AddCommand(getCmd, describeCmd, deleteCmd, sshCmd, execShortcutCmd, runCmd, statusCmd, connectCmd, versionCmd)
|
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.
|
Volt Workload Commands — Unified workload abstraction for scale-to-zero.
|
||||||
|
|
||||||
Provides a single command surface (volt workload ...) that works identically
|
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
|
(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.
|
all consume this abstraction.
|
||||||
|
|
||||||
Backend dispatch:
|
Backend dispatch:
|
||||||
@@ -52,8 +52,8 @@ var (
|
|||||||
var workloadCmd = &cobra.Command{
|
var workloadCmd = &cobra.Command{
|
||||||
Use: "workload",
|
Use: "workload",
|
||||||
Short: "Unified workload management (containers + hybrid-native + VMs)",
|
Short: "Unified workload management (containers + hybrid-native + VMs)",
|
||||||
Long: `Manage workloads across Voltainer containers, hybrid-native processes,
|
Long: `Manage workloads across Volt containers, hybrid-native processes,
|
||||||
and VoltVisor VMs.
|
and Volt VMs.
|
||||||
|
|
||||||
The workload abstraction layer provides a single interface for lifecycle
|
The workload abstraction layer provides a single interface for lifecycle
|
||||||
operations regardless of backend type and execution mode. Each command
|
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.
|
delegates to the appropriate backend.
|
||||||
|
|
||||||
Modes:
|
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-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
|
hybrid-emulated QEMU user-mode emulation — cross-arch workloads
|
||||||
|
|
||||||
Used by the Volt Edge wake proxy and Sleep Controller for scale-to-zero
|
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.
|
Long: `Create a new workload with a specified execution mode.
|
||||||
|
|
||||||
Modes:
|
Modes:
|
||||||
container Standard Voltainer container (systemd-nspawn)
|
container Standard Volt container (systemd-nspawn)
|
||||||
hybrid-native Direct process execution with Landlock + cgroups v2
|
hybrid-native Direct process execution with Landlock + cgroups v2
|
||||||
hybrid-kvm KVM micro-VM (requires kernel path in manifest)
|
hybrid-kvm KVM micro-VM (requires kernel path in manifest)
|
||||||
hybrid-emulated QEMU user-mode emulation
|
hybrid-emulated QEMU user-mode emulation
|
||||||
@@ -217,7 +217,7 @@ func workloadCreateRun(cmd *cobra.Command, args []string) error {
|
|||||||
// Provision the backend
|
// Provision the backend
|
||||||
switch mode {
|
switch mode {
|
||||||
case WorkloadModeContainer:
|
case WorkloadModeContainer:
|
||||||
fmt.Printf(" Backend: Voltainer (systemd-nspawn)\n")
|
fmt.Printf(" Backend: Volt (systemd-nspawn)\n")
|
||||||
if err := ensureContainerBackend(name); err != nil {
|
if err := ensureContainerBackend(name); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -227,12 +227,12 @@ func workloadCreateRun(cmd *cobra.Command, args []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case WorkloadModeHybridKVM:
|
case WorkloadModeHybridKVM:
|
||||||
fmt.Printf(" Backend: VoltVisor (KVM)\n")
|
fmt.Printf(" Backend: Volt (KVM)\n")
|
||||||
if err := ensureHybridKVMBackend(w); err != nil {
|
if err := ensureHybridKVMBackend(w); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case WorkloadModeHybridEmulated:
|
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"))
|
fmt.Println(Yellow(" Note: hybrid-emulated backend is experimental"))
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unsupported mode: %s", mode)
|
return fmt.Errorf("unsupported mode: %s", mode)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ const (
|
|||||||
type WorkloadMode string
|
type WorkloadMode string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// WorkloadModeContainer uses Voltainer (systemd-nspawn) for isolation.
|
// WorkloadModeContainer uses Volt (systemd-nspawn) for isolation.
|
||||||
WorkloadModeContainer WorkloadMode = "container"
|
WorkloadModeContainer WorkloadMode = "container"
|
||||||
// WorkloadModeHybridNative uses the hybrid backend: direct process execution
|
// WorkloadModeHybridNative uses the hybrid backend: direct process execution
|
||||||
// with Landlock LSM, seccomp-bpf, and cgroups v2 isolation — no namespace overhead.
|
// 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 {
|
func (w *WorkloadEntry) BackendLabel() string {
|
||||||
switch w.EffectiveMode() {
|
switch w.EffectiveMode() {
|
||||||
case WorkloadModeContainer:
|
case WorkloadModeContainer:
|
||||||
return "Voltainer (systemd-nspawn)"
|
return "Volt (systemd-nspawn)"
|
||||||
case WorkloadModeHybridNative:
|
case WorkloadModeHybridNative:
|
||||||
return "Hybrid (Landlock + cgroups v2)"
|
return "Hybrid (Landlock + cgroups v2)"
|
||||||
case WorkloadModeHybridKVM:
|
case WorkloadModeHybridKVM:
|
||||||
return "VoltVisor (KVM)"
|
return "Volt (KVM)"
|
||||||
case WorkloadModeHybridEmulated:
|
case WorkloadModeHybridEmulated:
|
||||||
return "VoltVisor (QEMU user-mode)"
|
return "Volt (QEMU user-mode)"
|
||||||
default:
|
default:
|
||||||
return "unknown"
|
return "unknown"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Volt Platform - Virtual Machine Runtime
|
Volt Platform - Virtual Machine Runtime
|
||||||
Extending Voltainer into comprehensive virtualization
|
Unified Linux platform management
|
||||||
|
|
||||||
Copyright 2026 ArmoredGate LLC
|
Copyright 2026 ArmoredGate LLC
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user