runner

package
v0.1.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArchitectureAMD64 = meta.ArchitectureAMD64
	ArchitectureARM64 = meta.ArchitectureARM64
)

Variables

This section is empty.

Functions

func NewServer

func NewServer(cfg Config, vm *VMManager, state *RuntimeState) (*http.Server, error)

func Run

func Run(ctx context.Context, cfg Config) error

Types

type BootConfig

type BootConfig struct {
	Target  BootTarget
	Enabled BootEnabled
}

type BootEnabled

type BootEnabled string
const (
	BootContinuous BootEnabled = "Continuous"
	BootDisabled   BootEnabled = "Disabled"
)

type BootTarget

type BootTarget string
const (
	BootTargetPxe BootTarget = "Pxe"
	BootTargetHdd BootTarget = "Hdd"
)

type Commander

type Commander interface {
	Run(ctx context.Context, name string, args ...string) error
	Start(ctx context.Context, name string, args []string, stdoutPath, stderrPath string) (Process, error)
}

type Config

type Config struct {
	ListenAddr       string
	PublicRedfishURL string
	DataDir          string
	PodName          string
	PodNamespace     string
	Architecture     string
	KubernetesClient client.Client
	ConfigureNetwork bool
	WireGuard        WireGuardConfig
	VXLAN            VXLANConfig
	BridgeName       string
	TapName          string
	Guest            GuestConfig
	Redfish          RedfishConfig
	QEMU             QEMUConfig
}

Config contains all settings for one standalone playpen runner pod.

func DefaultConfig

func DefaultConfig() Config

func (*Config) ApplyArchitectureDefaults

func (c *Config) ApplyArchitectureDefaults() error

type GuestConfig

type GuestConfig struct {
	MAC        string
	IPv4       string
	SubnetMask string
	Gateway    string
	DNS        []string
}

type NetworkManager

type NetworkManager struct {
	// contains filtered or unexported fields
}

func NewNetworkManager

func NewNetworkManager(cmd Commander, cfg Config) *NetworkManager

func (*NetworkManager) ConfigurePeer

func (m *NetworkManager) ConfigurePeer(ctx context.Context, clientPublicKey string) error

func (*NetworkManager) Setup

func (m *NetworkManager) Setup(ctx context.Context) error

func (*NetworkManager) Teardown

func (m *NetworkManager) Teardown(ctx context.Context) error

type OSCommander

type OSCommander struct{}

func (OSCommander) Run

func (OSCommander) Run(ctx context.Context, name string, args ...string) error

func (OSCommander) Start

func (OSCommander) Start(ctx context.Context, name string, args []string, stdoutPath, stderrPath string) (Process, error)

type PowerState

type PowerState string
const (
	PowerOn  PowerState = "On"
	PowerOff PowerState = "Off"
)

type Process

type Process interface {
	PID() int
	Exited() bool
	Signal(sig os.Signal) error
	Kill() error
	Wait() error
}

type QEMUConfig

type QEMUConfig struct {
	Binary           string
	ImgBinary        string
	SWTPMBinary      string
	EnableTPM        bool
	Machine          string
	CPU              string
	NICDevice        string
	SerialDevice     string
	TPMDevice        string
	OVMFCodeFile     string
	OVMFVarsTemplate string
	DiskSize         string
	MemoryMiB        int
	CPUs             int
}

type RedfishConfig

type RedfishConfig struct {
	Username string
	Password string
	DeviceID string
}

type RedfishHandler

type RedfishHandler struct {
	// contains filtered or unexported fields
}

func NewRedfishHandler

func NewRedfishHandler(vm *VMManager, cfg RedfishConfig, dataDir string) *RedfishHandler

func (*RedfishHandler) ServeHTTP

func (h *RedfishHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ResetType

type ResetType string
const (
	ResetForceOff ResetType = "ForceOff"
	ResetOn       ResetType = "On"
)

type RuntimeState

type RuntimeState struct {
	// contains filtered or unexported fields
}

func NewRuntimeState

func NewRuntimeState(serverWireGuardPublicKey string, ready bool) *RuntimeState

func (*RuntimeState) Ready

func (s *RuntimeState) Ready() bool

func (*RuntimeState) ServerWireGuardPublicKey

func (s *RuntimeState) ServerWireGuardPublicKey() string

func (*RuntimeState) SetReady

func (s *RuntimeState) SetReady()

type VMManager

type VMManager struct {
	// contains filtered or unexported fields
}

func NewVMManager

func NewVMManager(cmd Commander, cfg Config) *VMManager

func (*VMManager) BootConfig

func (m *VMManager) BootConfig() BootConfig

func (*VMManager) PowerState

func (m *VMManager) PowerState() PowerState

func (*VMManager) Reset

func (m *VMManager) Reset(ctx context.Context, reset ResetType) error

func (*VMManager) SetBootConfig

func (m *VMManager) SetBootConfig(config BootConfig)

func (*VMManager) Start

func (m *VMManager) Start(ctx context.Context) error

func (*VMManager) Stop

func (m *VMManager) Stop() error

type VXLANConfig

type VXLANConfig struct {
	Interface string
	VNI       int
	Port      int
}

type WireGuardConfig

type WireGuardConfig struct {
	PrivateKeyFile  string
	ClientPublicKey string
	Interface       string
	ServerAddress   string
	ClientAddress   string
	ListenPort      int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL