remotebuild

package
v0.174.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package remotebuild runs read-only build commands in reusable, worktree-owned builder Jobs. Cluster names, images and credentials belong to desk configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Job

func Job(c Config, name, image string) *batchv1.Job

Job gives each worktree/toolchain a warm workspace without cluster credentials. Exiting the watchdog lets the TTL controller delete both Job and pod.

func Toolchain

func Toolchain(argv []string) string

Toolchain admits only one literal build invocation. Shell operators, assignments, expansions, formatters and arbitrary scripts remain local. Builds and tests may write their pod's copy; callers needing those writes in the local worktree must select --local.

Types

type Command

type Command func(context.Context, io.Reader, io.Writer, ...string) error

Command is the kubectl transport. Tests replace it without a live cluster.

type Config

type Config struct {
	Enabled          bool              `yaml:"enabled"`
	Kubeconfig       string            `yaml:"kubeconfig"`
	Context          string            `yaml:"context"`
	Namespace        string            `yaml:"namespace"`
	Images           map[string]string `yaml:"images"`
	CPU              string            `yaml:"cpu"`
	Memory           string            `yaml:"memory"`
	MaxPods          int               `yaml:"maxPods"`
	PlacementTimeout time.Duration     `yaml:"placementTimeout"`
	IdleTimeout      time.Duration     `yaml:"idleTimeout"`
}

Config is opt-in; no Kubernetes call is made while Enabled is false.

func (Config) Defaults

func (c Config) Defaults() Config

Defaults returns operational defaults without choosing a cluster or image.

func (Config) Validate

func (c Config) Validate() error

type Record added in v0.174.0

type Record func(verb, detail string)

Record appends one of the run's events (runrecord.Start, End, Fallback) to the event log; nil records nothing. Like guard.Options.Record, it must not fail or block the run.

type Runner

type Runner struct {
	Config         Config
	StateDir       string
	Stdout, Stderr io.Writer
	Command        Command
	// Record writes the run's events; nil records nothing.
	Record Record
	// Name is the command the run's records name (guard.CommandHead of the
	// caller's argv); Repo and Head what it builds.
	Name, Repo, Head string
	// Tail keeps the remote run's streamed output for the failure record,
	// exactly as the local scope's stream does; nil keeps nothing.
	Tail io.Writer
	// KeepFailure keeps the failed run's tail in the run record and
	// prints it, named by the run's id, and answers the path it kept
	// ("" when nothing was): the end record names it, as the local run's
	// does. It is the caller's: the tail's size, masking and directory
	// belong to `beekeeper run`, not to the transport.
	KeepFailure func(runID string, exit int) string
}

func (Runner) Try

func (r Runner) Try(ctx context.Context, argv []string) (handled bool, code int)

Try returns handled=false only before any command could have started remotely. Every such failure emits one line and leaves the ordinary local slot unchanged.

Jump to

Keyboard shortcuts

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