remotebuild

package
v0.173.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 26 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 Runner

type Runner struct {
	Config         Config
	StateDir       string
	Stdout, Stderr io.Writer
	Command        Command
}

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