Skip to main content
Version: 0.1.0-alpha.1

Runtime Selection Flowchart

This diagram documents the decision tree for selecting which runtime executes a command. Understanding this helps users choose the right runtime for their use case.

Decision Flowchart

Diagram: architecture/runtime-decision

Platform Selection Details

Diagram: architecture/runtime-platform

Platform Values

Platform ValueMatches On
"linux"Linux systems
"macos"macOS systems
"windows"Windows systems

Example Command Definition

cmds: {
build: {
default: {
runtime: "native"
script: "make build"
}
implementations: [
{
platforms: ["windows"]
runtime: "native"
script: "nmake build"
},
{
platforms: ["linux"]
runtime: "container"
container: {
image: "golang:1.21"
}
script: "make build"
}
]
}
}

Runtime Comparison

AspectNativeVirtualContainer
SpeedFastestFastSlower (overhead)
IsolationNoneProcessFull
PortabilityPlatform-dependentHighHighest
Shell featuresFull host shellPOSIX subsetFull (in container)
DependenciesHost shellNoneDocker/Podman
Best forSimple scriptsCross-platformComplex environments

Runtime Availability Checks

Native Runtime

Diagram: architecture/runtime-native-check

Virtual Runtime

Diagram: architecture/runtime-virtual-check

The virtual runtime is always available because it's embedded in the Invowk binary.

Container Runtime

Diagram: architecture/runtime-container-check

Container Provisioning Details

When the container runtime is selected, Invowk creates an ephemeral image layer:

Diagram: architecture/runtime-provision

Why Ephemeral Layers?

  1. No image pollution: Base images stay clean
  2. Fast iteration: No full rebuild needed
  3. Portable: Commands work with any compatible base image
  4. Secure: Invowk binary is injected, not installed in image

SSH Server for Callbacks

When enable_host_ssh: true is set, Invowk starts a temporary SSH server:

Diagram: architecture/runtime-ssh

Use cases:

  • Accessing host secrets
  • Running host-only commands
  • File synchronization

Decision Guidelines

Use CaseRecommended RuntimeWhy
Quick scriptsnativeFastest, no overhead
Cross-platform commandsvirtualWorks everywhere
CI/CD pipelinescontainerReproducible
Commands needing specific toolscontainerIsolated dependencies
Interactive TUInative or virtualBetter terminal support