Documentation
¶
Index ¶
- Constants
- func ValidateLiveRunnerMetadata(metadata string) error
- func ValidateProxyURLTemplate(raw string, serviceURI *url.URL) error
- type LiveRunnerDiscoveryRunner
- type LiveRunnerGPU
- type LiveRunnerHeartbeatRequest
- type LiveRunnerHeartbeatResponse
- type LiveRunnerPriceInfo
- type LiveRunnerProxy
- type LiveRunnerProxyRoute
- type LiveRunnerRegistry
- func (r *LiveRunnerRegistry) CreateSessionProxy(runnerID, sessionID, targetURL string) (LiveRunnerProxy, error)
- func (r *LiveRunnerRegistry) CreateTrickleChannel(runnerID, sessionID, name, mimeType string) (LiveRunnerTrickleChannel, error)
- func (r *LiveRunnerRegistry) DeleteTrickleChannel(runnerID, sessionID, name string) error
- func (r *LiveRunnerRegistry) Heartbeat(req LiveRunnerHeartbeatRequest, auth string) (*LiveRunnerHeartbeatResponse, error)
- func (r *LiveRunnerRegistry) PaymentInfo(runnerID string) (*LiveRunnerPriceInfo, error)
- func (r *LiveRunnerRegistry) RegisterStaticRunners(cfg StaticLiveRunnerConfig) (*StaticLiveRunnerRegistrationResponse, error)
- func (r *LiveRunnerRegistry) RegisterStaticRunnersJSON(data []byte) (*StaticLiveRunnerRegistrationResponse, error)
- func (r *LiveRunnerRegistry) ReleaseSession(runnerID, sessionID string) error
- func (r *LiveRunnerRegistry) ReserveSession(runnerID string, optSessionID ...string) (string, string, error)
- func (r *LiveRunnerRegistry) ResolveSessionProxy(host, path string) (LiveRunnerProxyRoute, bool, error)
- func (r *LiveRunnerRegistry) RunnerEndpointForSession(runnerID, sessionID string) (string, error)
- func (r *LiveRunnerRegistry) RunnerMode(runnerID string) (string, error)
- func (r *LiveRunnerRegistry) Runners() []LiveRunnerDiscoveryRunner
- func (r *LiveRunnerRegistry) SessionPriceInfo(runnerID, sessionID string) (LiveRunnerPriceInfo, error)
- func (r *LiveRunnerRegistry) SessionTokenForSession(runnerID, sessionID string) (string, error)
- func (r *LiveRunnerRegistry) SetTrickleServer(srv *trickle.Server, publicBaseURL, internalBaseURL string)
- func (r *LiveRunnerRegistry) Stop()
- func (r *LiveRunnerRegistry) Unregister(runnerID, auth string) error
- func (r *LiveRunnerRegistry) ValidSessionToken(runnerID, sessionID, token string) error
- type LiveRunnerRegistryConfig
- type LiveRunnerTrickleChannel
- type RunnerError
- type RunnerHost
- type StaticLiveRunnerConfig
- type StaticLiveRunnerConfigEntry
- type StaticLiveRunnerRegistration
- type StaticLiveRunnerRegistrationResponse
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 ¶
ValidateLiveRunnerMetadata validates application-controlled runner metadata.
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 LiveRunnerProxy ¶
type LiveRunnerProxyRoute ¶
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 (r *LiveRunnerRegistry) Heartbeat(req LiveRunnerHeartbeatRequest, auth string) (*LiveRunnerHeartbeatResponse, error)
func (*LiveRunnerRegistry) PaymentInfo ¶
func (r *LiveRunnerRegistry) PaymentInfo(runnerID string) (*LiveRunnerPriceInfo, error)
func (*LiveRunnerRegistry) RegisterStaticRunners ¶
func (r *LiveRunnerRegistry) RegisterStaticRunners(cfg StaticLiveRunnerConfig) (*StaticLiveRunnerRegistrationResponse, error)
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 (r *LiveRunnerRegistry) Runners() []LiveRunnerDiscoveryRunner
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 RunnerError ¶
func (*RunnerError) Error ¶
func (e *RunnerError) Error() string
type RunnerHost ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.