deploy

package
v0.2026272.1512 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: MIT Imports: 5 Imported by: 7 modules, 6 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

This section is empty.

Variables

View Source
var TaskAutoExports = map[string]bool{
	"USER":       true,
	"UID":        true,
	"GID":        true,
	"HOME":       true,
	"ARCH":       true,
	"BUILD_ARCH": true,
}

TaskAutoExports are the auto-exported variable names reserved for the generator; `vars:` entries may not shadow these, and every `${VAR}` reference resolves against (auto-exports ∪ candy.Vars).

Functions

func BedCheckLiveRefs

func BedCheckLiveRefs(name string, node *spec.DeployNode) []string

BedCheckLiveRefs returns the ordered `charly check live` targets for a bed: the substrate itself first, then each IN-SUBSTRATE member as a dotted path in authored order. A `target: android` member shares the parent pod's venue (Descent.Venue == "parent") and has no own image — its app-presence checks are baked into the parent ref, so it is skipped. Pure + unit-tested.

func CandyArtifactRegisters

func CandyArtifactRegisters(layers []spec.CandyReader) map[string]bool

CandyArtifactRegisters returns the DISTINCT `register:` hints declared across every candy's artifact list — name-blind (it reads each artifact's own declaration, never a candy name).

func CandyMapKey

func CandyMapKey(layer spec.CandyReader) string

CandyMapKey returns the candy's map key: the full @github ref for a remote candy (RepoPath/SubPathPrefix+Name), else the bare Name. A ROOT-LEVEL remote candy (the candy de-submodule cutover — a standalone candy repo whose manifest lives at the repo root, SubPathPrefix "") keys as the repo path itself: appending the name would double it (github.com/org/layer-ripgrep/layer-ripgrep).

func CandyStageDirName

func CandyStageDirName(layer spec.CandyReader) string

CandyStageDirName returns the content-addressed staging dir name for a remote candy's copied tree (name.version).

func ClassifyNodeTarget

func ClassifyNodeTarget(node *spec.DeployNode, path string) string

