builder

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package builder runs source-to-image builds in the ah-builder systemd unit.

Index

Constants

View Source
const (
	DefaultBuildDir = "/var/lib/ah-builds"
	BrokerSocket    = "/run/ah-build-broker/broker.sock"
)

Variables

This section is empty.

Functions

func RunBroker

func RunBroker(ctx context.Context, socketPath string) error

RunBroker serves fixed start/stop/status operations for ah-build@ units.

func RunWorker

func RunWorker(workDir, nixpacksPath, buildID string) error

RunWorker executes one manifest. It is only called by ah-build@.service, which runs as ah-builder inside a bounded cgroup with no daemon secrets.

Types

type BuildRequest

type BuildRequest struct {
	BuildID    string `json:"build_id"`
	ServiceID  string `json:"service_id"`
	TenantID   string `json:"tenant_id"`
	SourceType string `json:"source_type"`
	SourceURL  string `json:"source_url"`
	SourceRef  string `json:"source_ref"`
	ImageTag   string `json:"image_tag"`
}

BuildRequest describes a build to execute.

type Builder

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

Builder coordinates builds in the ah-builder systemd service.

func NewBuilder

func NewBuilder(workDir, nixpacksPath string) (*Builder, error)

NewBuilder creates a builder.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, req BuildRequest, logCb func(string)) error

Build asks the narrow systemd broker to start a fixed ah-build@ unit, then streams its secret-free log file until the worker exits or the request is cancelled.

func (*Builder) CancelBuild

func (b *Builder) CancelBuild(buildID string) error

CancelBuild stops only the fixed unit associated with a generated build ID.

Jump to

Keyboard shortcuts

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