sessionallocation

package
v1.517.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationRequest

type AllocationRequest struct {
	SessionID          string                           `json:"session_id"`
	ManagerID          string                           `json:"manager_id,omitempty"`
	Request            *entities.RunServerRequest       `json:"request"`
	ProvisionSettings  *sessionsettings.SessionSettings `json:"provision_settings,omitempty"`
	WebhookPayload     []byte                           `json:"webhook_payload,omitempty"`
	Status             Status                           `json:"status"`
	Message            string                           `json:"message,omitempty"`
	AllocatedSessionID string                           `json:"allocated_session_id,omitempty"`
	Requirements       Requirements                     `json:"requirements"`
	UpdatedAt          time.Time                        `json:"updated_at"`
}

AllocationRequest is the cluster-visible request consumed by allocator workers.

type AllocationResult

type AllocationResult struct {
	Status             Status `json:"status"`
	Message            string `json:"message,omitempty"`
	AllocatedSessionID string `json:"allocated_session_id,omitempty"`
	ProxyURL           string `json:"proxy_url,omitempty"`
}

type ExternalAllocatorClient

type ExternalAllocatorClient interface {
	NextExternal(ctx context.Context, wait time.Duration) (*AllocationRequest, bool, error)
	CompleteExternal(ctx context.Context, sessionID string, result AllocationResult) error
}

type InternalAllocatorClient

type InternalAllocatorClient interface {
	Next(ctx context.Context, wait time.Duration) (*AllocationRequest, bool, error)
	Complete(ctx context.Context, sessionID string, result AllocationResult) error
}

type Notifier

type Notifier interface {
	Notify(ctx context.Context) error
	Subscribe(ctx context.Context) (<-chan struct{}, func(), error)
}

type Queue

type Queue interface {
	SubmitExternalSessionAllocation(ctx context.Context, managerID, sessionID string, settings *sessionsettings.SessionSettings, req *entities.RunServerRequest) error
	NextSessionAllocation(ctx context.Context, wait time.Duration) (*AllocationRequest, bool, error)
	CompleteSessionAllocation(ctx context.Context, sessionID string, result AllocationResult) error
	NextExternalSessionAllocation(ctx context.Context, managerID string, wait time.Duration) (*AllocationRequest, bool, error)
	CompleteExternalSessionAllocation(ctx context.Context, sessionID string, result AllocationResult) (*AllocationRequest, error)
}

type Requirements

type Requirements struct {
	AgentType string `json:"agent_type,omitempty"`
	// Sandbox is always true (network filter cannot be opted out).
	// The field is kept for backward compatibility with existing JSON.
	Sandbox bool `json:"sandbox"`
	DinD    bool `json:"dind"`
}

Requirements captures pod capabilities used for stock matching. Note: Sandbox (network filter) and scia sidecar are now always enabled. Only DinD remains configurable.

func RequirementsFromRunServerRequest

func RequirementsFromRunServerRequest(req *entities.RunServerRequest) Requirements

type Status

type Status string
const (
	StatusPending    Status = "pending"
	StatusAllocating Status = "allocating"
	StatusAssigned   Status = "assigned"
	StatusError      Status = "error"
)

Jump to

Keyboard shortcuts

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