Documentation
¶
Index ¶
- Constants
- Variables
- type Orchestrator
- func (o *Orchestrator) AdminNodeDetail(clusterID uuid.UUID, nodeID string) (*api.NodeDetail, error)
- func (o *Orchestrator) AdminNodes(clusterID uuid.UUID) ([]*api.Node, error)
- func (o *Orchestrator) Close(ctx context.Context) error
- func (o *Orchestrator) CreateSandbox(ctx context.Context, sandboxID, executionID string, team *teamtypes.Team, ...) (sbx sandbox.Sandbox, apiErr *api.APIError)
- func (o *Orchestrator) CreateSnapshotTemplate(ctx context.Context, teamID uuid.UUID, sandboxID string, ...) (result SnapshotTemplateResult, e error)
- func (o *Orchestrator) GetClusterNodes(clusterID uuid.UUID) []*nodemanager.Node
- func (o *Orchestrator) GetNode(clusterID uuid.UUID, nodeID string) *nodemanager.Node
- func (o *Orchestrator) GetNodeByNomadShortID(id string) *nodemanager.Nodedeprecated
- func (o *Orchestrator) GetNodeRouteIPAddress(clusterID uuid.UUID, nodeID string) string
- func (o *Orchestrator) GetSandbox(ctx context.Context, teamID uuid.UUID, sandboxID string) (sandbox.Sandbox, error)
- func (o *Orchestrator) GetSandboxes(ctx context.Context, teamID uuid.UUID, states []sandbox.State) ([]sandbox.Sandbox, error)
- func (o *Orchestrator) HandleExistingSandboxAutoResume(ctx context.Context, teamID uuid.UUID, sandboxID string, ...) (string, bool, error)
- func (o *Orchestrator) KeepAliveFor(ctx context.Context, teamID uuid.UUID, sandboxID string, ...) (*sandbox.Sandbox, *api.APIError)
- func (o *Orchestrator) NodeCount() int
- func (o *Orchestrator) RemoveSandbox(ctx context.Context, teamID uuid.UUID, sandboxID string, ...) error
- func (o *Orchestrator) UpdateSandbox(ctx context.Context, sandboxID string, endTime time.Time, clusterID uuid.UUID, ...) error
- func (o *Orchestrator) UpdateSandboxNetworkConfig(ctx context.Context, teamID uuid.UUID, sandboxID string, ...) *api.APIError
- func (o *Orchestrator) WaitForStateChange(ctx context.Context, teamID uuid.UUID, sandboxID string) error
- type PauseQueueExhaustedError
- type SandboxDataFetcher
- type SandboxMetadata
- type SnapshotCacheInvalidator
- type SnapshotTemplateOpts
- type SnapshotTemplateResult
Constants ¶
View Source
const MaxAutoResumeTransitionRetries = 3
Variables ¶
View Source
var ( ErrSandboxNotFound = errors.New("sandbox not found") ErrAccessForbidden = errors.New("access forbidden") ErrSandboxOperationFailed = errors.New("sandbox operation failed") )
View Source
var ErrNodeNotFound = errors.New("node not found")
View Source
var ErrSandboxStillTransitioning = errors.New(sharedproxygrpc.SandboxStillTransitioningMessage)
Functions ¶
This section is empty.
Types ¶
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, config cfg.Config, tel *telemetry.Client, nodeDiscovery discovery.Discovery, posthogClient *analyticscollector.PosthogClient, redisClient redis.UniversalClient, sqlcDB *sqlcdb.Client, clusters *clusters.Pool, featureFlags *featureflags.Client, accessTokenGenerator *sandbox.AccessTokenGenerator, snapshotCache SnapshotCacheInvalidator, snapshotUpsertSem *utils.AdjustableSemaphore, ) (*Orchestrator, error)
func (*Orchestrator) AdminNodeDetail ¶
func (o *Orchestrator) AdminNodeDetail(clusterID uuid.UUID, nodeID string) (*api.NodeDetail, error)
func (*Orchestrator) AdminNodes ¶
func (*Orchestrator) CreateSandbox ¶
func (o *Orchestrator) CreateSandbox( ctx context.Context, sandboxID, executionID string, team *teamtypes.Team, getSandboxData SandboxDataFetcher, startTime time.Time, endTime time.Time, timeout time.Duration, isResume bool, creationMeta sandbox.CreationMetadata, ) (sbx sandbox.Sandbox, apiErr *api.APIError)
func (*Orchestrator) CreateSnapshotTemplate ¶
func (o *Orchestrator) CreateSnapshotTemplate(ctx context.Context, teamID uuid.UUID, sandboxID string, opts SnapshotTemplateOpts) (result SnapshotTemplateResult, e error)
CreateSnapshotTemplate creates a persistent snapshot template from a running sandbox and immediately resumes it. The handler is responsible for parsing the name, resolving aliases via the cache, and populating opts.
func (*Orchestrator) GetClusterNodes ¶
func (o *Orchestrator) GetClusterNodes(clusterID uuid.UUID) []*nodemanager.Node
func (*Orchestrator) GetNode ¶
func (o *Orchestrator) GetNode(clusterID uuid.UUID, nodeID string) *nodemanager.Node
func (*Orchestrator) GetNodeByNomadShortID
deprecated
func (o *Orchestrator) GetNodeByNomadShortID(id string) *nodemanager.Node
Deprecated: use GetNode instead
func (*Orchestrator) GetNodeRouteIPAddress ¶
func (o *Orchestrator) GetNodeRouteIPAddress(clusterID uuid.UUID, nodeID string) string
func (*Orchestrator) GetSandbox ¶
func (*Orchestrator) GetSandboxes ¶
func (o *Orchestrator) GetSandboxes(ctx context.Context, teamID uuid.UUID, states []sandbox.State) ([]sandbox.Sandbox, error)
GetSandboxes returns instances for a given team.
func (*Orchestrator) HandleExistingSandboxAutoResume ¶
func (*Orchestrator) KeepAliveFor ¶
func (*Orchestrator) NodeCount ¶
func (o *Orchestrator) NodeCount() int
func (*Orchestrator) RemoveSandbox ¶
func (o *Orchestrator) RemoveSandbox(ctx context.Context, teamID uuid.UUID, sandboxID string, opts sandbox.RemoveOpts) error
func (*Orchestrator) UpdateSandbox ¶
func (*Orchestrator) UpdateSandboxNetworkConfig ¶
func (*Orchestrator) WaitForStateChange ¶
type PauseQueueExhaustedError ¶
type PauseQueueExhaustedError struct{}
func (PauseQueueExhaustedError) Error ¶
func (PauseQueueExhaustedError) Error() string
type SandboxDataFetcher ¶
type SandboxDataFetcher func(ctx context.Context) (SandboxMetadata, *api.APIError)
SandboxDataFetcher is a callback that fetches sandbox metadata. It is called after the concurrency lock is acquired to ensure fresh data.
type SandboxMetadata ¶
type SandboxMetadata struct {
Metadata map[string]string
EnvVars map[string]string
Build queries.EnvBuild
AllowInternetAccess *bool
Network *types.SandboxNetworkConfig
Alias string
TemplateID string
BaseTemplateID string
AutoPause bool
AutoResume *types.SandboxAutoResumeConfig
VolumeMounts []*orchestrator.SandboxVolumeMount
EnvdAccessToken *string
NodeID *string
}
type SnapshotCacheInvalidator ¶
SnapshotCacheInvalidator invalidates cached snapshot entries.
type SnapshotTemplateOpts ¶
type SnapshotTemplateOpts struct {
// ExistingTemplateID is set when the alias resolved to an existing template owned by the team.
ExistingTemplateID *string
// Alias is the parsed alias name (without namespace). Set when a name was provided.
Alias *string
// Namespace is the team slug used for alias scoping. Set when a name was provided.
Namespace *string
// Tag is the build tag parsed from the name, defaults to "default".
Tag string
}
type SnapshotTemplateResult ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package discovery enumerates running orchestrator (Firecracker host) instances for the API to route sandbox calls to.
|
Package discovery enumerates running orchestrator (Firecracker host) instances for the API to route sandbox calls to. |
Click to show internal directories.
Click to hide internal directories.