Documentation
¶
Overview ¶
Package guestexec implements the bounded microVM guest exec data plane.
Index ¶
- Variables
- type CommandResult
- type GuestServer
- type Limits
- type OutputFrame
- type Runner
- func (r *Runner) Run(ctx context.Context, command string) (tool.CommandResult, error)
- func (r *Runner) RunFrames(ctx context.Context, command string, receive func(OutputFrame) error) (int, error)
- func (r *Runner) RunFramesWithTemporaryScope(ctx context.Context, command string, scope tool.TemporaryScope, ...) (int, error)
- func (r *Runner) RunStreaming(ctx context.Context, command string, out io.Writer) (int, error)
- func (r *Runner) RunStreamingWithTemporaryScope(ctx context.Context, command string, scope tool.TemporaryScope, out io.Writer) (int, error)
- func (r *Runner) RunWithTemporaryScope(ctx context.Context, command string, scope tool.TemporaryScope) (tool.CommandResult, error)
- type RunnerConfig
- type RuntimeContract
- type ServerConfig
- type WorkloadIdentity
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnauthenticated reports an invalid, stale, or replayed endpoint credential. ErrUnauthenticated = errors.New("microvm exec endpoint is not authenticated") // ErrTransport distinguishes a broken data-plane channel from a guest command exit. ErrTransport = errors.New("microvm exec transport fault") // ErrOutputOverflow reports that the guest command exceeded its output budget. ErrOutputOverflow = errors.New("microvm exec output exceeds bound") // ErrConcurrencyLimit reports that the environment's exec slots are occupied. ErrConcurrencyLimit = errors.New("microvm exec concurrency limit reached") )
Functions ¶
This section is empty.
Types ¶
type CommandResult ¶
type CommandResult = tool.CommandResult
CommandResult is the engine command result implemented by Runner.
type GuestServer ¶
type GuestServer struct {
// contains filtered or unexported fields
}
GuestServer executes bounded commands inside the authenticated guest connection.
func NewGuestServer ¶
func NewGuestServer(cfg ServerConfig) (*GuestServer, error)
NewGuestServer constructs the guest exec endpoint.
func (*GuestServer) Handler ¶
func (s *GuestServer) Handler() control.Handler
Handler returns the exec service for the shared authenticated guest multiplexer.
type Limits ¶
type Limits struct {
MaxFrameBytes uint32
MaxOutputBytes int64
MaxConcurrent int
CancelGrace time.Duration
}
Limits are immutable bounds applied independently by both protocol peers.
type OutputFrame ¶
OutputFrame is one globally ordered guest output chunk.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner implements the engine's bound CommandRunner and optional CommandStreamer.
func NewRunner ¶
func NewRunner(cfg RunnerConfig) (*Runner, error)
NewRunner constructs a guest-only bound runner. No error path has a local execution fallback.
func (*Runner) RunFrames ¶
func (r *Runner) RunFrames(ctx context.Context, command string, receive func(OutputFrame) error) (int, error)
RunFrames delivers stdout and stderr chunks with their channel in global guest order.
func (*Runner) RunFramesWithTemporaryScope ¶
func (r *Runner) RunFramesWithTemporaryScope(ctx context.Context, command string, scope tool.TemporaryScope, receive func(OutputFrame) error) (int, error)
RunFramesWithTemporaryScope preserves channel framing with the selected guest-owned temporary storage.
func (*Runner) RunStreaming ¶
RunStreaming writes stdout and stderr frames to out in guest delivery order.
func (*Runner) RunStreamingWithTemporaryScope ¶
func (r *Runner) RunStreamingWithTemporaryScope(ctx context.Context, command string, scope tool.TemporaryScope, out io.Writer) (int, error)
RunStreamingWithTemporaryScope streams with the selected guest-owned temporary storage.
func (*Runner) RunWithTemporaryScope ¶
func (r *Runner) RunWithTemporaryScope(ctx context.Context, command string, scope tool.TemporaryScope) (tool.CommandResult, error)
RunWithTemporaryScope runs with the selected guest-owned temporary storage.
type RunnerConfig ¶
RunnerConfig binds a runner to exactly one environment generation.
type RuntimeContract ¶
type RuntimeContract struct {
Identity WorkloadIdentity
Home string
Path string
Workdir string
Environment map[string]string
}
RuntimeContract is the explicit process environment restored when a rootfs is supplied directly and therefore carries no OCI configuration.
func DefaultRuntimeContract ¶
func DefaultRuntimeContract() RuntimeContract
DefaultRuntimeContract returns the repository VM's fixed workload contract.
func (RuntimeContract) CacheDirectories ¶
func (c RuntimeContract) CacheDirectories() []string
CacheDirectories returns the declared writable cache roots in stable order.
type ServerConfig ¶
type ServerConfig struct {
Binding control.Binding
Limits Limits
Shell string
WorkspaceRoot string
GitDirectory string
WorkloadIdentity WorkloadIdentity
RuntimeContract RuntimeContract
}
ServerConfig configures a guest endpoint. Production execution is fixed at /workspace.
type WorkloadIdentity ¶
WorkloadIdentity is the dedicated guest UID/GID used for model-controlled commands.
func DefaultWorkloadIdentity ¶
func DefaultWorkloadIdentity() WorkloadIdentity
DefaultWorkloadIdentity returns the fixed unprivileged production identity.