runtimeapi

package
v1.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: EPL-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuntimeClassStageWriteConfig     = "write_config"
	RuntimeClassStageStopRuntime     = "stop_runtime"
	RuntimeClassStageStartRuntime    = "start_runtime"
	RuntimeClassStageWaitCRIReady    = "wait_cri_ready"
	RuntimeClassStageVerifyStability = "verify_stability"
	RuntimeClassStageRollbackConfig  = "rollback_config"
	RuntimeClassStageEscalateRestart = "escalate_restart"
	RuntimeClassStageDone            = "done"
)
View Source
const (
	PruneModeDangling   = "dangling"
	PruneModeContainers = "containers"
	PruneModeVolumes    = "volumes"
	PruneModeAll        = "all"
)
View Source
const (
	DeployStageParsing    = "parsing"
	DeployStagePulling    = "pulling"
	DeployStageCreating   = "creating"
	DeployStageStarting   = "starting"
	DeployStagePersisting = "persisting"
	DeployStageDone       = "done"
)

Variables

View Source
var (
	ErrControlPlaneNotFound       = errors.New("control plane deployment not found")
	ErrControlPlaneRestartBlocked = errors.New("control plane restart blocked: apply in progress")
)
View Source
var ErrRuntimeClassUnsupported = errors.New("runtimeclass is supported only when containerEngine=edgelet")

Functions

func ControlPlaneStatusMap

func ControlPlaneStatusMap(item *models.ControlPlaneDeployment) map[string]any

ControlPlaneStatusMap builds the GET /v1/system/controlplane response body.

func IsControlPlaneDeleteBlocked

func IsControlPlaneDeleteBlocked(err error) bool

IsControlPlaneDeleteBlocked reports whether err blocks control-plane delete while provisioned.

func IsControlPlaneLifecycleBlocked

func IsControlPlaneLifecycleBlocked(err error) bool

IsControlPlaneLifecycleBlocked reports whether err blocks control-plane ms lifecycle.

func IsControlPlaneRestartBlocked

func IsControlPlaneRestartBlocked(err error) bool

IsControlPlaneRestartBlocked reports whether err blocks operator control-plane restart.

func NormalizeRuntimeClassOperationStage

func NormalizeRuntimeClassOperationStage(stage string) string

Types

type ControlPlaneApplyResult

type ControlPlaneApplyResult struct {
	Mode           string
	ControllerUUID string
	Namespace      string
	Name           string
	Image          string
	State          string
	RuntimeState   string
	ContainerID    string
	Generation     int64
}

ControlPlaneApplyResult is the control plane apply outcome.

type DeployProgressCallback

type DeployProgressCallback func(stage string, message string)

DeployProgressCallback reports deploy stage transitions from runtime flow.

type ErrAmbiguousImageSelector added in v1.0.1

type ErrAmbiguousImageSelector struct {
	Selector string
	Matches  []string
}

ErrAmbiguousImageSelector indicates an image selector matched multiple images.

func (*ErrAmbiguousImageSelector) Error added in v1.0.1

func (e *ErrAmbiguousImageSelector) Error() string

type ErrAmbiguousMicroserviceSelector

type ErrAmbiguousMicroserviceSelector struct {
	Matches []string
}

ErrAmbiguousMicroserviceSelector indicates selector matched multiple targets.

func (*ErrAmbiguousMicroserviceSelector) Error

type ErrControlPlaneDeleteBlocked

type ErrControlPlaneDeleteBlocked struct{}

ErrControlPlaneDeleteBlocked indicates DELETE /v1/system/controlplane is forbidden while provisioned.

func (*ErrControlPlaneDeleteBlocked) Error

type ErrControlPlaneIdentityImmutable

type ErrControlPlaneIdentityImmutable struct {
	ExistingNamespace string
	ExistingName      string
	NewNamespace      string
	NewName           string
}

ErrControlPlaneIdentityImmutable indicates metadata.name or metadata.namespace changed on patch.

func (*ErrControlPlaneIdentityImmutable) Error

type ErrControlPlaneLifecycleBlocked

type ErrControlPlaneLifecycleBlocked struct {
	Operation string
}

ErrControlPlaneLifecycleBlocked indicates ms rm/stop/kill/start/restart on the controller UUID is forbidden.

