Documentation
¶
Overview ¶
Node-local adapter configuration and construction.
Package providers is the explicit registration boundary for sandbox adapters. It performs read-only configuration work; it never allocates compute.
Index ¶
- Variables
- func BackendFingerprint(kind, namespace string) string
- func ValidateBinding(adapter Adapter, provider sandbox.SandboxProvider) error
- func ValidateRegistration(a Adapter) error
- type Adapter
- type Built
- type Config
- type DirectConfig
- type Docker
- type LocalOptions
- type Microsandbox
- type Network
- type Registry
- func (r *Registry) ArtifactCatalog() (map[string][]providerassets.Artifact, error)
- func (r *Registry) Build(config Config, options LocalOptions) (*Built, func(), error)
- func (r *Registry) BuildDirect(c DirectConfig) (sandbox.SandboxProvider, error)
- func (r *Registry) Decode(kind string, record sandbox.ConfigurationRecord) (sandbox.Configuration, error)
- func (r *Registry) DecodeInput(kind string, public, credential json.RawMessage) (sandbox.Configuration, error)
- func (r *Registry) Describe(kind, installation string) (sandbox.Description, error)
- func (r *Registry) DiscoverConfiguration(ctx context.Context, kind string, input sandbox.ConfigurationDiscoveryInput, ...) (json.RawMessage, error)
- func (r *Registry) Encode(kind string, c sandbox.Configuration) (sandbox.ConfigurationRecord, error)
- func (r *Registry) Equal(kind string, a, b sandbox.Configuration) (bool, error)
- func (r *Registry) IsNode(kind string) (bool, error)
- func (r *Registry) Lookup(kind string) (Adapter, error)
- func (r *Registry) Normalize(s sandbox.Selection) (sandbox.Selection, error)
- func (r *Registry) PythonDeploymentContract() (string, error)
- func (r *Registry) RequiresPublicOrigin(kind string) (bool, error)
- func (r *Registry) ResolveChange(next, previous sandbox.Selection) (sandbox.Selection, error)
- func (r *Registry) RetainedLimit(kind string, active, retained int) (int, error)
- func (r *Registry) SupportsCheckpoint(kind string) (bool, error)
- func (r *Registry) UsesCredential(kind string) (bool, error)
- func (r *Registry) ValidateResources(kind string, s sandbox.Resources) error
- func (r *Registry) ValidateSpecification(kind string, s sandbox.DeploymentSpec) error
- func (r *Registry) WithCredential(owner, candidate sandbox.Selection) (sandbox.Selection, error)
- type Rule
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownProvider = fmt.Errorf("%w: unsupported sandbox provider", sandbox.ErrInvalid)
ErrUnknownProvider reports a provider kind that no adapter registers.
Functions ¶
func BackendFingerprint ¶
func ValidateBinding ¶
func ValidateBinding(adapter Adapter, provider sandbox.SandboxProvider) error
ValidateBinding catches construction that disagrees with its registration.
func ValidateRegistration ¶
ValidateRegistration checks wiring before configuration parsing or construction. Only configuration requirements and operation declarations are read.
Types ¶
type Adapter ¶
type Adapter struct {
NodeArtifacts []providerassets.Artifact
Policy sandbox.DeploymentPolicy
Configuration sandbox.ConfigurationAdapter
BuildLocal func(Config, LocalOptions, *Built) (func(), error)
BuildDirect func(DirectConfig) (sandbox.SandboxProvider, error)
Mode string
Operations func() providercontract.Operations
IdleSeconds, RetentionSeconds int64
ValidateSpecification func(sandbox.DeploymentSpec) error
ValidateResources func(sandbox.Resources) error
}
Adapter describes configuration and transport independently of compute operations. Native operation support comes from the adapter-owned complete declaration.
type Config ¶
type Config struct {
Specification sandbox.DeploymentSpec `json:"specification"`
Generation uint64 `json:"generation"`
CoreURL string `json:"core_url"`
Provider string `json:"provider"`
InstallationID string `json:"installation_id"`
Docker *Docker `json:"docker,omitempty"`
Microsandbox *Microsandbox `json:"microsandbox,omitempty"`
}
type DirectConfig ¶
type LocalOptions ¶
type LocalOptions struct {
// Standalone selects registration or execution without a generation manager.
Standalone bool
// GenerationStateDirectory is the node state directory when constructing a
// retained generation. It must be canonical and absolute, and Standalone
// must be false.
GenerationStateDirectory string
}
LocalOptions supplies process-local context without changing persisted configuration.
type Microsandbox ¶
type Microsandbox struct {
HelperPath string `json:"helper_path"`
RuntimeHome string `json:"runtime_home"`
RuntimePath string `json:"runtime_path"`
FirmwarePath string `json:"firmware_path"`
RuntimeSHA256 string `json:"runtime_sha256"`
FirmwareSHA256 string `json:"firmware_sha256"`
Image string `json:"image"`
MemoryMiB uint32 `json:"memory_mib"`
CPUs uint8 `json:"cpus"`
RootDiskMiB uint32 `json:"root_disk_mib"`
EnvironmentDiskMiB uint32 `json:"environment_disk_mib"`
Network Network `json:"network"`
}
Single-host providers pin the helper, runtime, firmware, image and resource limits explicitly. The helper owns local paths; no ambient backend is selected.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds the registered adapters. Core and the node program each build one with Builtin and pass it explicitly; there is no package-level lookup.
func Builtin ¶
func Builtin() *Registry
Builtin returns a registry of the adapters built into this program.
func (*Registry) ArtifactCatalog ¶
func (r *Registry) ArtifactCatalog() (map[string][]providerassets.Artifact, error)
ArtifactCatalog projects registered node requirements for Web and installers.
func (*Registry) Build ¶
func (r *Registry) Build(config Config, options LocalOptions) (*Built, func(), error)
func (*Registry) BuildDirect ¶
func (r *Registry) BuildDirect(c DirectConfig) (sandbox.SandboxProvider, error)
func (*Registry) Decode ¶
func (r *Registry) Decode(kind string, record sandbox.ConfigurationRecord) (sandbox.Configuration, error)
func (*Registry) DecodeInput ¶
func (r *Registry) DecodeInput(kind string, public, credential json.RawMessage) (sandbox.Configuration, error)
func (*Registry) Describe ¶
func (r *Registry) Describe(kind, installation string) (sandbox.Description, error)
Describe derives the description once for both preview and persistence. Its fingerprint identifies a namespace, never mutable capacity or a credential.
func (*Registry) DiscoverConfiguration ¶
func (r *Registry) DiscoverConfiguration(ctx context.Context, kind string, input sandbox.ConfigurationDiscoveryInput, paths sandbox.ProcessPaths) (json.RawMessage, error)
func (*Registry) Encode ¶
func (r *Registry) Encode(kind string, c sandbox.Configuration) (sandbox.ConfigurationRecord, error)
func (*Registry) PythonDeploymentContract ¶
PythonDeploymentContract projects the same registered adapter policies into the node installer; no second provider list exists in another language.
func (*Registry) RequiresPublicOrigin ¶
func (*Registry) ResolveChange ¶
func (*Registry) RetainedLimit ¶
RetainedLimit keeps nodes without checkpoint support within their active capacity.
func (*Registry) SupportsCheckpoint ¶
SupportsCheckpoint reports whether the provider declares checkpoint suspension.
func (*Registry) ValidateResources ¶
func (*Registry) ValidateSpecification ¶
func (r *Registry) ValidateSpecification(kind string, s sandbox.DeploymentSpec) error