Documentation
¶
Index ¶
- Variables
- func ValidateSessionID(sessionID string) error
- type ContainerRuntime
- type CreateSessionRequest
- type ExecuteToolRequest
- type ExecuteToolResponse
- type GetProcessStatusRequest
- type GetProcessStatusResponse
- type HealthStatus
- type KillProcessRequest
- type LaunchProcessRequest
- type LaunchProcessResponse
- type ManagedProcess
- type ProcessStatus
- type SandboxHostService
- func (svc *SandboxHostService) Capabilities() environment.Capabilities
- func (svc *SandboxHostService) CreateSession(ctx context.Context, req CreateSessionRequest) (*SessionInfo, error)
- func (svc *SandboxHostService) CreateSnapshot(ctx context.Context, sessionID string, name string) (*SnapshotResult, error)
- func (svc *SandboxHostService) DestroySession(ctx context.Context, sessionID string) error
- func (svc *SandboxHostService) ExecuteTool(ctx context.Context, req ExecuteToolRequest) (*ExecuteToolResponse, error)
- func (svc *SandboxHostService) GetProcessStatus(_ context.Context, req GetProcessStatusRequest) (*GetProcessStatusResponse, error)
- func (svc *SandboxHostService) GetSession(_ context.Context, sessionID string) (*SessionInfo, error)
- func (svc *SandboxHostService) HealthCheck(ctx context.Context) (*HealthStatus, error)
- func (svc *SandboxHostService) KillProcess(_ context.Context, req KillProcessRequest) error
- func (svc *SandboxHostService) LaunchProcess(ctx context.Context, req LaunchProcessRequest) (*LaunchProcessResponse, error)
- func (svc *SandboxHostService) ListSessions(_ context.Context) ([]SessionInfo, error)
- func (svc *SandboxHostService) ListSnapshots(ctx context.Context, sessionID string) ([]zfs.SnapshotInfo, error)
- func (svc *SandboxHostService) PauseSession(ctx context.Context, sessionID string) error
- func (svc *SandboxHostService) ResumeSession(_ context.Context, sessionID string) error
- func (svc *SandboxHostService) RollbackSession(ctx context.Context, sessionID string, snapshotID string) error
- func (svc *SandboxHostService) Shutdown(ctx context.Context) error
- func (svc *SandboxHostService) Start(ctx context.Context)
- func (svc *SandboxHostService) TurnComplete(ctx context.Context, sessionID string) (*SnapshotResult, error)
- type ServiceConfig
- type Session
- type SessionInfo
- type SessionState
- type SnapshotEntry
- type SnapshotResult
- type StorageBackend
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSessionNotFound = errors.New("sandbox: session not found") ErrSessionExists = errors.New("sandbox: session already exists") ErrSessionPaused = errors.New("sandbox: session is paused") ErrSessionDestroying = errors.New("sandbox: session is destroying") ErrProcessNotFound = errors.New("sandbox: process not found") ErrRollbackInProgress = errors.New("sandbox: rollback in progress") ErrInvalidState = errors.New("sandbox: invalid session state") ErrMaxSessionsReached = errors.New("sandbox: max sessions reached") ErrToolsInFlight = errors.New("sandbox: tools in flight") ErrSnapshotsNotAvailable = errors.New("sandbox: snapshots not available (requires ZFS storage backend)") )
Functions ¶
func ValidateSessionID ¶
ValidateSessionID validates session ids used in filesystem-backed storage.
Types ¶
type ContainerRuntime ¶
type ContainerRuntime string
ContainerRuntime identifies the runtime for Tier 2 tool execution.
const ( ContainerRuntimeGVisor ContainerRuntime = "gvisor" ContainerRuntimeNone ContainerRuntime = "none" )
type CreateSessionRequest ¶
type ExecuteToolRequest ¶
type ExecuteToolResponse ¶
type GetProcessStatusRequest ¶
type GetProcessStatusResponse ¶
type GetProcessStatusResponse struct {
Status ProcessStatus
ExitCode *int
}
type HealthStatus ¶
type KillProcessRequest ¶
type LaunchProcessRequest ¶
type LaunchProcessResponse ¶
type LaunchProcessResponse struct {
ProcessID string
Address string
Status ProcessStatus
}
type ManagedProcess ¶
type ManagedProcess struct {
// contains filtered or unexported fields
}
type ProcessStatus ¶
type ProcessStatus string
const ( ProcessStatusStarting ProcessStatus = "starting" ProcessStatusRunning ProcessStatus = "running" ProcessStatusExited ProcessStatus = "exited" )
type SandboxHostService ¶
type SandboxHostService struct {
// contains filtered or unexported fields
}
func NewSandboxHostService ¶
func NewSandboxHostService(cfg ServiceConfig, z zfs.ZFSManager, g gvisor.GVisorManager, logger *slog.Logger) (*SandboxHostService, error)
func (*SandboxHostService) Capabilities ¶
func (svc *SandboxHostService) Capabilities() environment.Capabilities
Capabilities returns host capabilities derived from configured backends.
func (*SandboxHostService) CreateSession ¶
func (svc *SandboxHostService) CreateSession(ctx context.Context, req CreateSessionRequest) (*SessionInfo, error)
func (*SandboxHostService) CreateSnapshot ¶
func (svc *SandboxHostService) CreateSnapshot(ctx context.Context, sessionID string, name string) (*SnapshotResult, error)
func (*SandboxHostService) DestroySession ¶
func (svc *SandboxHostService) DestroySession(ctx context.Context, sessionID string) error
func (*SandboxHostService) ExecuteTool ¶
func (svc *SandboxHostService) ExecuteTool(ctx context.Context, req ExecuteToolRequest) (*ExecuteToolResponse, error)
func (*SandboxHostService) GetProcessStatus ¶
func (svc *SandboxHostService) GetProcessStatus(_ context.Context, req GetProcessStatusRequest) (*GetProcessStatusResponse, error)
func (*SandboxHostService) GetSession ¶
func (svc *SandboxHostService) GetSession(_ context.Context, sessionID string) (*SessionInfo, error)
func (*SandboxHostService) HealthCheck ¶
func (svc *SandboxHostService) HealthCheck(ctx context.Context) (*HealthStatus, error)
func (*SandboxHostService) KillProcess ¶
func (svc *SandboxHostService) KillProcess(_ context.Context, req KillProcessRequest) error
func (*SandboxHostService) LaunchProcess ¶
func (svc *SandboxHostService) LaunchProcess(ctx context.Context, req LaunchProcessRequest) (*LaunchProcessResponse, error)
func (*SandboxHostService) ListSessions ¶
func (svc *SandboxHostService) ListSessions(_ context.Context) ([]SessionInfo, error)
func (*SandboxHostService) ListSnapshots ¶
func (svc *SandboxHostService) ListSnapshots(ctx context.Context, sessionID string) ([]zfs.SnapshotInfo, error)
func (*SandboxHostService) PauseSession ¶
func (svc *SandboxHostService) PauseSession(ctx context.Context, sessionID string) error
func (*SandboxHostService) ResumeSession ¶
func (svc *SandboxHostService) ResumeSession(_ context.Context, sessionID string) error
func (*SandboxHostService) RollbackSession ¶
func (*SandboxHostService) Shutdown ¶
func (svc *SandboxHostService) Shutdown(ctx context.Context) error
func (*SandboxHostService) Start ¶
func (svc *SandboxHostService) Start(ctx context.Context)
func (*SandboxHostService) TurnComplete ¶
func (svc *SandboxHostService) TurnComplete(ctx context.Context, sessionID string) (*SnapshotResult, error)
type ServiceConfig ¶
type ServiceConfig struct {
StorageBackend StorageBackend
ContainerRuntime ContainerRuntime
AdvertiseAddr string
PoolName string
BasesDataset string
SessionsDataset string
SessionsRootDir string
MaxSessions int
DefaultSessionQuota int64
SnapshotPrefix string
MaxSnapshotsPerSession int
DefaultResources gvisor.ResourceSpec
ToolTimeout time.Duration
PoolSpaceWarnThreshold float64
PoolSpaceCritThreshold float64
HealthCheckInterval time.Duration
PauseDrainTimeout time.Duration
ShutdownTimeout time.Duration
PerToolSnapshots bool
}
func DefaultServiceConfig ¶
func DefaultServiceConfig() ServiceConfig
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) Info ¶
func (s *Session) Info() SessionInfo
type SessionInfo ¶
type SessionState ¶
type SessionState string
const ( SessionCreating SessionState = "creating" SessionActive SessionState = "active" SessionPaused SessionState = "paused" SessionDestroying SessionState = "destroying" SessionFailed SessionState = "failed" )
type SnapshotEntry ¶
type SnapshotResult ¶
type StorageBackend ¶
type StorageBackend string
StorageBackend identifies the session storage mechanism.
const ( StorageBackendZFS StorageBackend = "zfs" StorageBackendLocalDisk StorageBackend = "local-disk" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package control defines the SandboxControl interface for orchestrator-level sandbox lifecycle management.
|
Package control defines the SandboxControl interface for orchestrator-level sandbox lifecycle management. |
|
cloud
Package cloud provides placeholder stubs for cloud-based SandboxControl providers (E2B, Daytona, Fly).
|
Package cloud provides placeholder stubs for cloud-based SandboxControl providers (E2B, Daytona, Fly). |
|
direct
Package direct implements DirectSandboxControl, which manages raw EC2 instances as agent execution environments.
|
Package direct implements DirectSandboxControl, which manages raw EC2 instances as agent execution environments. |
|
fleet
Package fleet implements FleetSandboxControl, a SandboxControl adapter that manages a fleet of sandbox-host instances with auto-scaling, health monitoring, warm pool maintenance, and capacity-aware routing.
|
Package fleet implements FleetSandboxControl, a SandboxControl adapter that manages a fleet of sandbox-host instances with auto-scaling, health monitoring, warm pool maintenance, and capacity-aware routing. |
|
fleet/ec2
Package ec2 implements the instance.InstanceProvisioner interface using the AWS EC2 API (SDK v2).
|
Package ec2 implements the instance.InstanceProvisioner interface using the AWS EC2 API (SDK v2). |
|
instance
Package instance defines the InstanceProvisioner interface and associated types for cloud instance lifecycle management.
|
Package instance defines the InstanceProvisioner interface and associated types for cloud instance lifecycle management. |
|
node
Package node implements NodeSandboxControl, which wraps our sandbox-host RPC service to satisfy the SandboxControl interface.
|
Package node implements NodeSandboxControl, which wraps our sandbox-host RPC service to satisfy the SandboxControl interface. |
|
restapi
Package restapi provides shared HTTP/JSON helpers for remote ExecutionEnvironment providers (E2B, Daytona, Fly).
|
Package restapi provides shared HTTP/JSON helpers for remote ExecutionEnvironment providers (E2B, Daytona, Fly). |
Click to show internal directories.
Click to hide internal directories.