control

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CPUProfileThink = "think"
	CPUProfileTool  = "tool"
	CPUWeightThink  = int64(2)
	CPUWeightTool   = int64(1024)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	DB      *sql.DB
	Paths   store.Paths
	Driver  runtimeplane.Driver
	WriteMu *sync.Mutex
}

func (Service) CreateLease

func (s Service) CreateLease(taskPath string) (string, error)

func (Service) CreateSession

func (s Service) CreateSession(leaseID string) (string, error)

func (Service) CreateSessionFromWorkspace

func (s Service) CreateSessionFromWorkspace(req WorkspaceSessionRequest) (string, error)

func (Service) Exec

func (s Service) Exec(sessionID string, command []string, stream bool) (string, error)

func (Service) ExecStream

func (s Service) ExecStream(sessionID string, command []string, stdout, stderr io.Writer) (string, error)

func (Service) ExposePort

func (s Service) ExposePort(sessionID string, port int) (string, error)

func (Service) InspectSession

func (s Service) InspectSession(sessionID string) (SessionInfo, error)

func (Service) Interrupt

func (s Service) Interrupt(processID string) error

func (Service) ListSessions

func (s Service) ListSessions() ([]SessionInfo, error)

func (Service) RemoveSession

func (s Service) RemoveSession(sessionID string) error

func (Service) ResumeSnapshot

func (s Service) ResumeSnapshot(snapshotNameOrID, leaseID string) (string, error)

func (Service) SetSessionCPUProfile

func (s Service) SetSessionCPUProfile(sessionID, profile string) error

func (Service) StopSession

func (s Service) StopSession(sessionID string) error

type SessionInfo

type SessionInfo struct {
	ID                    string
	LeaseID               string
	RunID                 string
	ContainerID           string
	WorkspacePath         string
	Status                string
	StartupColdMS         int64
	RuntimeName           string
	ParentSnapshotID      string
	ResumedFromSnapshotID string
	CreatedAt             string
	UpdatedAt             string
}

type Task

type Task struct {
	RunID          string   `yaml:"run_id"`
	Image          string   `yaml:"image"`
	Workspace      string   `yaml:"workspace"`
	Command        []string `yaml:"command"`
	RiskTier       string   `yaml:"risk_tier"`
	NetworkMode    string   `yaml:"network_mode"`
	CPURequest     float64  `yaml:"cpu_request"`
	MemoryMB       int64    `yaml:"memory_mb"`
	TimeoutSeconds int      `yaml:"timeout_seconds"`
}

func LoadTask

func LoadTask(path string) (Task, []byte, error)

func ParseTask

func ParseTask(raw []byte) (Task, error)

type WorkspaceSessionRequest

type WorkspaceSessionRequest struct {
	RunID            string
	TaskPath         string
	WorkspacePath    string
	ParentSnapshotID string
	AttemptID        string
}

Jump to

Keyboard shortcuts

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