func (*ErrControlPlaneLifecycleBlocked) Error

type ErrReservedRuntimeClassDelete

type ErrReservedRuntimeClassDelete struct {
	Name string
}

func (*ErrReservedRuntimeClassDelete) Details

func (e *ErrReservedRuntimeClassDelete) Details() map[string]any

func (*ErrReservedRuntimeClassDelete) Error

type ErrRuntimeClassInUse

type ErrRuntimeClassInUse struct {
	Name                      string
	RuntimeNames              []string
	BlockingMicroserviceUuids []string
}

func (*ErrRuntimeClassInUse) Details

func (e *ErrRuntimeClassInUse) Details() map[string]any

func (*ErrRuntimeClassInUse) Error

func (e *ErrRuntimeClassInUse) Error() string

type ErrRuntimeClassManagedName added in v1.1.0

type ErrRuntimeClassManagedName struct {
	Name string
}

ErrRuntimeClassManagedName is returned when a local apply targets a name the controller currently manages on this provisioned node.

func (*ErrRuntimeClassManagedName) Details added in v1.1.0

func (e *ErrRuntimeClassManagedName) Details() map[string]any

func (*ErrRuntimeClassManagedName) Error added in v1.1.0

type ErrRuntimeClassOperation

type ErrRuntimeClassOperation struct {
	Stage string
	Err   error
}

func (*ErrRuntimeClassOperation) Details

func (e *ErrRuntimeClassOperation) Details() map[string]any

func (*ErrRuntimeClassOperation) Error

func (e *ErrRuntimeClassOperation) Error() string

func (*ErrRuntimeClassOperation) Unwrap

func (e *ErrRuntimeClassOperation) Unwrap() error

type Facade

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

Facade is a thin runtime adapter used by EdgeletAPI handlers. It intentionally delegates to existing modules to preserve daemon behavior.

func NewFacade

func NewFacade() *Facade

NewFacade returns a singleton-backed runtime facade.

func (*Facade) ApplyControlPlaneManifest

func (f *Facade) ApplyControlPlaneManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (*ControlPlaneApplyResult, error)

ApplyControlPlaneManifest validates, persists, and launches the controller.

func (*Facade) ApplyControllerRuntimeClasses added in v1.1.0

func (f *Facade) ApplyControllerRuntimeClasses(items []*models.ControllerRuntimeClass) error

ApplyControllerRuntimeClasses replaces the fleet-desired RuntimeClass snapshot and applies it on the edgelet engine. Catalog handlers stay on the existing metadata persist path and do not bounce the data plane.

func (*Facade) ApplyLocalManifest

func (f *Facade) ApplyLocalManifest(manifest, sourceName string, dryRun bool, progress DeployProgressCallback) (string, *models.LocalDeployManifest, error)

ApplyLocalManifest validates and persists local deployment metadata.

func (*Facade) ApplyLocalModelManifests added in v1.1.0

func (f *Facade) ApplyLocalModelManifests(manifest string, dryRun bool) ([]*models.LocalModel, error)

ApplyLocalModelManifests upserts each Model document by metadata.name. Persist is synchronous. Artifact download is started by the apply handler (or POST /v1/models:pull) after every document is written.

func (*Facade) ApplyLocalRegistryManifest

func (f *Facade) ApplyLocalRegistryManifest(manifest string, dryRun bool) (*models.Registry, error)

ApplyLocalRegistryManifest validates and stores a registry manifest. spec.id set → upsert that id; omitted → NextLocalRegistryID(). Built-in ids cannot be edited. Collision on (type, url) for an existing id is a validate error.

func (*Facade) ApplyLocalRuntimeClassManifest

func (f *Facade) ApplyLocalRuntimeClassManifest(manifest string, dryRun bool) (*models.LocalRuntimeClass, error)

ApplyLocalRuntimeClassManifest validates and stores a RuntimeClass manifest.

func (*Facade) DeleteControlPlane

func (f *Facade) DeleteControlPlane() error

DeleteControlPlane removes the controller deployment, container, and volumes.

func (*Facade) DeleteLocalDeployment

func (f *Facade) DeleteLocalDeployment(id string) error

DeleteLocalDeployment removes local deployment by id.

func (*Facade) DeleteRegistry

