deploy

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 28 Imported by: 1 module, 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

Index

Constants

View Source
const TartMacOSBridgedInterfaceEnvVar = tartMacOSBridgedInterfaceEnvVar

TartMacOSBridgedInterfaceEnvVar names the host interface Tart VMs are bridged to; unset means Tart's shared NAT network.

Variables

View Source
var TartMacOSNetworkEnvVars = []string{
	tartMacOSDNSServersEnvVar,
	tartMacOSDNSServersForceEnvVar,
	tartMacOSNetworkCheckEnvVar,
	tartMacOSNetworkCheckURLsEnvVar,
	tartMacOSNetworkCheckDNSNamesEnvVar,
	tartMacOSNetworkCheckTimeoutEnvVar,
	tartMacOSBridgedInterfaceEnvVar,
}

TartMacOSNetworkEnvVars lists the Tart guest network variables: guest DNS, the readiness check and the bridged interface. Gateway jobs receive them only through env_passthrough, and the gateway does not redact their values (they hold resolver addresses and URLs, not credentials).

Functions

func ConfigureNamedGuestHostname added in v0.27.0

func ConfigureNamedGuestHostname(vm build.VirtualMachineConfig) error

ConfigureNamedGuestHostname uses the guest agent, so even a cloned guest with an inherited network identity is selected by its provider identity, not its IP. Defaults are deliberately untouched. Tart uses its existing SSH provisioning.

func CreateTargetExists added in v0.7.0

func CreateTargetExists(config alchemy_build.VirtualMachineConfig) (bool, error)

func DestroyTargetExists added in v0.7.0

func DestroyTargetExists(config alchemy_build.VirtualMachineConfig) (bool, error)

func DiscoverInstances added in v0.27.0

func DiscoverInstances(bases []build.VirtualMachineConfig) ([]build.VirtualMachineConfig, error)

DiscoverInstances queries the hypervisor, not the registry. Defaults are supplied by the caller, so old installations need no metadata or migration.

func EnsureTartGuestNetwork added in v0.29.0

func EnsureTartGuestNetwork(projectDir string, vmName string) error

EnsureTartGuestNetwork applies the configured guest DNS servers and checks guest access, system DNS and HTTPS from inside the running Tart VM. It returns a *GuestNetworkError when the guest is reachable by IP but not ready for networked provisioning.

func EnsureTartGuestNetworkWithOptions added in v0.29.0

func EnsureTartGuestNetworkWithOptions(projectDir string, vmName string, options TartGuestNetworkOptions) error

EnsureTartGuestNetworkWithOptions is EnsureTartGuestNetwork with options.

func InspectInstanceID added in v0.27.0

func InspectInstanceID(config alchemy_build.VirtualMachineConfig) (id string, exists bool, err error)

InspectInstanceID returns the hypervisor's identifier of the VM for config, which changes when the VM is destroyed and created again under the same name. It works for stopped VMs. exists is false when no VM exists. UTM uses its bundle UUID; Tart uses the local VM directory identity because clones can share hardware IDs.

func InstanceStorageDirectory added in v0.27.0

func InstanceStorageDirectory(vm build.VirtualMachineConfig) string

InstanceStorageDirectory selects the filesystem used for the new clone.

func LinuxLibvirtDomainName added in v0.14.0

func LinuxLibvirtDomainName(config alchemy_build.VirtualMachineConfig) string

LinuxLibvirtDomainName returns the managed libvirt domain name for a VM config.

func LinuxLibvirtURI added in v0.14.0

func LinuxLibvirtURI() string

LinuxLibvirtURI returns the configured libvirt connection URI.

func RecordInstance added in v0.27.0

func RecordInstance(vm build.VirtualMachineConfig) error

RecordInstance stores metadata only after successful creation. Unknown image provenance is represented by an empty image_version, never an invented version.

func RemoveInstanceRecord added in v0.27.0

func RemoveInstanceRecord(vm build.VirtualMachineConfig) error

func RunDestroy added in v0.7.0

func RunDestroy(config alchemy_build.VirtualMachineConfig) error

func RunHypervVagrantDeployOnWindows added in v0.2.0

func RunHypervVagrantDeployOnWindows(config alchemy_build.VirtualMachineConfig) error

