ctrbuild

package
v0.17.3 Latest Latest
Warning

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

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

Documentation

Overview

Package ctrbuild runs the lbd builder image on containerd.

It is separate from pkg/lbdmod so that package can stay free of container runtime dependencies: components/diskio and controllers/disk import lbdmod only to ask whether lbd is usable, and should not pull containerd in behind that question.

Index

Constants

View Source
const DefaultNamespace = "miren"

DefaultNamespace is the containerd namespace miren's own containers live in.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder runs a build container on containerd.

Nothing in components/ does this: every component there is a supervised daemon with a restart policy. A build is the opposite -- it runs to completion, its exit code is the answer, and it must leave nothing behind.

func New

func New(cc *containerd.Client, log *slog.Logger, opts ...Option) *Builder

New returns a Builder that runs containers on cc.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, spec lbdmod.BuildSpec) error

Build pulls the image, runs the container to completion, and tears everything down. It returns an error unless the container exited zero.

type ClusterRegistry

type ClusterRegistry struct {
	// Resolver maps cluster.local to an address. On a runner that is the
	// coordinator's IP; on the coordinator it is the local router.
	Resolver netresolve.Resolver

	// Issuer mints the registry token. A distributed runner holds a remote
	// issuer that proxies to the coordinator, since it has no signing key of
	// its own.
	Issuer workloadidentity.TokenIssuer
}

ClusterRegistry resolves images from the cluster-local registry, which is where the toolchain image lives. Without it a node can only reach public registries, and the builder image is deliberately not published to one.

This is the same path app image pulls already take on a runner: the address comes from an in-process host map rather than DNS, the hop is plain HTTP on the cluster's own network, and the bearer token is minted by the coordinator on a distributed runner's behalf.

type Option

type Option func(*Builder)

Option configures a Builder.

func WithClusterRegistry

func WithClusterRegistry(r *ClusterRegistry) Option

WithClusterRegistry lets the builder pull from the cluster-local registry, which is where the toolchain image is published.

Jump to

Keyboard shortcuts

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