Documentation
¶
Index ¶
- Constants
- Variables
- func DrainOnShutdown(drain context.Context) echo.MiddlewareFunc
- func HTTPBadRequest(message string) error
- func HTTPClientClosedRequest(ctx echo.Context) error
- func HTTPConflict(message string) error
- func HTTPForbidden(message string) error
- func HTTPInternalServerError(message string) error
- func HTTPNotFound() error
- func HTTPUnauthorized(message string) error
- func IsRequestCanceled(ctx echo.Context, err error) bool
- func NewHTTPError(code int, message string) error
- func RedactWebhook(w types.WorkspaceWebhook) types.WorkspaceWebhook
- func SetConfigField(config *types.StubConfigV1, fieldPath string, value interface{}) error
- func ValidateWebhookURL(ctx context.Context, raw string) error
- type AppGroup
- type AppListResponse
- type AppWithLatestStubOrDeployment
- type ClipAccessMetric
- type ClusterAdminTokensRequestSerializer
- type CommonClients
- type ConcurrencyLimitGroup
- func (c *ConcurrencyLimitGroup) CreateConcurrencyLimit(ctx echo.Context) error
- func (c *ConcurrencyLimitGroup) DeleteConcurrencyLimit(ctx echo.Context) error
- func (c *ConcurrencyLimitGroup) GetConcurrencyLimitByWorkspaceId(ctx echo.Context) error
- func (c *ConcurrencyLimitGroup) ListConcurrencyLimitsByWorkspaceId(ctx echo.Context) error
- func (c *ConcurrencyLimitGroup) RevertConcurrencyLimit(ctx echo.Context) error
- type ContainerEventSummary
- type ContainerEventsBatchRequest
- type ContainerEventsBatchResponse
- type ContainerEventsBatchTarget
- type ContainerEventsCoverage
- type ContainerGroup
- func (c *ContainerGroup) GetContainer(ctx echo.Context) error
- func (c *ContainerGroup) GetContainerAsAdmin(ctx echo.Context) error
- func (c *ContainerGroup) ListContainersByWorkspaceId(ctx echo.Context) error
- func (c *ContainerGroup) StopAllWorkspaceContainers(ctx echo.Context) error
- func (c *ContainerGroup) StopContainer(ctx echo.Context) error
- type ContainerLifecycleMetric
- type ContainerMetricSummary
- type ContainerPhaseSummary
- type ContainerStageSummary
- type ContainerStateWithAppId
- type CreateWorkspaceRequest
- type CreateWorkspaceStorageRequest
- type DatabaseGroup
- type DatabaseManager
- type DeploymentGroup
- func (g *DeploymentGroup) DeleteDeployment(ctx echo.Context) error
- func (g *DeploymentGroup) DownloadDeploymentPackage(ctx echo.Context) error
- func (g *DeploymentGroup) GetURL(ctx echo.Context) error
- func (g *DeploymentGroup) ListDeployments(ctx echo.Context) error
- func (g *DeploymentGroup) ListLatestDeployments(ctx echo.Context) error
- func (g *DeploymentGroup) RetrieveDeployment(ctx echo.Context) error
- func (g *DeploymentGroup) StartDeployment(ctx echo.Context) error
- func (g *DeploymentGroup) StopAllActiveDeployments(ctx echo.Context) error
- func (g *DeploymentGroup) StopDeployment(ctx echo.Context) error
- type EventGroup
- func (g *EventGroup) GetContainerEventSummary(ctx echo.Context) error
- func (g *EventGroup) GetContainerEvents(ctx echo.Context) error
- func (g *EventGroup) GetContainerEventsBatch(ctx echo.Context) error
- func (g *EventGroup) GetEventHistory(ctx echo.Context) error
- func (g *EventGroup) GetTaskEvents(ctx echo.Context) error
- func (g *EventGroup) StreamAppNamespaceEvents(ctx echo.Context) error
- func (g *EventGroup) StreamContainerEvents(ctx echo.Context) error
- func (g *EventGroup) StreamStubEvents(ctx echo.Context) error
- func (g *EventGroup) StreamTaskEvents(ctx echo.Context) error
- func (g *EventGroup) StreamWorkspaceEvents(ctx echo.Context) error
- type HealthGroup
- type LogGroup
- type MachineGroup
- type MetricsGroup
- type OverrideStubConfig
- type PoolGroup
- type PoolService
- type SandboxCreatedBucket
- type SandboxListResponse
- type SandboxRow
- type SandboxStatsResponse
- type SandboxTimeline
- type ScaleStubRequest
- type StackGroup
- type StackRequest
- type StopTasksRequest
- type StubGroup
- func (g *StubGroup) CloneStubPublic(ctx echo.Context) error
- func (g *StubGroup) GetConfig(ctx echo.Context) error
- func (g *StubGroup) GetSandboxStats(ctx echo.Context) error
- func (g *StubGroup) GetSandboxTimeline(ctx echo.Context) error
- func (g *StubGroup) GetURL(ctx echo.Context) error
- func (g *StubGroup) ListSandboxes(ctx echo.Context) error
- func (g *StubGroup) ListStubs(ctx echo.Context) error
- func (g *StubGroup) ListStubsByWorkspaceId(ctx echo.Context) error
- func (g *StubGroup) RetrieveStub(ctx echo.Context) error
- func (g *StubGroup) ScaleStub(ctx echo.Context) error
- func (g *StubGroup) UpdateConfig(ctx echo.Context) error
- type TaskGroup
- func (g *TaskGroup) AggregateTasksByTimeWindow(ctx echo.Context) error
- func (g *TaskGroup) GetClusterTaskMetrics(ctx echo.Context) error
- func (g *TaskGroup) GetTaskCountByDeployment(ctx echo.Context) error
- func (g *TaskGroup) ListTasksPaginated(ctx echo.Context) error
- func (g *TaskGroup) RetrieveTask(ctx echo.Context) error
- func (g *TaskGroup) StopTasks(ctx echo.Context) error
- func (g *TaskGroup) SubscribeTask(ctx echo.Context) error
- type TokenGroup
- func (g *TokenGroup) ClusterAdminUpdateAllWorkspaceTokens(ctx echo.Context) error
- func (g *TokenGroup) CreateWorkspaceToken(ctx echo.Context) error
- func (g *TokenGroup) DeleteWorkspaceToken(ctx echo.Context) error
- func (g *TokenGroup) GetSigningKey(ctx echo.Context) error
- func (g *TokenGroup) ListWorkspaceTokens(ctx echo.Context) error
- func (g *TokenGroup) ToggleWorkspaceToken(ctx echo.Context) error
- type UpdateConfigRequest
- type WebhookGroup
- type WebhookRequest
- type WorkspaceConfigExport
- type WorkspaceGroup
- func (g *WorkspaceGroup) CreateWorkspace(ctx echo.Context) error
- func (g *WorkspaceGroup) CreateWorkspaceStorage(ctx echo.Context) error
- func (g *WorkspaceGroup) CurrentWorkspace(ctx echo.Context) error
- func (g *WorkspaceGroup) ExportWorkspaceConfig(ctx echo.Context) error
- func (g *WorkspaceGroup) Limits(ctx echo.Context) error
- func (g *WorkspaceGroup) SetExternalWorkspaceStorage(ctx echo.Context) error
- type WorkspaceLimits
Constants ¶
const ( HttpServerBaseRoute string = "/api/v1" HttpServerRootRoute string = "" )
const ( SandboxStatusPending = string(types.ContainerStatusPending) // "PENDING" SandboxStatusRunning = string(types.ContainerStatusRunning) // "RUNNING" SandboxStatusStopping = string(types.ContainerStatusStopping) // "STOPPING" SandboxStatusStopped = "STOPPED" SandboxStatusFailed = "FAILED" )
Sandbox status values surfaced to the dashboard. The live states reuse the canonical container status enum (types.ContainerStatus) so the dashboard filters line up with actual container states; the terminal states cover sandboxes that no longer have an active container.
const DatabaseCreateTimeout = 10 * time.Minute
Variables ¶
var ( DefaultTaskOutputExpirationS uint32 = 3600 DefaultTaskSubscribeIntervalS uint32 = 1 )
Functions ¶
func DrainOnShutdown ¶
func DrainOnShutdown(drain context.Context) echo.MiddlewareFunc
DrainOnShutdown disconnects resumable subscriptions when a gateway drains. Ordinary API calls and application requests retain their graceful shutdown budget; idle observers should reconnect to a serving replica immediately.
func HTTPBadRequest ¶
func HTTPClientClosedRequest ¶
func HTTPConflict ¶
func HTTPForbidden ¶
func HTTPInternalServerError ¶
func HTTPNotFound ¶
func HTTPNotFound() error
func HTTPUnauthorized ¶
func NewHTTPError ¶
func RedactWebhook ¶
func RedactWebhook(w types.WorkspaceWebhook) types.WorkspaceWebhook
RedactWebhook returns a copy without its signing secret.
func SetConfigField ¶
func SetConfigField(config *types.StubConfigV1, fieldPath string, value interface{}) error
SetConfigField sets a dotted path such as runtime.cpu or autoscaler.max_containers.
Types ¶
type AppGroup ¶
type AppGroup struct {
// contains filtered or unexported fields
}
func NewAppGroup ¶
func NewAppGroup(g *echo.Group, backendRepo repository.BackendRepository, config types.AppConfig, containerRepo repository.ContainerRepository, scheduler scheduler.Scheduler, redisClient *common.RedisClient) *AppGroup
func (*AppGroup) GetAppActivity ¶
GetAppActivity returns the last 24h of hourly activity for a set of apps in one call: tasks created (and failed) from Postgres, sandboxes created from the Redis counters bumped at creation. Every app gets a full, zero-filled series so the client never has to align buckets itself.
func (*AppGroup) ListAppWithLatestActivity ¶
type AppListResponse ¶
type AppListResponse struct {
repoCommon.CursorPaginationInfo[AppWithLatestStubOrDeployment]
StateCounts types.AppStateCounts `json:"state_counts" serializer:"state_counts"`
}
AppListResponse is a page of apps plus workspace-wide state counts, so the dashboard's Running / Idle / Stopped tabs describe the whole workspace and not just the page that happens to be loaded.
type AppWithLatestStubOrDeployment ¶
type AppWithLatestStubOrDeployment struct {
types.App
Stub *types.StubWithRelated `json:"stub,omitempty" serializer:"stub"`
Deployment *types.DeploymentWithRelated `json:"deployment,omitempty" serializer:"deployment"`
URL string `json:"url,omitempty" serializer:"url,omitempty"`
InvokeURL string `json:"invoke_url,omitempty" serializer:"invoke_url,omitempty"`
ConnectionURL string `json:"connection_url,omitempty" serializer:"connection_url,omitempty"`
PoolName string `json:"pool_name" serializer:"pool_name"`
// RunningContainers counts running containers across every stub in the
// app, not just the latest one, so multi-function and multi-config apps
// read as live whenever any of them is doing work.
RunningContainers int `json:"running_containers" serializer:"running_containers"`
// ActiveDeployments counts deployments in the app that are currently
// active (deployed and not stopped), across all of its functions.
ActiveDeployments int `json:"active_deployments" serializer:"active_deployments"`
// State is derived from the two counts above: running > idle > stopped.
// Only the list endpoint knows running containers, so only it sets this.
State types.AppState `json:"state,omitempty" serializer:"state,omitempty"`
IsService bool `json:"is_service" serializer:"is_service"`
Serving *types.ServingConfig `json:"serving,omitempty" serializer:"serving"`
}
type ClipAccessMetric ¶
type ClipAccessMetric struct {
Operation string `json:"operation,omitempty"`
Path string `json:"path,omitempty"`
Source string `json:"source,omitempty"`
LayerDigest string `json:"layer_digest,omitempty"`
DecompressedHash string `json:"decompressed_hash,omitempty"`
ContentHash string `json:"content_hash,omitempty"`
Count int `json:"count"`
TotalUs int64 `json:"total_us,omitempty"`
MaxUs int64 `json:"max_us,omitempty"`
TotalMs int64 `json:"total_ms"`
MaxMs int64 `json:"max_ms"`
BytesRead int64 `json:"bytes_read"`
}
type ClusterAdminTokensRequestSerializer ¶
type ClusterAdminTokensRequestSerializer struct {
Disabled bool `json:"disabled"`
}
type CommonClients ¶
type CommonClients struct {
// contains filtered or unexported fields
}
type ConcurrencyLimitGroup ¶
type ConcurrencyLimitGroup struct {
// contains filtered or unexported fields
}
func NewConcurrencyLimitGroup ¶
func NewConcurrencyLimitGroup( g *echo.Group, backendRepo repository.BackendRepository, workspaceRepo repository.WorkspaceRepository, ) *ConcurrencyLimitGroup
func (*ConcurrencyLimitGroup) CreateConcurrencyLimit ¶
func (c *ConcurrencyLimitGroup) CreateConcurrencyLimit(ctx echo.Context) error
func (*ConcurrencyLimitGroup) DeleteConcurrencyLimit ¶
func (c *ConcurrencyLimitGroup) DeleteConcurrencyLimit(ctx echo.Context) error
func (*ConcurrencyLimitGroup) GetConcurrencyLimitByWorkspaceId ¶
func (c *ConcurrencyLimitGroup) GetConcurrencyLimitByWorkspaceId(ctx echo.Context) error
func (*ConcurrencyLimitGroup) ListConcurrencyLimitsByWorkspaceId ¶
func (c *ConcurrencyLimitGroup) ListConcurrencyLimitsByWorkspaceId(ctx echo.Context) error
func (*ConcurrencyLimitGroup) RevertConcurrencyLimit ¶
func (c *ConcurrencyLimitGroup) RevertConcurrencyLimit(ctx echo.Context) error
type ContainerEventSummary ¶
type ContainerEventSummary struct {
ContainerID string `json:"container_id"`
WorkspaceID string `json:"workspace_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
Status string `json:"status,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
RootCauseEvent string `json:"root_cause_event,omitempty"`
EventCount int `json:"event_count"`
Summary map[string]int64 `json:"summary"`
Stages []ContainerStageSummary `json:"stages,omitempty"`
Lifecycle []ContainerLifecycleMetric `json:"lifecycle,omitempty"`
SlowestLifecycle []ContainerLifecycleMetric `json:"slowest_lifecycle,omitempty"`
ClipAccesses []ClipAccessMetric `json:"clip_accesses,omitempty"`
Missing []string `json:"missing,omitempty"`
Streams []string `json:"streams,omitempty"`
CanonicalStream string `json:"canonical_stream,omitempty"`
Events []types.ContainerEventRecord `json:"events,omitempty"`
Error string `json:"error,omitempty"`
}
type ContainerEventsBatchRequest ¶
type ContainerEventsBatchRequest struct {
ContainerIDs []string `json:"container_ids"`
TaskIDs []string `json:"task_ids"`
Targets []ContainerEventsBatchTarget `json:"targets,omitempty"`
Limit uint64 `json:"limit,omitempty"`
EventTypes []string `json:"event_types,omitempty"`
IncludeEvents bool `json:"include_events,omitempty"`
TopLifecycle int `json:"top_lifecycle,omitempty"`
RequiredLifecycleIDs []string `json:"required_lifecycle_ids,omitempty"`
RequiredMetrics []string `json:"required_metrics,omitempty"`
}
type ContainerEventsBatchResponse ¶
type ContainerEventsBatchResponse struct {
Count int `json:"count"`
Items []ContainerEventSummary `json:"items"`
Summary map[string]ContainerMetricSummary `json:"summary"`
Coverage ContainerEventsCoverage `json:"coverage"`
Stages []ContainerPhaseSummary `json:"stages"`
Phases []ContainerPhaseSummary `json:"phases"`
TopBottlenecks []ContainerPhaseSummary `json:"top_bottlenecks"`
PrimaryBottleneck *ContainerPhaseSummary `json:"primary_bottleneck,omitempty"`
}
type ContainerEventsCoverage ¶
type ContainerEventsCoverage struct {
RequestedContainers int `json:"requested_containers"`
Items int `json:"items"`
ContainersWithEvents int `json:"containers_with_events"`
EventErrors int `json:"event_errors"`
MissingContainers []string `json:"missing_containers,omitempty"`
RequiredLifecyclePresent int `json:"required_lifecycle_present"`
RequiredLifecycleTotal int `json:"required_lifecycle_total"`
RequiredLifecycleMissing map[string]int `json:"required_lifecycle_missing"`
RequiredMetricPresent int `json:"required_metric_present"`
RequiredMetricTotal int `json:"required_metric_total"`
RequiredMetricMissing map[string]int `json:"required_metric_missing"`
}
type ContainerGroup ¶
type ContainerGroup struct {
// contains filtered or unexported fields
}
func NewContainerGroup ¶
func NewContainerGroup( g *echo.Group, backendRepo repository.BackendRepository, containerRepo repository.ContainerRepository, scheduler scheduler.Scheduler, config types.AppConfig, ) *ContainerGroup
func (*ContainerGroup) GetContainer ¶
func (c *ContainerGroup) GetContainer(ctx echo.Context) error
func (*ContainerGroup) GetContainerAsAdmin ¶
func (c *ContainerGroup) GetContainerAsAdmin(ctx echo.Context) error
func (*ContainerGroup) ListContainersByWorkspaceId ¶
func (c *ContainerGroup) ListContainersByWorkspaceId(ctx echo.Context) error
func (*ContainerGroup) StopAllWorkspaceContainers ¶
func (c *ContainerGroup) StopAllWorkspaceContainers(ctx echo.Context) error
func (*ContainerGroup) StopContainer ¶
func (c *ContainerGroup) StopContainer(ctx echo.Context) error
type ContainerLifecycleMetric ¶
type ContainerLifecycleMetric struct {
EventID string `json:"event_id"`
Domain string `json:"domain,omitempty"`
ParentID string `json:"parent_id,omitempty"`
DurationMs int64 `json:"duration_ms"`
StartTime time.Time `json:"start_time,omitempty"`
EndTime time.Time `json:"end_time,omitempty"`
Success *bool `json:"success,omitempty"`
Attrs map[string]string `json:"attrs,omitempty"`
}
type ContainerMetricSummary ¶
type ContainerPhaseSummary ¶
type ContainerPhaseSummary struct {
MetricKey string `json:"metric_key"`
EventID string `json:"event_id"`
Label string `json:"label,omitempty"`
Domain string `json:"domain,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Count int `json:"count"`
Coverage float64 `json:"coverage"`
CoverageStatus string `json:"coverage_status"`
Rollup bool `json:"rollup,omitempty"`
Min int64 `json:"min_ms"`
Avg float64 `json:"avg_ms"`
P50 float64 `json:"p50_ms"`
P90 float64 `json:"p90_ms"`
P95 float64 `json:"p95_ms"`
P99 float64 `json:"p99_ms"`
Max int64 `json:"max_ms"`
Total int64 `json:"total_ms"`
}
type ContainerStageSummary ¶
type ContainerStateWithAppId ¶
type ContainerStateWithAppId struct {
types.ContainerState
AppId string `json:"app_id"`
}
type CreateWorkspaceRequest ¶
type CreateWorkspaceRequest struct{}
type CreateWorkspaceStorageRequest ¶
type CreateWorkspaceStorageRequest struct {
BucketName string `json:"bucket_name" validate:"required"`
AccessKey string `json:"access_key" validate:"required"`
SecretKey string `json:"secret_key" validate:"required"`
EndpointUrl string `json:"endpoint_url" validate:"required"`
Region string `json:"region" validate:"required"`
}
type DatabaseGroup ¶
type DatabaseGroup struct {
// contains filtered or unexported fields
}
func NewDatabaseGroup ¶
func NewDatabaseGroup(g *echo.Group, gws DatabaseManager) *DatabaseGroup
type DatabaseManager ¶
type DatabaseManager interface {
CreateDatabaseService(ctx context.Context, authInfo *auth.AuthInfo, params types.CreateDatabaseParams) (*types.DatabaseServiceInfo, error)
RotateDatabaseCredentials(ctx context.Context, authInfo *auth.AuthInfo, name string) (*types.DatabaseServiceInfo, error)
DeleteDatabaseService(ctx context.Context, authInfo *auth.AuthInfo, name string) error
ListDatabaseServices(ctx context.Context, authInfo *auth.AuthInfo) ([]types.DatabaseServiceInfo, error)
CheckDatabaseReadiness(ctx context.Context, authInfo *auth.AuthInfo, name, deploymentID string) (*types.DatabaseReadiness, error)
}
DatabaseManager is implemented by the gateway service.
type DeploymentGroup ¶
type DeploymentGroup struct {
// contains filtered or unexported fields
}
func NewDeploymentGroup ¶
func NewDeploymentGroup( g *echo.Group, backendRepo repository.BackendRepository, containerRepo repository.ContainerRepository, scheduler scheduler.Scheduler, redisClient *common.RedisClient, config types.AppConfig, ) *DeploymentGroup
func (*DeploymentGroup) DeleteDeployment ¶
func (g *DeploymentGroup) DeleteDeployment(ctx echo.Context) error
func (*DeploymentGroup) DownloadDeploymentPackage ¶
func (g *DeploymentGroup) DownloadDeploymentPackage(ctx echo.Context) error
func (*DeploymentGroup) ListDeployments ¶
func (g *DeploymentGroup) ListDeployments(ctx echo.Context) error
func (*DeploymentGroup) ListLatestDeployments ¶
func (g *DeploymentGroup) ListLatestDeployments(ctx echo.Context) error
func (*DeploymentGroup) RetrieveDeployment ¶
func (g *DeploymentGroup) RetrieveDeployment(ctx echo.Context) error
func (*DeploymentGroup) StartDeployment ¶
func (g *DeploymentGroup) StartDeployment(ctx echo.Context) error
func (*DeploymentGroup) StopAllActiveDeployments ¶
func (g *DeploymentGroup) StopAllActiveDeployments(ctx echo.Context) error
func (*DeploymentGroup) StopDeployment ¶
func (g *DeploymentGroup) StopDeployment(ctx echo.Context) error
type EventGroup ¶
type EventGroup struct {
// contains filtered or unexported fields
}
func NewEventGroup ¶
func NewEventGroup(g *echo.Group, backendRepo repository.BackendRepository, containerRepo repository.ContainerRepository, eventRepo repository.EventRepository, streamMiddleware echo.MiddlewareFunc) *EventGroup
func (*EventGroup) GetContainerEventSummary ¶
func (g *EventGroup) GetContainerEventSummary(ctx echo.Context) error
func (*EventGroup) GetContainerEvents ¶
func (g *EventGroup) GetContainerEvents(ctx echo.Context) error
func (*EventGroup) GetContainerEventsBatch ¶
func (g *EventGroup) GetContainerEventsBatch(ctx echo.Context) error
func (*EventGroup) GetEventHistory ¶
func (g *EventGroup) GetEventHistory(ctx echo.Context) error
func (*EventGroup) GetTaskEvents ¶
func (g *EventGroup) GetTaskEvents(ctx echo.Context) error
func (*EventGroup) StreamAppNamespaceEvents ¶
func (g *EventGroup) StreamAppNamespaceEvents(ctx echo.Context) error
func (*EventGroup) StreamContainerEvents ¶
func (g *EventGroup) StreamContainerEvents(ctx echo.Context) error
func (*EventGroup) StreamStubEvents ¶
func (g *EventGroup) StreamStubEvents(ctx echo.Context) error
func (*EventGroup) StreamTaskEvents ¶
func (g *EventGroup) StreamTaskEvents(ctx echo.Context) error
func (*EventGroup) StreamWorkspaceEvents ¶
func (g *EventGroup) StreamWorkspaceEvents(ctx echo.Context) error
type HealthGroup ¶
type HealthGroup struct {
// contains filtered or unexported fields
}
func NewHealthGroup ¶
func NewHealthGroup(g *echo.Group, rdb *common.RedisClient, backendRepo repository.BackendRepository, ready func() bool) *HealthGroup
func (*HealthGroup) HealthCheck ¶
func (h *HealthGroup) HealthCheck(c echo.Context) error
type LogGroup ¶
type LogGroup struct {
// contains filtered or unexported fields
}
func NewLogGroup ¶
func NewLogGroup(g *echo.Group, backendRepo repository.BackendRepository, containerRepo repository.ContainerRepository, computeRepo repository.ComputeRepository, eventRepo repository.EventRepository, streamMiddleware echo.MiddlewareFunc) *LogGroup
type MachineGroup ¶
type MachineGroup struct {
// contains filtered or unexported fields
}
func NewMachineGroup ¶
func NewMachineGroup(g *echo.Group, workerRepo repository.WorkerRepository) *MachineGroup
type MetricsGroup ¶
type MetricsGroup struct {
// contains filtered or unexported fields
}
func NewMetricsGroup ¶
func NewMetricsGroup(g *echo.Group, backendRepo repository.BackendRepository, eventRepo repository.EventRepository) *MetricsGroup
func (*MetricsGroup) GetPoolMetricTimeseries ¶
func (g *MetricsGroup) GetPoolMetricTimeseries(ctx echo.Context) error
func (*MetricsGroup) GetStubMetricTimeseries ¶
func (g *MetricsGroup) GetStubMetricTimeseries(ctx echo.Context) error
func (*MetricsGroup) GetWorkspaceMetricTimeseries ¶
func (g *MetricsGroup) GetWorkspaceMetricTimeseries(ctx echo.Context) error
func (*MetricsGroup) StreamStubMetrics ¶
func (g *MetricsGroup) StreamStubMetrics(ctx echo.Context) error
type OverrideStubConfig ¶
type PoolGroup ¶
type PoolGroup struct {
// contains filtered or unexported fields
}
func NewPoolGroup ¶
func NewPoolGroup(g *echo.Group, service PoolService) *PoolGroup
type PoolService ¶
type PoolService interface {
ListManagedPools(ctx context.Context, authInfo *auth.AuthInfo) ([]*model.ManagedPool, error)
CreateManagedPool(ctx context.Context, authInfo *auth.AuthInfo, name string, config types.WorkerPoolConfig) (*model.ManagedPool, error)
UpdateManagedPool(ctx context.Context, authInfo *auth.AuthInfo, name string, config types.WorkerPoolConfig) (*model.ManagedPool, error)
DeleteManagedPool(ctx context.Context, authInfo *auth.AuthInfo, name string) error
}
type SandboxCreatedBucket ¶
type SandboxListResponse ¶
type SandboxListResponse struct {
Data []SandboxRow `json:"data"`
Next string `json:"next"`
}
type SandboxRow ¶
type SandboxRow struct {
Id string `json:"id"`
StubId string `json:"stub_id,omitempty"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
Status string `json:"status"`
Gpu string `json:"gpu,omitempty"`
ContainerId string `json:"container_id,omitempty"`
TimeToStartedMs *int64 `json:"time_to_started_ms,omitempty"`
TimeToInteractiveMs *int64 `json:"time_to_interactive_ms,omitempty"`
LifetimeMs *int64 `json:"lifetime_ms,omitempty"`
StartedAtMs *int64 `json:"started_at_ms,omitempty"`
InteractiveAtMs *int64 `json:"interactive_at_ms,omitempty"`
}
type SandboxStatsResponse ¶
type SandboxStatsResponse struct {
Concurrent int `json:"concurrent"`
TotalCreated int `json:"total_created"`
RatePerSecond float64 `json:"rate_per_second"`
StatusCounts map[string]int `json:"status_counts"`
CreatedBuckets []SandboxCreatedBucket `json:"created_buckets"`
// Window the buckets, TotalCreated and RatePerSecond were computed over.
WindowStart time.Time `json:"window_start"`
WindowEnd time.Time `json:"window_end"`
}
type SandboxTimeline ¶
type SandboxTimeline struct {
ContainerId string `json:"container_id,omitempty"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
ScheduledAt *time.Time `json:"scheduled_at,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty"`
EndedAt *time.Time `json:"ended_at,omitempty"`
SchedulingMs *int64 `json:"scheduling_ms,omitempty"`
StartupMs *int64 `json:"startup_ms,omitempty"`
RuntimeMs *int64 `json:"runtime_ms,omitempty"`
}
type ScaleStubRequest ¶
type ScaleStubRequest struct {
Containers uint `json:"containers"`
}
type StackGroup ¶
type StackGroup struct {
// contains filtered or unexported fields
}
func NewStackGroup ¶
func NewStackGroup(g *echo.Group, backendRepo repository.BackendRepository) *StackGroup
type StackRequest ¶
type StackRequest struct {
Name string `json:"name"`
Spec json.RawMessage `json:"spec"`
}
type StopTasksRequest ¶
type StopTasksRequest struct {
TaskIds types.StringSlice `query:"task_ids"`
}
type StubGroup ¶
type StubGroup struct {
// contains filtered or unexported fields
}
func NewStubGroup ¶
func NewStubGroup(g *echo.Group, backendRepo repository.BackendRepository, containerRepo repository.ContainerRepository, eventRepo repository.EventRepository, redisClient *common.RedisClient, config types.AppConfig) *StubGroup
func (*StubGroup) GetSandboxStats ¶
GetSandboxStats returns aggregate stats for the sandboxes dashboard using the same container-backed rows as ListSandboxes.
func (*StubGroup) GetSandboxTimeline ¶
GetSandboxTimeline returns a Created -> Scheduled -> Started -> Ended timeline for a single sandbox, derived from S2 container lifecycle/scheduling events.
func (*StubGroup) ListSandboxes ¶
ListSandboxes returns a cursor-paginated list of sandboxes enriched with live status, GPU, time-to-started, and lifetime. It is scoped to the app when an app_id is provided, otherwise it lists all sandboxes in the workspace.
func (*StubGroup) ListStubsByWorkspaceId ¶
type TaskGroup ¶
type TaskGroup struct {
// contains filtered or unexported fields
}
func NewTaskGroup ¶
func NewTaskGroup(g *echo.Group, redisClient *common.RedisClient, taskRepo repository.TaskRepository, containerRepo repository.ContainerRepository, eventRepo repository.EventRepository, backendRepo repository.BackendRepository, taskDispatcher *task.Dispatcher, scheduler *scheduler.Scheduler, config types.AppConfig, streamMiddleware echo.MiddlewareFunc) *TaskGroup
func (*TaskGroup) AggregateTasksByTimeWindow ¶
func (*TaskGroup) GetClusterTaskMetrics ¶
func (*TaskGroup) GetTaskCountByDeployment ¶
func (*TaskGroup) ListTasksPaginated ¶
type TokenGroup ¶
type TokenGroup struct {
// contains filtered or unexported fields
}
func NewTokenGroup ¶
func NewTokenGroup(g *echo.Group, backendRepo repository.BackendRepository, workspaceRepo repository.WorkspaceRepository, config types.AppConfig) *TokenGroup
func (*TokenGroup) ClusterAdminUpdateAllWorkspaceTokens ¶
func (g *TokenGroup) ClusterAdminUpdateAllWorkspaceTokens(ctx echo.Context) error
func (*TokenGroup) CreateWorkspaceToken ¶
func (g *TokenGroup) CreateWorkspaceToken(ctx echo.Context) error
func (*TokenGroup) DeleteWorkspaceToken ¶
func (g *TokenGroup) DeleteWorkspaceToken(ctx echo.Context) error
func (*TokenGroup) GetSigningKey ¶
func (g *TokenGroup) GetSigningKey(ctx echo.Context) error
func (*TokenGroup) ListWorkspaceTokens ¶
func (g *TokenGroup) ListWorkspaceTokens(ctx echo.Context) error
func (*TokenGroup) ToggleWorkspaceToken ¶
func (g *TokenGroup) ToggleWorkspaceToken(ctx echo.Context) error
type UpdateConfigRequest ¶
type UpdateConfigRequest struct {
Fields map[string]interface{} `json:"fields"` // Map of field paths to values (e.g., {"runtime.cpu": 4, "runtime.memory": 8192})
}
type WebhookGroup ¶
type WebhookGroup struct {
// contains filtered or unexported fields
}
WebhookGroup edits a workspace's webhook subscriptions; the event sink delivers (its list cache expires within seconds).
func NewWebhookGroup ¶
func NewWebhookGroup(g *echo.Group, workspaceRepo repository.WorkspaceRepository) *WebhookGroup
type WebhookRequest ¶
type WorkspaceConfigExport ¶
type WorkspaceConfigExport struct {
GatewayHTTPHost string `json:"gateway_http_host"`
GatewayHTTPPort int `json:"gateway_http_port"`
GatewayHTTPTLS bool `json:"gateway_http_tls"`
GatewayGRPCHost string `json:"gateway_grpc_host"`
GatewayGRPCPort int `json:"gateway_grpc_port"`
GatewayGRPCTLS bool `json:"gateway_grpc_tls"`
WorkspaceID string `json:"workspace_id"`
Token string `json:"token"`
}
type WorkspaceGroup ¶
type WorkspaceGroup struct {
// contains filtered or unexported fields
}
func NewWorkspaceGroup ¶
func NewWorkspaceGroup(g *echo.Group, backendRepo repository.BackendRepository, workspaceRepo repository.WorkspaceRepository, defaultStorageClient *clients.StorageClient, config types.AppConfig) *WorkspaceGroup
func (*WorkspaceGroup) CreateWorkspace ¶
func (g *WorkspaceGroup) CreateWorkspace(ctx echo.Context) error
func (*WorkspaceGroup) CreateWorkspaceStorage ¶
func (g *WorkspaceGroup) CreateWorkspaceStorage(ctx echo.Context) error
CreateWorkspaceStorage creates a new bucket in the configured default storage provider. It then creates a new workspace storage object for that bucket and sets it as the storage bucket for the workspace.
func (*WorkspaceGroup) CurrentWorkspace ¶
func (g *WorkspaceGroup) CurrentWorkspace(ctx echo.Context) error
func (*WorkspaceGroup) ExportWorkspaceConfig ¶
func (g *WorkspaceGroup) ExportWorkspaceConfig(ctx echo.Context) error
func (*WorkspaceGroup) SetExternalWorkspaceStorage ¶
func (g *WorkspaceGroup) SetExternalWorkspaceStorage(ctx echo.Context) error
SetExternalWorkspaceStorage takes in the details for accessing an external s3 compatible storage bucket. This includes: - Bucket name - Access key - Secret key - Endpoint URL - Region It then creates a new workspace storage object for that bucket and sets it as the storage bucket for the workspace.
type WorkspaceLimits ¶
type WorkspaceLimits struct {
Cpu uint64 `json:"cpu"`
Memory uint64 `json:"memory"`
MaxReplicas uint64 `json:"max_replicas"`
MaxGpuCount uint32 `json:"max_gpu_count"`
GPULimit uint32 `json:"gpu_limit"`
CPUMillicoreLimit uint32 `json:"cpu_millicore_limit"`
GPUTypes []string `json:"gpu_types"`
}
WorkspaceLimits: per-stub ceilings, concurrency limit and GPU types a client may request.