func RunHypervVagrantDestroyOnWindows added in v0.7.0

func RunHypervVagrantDestroyOnWindows(config alchemy_build.VirtualMachineConfig) error

func RunHypervVagrantStartOnWindows added in v0.7.0

func RunHypervVagrantStartOnWindows(config alchemy_build.VirtualMachineConfig) error

func RunHypervVagrantStopOnWindows added in v0.7.0

func RunHypervVagrantStopOnWindows(config alchemy_build.VirtualMachineConfig) error

func RunLinuxQemuDeployOnLinux added in v0.14.0

func RunLinuxQemuDeployOnLinux(config alchemy_build.VirtualMachineConfig) error

func RunLinuxQemuDestroyOnLinux added in v0.14.0

func RunLinuxQemuDestroyOnLinux(config alchemy_build.VirtualMachineConfig) error

func RunLinuxQemuStartOnLinux added in v0.14.0

func RunLinuxQemuStartOnLinux(config alchemy_build.VirtualMachineConfig) error

func RunLinuxQemuStopOnLinux added in v0.14.0

func RunLinuxQemuStopOnLinux(config alchemy_build.VirtualMachineConfig) error

func RunStart added in v0.7.0

func RunStart(config alchemy_build.VirtualMachineConfig) error

func RunStop added in v0.7.0

func RunTartDeployOnMacOS added in v0.6.0

func RunTartDeployOnMacOS(config alchemy_build.VirtualMachineConfig) error

func RunTartDestroyOnMacOS added in v0.7.0

func RunTartDestroyOnMacOS(config alchemy_build.VirtualMachineConfig) error

func RunTartStartOnMacOS added in v0.7.0

func RunTartStartOnMacOS(config alchemy_build.VirtualMachineConfig) error

func RunTartStopOnMacOS added in v0.7.0

func RunTartStopOnMacOS(config alchemy_build.VirtualMachineConfig) error

func RunUtmDeployOnMacOS

func RunUtmDeployOnMacOS(config alchemy_build.VirtualMachineConfig) error

func RunUtmDestroyOnMacOS added in v0.7.0

func RunUtmDestroyOnMacOS(config alchemy_build.VirtualMachineConfig) error

func RunUtmStartOnMacOS added in v0.7.0

func RunUtmStartOnMacOS(config alchemy_build.VirtualMachineConfig) error

func RunUtmStopOnMacOS added in v0.7.0

func RunUtmStopOnMacOS(config alchemy_build.VirtualMachineConfig) error

func SupportsCreate added in v0.14.0

func SupportsCreate(config alchemy_build.VirtualMachineConfig) bool

func SupportsDestroy added in v0.7.0

func SupportsDestroy(config alchemy_build.VirtualMachineConfig) bool

func SupportsStart added in v0.7.0

func SupportsStart(config alchemy_build.VirtualMachineConfig) bool

func SupportsStop added in v0.7.0

func SupportsStop(config alchemy_build.VirtualMachineConfig) bool

func ValidateTartGuestNetworkConfig added in v0.29.0

func ValidateTartGuestNetworkConfig() error

ValidateTartGuestNetworkConfig reports invalid Tart guest network settings before any VM work starts.

Types

type GuestNetworkCheckMode added in v0.29.0

type GuestNetworkCheckMode string

GuestNetworkCheckMode selects how much of the guest network is verified after a VM start.

const (
	// GuestNetworkCheckFull verifies guest access, system DNS and HTTPS.
	GuestNetworkCheckFull GuestNetworkCheckMode = "full"
	// GuestNetworkCheckOffline verifies guest access only and reports that
	// internet access was not verified.
	GuestNetworkCheckOffline GuestNetworkCheckMode = "offline"
	// GuestNetworkCheckOff disables the readiness check.
	GuestNetworkCheckOff GuestNetworkCheckMode = "off"
)

type GuestNetworkError added in v0.29.0

type GuestNetworkError struct {
	Report GuestNetworkReport
}

GuestNetworkError is returned when a guest fails its readiness check.

func (*GuestNetworkError) Error added in v0.29.0

func (e *GuestNetworkError) Error() string

type GuestNetworkReport added in v0.29.0