func (f *Facade) DeleteRegistry(id int) error

DeleteRegistry removes one local registry entry.

func (*Facade) DeleteRuntimeClass

func (f *Facade) DeleteRuntimeClass(name string) error

DeleteRuntimeClass removes one RuntimeClass entry by name.

func (*Facade) Deprovision

func (f *Facade) Deprovision(scope string) error

Deprovision deprovisions the agent.

func (*Facade) GetControlPlaneDeployment

func (f *Facade) GetControlPlaneDeployment() (*models.ControlPlaneDeployment, error)

GetControlPlaneDeployment returns the singleton control plane row.

func (*Facade) GetControlPlaneManifestMasked

func (f *Facade) GetControlPlaneManifestMasked() (string, error)

GetControlPlaneManifestMasked returns secrets-redacted manifest YAML.

func (*Facade) GetLocalDeployment

func (f *Facade) GetLocalDeployment(id string) (*models.LocalDeployedMicroservice, error)

GetLocalDeployment gets local deployment by id.

func (*Facade) GetModel added in v1.1.0

func (f *Facade) GetModel(name string) (map[string]any, error)

GetModel returns one local Model by metadata.name.

func (*Facade) GetModelPull added in v1.1.0

func (f *Facade) GetModelPull(operationID string) (*modelmanager.PullOperation, bool)

GetModelPull returns one async model pull operation.

func (*Facade) GetRegistry

func (f *Facade) GetRegistry(id int) (*models.Registry, error)

GetRegistry returns one local registry entry.

func (*Facade) GetRuntimeClass

func (f *Facade) GetRuntimeClass(name string) (*models.LocalRuntimeClass, error)

GetRuntimeClass returns one RuntimeClass entry by name.

func (*Facade) GetRuntimeMicroservice

func (f *Facade) GetRuntimeMicroservice(id string) (map[string]any, error)

GetRuntimeMicroservice returns one process-manager tracked microservice.

func (*Facade) GetRuntimeMicroserviceLogs

func (f *Facade) GetRuntimeMicroserviceLogs(selector string, tailLines int, since, until string) (string, []map[string]any, error)

func (*Facade) KillRuntimeMicroservice

func (f *Facade) KillRuntimeMicroservice(selector string) (string, error)

func (*Facade) ListImages

func (f *Facade) ListImages() ([]map[string]any, error)

ListImages returns normalized image list for local runtime engine.

func (*Facade) ListLocalDeployments

func (f *Facade) ListLocalDeployments() ([]*models.LocalDeployedMicroservice, error)

ListLocalDeployments lists local deployment records.

func (*Facade) ListModels added in v1.1.0

func (f *Facade) ListModels() ([]map[string]any, error)

ListModels returns local Model rows as API maps.

func (*Facade) ListRegistries

func (f *Facade) ListRegistries() ([]*models.Registry, error)

ListRegistries returns persisted registry entries with defaults guaranteed.

func (*Facade) ListRuntimeClasses

func (f *Facade) ListRuntimeClasses() ([]*models.LocalRuntimeClass, error)

ListRuntimeClasses returns persisted RuntimeClass entries.

func (*Facade) ListRuntimeMicroservices

func (f *Facade) ListRuntimeMicroservices() []map[string]any

ListRuntimeMicroservices returns process-manager tracked microservices.

func (*Facade) LoadImageFromPath

func (f *Facade) LoadImageFromPath(path string) ([]engine.LoadedImage, error)

LoadImageFromPath imports a daemon-local image archive path.

func (*Facade) ParseAndValidateControlPlaneManifest

func (f *Facade) ParseAndValidateControlPlaneManifest(manifest string) (*models.ControlPlaneManifest, error)

ParseAndValidateControlPlaneManifest validates ControlPlane YAML.

func (*Facade) ParseAndValidateLocalManifest

func (f *Facade) ParseAndValidateLocalManifest(manifest string) (*models.LocalDeployManifest, error)

ParseAndValidateLocalManifest validates a local deploy manifest.

func (*Facade) ParseAndValidateLocalModelManifests added in v1.1.0

func (f *Facade) ParseAndValidateLocalModelManifests(manifest string) ([]*models.LocalModelManifest, error)

ParseAndValidateLocalModelManifests decodes one or more Model documents and validates each.

