runner

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LiveRunnerModePersistent = "persistent"
	LiveRunnerModeSingleShot = "single-shot"
)
View Source
const (
	LiveRunnerRoutingRunnerID = "runner-id"
	LiveRunnerRoutingLabel    = "label"
)
View Source
const (
	// o2r gives the orchestrator an inbound signaling path to the runner without
	// requiring a new runner port or quietly extending the runner app API.
	// Runner-originated calls still use normal HTTP endpoints for heartbeats,
	// trickle channel creation, and related control-plane requests.
	LiveRunnerTrickleOrchestratorToRunner = "o2r"
)

Variables

This section is empty.

Functions

func ValidateLiveRunnerMetadata

func ValidateLiveRunnerMetadata(metadata string) error

ValidateLiveRunnerMetadata validates application-controlled runner metadata.

func ValidateProxyURLTemplate

func ValidateProxyURLTemplate(raw string, serviceURI *url.URL) error

ValidateProxyURLTemplate checks a public live runner proxy URL template.

Types

type LiveRunnerDiscoveryRunner

type LiveRunnerDiscoveryRunner struct {
	URL               string               `json:"url"`
	GPU               *LiveRunnerGPU       `json:"gpu,omitempty"`
	App               string               `json:"app"`
	Version           string               `json:"version,omitempty"`
	Metadata          string               `json:"metadata,omitempty"`
	Mode              string               `json:"mode,omitempty"`
	Capacity          int                  `json:"capacity"`
	CapacityUsed      int                  `json:"capacity_used"`
	CapacityAvailable int                  `json:"capacity_available"`
	PriceInfo         *LiveRunnerPriceInfo `json:"price_info,omitempty"`
}

type LiveRunnerGPU

