Documentation
¶
Overview ¶
Package sandboxexec runs tasks in cloud sandboxes for podium-node. For each task it makes one sandbox through a sandbox.Provider, starts podium-sandbox-agent in it, and relays the agent's events and transfers. It never knows which provider it is driving.
Index ¶
- type Executor
- func (e *Executor) AccountLimit() int32
- func (e *Executor) Adopt(ctx context.Context, req docker.AdoptRequest, events chan<- docker.Event) (docker.Result, error)
- func (e *Executor) Cancel(taskID string)
- func (e *Executor) Close() error
- func (e *Executor) GatewayPorts(context.Context, string) (map[int]int, error)
- func (e *Executor) HeldExit(taskID string) (int, bool)
- func (e *Executor) Holds(_ context.Context, taskID string) bool
- func (e *Executor) Inject(taskID, text string) error
- func (e *Executor) ListOwned(context.Context) ([]docker.OwnedContainer, error)
- func (e *Executor) ListPreviews(ctx context.Context) ([]docker.HeldPreview, error)
- func (e *Executor) OnDeleted(fn func(id string))
- func (e *Executor) PruneImages(context.Context, docker.PruneRequest) ([]docker.ImageRecord, error)
- func (e *Executor) Reap(ctx context.Context, id string) error
- func (e *Executor) Run(ctx context.Context, req docker.Request, events chan<- docker.Event) (docker.Result, error)
- func (e *Executor) ServerVersion() string
- func (e *Executor) SetTemplate(t string)
- func (e *Executor) TaskDir(taskID string) string
- func (e *Executor) Teardown(ctx context.Context, taskID string, _ bool) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor implements podium-node's executor on a sandbox provider.
func (*Executor) AccountLimit ¶
AccountLimit is the most sandboxes the provider account allows at once, 0 when unknown. It answers from the last read and reads again in the background at most once a minute, so a heartbeat never waits on the provider.
func (*Executor) Adopt ¶
func (e *Executor) Adopt(ctx context.Context, req docker.AdoptRequest, events chan<- docker.Event) (docker.Result, error)
Adopt reattaches to a run whose sandbox outlived the previous daemon.
func (*Executor) GatewayPorts ¶
GatewayPorts has nothing to say: a sandbox preview's URLs come from the provider.
func (*Executor) ListPreviews ¶
ListPreviews is every recorded task that publishes ports. Their URLs are the provider's, so there is no address or slot to give back.
func (*Executor) PruneImages ¶
func (e *Executor) PruneImages(context.Context, docker.PruneRequest) ([]docker.ImageRecord, error)
PruneImages implements the node's executor.
func (*Executor) Reap ¶
Reap deletes a sandbox this node does not hold, for a task the control plane gave up on. One that is already gone is not an error.
func (*Executor) Run ¶
func (e *Executor) Run(ctx context.Context, req docker.Request, events chan<- docker.Event) (docker.Result, error)
Run makes the task's sandbox, starts the agent in it and relays the run.
func (*Executor) ServerVersion ¶
ServerVersion implements the node's executor.
func (*Executor) SetTemplate ¶
SetTemplate changes the snapshot image tasks start from, for every task planned after it.