func (*Facade) ParseAndValidateLocalRegistryManifest

func (f *Facade) ParseAndValidateLocalRegistryManifest(manifest string) (*models.LocalRegistryManifest, error)

ParseAndValidateLocalRegistryManifest validates a local registry manifest.

func (*Facade) ParseAndValidateLocalRuntimeClassManifest

func (f *Facade) ParseAndValidateLocalRuntimeClassManifest(manifest string) (*models.LocalRuntimeClassManifest, error)

ParseAndValidateLocalRuntimeClassManifest validates a RuntimeClass manifest.

func (*Facade) Provision

func (f *Facade) Provision(provisioningKey string) error

Provision provisions the agent.

func (*Facade) Prune

func (f *Facade) Prune(mode string) (map[string]any, error)

Prune triggers runtime prune for the requested mode.

func (*Facade) PruneModels added in v1.1.0

func (f *Facade) PruneModels(mode string) (*modelmanager.PruneReport, error)

PruneModels removes unreferenced model artifacts.

func (*Facade) PullImage

func (f *Facade) PullImage(imageRef string, registryID *int, platform string) (string, error)

PullImage pulls an image with optional registry id and platform selector.

func (*Facade) PullImageWithProgress

func (f *Facade) PullImageWithProgress(imageRef string, registryID *int, platform string, onProgress func(float32)) (string, error)

PullImageWithProgress pulls an image while reporting progress updates.

func (*Facade) RemoveImage

func (f *Facade) RemoveImage(selector string) (string, error)

RemoveImage removes an image by selector (id, id prefix, name:tag, or digest).

func (*Facade) RemoveModel added in v1.1.0

func (f *Facade) RemoveModel(name string) error

RemoveModel deletes one local Model and its on-disk artifacts.

func (*Facade) RemoveRuntimeMicroservice

func (f *Facade) RemoveRuntimeMicroservice(selector string) (string, error)

func (*Facade) ResolveImageDeleteRef added in v1.0.1

func (f *Facade) ResolveImageDeleteRef(selector string) (string, error)

ResolveImageDeleteRef resolves a user selector to an engine delete reference.

func (*Facade) ResolveMicroserviceID

func (f *Facade) ResolveMicroserviceID(selector string) (string, error)

ResolveMicroserviceID resolves selectors in this order: exact UUID -> container ID prefix -> exact ApplicationName.MicroserviceName.

func (*Facade) RestartControlPlane

func (f *Facade) RestartControlPlane(pull bool) (*models.ControlPlaneDeployment, error)

RestartControlPlane bounces the singleton controller container without deprovisioning or deleting the system_control_plane row.

func (*Facade) RestartRuntimeMicroservice

func (f *Facade) RestartRuntimeMicroservice(selector string) (string, error)

func (*Facade) SetModelManager added in v1.1.0

func (f *Facade) SetModelManager(m *modelmanager.Manager)

SetModelManager replaces the model manager used by deploy and model routes (tests).

func (*Facade) StartModelPull added in v1.1.0

func (f *Facade) StartModelPull(name string) (*modelmanager.PullOperation, error)

StartModelPull begins an async artifact pull for a deployed Model. Download is detached from the HTTP request so a 202 return cannot cancel it.

func (*Facade) StartRuntimeMicroservice

func (f *Facade) StartRuntimeMicroservice(selector string) (string, error)

func (*Facade) StopRuntimeMicroservice

func (f *Facade) StopRuntimeMicroservice(selector string) (string, error)

func (*Facade) UpsertLocalDeployment

func (f *Facade) UpsertLocalDeployment(ms *models.LocalDeployedMicroservice) error

UpsertLocalDeployment upserts one local deployment record.

func (*Facade) UpsertLocalModelSpec added in v1.1.0

func (f *Facade) UpsertLocalModelSpec(name, repo, revision string, registryID int, files []string, format string) (*models.LocalModel, error)

UpsertLocalModelSpec upserts one Model from pull-request fields using the same validation as deploy apply.

func (*Facade) ValidateRuntimeClassDelete

func (f *Facade) ValidateRuntimeClassDelete(name string) (*models.LocalRuntimeClass, error)

ValidateRuntimeClassDelete validates whether one RuntimeClass can be deleted.

Jump to

Keyboard shortcuts

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