ClassifyNodeTarget picks the target discriminator for a node. Uses node.Target when non-empty (canonical pod|vm|kubernetes|local|android|kindcluster, set from the node-form kind by the loader's deployTargetForDisc). For ref-based deploys with no charly.yml entry, the deploy name itself is the hint: a literal `host`/`local` LEAF → local target; anything else → pod. A pure function of node+path with no LoadUnified/executor dependency.

func DeployNestedLocalChildren

func DeployNestedLocalChildren(parent string, node *spec.DeployNode, apply func(memberKey, dotted string) error) error

DeployNestedLocalChildren deploys a parent venue's IN-SUBSTRATE target:local members via the dotted-path dispatch — each host-rooted (local/SSH-shell) member applies its candies in place. Promoted from sdk/deploykit (#55 U4), now that HostRooted is a spec predicate; deploykit keeps a re-export forwarder so its charly callers compile unchanged.

plugin-deploy-vm's PostApply brings up nested target:pod members as in-guest quadlets, but it SKIPS target:local members — they carry no image, they apply candies in place. Without this loop a nested local member never deploys, and a deploy-scope check against it either fails or (worse) silently checks nothing.

Both sites that own a VM venue call it: the isVM bed ROOT and bringUpMembers' VM-member branch. They differ only in how a member deploy is executed (the root wraps it in a recorded step(); a member shells out directly), so that is the injected apply func.

func DescriptionInfo

func DescriptionInfo(d string) string

DescriptionInfo returns the first non-empty line of a candy/box description, trimmed.

func ExternalInPlaceVenue

func ExternalInPlaceVenue(node *spec.DeployNode) bool

ExternalInPlaceVenue reports whether node's stamped venue is an EXTERNAL deploy substrate that applies its workload IN PLACE — local-like: no container image to build, no `charly config`/`charly start`, teardown via `charly deploy del` (replay the recorded reverse ops). local/android/kubernetes/exampledeploy are in-place (parent/none venues); pod is the one externalized substrate that is NOT in-place (excluded by requiring venue != container implicitly, since parent/none never equals container). Mirrors HostRooted's shape (#55 W3 B2-full) — the plugin-reachable equivalent of the former core-private bedExternalInPlace(target string), which queried isExternalDeploySubstrate against the live provider registry: every node this predicate sees comes from an already-loaded, Descent-stamped project, so the registry round-trip was redundant with data already on the wire (the SAME finding candy/plugin-fleet's externalInPlaceFromDescent already proved for a bed's sibling MEMBERS — this promotes that one shared predicate for the bed ROOT too, R3).

func FindVMClaimant

func FindVMClaimant(tree map[string]spec.DeployNode, vmEntity, claimantID string) (string, spec.DeployNode, bool)

FindVMClaimant returns the node claiming the given VM entity via requires_exclusive.

When claimantID (a deploy KEY or a VmDomainIdentity — both compared after spec.VmDomainIdentity normalization) is non-empty, the lookup is IDENTITY-SCOPED: it resolves ONLY that exact node, so a sibling deploy sharing the same `from:` entity can never hijack this one's resource claim. This matters because MANY deploys routinely share one kind:vm entity (a 16-bed suite all `from: omarchy-vm`, exactly one of which carries `requires_exclusive: [nvidia-gpu]`) — an entity-wide scan made EVERY sibling inherit that GPU requirement (RCA: `check-omarchy-iso-vm`, a GPU-free bed, failed vm-create demanding an NVIDIA card present only on the hybrid-GPU bed's host).

Only when claimantID is EMPTY (the direct `charly vm create <entity>` path, which carries no deploy identity) does the legacy entity-wide scan run. In that path an entity claimed by more than one exclusive-resource node is AMBIGUOUS and returns false rather than picking an arbitrary map-order winner — the caller then treats the create as unclaimed, never as some other deploy's claim.

func HolderAddrFor

func HolderAddrFor(name string, node spec.DeployNode) spec.HolderAddr

HolderAddrFor derives the resource-arbiter holder address for a deploy-tree node — servable off a plain map[string]spec.DeployNode (the shape both a freshly-loaded uf.Deploy and a resolved-project envelope's Deploy map carry).

func HostRooted

func HostRooted(node *spec.DeployNode) bool

The uniform ordered member tree (Cutover C task 0) needs no sorted-key helper: the ONE ordered Member list is already deterministic in authored order. HostRooted reports whether node's stamped descent trait is host-rooted — the substrate's own ROOT executor runs directly on the host (a local/SSH-shell venue, not a container/VM venue). Reads the wire-stamped node.Descent directly (every node a LoadUnified'd project produces is Descent-stamped by StampDescent), so it needs no registry access. Promoted from sdk/deploykit's former private host-rooted predicate (#55 U4) so DeployNestedLocalChildren + the bed-session apply path (PersistBedDeployOverrides) share ONE predicate over the spec value type; deploykit callers repoint to spec/deploy.HostRooted directly.

func IsContainerVenue

func IsContainerVenue(node *spec.DeployNode) bool

IsContainerVenue reports whether node's stamped venue is the container-exec (pod) substrate. Mirrors HostRooted's shape (#55 W3 A4) — see IsVmVenue.

func IsVmVenue

func IsVmVenue(node *spec.DeployNode) bool

IsVmVenue reports whether node's stamped venue is the HOST-LIBVIRT vm substrate — the one whose VM lifecycle is `charly vm build`/`vm create`/`vm destroy` over a host-global libvirt domain. The venue hop ("ssh") is SHARED with kubevirt, so the hop alone does NOT name libvirt: the discriminating trait is ExclusiveVenue, the host-resource lease boundary the traits table declares for vm and deliberately NOT for kubevirt (whose machine is a cluster-managed CR with no host arbiter). Read BY TRAIT over the wire-stamped node.Descent — the same shape HostRooted uses — never by switching on the substrate kind word (the kernel/plugin boundary law). Every libvirt-domain caller shares this ONE predicate: a kubevirt node is NOT a host-libvirt vm, so it falls through to the external/deploy arm (`charly deploy add`/`del`), which the plugin-kubevirt lifecycle owns.

func MergeDeployNode

func MergeDeployNode(dst, src spec.DeployNode) spec.DeployNode

MergeDeployNode overlays src onto dst: every authored (yaml-tagged, non-zero) field of src wins, and the loader-DERIVED structural TREE fields (Target, the uniform ordered Member tree) merge explicitly (src non-zero wins). Pure (reflect over the spec.DeployNode value type).

func PathLeaf

func PathLeaf(path string) string

PathLeaf returns the last segment of a dotted deployment path. "foo.bar.baz" -> "baz"; "foo" -> "foo"; "" -> "". Unlike SplitDottedPath, a malformed path (leading/trailing/doubled dots) still yields its raw trailing segment rather than nil — callers that only care about the LEAF (e.g. a "host"/"local" literal-name check) want the tolerant form.

func ResolveNodePath

func ResolveNodePath(roots map[string]spec.DeployNode, path string) (*spec.DeployNode, []*spec.DeployNode, error)

ResolveNodePath resolves a dotted deployment path against a root map, returning the leaf node, its ancestor chain, and any lookup error.

func SplitDottedPath

func SplitDottedPath(path string) []string

SplitDottedPath splits a dotted deployment path into segments. An empty input or a path with any empty segment (leading/trailing/doubled dots) yields nil so callers can flag the error at their layer with the original offending path string.

func SshVenue added in v0.2026269.212

func SshVenue(node *spec.DeployNode) bool

SshVenue reports whether node's stamped venue is an SSH HOP — a substrate whose commands execute through an ssh transport into a guest (both the host-libvirt vm AND kubevirt). This is the VENUE (transport) predicate: a caller that only needs "build an ssh executor for this venue" reads it. A caller that must decide whether the node is the HOST-LIBVIRT vm (bed bring-up, the libvirt domain lock, the `charly vm` spec path) reads IsVmVenue instead — venue is not substrate (R3). It reads the DERIVED `transport`, not the venue token, so it stays true for kubevirt after that substrate migrates to its OWN `kubevirt` venue value (which still descends over ssh) — matching this doc's "vm AND kubevirt" claim.

func TaskKnownNames

func TaskKnownNames(vars map[string]string) map[string]bool

TaskKnownNames returns the ${NAME} references that resolve cleanly for this candy: auto-exports ∪ candy.Vars keys.

Types

This section is empty.

Jump to

Keyboard shortcuts

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