Documentation
¶
Overview ¶
Package s4wave_forge_world registers Forge ObjectTypes in the Space World.
Index ¶
- Variables
- func ForgeReadOnlyFactory(ctx context.Context, le *logrus.Entry, b bus.Bus, engine world.Engine, ...) (srpc.Invoker, func(), error)
- type WorkerAdmission
- func (w *WorkerAdmission) ApplyPolicy(ctx context.Context, deviceKey string, ...) error
- func (w *WorkerAdmission) Close(ctx context.Context) error
- func (w *WorkerAdmission) Renew(ctx context.Context) error
- func (w *WorkerAdmission) Reserve(ctx context.Context, executionKey string, conf *forge_lib_docker.Config) (forge_lib_docker.Reservation, error)
Constants ¶
This section is empty.
Variables ¶
var ClusterType = objecttype.NewObjectType(forge_cluster.ClusterTypeID, ForgeReadOnlyFactory)
ClusterType is the ObjectType for forge/cluster objects.
var DashboardType = objecttype.NewObjectType(forge_dashboard.ForgeDashboardTypeID, ForgeReadOnlyFactory)
DashboardType is the ObjectType for spacewave/forge/dashboard objects.
var ErrWorkerStopPending = errors.New("Worker runtime stop remains pending")
ErrWorkerStopPending reports a durable pending stop whose owner claim must keep renewing until the runtime stop confirms.
var ExecutionType = objecttype.NewObjectType(forge_execution.ExecutionTypeID, ForgeReadOnlyFactory)
ExecutionType is the ObjectType for forge/execution objects.
var JobType = objecttype.NewObjectType(forge_job.JobTypeID, ForgeReadOnlyFactory)
JobType is the ObjectType for forge/job objects.
var PassType = objecttype.NewObjectType(forge_pass.PassTypeID, ForgeReadOnlyFactory)
PassType is the ObjectType for forge/pass objects.
var TaskType = objecttype.NewObjectType(forge_task.TaskTypeID, ForgeReadOnlyFactory)
TaskType is the ObjectType for forge/task objects.
var WorkerType = objecttype.NewObjectType(forge_worker.WorkerTypeID, forgeWorkerFactory)
WorkerType is the ObjectType for forge/worker objects. Uses forgeWorkerFactory which returns a PersistentExecutionService invoker when the session peer ID matches the Worker's linked keypair.
Functions ¶
func ForgeReadOnlyFactory ¶
func ForgeReadOnlyFactory( ctx context.Context, le *logrus.Entry, b bus.Bus, engine world.Engine, ws world.WorldState, objectKey string, ) (srpc.Invoker, func(), error)
ForgeReadOnlyFactory is a minimal factory for read-only object types. Viewers access block state through the objectState prop directly.
Types ¶
type WorkerAdmission ¶
type WorkerAdmission struct {
// contains filtered or unexported fields
}
WorkerAdmission owns one Worker's World capacity claim and Docker reservations.
func NewWorkerAdmission ¶
func NewWorkerAdmission(eng world.Engine, workerKey string, peerID peer.ID, claimID string, stopper forge_runtime.RuntimeStopper) *WorkerAdmission
NewWorkerAdmission constructs one Worker admission with a Docker stopper.
func (*WorkerAdmission) ApplyPolicy ¶
func (w *WorkerAdmission) ApplyPolicy(ctx context.Context, deviceKey string, declared *device_policy.ForgeWorkerPolicy) error
ApplyPolicy claims and observes this Worker or drains it when policy removes capacity.
func (*WorkerAdmission) Close ¶
func (w *WorkerAdmission) Close(ctx context.Context) error
Close drains this Worker's remaining runtimes on a clean execution exit. A crashed process leaves the claim to expire at its lease deadline.
func (*WorkerAdmission) Renew ¶
func (w *WorkerAdmission) Renew(ctx context.Context) error
Renew extends the live Worker claim while this execution owns capacity.
func (*WorkerAdmission) Reserve ¶
func (w *WorkerAdmission) Reserve(ctx context.Context, executionKey string, conf *forge_lib_docker.Config) (forge_lib_docker.Reservation, error)
Reserve debits the Docker target's explicit request under the current claim.