type GuestNetworkReport struct {
	Guest  string
	Status GuestNetworkStatus
	// Stage is the failed stage; empty unless Status is failed.
	Stage GuestNetworkStage
	// Detail is the last probe error of the failed stage.
	Detail string
	// Hint is a concrete next step for the failed stage.
	Hint string
	// Resolvers lists the guest's system resolvers with a direct probe
	// result, collected when system DNS fails.
	Resolvers []string
	// DNSConfig summarizes what the DNS configuration step did.
	DNSConfig string
	// Verified lists the probes that passed.
	Verified []string
	Attempts int
	Elapsed  time.Duration
}

GuestNetworkReport describes a readiness check result without secrets.

func (GuestNetworkReport) String added in v0.29.0

func (r GuestNetworkReport) String() string

String renders a single-line summary suitable for CLI and gateway logs.

type GuestNetworkStage added in v0.29.0

type GuestNetworkStage string

GuestNetworkStage names one step of the readiness check.

const (
	GuestNetworkStageAccess    GuestNetworkStage = "guest-access"
	GuestNetworkStageDNSConfig GuestNetworkStage = "dns-config"
	GuestNetworkStageSystemDNS GuestNetworkStage = "system-dns"
	GuestNetworkStageHTTPS     GuestNetworkStage = "https"
)

type GuestNetworkStatus added in v0.29.0

type GuestNetworkStatus string

GuestNetworkStatus is the overall result of a readiness check.

const (
	GuestNetworkReady   GuestNetworkStatus = "ready"
	GuestNetworkOffline GuestNetworkStatus = "offline"
	GuestNetworkSkipped GuestNetworkStatus = "skipped"
	GuestNetworkFailed  GuestNetworkStatus = "failed"
)

type HypervVagrantExecutionSettings added in v0.7.0

type HypervVagrantExecutionSettings struct {
	VagrantDir string
	VagrantEnv []string
}

func ResolveHypervVagrantExecutionSettings added in v0.7.0

func ResolveHypervVagrantExecutionSettings(config alchemy_build.VirtualMachineConfig) (HypervVagrantExecutionSettings, error)

type InstanceRecord added in v0.27.0

type InstanceRecord struct {
	SchemaVersion  int                        `json:"schema_version"`
	Name           string                     `json:"name"`
	OS             string                     `json:"os"`
	Type           string                     `json:"type"`
	Arch           string                     `json:"arch"`
	Engine         build.VirtualizationEngine `json:"engine"`
	HypervisorName string                     `json:"hypervisor_name"`
	InstanceID     string                     `json:"instance_id"`
	CreatedAt      time.Time                  `json:"created_at"`
	ImageVersion   string                     `json:"image_version"`
}

InstanceRecord is supplemental metadata. Hypervisor state remains authoritative. SchemaVersion leaves room for additional lifecycle policy fields.

type NetworkMode added in v0.27.0

type NetworkMode struct {
	Mode   string `json:"mode"`
	Detail string `json:"detail"`
}

NetworkMode describes exposure, rather than promising a particular firewall configuration. Host-only networks are classified as nat because they do not expose the guest to the LAN.

func InspectNetworkMode added in v0.27.0

func InspectNetworkMode(vm alchemy_build.VirtualMachineConfig, creating bool) NetworkMode

InspectNetworkMode inspects the current VM, or the intended deployment when creating is true. Failed or incomplete inspection always returns unknown.

type StartTargetState added in v0.7.0

type StartTargetState = VirtualMachineState

type TartGuestNetworkOptions added in v0.29.0

type TartGuestNetworkOptions struct {
	// ReadOnly checks the network but does not change guest DNS; planned
	// changes are only reported. Used for `provision --check`.
	ReadOnly bool
}

TartGuestNetworkOptions adjusts EnsureTartGuestNetworkWithOptions.

type VirtualMachineState added in v0.7.0

type VirtualMachineState struct {
	Exists  bool
	Running bool
	State   string
}

func InspectStartTarget added in v0.7.0

func InspectStartTarget(config alchemy_build.VirtualMachineConfig) (VirtualMachineState, error)

func InspectStopTarget added in v0.7.0

func InspectStopTarget(config alchemy_build.VirtualMachineConfig) (VirtualMachineState, error)

Jump to

Keyboard shortcuts

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