type LiveRunnerGPU struct {
	ID     string `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	VRAMMB int    `json:"vram_mb,omitempty"`
}

func (*LiveRunnerGPU) UnmarshalJSON

func (g *LiveRunnerGPU) UnmarshalJSON(data []byte) error

type LiveRunnerHeartbeatRequest

type LiveRunnerHeartbeatRequest struct {
	RunnerID   string              `json:"runner_id,omitempty"`
	Label      string              `json:"label,omitempty"`
	Proxy      bool                `json:"proxy,omitempty"`
	RunnerURL  string              `json:"runner_url"`
	Version    string              `json:"version,omitempty"`
	Metadata   string              `json:"metadata,omitempty"`
	Status     string              `json:"status,omitempty"`
	Mode       string              `json:"mode,omitempty"`
	GPU        *LiveRunnerGPU      `json:"gpu,omitempty"`
	App        string              `json:"app"`
	Capacity   int                 `json:"capacity"`
	PriceInfo  LiveRunnerPriceInfo `json:"price_info"`
	SessionIDs []string            `json:"session_ids,omitempty"`
}

type LiveRunnerHeartbeatResponse

type LiveRunnerHeartbeatResponse struct {
	RunnerID          string                    `json:"runner_id"`
	Orchestrator      string                    `json:"orchestrator,omitempty"`
	HeartbeatInterval string                    `json:"heartbeat_interval"`
	HeartbeatTTL      string                    `json:"heartbeat_ttl"`
	HeartbeatSecret   string                    `json:"heartbeat_secret,omitempty"`
	O2R               *LiveRunnerTrickleChannel `json:"o2r,omitempty"`
	SessionIDs        []string                  `json:"session_ids"`
}

type LiveRunnerPriceInfo

type LiveRunnerPriceInfo struct {
	Price    json.Number `json:"price"`
	Currency string      `json:"currency,omitempty"`
	Unit     string      `json:"unit,omitempty"`
}

type LiveRunnerProxy

type LiveRunnerProxy struct {
	ProxyID string `json:"proxy_id"`
	URL     string `json:"url"`
}

type LiveRunnerProxyRoute

type LiveRunnerProxyRoute struct {
	RunnerID     string
	SessionID    string
	SessionToken string
	TargetURL    string
	AppPath      string
	LocalPath    string
}

type LiveRunnerRegistry

type LiveRunnerRegistry struct {
	// contains filtered or unexported fields
}

func NewLiveRunnerRegistry

func NewLiveRunnerRegistry(config LiveRunnerRegistryConfig) *LiveRunnerRegistry

func (*LiveRunnerRegistry) CreateSessionProxy

func (r *LiveRunnerRegistry) CreateSessionProxy(runnerID, sessionID, targetURL string) (LiveRunnerProxy, error)

func (*LiveRunnerRegistry) CreateTrickleChannel

func (r *LiveRunnerRegistry) CreateTrickleChannel(runnerID, sessionID, name, mimeType string) (LiveRunnerTrickleChannel, error)

func (*LiveRunnerRegistry) DeleteTrickleChannel

func (r *LiveRunnerRegistry) DeleteTrickleChannel(runnerID, sessionID, name string) error

func (*LiveRunnerRegistry) Heartbeat

func (*LiveRunnerRegistry) PaymentInfo

func (r *LiveRunnerRegistry) PaymentInfo(runnerID string) (*LiveRunnerPriceInfo, error)

func (*LiveRunnerRegistry) RegisterStaticRunners

func (*LiveRunnerRegistry) RegisterStaticRunnersJSON

func (r *LiveRunnerRegistry) RegisterStaticRunnersJSON(data []byte) (*StaticLiveRunnerRegistrationResponse, error)

func (*LiveRunnerRegistry) ReleaseSession

func (r *LiveRunnerRegistry) ReleaseSession(runnerID, sessionID string) error

func (*LiveRunnerRegistry) ReserveSession

func (r *LiveRunnerRegistry) ReserveSession(runnerID string, optSessionID ...string) (string, string, error)

ReserveSession reserves runner capacity and returns the session ID and the URL its caller should use for the app request. Persistent reservations return a public app URL, while single-shot reservations return the runner endpoint for internal forwarding.

func (*LiveRunnerRegistry) ResolveSessionProxy

func (r *LiveRunnerRegistry) ResolveSessionProxy(host, path string) (LiveRunnerProxyRoute, bool, error)

func (*LiveRunnerRegistry) RunnerEndpointForSession

func (r *LiveRunnerRegistry) RunnerEndpointForSession(runnerID, sessionID string) (string, error)

func (*LiveRunnerRegistry) RunnerMode

func (r *LiveRunnerRegistry) RunnerMode(runnerID string) (string, error)

func (*LiveRunnerRegistry) Runners

func (*LiveRunnerRegistry) SessionPriceInfo

func (r *LiveRunnerRegistry) SessionPriceInfo(runnerID, sessionID string) (LiveRunnerPriceInfo, error)

func (*LiveRunnerRegistry) SessionTokenForSession

func (r *LiveRunnerRegistry) SessionTokenForSession(runnerID, sessionID string) (string, error)

func (*LiveRunnerRegistry) SetTrickleServer

func (r *LiveRunnerRegistry) SetTrickleServer(srv *trickle.Server, publicBaseURL, internalBaseURL string)

func (*LiveRunnerRegistry) Stop

func (r *LiveRunnerRegistry) Stop()

func (*LiveRunnerRegistry) Unregister

func (r *LiveRunnerRegistry) Unregister(runnerID, auth string) error

func (*LiveRunnerRegistry) ValidSessionToken

func (r *LiveRunnerRegistry) ValidSessionToken(runnerID, sessionID, token string) error

type LiveRunnerRegistryConfig

type LiveRunnerRegistryConfig struct {
	Host             RunnerHost
	Onchain          bool
	ProxyURLTemplate string
	O2RInterval      time.Duration
}

type LiveRunnerTrickleChannel

type LiveRunnerTrickleChannel struct {
	Name        string `json:"name"`
	ChannelName string `json:"channel_name"`
	URL         string `json:"url"`
	InternalURL string `json:"internal_url,omitempty"`
	MimeType    string `json:"mime_type"`
}

type RunnerError

type RunnerError struct {
	StatusCode int
	Message    string
}

func (*RunnerError) Error

func (e *RunnerError) Error() string

type RunnerHost

type RunnerHost interface {
	ServiceURI() *url.URL
	LiveRunnerURI() *url.URL
	RegistrationSecret() string
}

type StaticLiveRunnerConfig

type StaticLiveRunnerConfig struct {
	Runners []StaticLiveRunnerConfigEntry `json:"runners"`
}

func ParseStaticLiveRunnerConfig

func ParseStaticLiveRunnerConfig(data []byte) (StaticLiveRunnerConfig, error)

type StaticLiveRunnerConfigEntry

type StaticLiveRunnerConfigEntry struct {
	Label             string              `json:"label,omitempty"`
	Routing           string              `json:"routing,omitempty"`
	Proxy             bool                `json:"proxy,omitempty"`
	RunnerURL         string              `json:"runner_url"`
	Version           string              `json:"version,omitempty"`
	Metadata          string              `json:"metadata,omitempty"`
	Mode              string              `json:"mode,omitempty"`
	GPU               *LiveRunnerGPU      `json:"gpu,omitempty"`
	App               string              `json:"app"`
	Capacity          int                 `json:"capacity"`
	PriceInfo         LiveRunnerPriceInfo `json:"price_info"`
	HealthURL         string              `json:"health_url"`
	HealthyStatusCode int                 `json:"healthy_status_code,omitempty"`
}

type StaticLiveRunnerRegistration

type StaticLiveRunnerRegistration struct {
	RunnerID          string `json:"runner_id"`
	Label             string `json:"label,omitempty"`
	App               string `json:"app"`
	Proxy             bool   `json:"proxy,omitempty"`
	RunnerURL         string `json:"runner_url"`
	Mode              string `json:"mode,omitempty"`
	HealthURL         string `json:"health_url"`
	HealthyStatusCode int    `json:"healthy_status_code"`
	Healthy           bool   `json:"healthy"`
}

type StaticLiveRunnerRegistrationResponse

type StaticLiveRunnerRegistrationResponse struct {
	Runners []StaticLiveRunnerRegistration `json:"runners"`
}

Jump to

Keyboard shortcuts

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