sandboxes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package sandboxes runs cloud sandboxes for podium-server.

A node is a machine of your own. A cloud provider is not one, and nobody should have to run a process to use it: configuring the provider on the Sandboxes screen is the whole of the setup. So for every configured provider the server runs that provider's RUNNER itself — the node machinery (internal/node) driving the provider's API, with the same executor, relay, event buffering, previews and adoption a node has — connected to the server's own node service in memory. To the scheduler it is a node with the provider's labels, which is how the existing placement, capacity and lease logic covers it unchanged; to an operator it is the provider, on the Sandboxes screen, and it never appears among their nodes.

A runner's sandboxes are recorded under the server's state directory, so a restarted server adopts them. A provider removed from the Sandboxes screen stops its runner; one whose pool or cap changes is restarted with the new settings, adopting what was running.

Index

Constants

View Source
const (
	SettingPoolSize  = "pool_size"
	SettingPoolImage = "pool_image"
)

The provider settings that configure its runner rather than the provider itself.

View Source
const ManagedLabel = store.ManagedNodeLabel

ManagedLabel marks a node row that is a provider's runner rather than a machine.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager runs one runner per configured sandbox provider.

func New

func New(o Options) *Manager

New returns a Manager. It runs nothing until Run.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context) error

Run keeps a runner going for every configured provider until ctx ends, then stops them all.

func (*Manager) Running

func (m *Manager) Running() []string

Running is the providers that have a runner right now.

func (*Manager) Wake

func (m *Manager) Wake()

Wake reads the configured providers again now, rather than on the next tick: a provider saved on the Sandboxes screen gets its runner at once.

type Options

type Options struct {
	Store *store.Store
	// NodeService is the server's node service handler, served to runners in memory.
	NodeService http.Handler
	// ServerID names this server; a runner's node row is this server's, for its provider.
	ServerID string
	// Dir is where runners record their sandboxes.
	Dir    string
	Logger *slog.Logger
}

Options configures a Manager.

Jump to

Keyboard shortcuts

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