Documentation
¶
Index ¶
- Constants
- Variables
- func GPUTypesToMap(gpuTypes []GpuType) map[string]int
- func GpuTypesToSlice(gpuTypes []GpuType) []string
- func GpuTypesToStrings(gpus []GpuType) []string
- func NewProviderNotImplemented() error
- func ParseConditionFromQueryFilters(out interface{}, queryFilters ...QueryFilter)
- func TempContainerWorkspace(containerId string) string
- func ValidateCpuAndMemory(cpu, memory int64, stubLimits StubLimits) (valid bool, errorMsg string)
- func WorkspaceBucketName(prefix, workspaceExternalId string) string
- type AbstractionConfig
- type AgentConfig
- type AlluxioConfig
- type App
- type AppConfig
- type AppFilter
- type Autoscaler
- type AutoscalerType
- type AvailableHost
- type BaseFilter
- type BotConfig
- type BuildOptions
- type BuildRegistryCredentialsConfig
- type CORSConfig
- type CRIUConfig
- type CRIUConfigMode
- type CapacityUpdateType
- type Checkpoint
- type CheckpointStatus
- type CheckpointStorageConfig
- type CheckpointStorageMode
- type ClipVersion
- type ConcurrencyLimit
- type ConfigmanConfig
- type Container
- type ContainerAlreadyScheduledError
- type ContainerCostHookConfig
- type ContainerEvent
- type ContainerExitCode
- type ContainerRequest
- type ContainerRequestStatus
- type ContainerResourceLimitsConfig
- type ContainerResourceUsage
- type ContainerRuntime
- type ContainerState
- type ContainerStatus
- type CrusoeProviderConfig
- type DatabaseConfig
- type DeletedWorkerReason
- type Deployment
- type DeploymentFilter
- type DeploymentWithRelated
- type DockerImageRegistryConfig
- type EC2ProviderConfig
- type ElasticSearchConfig
- type ErrCheckpointNotFound
- type ErrContainerStateNotFound
- type ErrExceededTaskLimit
- type ErrInvalidWorkerStatus
- type ErrNoSuitableWorkerFound
- type ErrWorkerNotFound
- type ErrWorkerPoolStateNotFound
- type EventClient
- type EventContainerLifecycleSchema
- type EventContainerMetricsData
- type EventContainerMetricsSchema
- type EventContainerStatusRequestedSchema
- type EventContainerStoppedSchema
- type EventGatewayEndpointSchema
- type EventSink
- type EventStubSchema
- type EventStubStateSchema
- type EventTaskSchema
- type EventWorkerLifecycleSchema
- type EventWorkerPoolStateSchema
- type ExitCodeError
- type FailoverConfig
- type FileInfo
- type FileSearchMatch
- type FileSearchPosition
- type FileSearchRange
- type FileSearchResult
- type FileServiceConfig
- type FilterFieldMapping
- type FluentBitConfig
- type FluentBitEventConfig
- type FluentBitEventMapping
- type GPUBlackListConfig
- type GRPCConfig
- type GatewayServiceConfig
- type GeeseConfig
- type GenericProviderConfig
- type GpuType
- type HTTPConfig
- type HydraProviderConfig
- type Image
- type ImageRegistriesConfig
- type ImageServiceConfig
- type InternalService
- type JuiceFSConfig
- type LambdaLabsProviderConfig
- type MachineProvider
- type MachineStatus
- type MetricsCollector
- type MonitoringConfig
- type Mount
- type MountPointConfig
- type NullTime
- type NvidiaCRIUConfig
- type OCIProviderConfig
- type Object
- type ObjectStoreConfig
- type OpenMeterConfig
- type PodConfig
- type PodTCPConfig
- type PoolMode
- type PostgresConfig
- type PricingPolicy
- type PricingPolicyCostModel
- type ProcessInfo
- type PrometheusConfig
- type ProviderComputeRequest
- type ProviderConfig
- type ProviderMachine
- type ProviderMachineMetrics
- type ProviderMachineState
- type ProviderNotImplemented
- type ProxyConfig
- type PythonStandaloneConfig
- type PythonVersion
- type QueryFilter
- type QuotaDoesNotExistError
- type RedisConfig
- type RedisMode
- type RunnerConfig
- type Runtime
- type RuntimeConfig
- type S3ImageRegistryConfig
- type ScheduledJob
- type ScheduledJobPayload
- type Schema
- type SchemaField
- type Secret
- type StopContainerArgs
- type StopContainerReason
- type StorageConfig
- type StringSlice
- type Stub
- type StubConfigLimitedValues
- type StubConfigV1
- type StubFilter
- type StubGetURLFilter
- type StubLimits
- type StubType
- type StubWithRelated
- type TailscaleConfig
- type Task
- type TaskCancellationReason
- type TaskCountByTime
- type TaskCountPerDeployment
- type TaskExecutor
- type TaskFilter
- type TaskInterface
- type TaskMessage
- type TaskMetadata
- type TaskMetrics
- type TaskOutput
- type TaskParams
- type TaskPayload
- type TaskPolicy
- type TaskStats
- type TaskStatus
- type TaskWithRelated
- type TelemetryConfig
- type ThrottledByConcurrencyLimitError
- type Time
- type Token
- type VictoriaLogsConfig
- type VictoriaMetricsConfig
- type Volume
- type VolumeWithRelated
- type Worker
- type WorkerConfig
- type WorkerPoolConfig
- type WorkerPoolJobSpecConfig
- type WorkerPoolJobSpecPoolSizingConfig
- type WorkerPoolSizingConfig
- type WorkerPoolState
- type WorkerPoolStatus
- type WorkerStatus
- type Workspace
- type WorkspaceStorage
- type WorkspaceStorageConfig
Constants ¶
const ( TokenTypeClusterAdmin string = "admin" TokenTypeWorkspacePrimary string = "workspace_primary" TokenTypeWorkspace string = "workspace" TokenTypeWorker string = "worker" TokenTypeMachine string = "machine" TokenTypeWorkspaceRestricted string = "workspace_restricted" )
const ( StubTypeFunction string = "function" StubTypeFunctionDeployment string = "function/deployment" StubTypeFunctionServe string = "function/serve" StubTypeContainer string = "container" StubTypeShell string = "shell" StubTypeTaskQueue string = "taskqueue" StubTypeTaskQueueDeployment string = "taskqueue/deployment" StubTypeTaskQueueServe string = "taskqueue/serve" StubTypeEndpoint string = "endpoint" StubTypeEndpointDeployment string = "endpoint/deployment" StubTypeEndpointServe string = "endpoint/serve" StubTypeASGI string = "asgi" StubTypeASGIDeployment string = "asgi/deployment" StubTypeASGIServe string = "asgi/serve" StubTypeScheduledJob string = "schedule" StubTypeScheduledJobDeployment string = "schedule/deployment" StubTypeBot string = "bot" StubTypeBotDeployment string = "bot/deployment" StubTypeBotServe string = "bot/serve" StubTypePod string = "pod" StubTypePodDeployment string = "pod/deployment" StubTypePodRun string = "pod/run" StubTypeSandbox string = "sandbox" )
const ( DefaultGatewayServiceName string = "gateway" DefaultExtractedObjectPath string = "/data/unpacked" DefaultVolumesPath string = "/data/volumes" DefaultObjectPath string = "/data/objects" DefaultOutputsPath string = "/data/outputs" DefaultObjectPrefix string = "objects" DefaultVolumesPrefix string = "volumes" DefaultOutputsPrefix string = "outputs" DefaultFilesystemName string = "beta9-fs" DefaultFilesystemPath string = "/data" FailedDeploymentContainerThreshold int = 3 FailedContainerThreshold int = 1 )
const ( MachineStatusRegistered MachineStatus = "registered" MachineStatusPending MachineStatus = "pending" MachineStatusReady MachineStatus = "ready" MachinePendingExpirationS int = 3600 // 1 hour MachineKeepaliveExpirationS int = 300 // 5 minutes MachineEmptyConsolidationPeriodM time.Duration = 10 * time.Minute )
const ( DefaultServeContainerTimeout = time.Minute * 10 DefaultCPUWorkerPoolName = "default" )
const ( WorkerStatusAvailable WorkerStatus = "available" WorkerStatusPending WorkerStatus = "pending" WorkerStatusDisabled WorkerStatus = "disabled" WorkerStateTtlS int = 60 )
const ( StubStateDegraded = "degraded" StubStateWarning = "warning" StubStateHealthy = "healthy" )
const ( ContainerDurationEmissionInterval time.Duration = 5 * time.Second ContainerResourceUsageEmissionInterval time.Duration = 3 * time.Second )
const ( WorkerLifecycleStatsKey string = "beta9.worker.usage.spawner.lifecycle" WorkerDurationStatsKey string = "beta9.worker.usage.spawner.duration" WorkerUserCodeVolume string = "/mnt/code" WorkerUserOutputVolume string = "/outputs" WorkerContainerVolumePath string = "/volumes" WorkerContainerUploadsHostPath string = "/tmp/container-uploads" WorkerContainerUploadsMountPath string = "/tmp/.beta9" WorkerDurationEmissionInterval time.Duration = 30 * time.Second WorkerKeepAliveInterval time.Duration = 15 * time.Second WorkerShellPort int32 = 2222 WorkerSandboxProcessManagerPort int32 = 7111 WorkerSandboxProcessManagerWorkerPath string = "/usr/local/bin/goproc" WorkerSandboxProcessManagerContainerPath string = "/usr/bin/goproc" )
const ( WorkerContainerExitCodeOomKillMessage = "Container killed due to an out-of-memory error" WorkerContainerExitCodeSchedulerMessage = "Container stopped" WorkerContainerExitCodeTtlMessage = "Container stopped due to TTL expiration" WorkerContainerExitCodeUserMessage = "Container stopped by user" WorkerContainerExitCodeAdminMessage = "Container stopped by admin" )
const ( // Used specifically for runc states. // Not the same as the scheduler container states. RuncContainerStatusCreated string = "created" RuncContainerStatusRunning string = "running" RuncContainerStatusPaused string = "paused" RuncContainerStatusStopped string = "stopped" )
const (
BuildContainerPrefix string = "build-"
)
const ContainerExitCodeTtlS int = 300
const ContainerStateTtlS int64 = 120
const ContainerStateTtlSWhilePending int64 = 600
const WorkspaceQuotaTtlS int64 = 600
Variables ¶
var ( /* Stripe events utilize a format of <resource>.<action> 1. <resource>: This indicates the type of object or resource that the event pertains to, such as payment_intent, invoice, customer, subscription, etc. 2. <action>: This indicates the specific action or change that occurred with that resource, such as created, updated, deleted, succeeded, etc. */ EventTaskUpdated = "task.updated" EventTaskCreated = "task.created" EventStubState = "stub.state.%s" // healthy, degraded, warning EventContainerLifecycle = "container.lifecycle" EventContainerMetrics = "container.metrics" EventWorkerLifecycle = "worker.lifecycle" EventStubDeploy = "stub.deploy" EventStubServe = "stub.serve" EventStubRun = "stub.run" EventStubClone = "stub.clone" EventWorkerPoolDegraded = "workerpool.degraded" EventWorkerPoolHealthy = "workerpool.healthy" EventGatewayEndpointCalled = "gateway.endpoint.called" )
var ( EventContainerLifecycleRequested = "requested" EventContainerLifecycleScheduled = "scheduled" EventContainerLifecycleStarted = "started" EventContainerLifecycleStopped = "stopped" EventContainerLifecycleOOM = "oom" EventContainerLifecycleFailed = "failed" )
var ( EventWorkerLifecycleStarted = "started" EventWorkerLifecycleStopped = "stopped" EventWorkerLifecycleDeleted = "deleted" )
var ( // Scheduler keys UsageMetricsSchedulerContainerScheduled = "container_scheduled_count" UsageMetricsSchedulerContainerRequested = "container_requested_count" // Worker keys UsageMetricsWorkerContainerDuration = "container_duration_milliseconds" UsageMetricsWorkerContainerCost = "container_cost_cents" // Gateway keys UsageMetricsPublicTaskCost = "public_task_cost_cents" UsageMetricsPublicTaskCount = "public_task_count" )
var DefaultTaskPolicy = TaskPolicy{
MaxRetries: 3,
Timeout: 3600,
}
var EventContainerLifecycleSchemaVersion = "1.1"
var EventContainerMetricsSchemaVersion = "1.0"
var EventContainerStatusRequestedSchemaVersion = "1.1"
var EventContainerStoppedSchemaVersion = "1.0"
var EventGatewayEndpointSchemaVersion = "1.0"
var EventStubSchemaVersion = "1.0"
var EventStubStateSchemaVersion = "1.0"
var EventTaskSchemaVersion = "1.0"
var EventWorkerLifecycleSchemaVersion = "1.0"
var EventWorkerPoolStateSchemaVersion = "1.0"
var ExitCodeMessages = map[ContainerExitCode]string{ ContainerExitCodeOomKill: WorkerContainerExitCodeOomKillMessage, ContainerExitCodeScheduler: WorkerContainerExitCodeSchedulerMessage, ContainerExitCodeTtl: WorkerContainerExitCodeTtlMessage, ContainerExitCodeUser: WorkerContainerExitCodeUserMessage, ContainerExitCodeAdmin: WorkerContainerExitCodeAdminMessage, }
var MaxTaskRetries = 5
var MaxTaskTTL = 24 * 60 * 60
var WorkerContainerExitCodes = map[ContainerExitCode]string{ ContainerExitCodeSuccess: "Success", ContainerExitCodeUnknownError: "UnknownError: An unknown error occurred.", ContainerExitCodeIncorrectImageArch: "InvalidArch: Image must be built for the " + runtime.GOARCH + " architecture.", ContainerExitCodeInvalidCustomImage: "InvalidCustomImage: Custom image not found. Check your image reference and registry credentials.", ContainerExitCodeIncorrectImageOs: "InvalidOS: Image must be built for Linux.", }
Functions ¶
func GPUTypesToMap ¶
func GpuTypesToSlice ¶
func GpuTypesToStrings ¶
func NewProviderNotImplemented ¶
func NewProviderNotImplemented() error
func ParseConditionFromQueryFilters ¶
func ParseConditionFromQueryFilters(out interface{}, queryFilters ...QueryFilter)
func TempContainerWorkspace ¶
func ValidateCpuAndMemory ¶
func ValidateCpuAndMemory(cpu, memory int64, stubLimits StubLimits) (valid bool, errorMsg string)
ValidateCpuAndMemory enforces limits on CPU and memory (min and max)
func WorkspaceBucketName ¶
Types ¶
type AbstractionConfig ¶
type AgentConfig ¶
type AgentConfig struct {
ElasticSearch ElasticSearchConfig `key:"elasticSearch" json:"elastic_search"`
VictoriaLogs VictoriaLogsConfig `key:"victoriaLogs" json:"victoria_logs"`
UpstreamURL string `key:"upstreamURL" json:"upstream_url"`
UpstreamBranch string `key:"upstreamBranch" json:"upstream_branch"`
UpstreamToken string `key:"upstreamToken" json:"upstream_token"`
Configman ConfigmanConfig `key:"configman" json:"configman"`
}
type AlluxioConfig ¶
type AlluxioConfig struct {
Debug bool `key:"debug" json:"debug"`
EtcdEndpoint string `key:"etcdEndpoint" json:"etcd_endpoint"`
EtcdUsername string `key:"etcdUsername" json:"etcd_username"`
EtcdPassword string `key:"etcdPassword" json:"etcd_password"`
EtcdTlsEnabled bool `key:"etcdTlsEnabled" json:"etcd_tls_enabled"`
ImageUrl string `key:"imageUrl" json:"image_url"`
BucketName string `key:"bucketName" json:"bucket_name"`
AccessKey string `key:"accessKey" json:"access_key"`
SecretKey string `key:"secretKey" json:"secret_key"`
EndpointURL string `key:"endpointURL" json:"endpoint_url"`
Region string `key:"region" json:"region"`
ReadOnly bool `key:"readOnly" json:"read_only"`
ForcePathStyle bool `key:"forcePathStyle" json:"force_path_style"`
}
type App ¶
type App struct {
Id uint `db:"id" json:"id" serializer:"id,source:external_id"`
ExternalId string `db:"external_id" json:"external_id,omitempty" serializer:"external_id"`
Name string `db:"name" json:"name" serializer:"name"`
Description string `db:"description" json:"description" serializer:"description"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id"` // Foreign key to Workspace
CreatedAt Time `db:"created_at" json:"created_at" serializer:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at" serializer:"updated_at"`
DeletedAt NullTime `db:"deleted_at" json:"deleted_at" serializer:"deleted_at"`
}
@go2proto
type AppConfig ¶
type AppConfig struct {
ClusterName string `key:"clusterName" json:"cluster_name"`
DebugMode bool `key:"debugMode" json:"debug_mode"`
PrettyLogs bool `key:"prettyLogs" json:"pretty_logs"`
Database DatabaseConfig `key:"database" json:"database"`
GatewayService GatewayServiceConfig `key:"gateway" json:"gateway_service"`
FileService FileServiceConfig `key:"fileService" json:"file_service"`
ImageService ImageServiceConfig `key:"imageService" json:"image_service"`
Storage StorageConfig `key:"storage" json:"storage"`
Worker WorkerConfig `key:"worker" json:"worker"`
Providers ProviderConfig `key:"providers" json:"providers"`
Tailscale TailscaleConfig `key:"tailscale" json:"tailscale"`
Proxy ProxyConfig `key:"proxy" json:"proxy"`
Monitoring MonitoringConfig `key:"monitoring" json:"monitoring"`
Abstractions AbstractionConfig `key:"abstractions" json:"abstractions"`
BlobCache blobcache.BlobCacheConfig `key:"blobcache" json:"blobcache"`
Agent AgentConfig `key:"agent" json:"agent"`
}
type Autoscaler ¶
type Autoscaler struct {
Type AutoscalerType `json:"type"`
MaxContainers uint `json:"max_containers"`
TasksPerContainer uint `json:"tasks_per_container"`
MinContainers uint `json:"min_containers"`
}
type AutoscalerType ¶
type AutoscalerType string
const (
QueueDepthAutoscaler AutoscalerType = "queue_depth"
)
type AvailableHost ¶
type BaseFilter ¶
type BuildOptions ¶
type BuildOptions struct {
SourceImage *string `json:"source_image"`
Dockerfile *string `json:"dockerfile"`
BuildCtxObject *string `json:"build_context"`
SourceImageCreds string `json:"source_image_creds"`
BuildSecrets []string `json:"build_secrets"`
}
@go2proto
type BuildRegistryCredentialsConfig ¶
type BuildRegistryCredentialsConfig struct {
// Type of credentials: "aws", "gcp", "azure", "basic", "token"
Type string `key:"type" json:"type"`
// Credentials is a map of credential key-value pairs
// For AWS: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_SESSION_TOKEN (optional)
// For GCP: GCP_ACCESS_TOKEN or GOOGLE_APPLICATION_CREDENTIALS
// For Azure: AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID
// For basic auth: USERNAME, PASSWORD
// For token auth: NGC_API_KEY, GITHUB_TOKEN, DOCKERHUB_TOKEN
Credentials map[string]string `key:"credentials" json:"credentials"`
}
BuildRegistryCredentialsConfig stores credentials for generating tokens for the build registry Supports: aws (ECR), gcp (GCR/GAR), basic (username/password), token (API keys)
type CORSConfig ¶
type CRIUConfig ¶
type CRIUConfig struct {
Mode CRIUConfigMode `key:"mode" json:"mode"`
Storage CheckpointStorageConfig `key:"storage" json:"storage"`
Cedana cedana.Config `key:"cedana" json:"cedana"`
Nvidia NvidiaCRIUConfig `key:"nvidia" json:"nvidia"`
}
type CRIUConfigMode ¶
type CRIUConfigMode string
var ( CRIUConfigModeCedana CRIUConfigMode = "cedana" CRIUConfigModeNvidia CRIUConfigMode = "nvidia" )
type CapacityUpdateType ¶
type CapacityUpdateType int
const ( AddCapacity CapacityUpdateType = iota RemoveCapacity )
type Checkpoint ¶
type Checkpoint struct {
Id uint `db:"id" json:"id" serializer:"id,source:external_id" go2proto:"ignore"`
CheckpointId string `db:"checkpoint_id" json:"checkpoint_id" serializer:"checkpoint_id"`
ExternalId string `db:"external_id" json:"external_id,omitempty" serializer:"external_id"`
SourceContainerId string `db:"source_container_id" json:"source_container_id" serializer:"source_container_id"`
ContainerIp string `db:"container_ip" json:"container_ip" serializer:"container_ip"`
Status string `db:"status" json:"status" serializer:"status"`
RemoteKey string `db:"remote_key" json:"remote_key" serializer:"remote_key"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id" go2proto:"ignore"` // Foreign key to Workspace
StubId uint `db:"stub_id" json:"stub_id" go2proto:"ignore"` // Foreign key to Stub
StubType string `db:"stub_type" json:"stub_type" serializer:"stub_type"`
AppId uint `db:"app_id" json:"app_id,omitempty" go2proto:"ignore"` // Foreign key to App
ExposedPorts []uint32 `db:"exposed_ports" json:"exposed_ports" serializer:"exposed_ports"`
CreatedAt Time `db:"created_at" json:"created_at" serializer:"created_at"`
LastRestoredAt Time `db:"last_restored_at" json:"last_restored_at" serializer:"last_restored_at"`
DeletedAt NullTime `db:"deleted_at" json:"deleted_at" serializer:"deleted_at"`
}
@go2proto
func NewCheckpointFromProto ¶
func NewCheckpointFromProto(in *pb.Checkpoint) *Checkpoint
func (*Checkpoint) ToProto ¶
func (c *Checkpoint) ToProto() *pb.Checkpoint
type CheckpointStatus ¶
type CheckpointStatus string
const ( CheckpointStatusAvailable CheckpointStatus = "available" CheckpointStatusCheckpointFailed CheckpointStatus = "checkpoint_failed" CheckpointStatusRestoreFailed CheckpointStatus = "restore_failed" CheckpointStatusNotFound CheckpointStatus = "not_found" )
type CheckpointStorageConfig ¶
type CheckpointStorageConfig struct {
MountPath string `key:"mountPath" json:"mount_path"`
Mode string `key:"mode" json:"mode"`
ObjectStore ObjectStoreConfig `key:"objectStore" json:"object_store"`
}
type CheckpointStorageMode ¶
type CheckpointStorageMode string
var ( CheckpointStorageModeLocal CheckpointStorageMode = "local" CheckpointStorageModeS3 CheckpointStorageMode = "s3" )
type ClipVersion ¶
type ClipVersion uint32
const ( ClipVersion1 ClipVersion = 1 ClipVersion2 ClipVersion = 2 )
type ConcurrencyLimit ¶
type ConcurrencyLimit struct {
Id uint `db:"id" json:"-" redis:"-"`
ExternalId string `db:"external_id" json:"external_id,omitempty" redis:"external_id"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id,omitempty" redis:"workspace_id"`
GPULimit uint32 `db:"gpu_limit" json:"gpu_limit" redis:"gpu_limit"`
CPUMillicoreLimit uint32 `db:"cpu_millicore_limit" json:"cpu_millicore_limit" redis:"cpu_millicore_limit"`
CreatedAt time.Time `db:"created_at" json:"created_at,omitempty" redis:"-"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at,omitempty" redis:"-"`
}
@go2proto
func NewConcurrencyLimitFromProto ¶
func NewConcurrencyLimitFromProto(in *pb.ConcurrencyLimit) *ConcurrencyLimit
func (*ConcurrencyLimit) ToProto ¶
func (c *ConcurrencyLimit) ToProto() *pb.ConcurrencyLimit
type ConfigmanConfig ¶
type Container ¶
type Container struct {
ContainerId string `redis:"container_id" json:"container_id"`
StubId string `redis:"stub_id" json:"stub_id"`
Status ContainerStatus `redis:"status" json:"status"`
ScheduledAt time.Time `redis:"scheduled_at" json:"scheduled_at"`
StartedAt time.Time `redis:"started_at" json:"started_at"`
WorkspaceId string `redis:"workspace_id" json:"workspace_id"`
WorkerId string `redis:"worker_id" json:"worker_id"`
MachineId string `redis:"machine_id" json:"machine_id"`
DeploymentId string `redis:"deployment_id" json:"deployment_id"`
}
@go2proto
func NewContainerFromProto ¶
type ContainerAlreadyScheduledError ¶
type ContainerAlreadyScheduledError struct {
Msg string
}
func (*ContainerAlreadyScheduledError) Error ¶
func (e *ContainerAlreadyScheduledError) Error() string
type ContainerCostHookConfig ¶
type ContainerEvent ¶
type ContainerExitCode ¶
type ContainerExitCode int
const ( ContainerExitCodeInvalidCustomImage ContainerExitCode = 555 ContainerExitCodeIncorrectImageArch ContainerExitCode = 556 ContainerExitCodeIncorrectImageOs ContainerExitCode = 557 ContainerExitCodeUnknownError ContainerExitCode = 1 ContainerExitCodeSuccess ContainerExitCode = 0 ContainerExitCodeOomKill ContainerExitCode = 137 // 128 + 9 (base value + SIGKILL), used to indicate OOM kill ContainerExitCodeSigterm ContainerExitCode = 143 // 128 + 15 (base value + SIGTERM), used to indicate a graceful termination ContainerExitCodeScheduler ContainerExitCode = 558 ContainerExitCodeTtl ContainerExitCode = 559 ContainerExitCodeUser ContainerExitCode = 560 ContainerExitCodeAdmin ContainerExitCode = 561 )
func (ContainerExitCode) IsFailed ¶
func (c ContainerExitCode) IsFailed() bool
type ContainerRequest ¶
type ContainerRequest struct {
ContainerId string `json:"container_id"`
EntryPoint []string `json:"entry_point"`
Env []string `json:"env"`
Cpu int64 `json:"cpu"`
Memory int64 `json:"memory"`
Gpu string `json:"gpu"`
GpuRequest []string `json:"gpu_request"`
GpuCount uint32 `json:"gpu_count"`
ImageId string `json:"image_id"`
StubId string `json:"stub_id"`
WorkspaceId string `json:"workspace_id"`
Workspace Workspace `json:"workspace"`
Stub StubWithRelated `json:"stub"`
Timestamp time.Time `json:"timestamp"`
Mounts []Mount `json:"mounts"`
RetryCount int `json:"retry_count"`
PoolSelector string `json:"pool_selector"`
Preemptable bool `json:"preemptable"`
CheckpointEnabled bool `json:"checkpoint_enabled"`
BuildOptions BuildOptions `json:"build_options"`
Ports []uint32 `json:"ports"`
CostPerMs float64 `json:"cost_per_ms"`
AppId string `json:"app_id"`
Checkpoint *Checkpoint `json:"checkpoint"`
ConfigPath string `json:"config_path"`
ImageCredentials string `json:"image_credentials"`
BuildRegistryCredentials string `json:"build_registry_credentials"`
BlockNetwork bool `json:"block_network"`
AllowList []string `json:"allow_list"`
DockerEnabled bool `json:"docker_enabled"` // Enable Docker-in-Docker (gVisor only)
}
@go2proto
func NewContainerRequestFromProto ¶
func NewContainerRequestFromProto(in *pb.ContainerRequest) *ContainerRequest
func (*ContainerRequest) IsBuildRequest ¶
func (c *ContainerRequest) IsBuildRequest() bool
IsBuildRequest checks if the sourceImage or Dockerfile field is not-nil, which means the container request is for a build container
func (*ContainerRequest) RequiresGPU ¶
func (c *ContainerRequest) RequiresGPU() bool
func (*ContainerRequest) StorageAvailable ¶
func (c *ContainerRequest) StorageAvailable() bool
func (*ContainerRequest) ToProto ¶
func (c *ContainerRequest) ToProto() *pb.ContainerRequest
func (*ContainerRequest) VolumeCacheCompatible ¶
func (c *ContainerRequest) VolumeCacheCompatible() bool
type ContainerRequestStatus ¶
type ContainerRequestStatus string
const ( ContainerRequestStatusFailed ContainerRequestStatus = "failed" ContainerRequestStatusTTL = 10 * time.Minute )
type ContainerResourceUsage ¶
type ContainerRuntime ¶
type ContainerRuntime string
const ( ContainerRuntimeRunc ContainerRuntime = "runc" ContainerRuntimeGvisor ContainerRuntime = "gvisor" )
func (ContainerRuntime) String ¶
func (r ContainerRuntime) String() string
type ContainerState ¶
type ContainerState struct {
ContainerId string `redis:"container_id" json:"container_id"`
StubId string `redis:"stub_id" json:"stub_id"`
Status ContainerStatus `redis:"status" json:"status"`
ScheduledAt int64 `redis:"scheduled_at" json:"scheduled_at"`
WorkspaceId string `redis:"workspace_id" json:"workspace_id"`
Gpu string `redis:"gpu" json:"gpu"`
GpuCount uint32 `redis:"gpu_count" json:"gpu_count"`
Cpu int64 `redis:"cpu" json:"cpu"`
Memory int64 `redis:"memory" json:"memory"`
StartedAt int64 `redis:"started_at" json:"started_at"`
}
@go2proto
type ContainerStatus ¶
type ContainerStatus string
const ( ContainerStatusPending ContainerStatus = "PENDING" ContainerStatusRunning ContainerStatus = "RUNNING" ContainerStatusStopping ContainerStatus = "STOPPING" )
type CrusoeProviderConfig ¶
type CrusoeProviderConfig struct {
}
type DatabaseConfig ¶
type DatabaseConfig struct {
Redis RedisConfig `key:"redis" json:"redis"`
Postgres PostgresConfig `key:"postgres" json:"postgres"`
}
type DeletedWorkerReason ¶
type DeletedWorkerReason string
const ( DeletedWorkerReasonPodWithoutState DeletedWorkerReason = "pod_without_state" DeletedWorkerReasonPodExceededPendingAgeLimit DeletedWorkerReason = "pod_exceeded_pending_age_limit" )
func (DeletedWorkerReason) String ¶
func (d DeletedWorkerReason) String() string
type Deployment ¶
type Deployment struct {
Id uint `db:"id" json:"id" serializer:"id,source:external_id"`
ExternalId string `db:"external_id" json:"external_id,omitempty" serializer:"external_id"`
Name string `db:"name" json:"name" serializer:"name"`
Active bool `db:"active" json:"active" serializer:"active"`
Subdomain string `db:"subdomain" json:"subdomain" serializer:"subdomain"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id"` // Foreign key to Workspace
StubId uint `db:"stub_id" json:"stub_id"` // Foreign key to Stub
StubType string `db:"stub_type" json:"stub_type" serializer:"stub_type"`
Version uint `db:"version" json:"version" serializer:"version"`
CreatedAt Time `db:"created_at" json:"created_at" serializer:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at" serializer:"updated_at"`
DeletedAt NullTime `db:"deleted_at" json:"deleted_at" serializer:"deleted_at"`
AppId uint `db:"app_id" json:"app_id,omitempty"` // Foreign key to App
}
type DeploymentFilter ¶
type DeploymentFilter struct {
BaseFilter
StubIds StringSlice `query:"stub_ids"`
WorkspaceID uint `query:"workspace_id"`
StubType StringSlice `query:"stub_type"`
Name string `query:"name"`
Active *bool `query:"active"`
Version uint `query:"version"`
Cursor string `query:"cursor"`
CreatedAtStart string `query:"created_at_start"`
CreatedAtEnd string `query:"created_at_end"`
Pagination bool `query:"pagination"`
Subdomain string `query:"subdomain"`
SearchQuery string `query:"search_query"`
MinContainersGTE uint `query:"min_containers"`
ShowDeleted bool `query:"show_deleted"`
AppId string `query:"app_id"`
}
type DeploymentWithRelated ¶
type DeploymentWithRelated struct {
Deployment
Workspace Workspace `db:"workspace" json:"workspace" serializer:"workspace"`
Stub Stub `db:"stub" json:"stub" serializer:"stub"`
App App `db:"app" json:"app" serializer:"app"`
StubId string `serializer:"stub_id,source:stub.id"`
AppId string `serializer:"app_id,source:app.id"`
WorkspaceId string `serializer:"workspace_id,source:workspace.id"`
}
type EC2ProviderConfig ¶
type ElasticSearchConfig ¶
type ErrCheckpointNotFound ¶
type ErrCheckpointNotFound struct {
CheckpointId string
}
func (*ErrCheckpointNotFound) Error ¶
func (e *ErrCheckpointNotFound) Error() string
type ErrContainerStateNotFound ¶
type ErrContainerStateNotFound struct {
ContainerId string
}
func (*ErrContainerStateNotFound) Error ¶
func (e *ErrContainerStateNotFound) Error() string
func (*ErrContainerStateNotFound) From ¶
func (e *ErrContainerStateNotFound) From(err error) bool
type ErrExceededTaskLimit ¶
type ErrExceededTaskLimit struct {
MaxPendingTasks uint
}
func (*ErrExceededTaskLimit) Error ¶
func (e *ErrExceededTaskLimit) Error() string
type ErrInvalidWorkerStatus ¶
type ErrInvalidWorkerStatus struct {
}
func (*ErrInvalidWorkerStatus) Error ¶
func (e *ErrInvalidWorkerStatus) Error() string
type ErrNoSuitableWorkerFound ¶
type ErrNoSuitableWorkerFound struct {
}
func (*ErrNoSuitableWorkerFound) Error ¶
func (e *ErrNoSuitableWorkerFound) Error() string
type ErrWorkerNotFound ¶
type ErrWorkerNotFound struct {
WorkerId string
}
func (*ErrWorkerNotFound) Error ¶
func (e *ErrWorkerNotFound) Error() string
func (*ErrWorkerNotFound) From ¶
func (e *ErrWorkerNotFound) From(err error) bool
type ErrWorkerPoolStateNotFound ¶
type ErrWorkerPoolStateNotFound struct {
PoolName string
}
func (*ErrWorkerPoolStateNotFound) Error ¶
func (e *ErrWorkerPoolStateNotFound) Error() string
func (*ErrWorkerPoolStateNotFound) From ¶
func (e *ErrWorkerPoolStateNotFound) From(err error) bool
type EventClient ¶
type EventClient interface {
PushEvent(event cloudevents.Event) error
}
type EventContainerLifecycleSchema ¶
type EventContainerLifecycleSchema struct {
ContainerID string `json:"container_id"`
WorkerID string `json:"worker_id"`
StubID string `json:"stub_id"`
Status string `json:"status"`
Request ContainerRequest `json:"request"`
}
type EventContainerMetricsData ¶
type EventContainerMetricsData struct {
CPUUsed uint64 `json:"cpu_used"`
CPUTotal uint64 `json:"cpu_total"`
CPUPercent float32 `json:"cpu_pct"`
MemoryRSS uint64 `json:"memory_rss_bytes"`
MemoryVMS uint64 `json:"memory_vms_bytes"`
MemorySwap uint64 `json:"memory_swap_bytes"`
MemoryTotal uint64 `json:"memory_total_bytes"`
DiskReadBytes uint64 `json:"disk_read_bytes"`
DiskWriteBytes uint64 `json:"disk_write_bytes"`
NetworkBytesRecv uint64 `json:"network_recv_bytes"`
NetworkBytesSent uint64 `json:"network_sent_bytes"`
NetworkPacketsRecv uint64 `json:"network_recv_packets"`
NetworkPacketsSent uint64 `json:"network_sent_packets"`
GPUMemoryUsed uint64 `json:"gpu_memory_used_bytes"`
GPUMemoryTotal uint64 `json:"gpu_memory_total_bytes"`
GPUType string `json:"gpu_type"`
}
type EventContainerMetricsSchema ¶
type EventContainerMetricsSchema struct {
WorkerID string `json:"worker_id"`
ContainerID string `json:"container_id"`
WorkspaceID string `json:"workspace_id"`
StubID string `json:"stub_id"`
ContainerMetrics EventContainerMetricsData `json:"metrics"`
}
type EventContainerStatusRequestedSchema ¶
type EventContainerStatusRequestedSchema struct {
ContainerID string `json:"container_id"`
Request ContainerRequest `json:"request"`
StubID string `json:"stub_id"`
Status string `json:"status"`
}
type EventContainerStoppedSchema ¶
type EventContainerStoppedSchema struct {
EventContainerLifecycleSchema
ExitCode int `json:"exit_code"`
}
type EventGatewayEndpointSchema ¶
type EventGatewayEndpointSchema struct {
Method string `json:"method"`
Path string `json:"path"`
WorkspaceID string `json:"workspace_id,omitempty"`
StatusCode int `json:"status_code"`
UserAgent string `json:"user_agent,omitempty"`
RemoteIP string `json:"remote_ip,omitempty"`
RequestID string `json:"request_id,omitempty"`
ContentType string `json:"content_type,omitempty"`
Accept string `json:"accept,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
}
type EventSink ¶
type EventSink = func(event []cloudevents.Event)
type EventStubSchema ¶
type EventStubStateSchema ¶
type EventTaskSchema ¶
type EventTaskSchema struct {
ID string `json:"id"`
Status TaskStatus `json:"status"`
ContainerID string `json:"container_id"`
StartedAt *time.Time `json:"started_at"`
EndedAt *time.Time `json:"ended_at"`
WorkspaceID string `json:"workspace_id"`
ExternalWorkspaceID string `json:"external_workspace_id"`
StubID string `json:"stub_id"`
CreatedAt time.Time `json:"created_at"`
AppID string `json:"app_id"`
}
type EventWorkerLifecycleSchema ¶
type EventWorkerLifecycleSchema struct {
WorkerID string `json:"worker_id"`
MachineID string `json:"machine_id"`
Status string `json:"status"`
PoolName string `json:"pool_name"`
Reason DeletedWorkerReason `json:"reason"`
}
type EventWorkerPoolStateSchema ¶
type EventWorkerPoolStateSchema struct {
PoolName string `json:"pool_name"`
Reasons []string `json:"reasons"`
Status string `json:"status"`
PoolState *WorkerPoolState `json:"pool_state"`
}
type ExitCodeError ¶
type ExitCodeError struct {
ExitCode ContainerExitCode
}
func (*ExitCodeError) Error ¶
func (e *ExitCodeError) Error() string
type FailoverConfig ¶
type FailoverConfig struct {
Enabled bool `key:"enabled" json:"enabled"`
MaxPendingWorkers int64 `key:"maxPendingWorkers" json:"max_pending_workers"`
MaxSchedulingLatencyMs int64 `key:"maxSchedulingLatencyMs" json:"max_scheduling_latency_ms"`
MinMachinesAvailable int64 `key:"minMachinesAvailable" json:"min_machines_available"`
}
type FileInfo ¶
type FileInfo struct {
Name string
IsDir bool
Size int64
Mode int32
ModTime int64
Owner string
Group string
Path string
Permissions uint32
}
@go2proto
type FileSearchMatch ¶
type FileSearchMatch struct {
Range FileSearchRange
Content string
}
@go2proto
type FileSearchRange ¶
type FileSearchRange struct {
Start FileSearchPosition
End FileSearchPosition
}
@go2proto
type FileSearchResult ¶
type FileSearchResult struct {
Path string
Matches []FileSearchMatch
}
@go2proto
type FileServiceConfig ¶
type FileServiceConfig struct {
EndpointURL string `key:"endpointUrl" json:"endpoint_url"`
BucketName string `key:"bucketName" json:"bucket_name"`
AccessKey string `key:"accessKey" json:"access_key"`
SecretKey string `key:"secretKey" json:"secret_key"`
Region string `key:"region" json:"region"`
// Determines if the SDK should use this service
// Requires that EndpointURL and BucketName are set
Enabled bool `key:"enabled" json:"enabled"`
}
type FilterFieldMapping ¶
FilterFieldMapping represents a mapping between a client-provided field and its corresponding database field, along with the values for filtering on the database field.
type FluentBitConfig ¶
type FluentBitConfig struct {
Events FluentBitEventConfig `key:"events" json:"events"`
}
type FluentBitEventConfig ¶
type FluentBitEventConfig struct {
Endpoint string `key:"endpoint" json:"endpoint"`
MaxConns int `key:"maxConns" json:"max_conns"`
MaxIdleConns int `key:"maxIdleConns" json:"max_idle_conns"`
IdleConnTimeout time.Duration `key:"idleConnTimeout" json:"idle_conn_timeout"`
DialTimeout time.Duration `key:"dialTimeout" json:"dial_timeout"`
KeepAlive time.Duration `key:"keepAlive" json:"keep_alive"`
Mapping []FluentBitEventMapping `key:"mapping" json:"mapping"`
}
type FluentBitEventMapping ¶
type GPUBlackListConfig ¶
type GRPCConfig ¶
type GRPCConfig struct {
ExternalPort int `key:"externalPort" json:"external_port"`
ExternalHost string `key:"externalHost" json:"external_host"`
TLS bool `key:"tls" json:"tls"`
Port int `key:"port" json:"port"`
MaxRecvMsgSize int `key:"maxRecvMsgSize" json:"max_recv_msg_size"`
MaxSendMsgSize int `key:"maxSendMsgSize" json:"max_send_msg_size"`
}
type GatewayServiceConfig ¶
type GatewayServiceConfig struct {
Host string `key:"host" json:"host"`
InvokeURLType string `key:"invokeURLType" json:"invoke_url_type"`
GRPC GRPCConfig `key:"grpc" json:"grpc"`
HTTP HTTPConfig `key:"http" json:"http"`
ShutdownTimeout time.Duration `key:"shutdownTimeout" json:"shutdown_timeout"`
StubLimits StubLimits `key:"stubLimits" json:"stub_limits"`
}
type GeeseConfig ¶
type GeeseConfig struct {
Debug bool `key:"debug" json:"debug"` // --debug
FsyncOnClose bool `key:"fsyncOnClose" json:"fsync_on_close"` // --fsync-on-close
MountOptions []string `key:"mountOptions" json:"mount_options"` // --mount-options
MemoryLimit int64 `key:"memoryLimit" json:"memory_limit"` // --memory-limit
MaxFlushers int `key:"maxFlushers" json:"max_flushers"` // --max-flushers
MaxParallelParts int `key:"maxParallelParts" json:"max_parallel_parts"` // --max-parallel-parts
ReadAheadKB int `key:"readAheadKB" json:"read_ahead_kb"` // --read-ahead-kb
ReadAheadLargeKB int `key:"readAheadLargeKB" json:"read_ahead_large_kb"` // --read-ahead-large-kb
ReadAheadParallelKB int `key:"readAheadParallelKB" json:"read_ahead_parallel_kb"` // --read-ahead-parallel-kb
FuseReadAheadKB int `key:"fuseReadAheadKB" json:"fuse_read_ahead_kb"` // --fuse-read-ahead-kb
DirMode string `key:"dirMode" json:"dir_mode"` // --dir-mode, e.g., "0777"
FileMode string `key:"fileMode" json:"file_mode"` // --file-mode, e.g., "0666"
ListType int `key:"listType" json:"list_type"` // --list-type
AccessKey string `key:"accessKey" json:"access_key"`
SecretKey string `key:"secretKey" json:"secret_key"`
EndpointUrl string `key:"endpointURL" json:"endpoint_url"` // --endpoint
BucketName string `key:"bucketName" json:"bucket_name"`
Region string `key:"region" json:"region"`
DisableVolumeCaching bool `key:"disableVolumeCaching" json:"disable_volume_caching"`
StagedWriteModeEnabled bool `key:"stagedWriteModeEnabled" json:"staged_write_mode_enabled"`
StagedWritePath string `key:"stagedWritePath" json:"staged_write_path"`
StagedWriteDebounce time.Duration `key:"stagedWriteDebounce" json:"staged_write_debounce"`
CacheStreamingEnabled bool `key:"cacheStreamingEnabled" json:"cache_streaming_enabled"`
CacheThroughModeEnabled bool `key:"cacheThroughModeEnabled" json:"cache_through_mode_enabled"`
}
type GenericProviderConfig ¶
type GenericProviderConfig struct {
}
type GpuType ¶
type GpuType string
const ( GPU_A10G GpuType = "A10G" GPU_A100_40 GpuType = "A100-40" GPU_A100_80 GpuType = "A100-80" GPU_L4 GpuType = "L4" GPU_T4 GpuType = "T4" GPU_H100 GpuType = "H100" GPU_A6000 GpuType = "A6000" GPU_RTX4090 GpuType = "RTX4090" GPU_L40S GpuType = "L40S" NO_GPU GpuType = "NO_GPU" GPU_ANY GpuType = "any" )
func AllGPUTypes ¶
func AllGPUTypes() []GpuType
func GPUTypesFromString ¶
func (*GpuType) MarshalJSON ¶
func (*GpuType) UnmarshalJSON ¶
type HTTPConfig ¶
type HTTPConfig struct {
ExternalPort int `key:"externalPort" json:"external_port"`
ExternalHost string `key:"externalHost" json:"external_host"`
TLS bool `key:"tls" json:"tls"`
Port int `key:"port" json:"port"`
EnablePrettyLogs bool `key:"enablePrettyLogs" json:"enable_pretty_logs"`
CORS CORSConfig `key:"cors" json:"cors"`
}
func (*HTTPConfig) GetExternalURL ¶
func (h *HTTPConfig) GetExternalURL() string
type HydraProviderConfig ¶
type HydraProviderConfig struct {
}
type ImageRegistriesConfig ¶
type ImageRegistriesConfig struct {
Docker DockerImageRegistryConfig `key:"docker" json:"docker"`
S3 S3ImageRegistryConfig `key:"s3" json:"s3"`
}
type ImageServiceConfig ¶
type ImageServiceConfig struct {
LocalCacheEnabled bool `key:"localCacheEnabled" json:"local_cache_enabled"`
RegistryStore string `key:"registryStore" json:"registry_store"`
RegistryCredentialProviderName string `key:"registryCredentialProvider" json:"registry_credential_provider_name"`
Registries ImageRegistriesConfig `key:"registries" json:"registries"`
PythonVersion string `key:"pythonVersion" json:"python_version"`
EnableTLS bool `key:"enableTLS" json:"enable_tls"`
BuildContainerCpu int64 `key:"buildContainerCpu" json:"build_container_cpu"`
BuildContainerMemory int64 `key:"buildContainerMemory" json:"build_container_memory"`
BuildContainerPoolSelector string `key:"buildContainerPoolSelector" json:"build_container_pool_selector"`
Runner RunnerConfig `key:"runner" json:"runner"`
ArchiveNanosecondsPerByte int64 `key:"archiveNanosecondsPerByte" json:"archive_nanoseconds_per_byte"`
ClipVersion uint32 `key:"clipVersion" json:"clip_version"`
BuildRegistry string `key:"buildRegistry" json:"build_registry"`
BuildRepositoryName string `key:"buildRepositoryName" json:"build_repository_name"`
BuildRegistryCredentials BuildRegistryCredentialsConfig `key:"buildRegistryCredentials" json:"build_registry_credentials"`
BuildRegistryInsecure bool `key:"buildRegistryInsecure" json:"build_registry_insecure"`
}
type InternalService ¶
type JuiceFSConfig ¶
type JuiceFSConfig struct {
RedisURI string `key:"redisURI" json:"redis_uri"`
AWSS3Bucket string `key:"awsS3Bucket" json:"aws_s3_bucket"`
AWSAccessKey string `key:"awsAccessKey" json:"aws_access_key"`
AWSSecretKey string `key:"awsSecretKey" json:"aws_secret_key"`
CacheSize int64 `key:"cacheSize" json:"cache_size"`
BlockSize int64 `key:"blockSize" json:"block_size"`
Prefetch int64 `key:"prefetch" json:"prefetch"`
BufferSize int64 `key:"bufferSize" json:"buffer_size"`
}
type LambdaLabsProviderConfig ¶
type LambdaLabsProviderConfig struct {
ApiKey string `key:"apiKey" json:"apiKey"`
}
type MachineProvider ¶
type MachineProvider string
var ( ProviderEC2 MachineProvider = "ec2" ProviderOCI MachineProvider = "oci" ProviderLambdaLabs MachineProvider = "lambda" ProviderCrusoe MachineProvider = "crusoe" ProviderHydra MachineProvider = "hydra" ProviderGeneric MachineProvider = "generic" )
type MachineStatus ¶
type MachineStatus string
type MetricsCollector ¶
type MetricsCollector string
var ( MetricsCollectorPrometheus MetricsCollector = "prometheus" MetricsCollectorOpenMeter MetricsCollector = "openmeter" )
type MonitoringConfig ¶
type MonitoringConfig struct {
MetricsCollector string `key:"metricsCollector" json:"metrics_collector"`
Prometheus PrometheusConfig `key:"prometheus" json:"prometheus"`
OpenMeter OpenMeterConfig `key:"openmeter" json:"openmeter"`
FluentBit FluentBitConfig `key:"fluentbit" json:"fluentbit"`
Telemetry TelemetryConfig `key:"telemetry" json:"telemetry"`
ContainerMetricsInterval time.Duration `key:"containerMetricsInterval" json:"container_metrics_interval"`
VictoriaMetrics VictoriaMetricsConfig `key:"victoriametrics" json:"victoriametrics"`
ContainerCostHookConfig ContainerCostHookConfig `key:"containerCostHook" json:"container_cost_hook"`
}
type Mount ¶
type Mount struct {
LocalPath string `json:"local_path"`
MountPath string `json:"mount_path"`
LinkPath string `json:"link_path"`
ReadOnly bool `json:"read_only"`
MountType string `json:"mount_type"`
MountPointConfig *MountPointConfig `json:"mountpoint_config"`
}
@go2proto
func NewMountFromProto ¶
type MountPointConfig ¶
type MountPointConfig struct {
BucketName string `json:"s3_bucket"`
AccessKey string `json:"access_key"`
SecretKey string `json:"secret_key"`
EndpointURL string `json:"bucket_url"`
Region string `json:"region"`
ReadOnly bool `json:"read_only"`
ForcePathStyle bool `json:"force_path_style"`
}
@go2proto
func NewMountPointConfigFromProto ¶
func NewMountPointConfigFromProto(in *pb.MountPointConfig) *MountPointConfig
func (*MountPointConfig) ToProto ¶
func (m *MountPointConfig) ToProto() *pb.MountPointConfig
type NvidiaCRIUConfig ¶
type NvidiaCRIUConfig struct {
}
type OCIProviderConfig ¶
type OCIProviderConfig struct {
Tenancy string `key:"tenancy" json:"tenancy"`
UserId string `key:"userId" json:"user_id"`
Region string `key:"region" json:"region"`
FingerPrint string `key:"fingerprint" json:"fingerprint"`
PrivateKey string `key:"privateKey" json:"private_key"`
PrivateKeyPassword string `key:"privateKeyPassword" json:"private_key_password"`
CompartmentId string `key:"compartmentId" json:"compartment_id"`
SubnetId string `key:"subnetId" json:"subnet_id"`
AvailabilityDomain string `key:"availabilityDomain" json:"availability_domain"`
ImageId string `key:"imageId" json:"image_id"`
}
type Object ¶
type Object struct {
Id uint `db:"id" json:"id" serializer:"id,source:external_id"`
ExternalId string `db:"external_id" json:"external_id,omitempty" serializer:"external_id"`
Hash string `db:"hash" json:"hash" serializer:"hash"`
Size int64 `db:"size" json:"size" serializer:"size"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id"` // Foreign key to Workspace
CreatedAt Time `db:"created_at" json:"created_at"`
}
@go2proto
func NewObjectFromProto ¶
type ObjectStoreConfig ¶
type ObjectStoreConfig struct {
BucketName string `key:"bucketName" json:"bucket_name"`
AccessKey string `key:"accessKey" json:"access_key"`
SecretKey string `key:"secretKey" json:"secret_key"`
EndpointURL string `key:"endpointURL" json:"bucket_url"`
Region string `key:"region" json:"region"`
ReadOnly bool `key:"readOnly" json:"read_only"`
ForcePathStyle bool `key:"forcePathStyle" json:"force_path_style"`
}
type OpenMeterConfig ¶
type PodConfig ¶
type PodConfig struct {
TCP PodTCPConfig `key:"tcp" json:"tcp"`
}
type PodTCPConfig ¶
type PodTCPConfig struct {
Enabled bool `key:"enabled" json:"enabled"`
ExternalPort int `key:"externalPort" json:"external_port"`
ExternalHost string `key:"externalHost" json:"external_host"`
Port int `key:"port" json:"port"`
CertFile string `key:"certFile" json:"cert_file"`
KeyFile string `key:"keyFile" json:"key_file"`
}
func (*PodTCPConfig) GetExternalURL ¶
func (p *PodTCPConfig) GetExternalURL() string
type PostgresConfig ¶
type PostgresConfig struct {
Host string `key:"host" json:"host"`
Port int `key:"port" json:"port"`
Name string `key:"name" json:"name"`
Username string `key:"username" json:"username"`
Password string `key:"password" json:"password"`
TimeZone string `key:"timezone" json:"timezone"`
EnableTLS bool `key:"enableTLS" json:"enable_tls"`
EncryptionKey string `key:"encryptionKey" json:"encryption_key"`
}
type PricingPolicy ¶
type PricingPolicy struct {
MaxInFlight int `json:"max_in_flight"`
CostModel string `json:"cost_model"`
CostPerTask float64 `json:"cost_per_task"`
CostPerTaskDurationMs float64 `json:"cost_per_task_duration_ms"`
}
@go2proto
type PricingPolicyCostModel ¶
type PricingPolicyCostModel string
@go2proto
const ( PricingPolicyCostModelTask PricingPolicyCostModel = "task" PricingPolicyCostModelDuration PricingPolicyCostModel = "duration" )
type ProcessInfo ¶
type ProcessInfo struct {
Running bool `json:"running"`
PID int32 `json:"pid"`
Cmd string `json:"cmd"`
Cwd string `json:"cwd"`
Env []string `json:"env"`
ExitCode int32 `json:"exit_code"`
}
@go2proto
type PrometheusConfig ¶
type PrometheusConfig struct {
AgentUrl string `key:"agentUrl" json:"agent_url"`
AgentUsername string `key:"agentUsername" json:"agent_username"`
AgentPassword string `key:"agentPassword" json:"agent_password"`
ScrapeWorkers bool `key:"scrapeWorkers" json:"scrape_workers"`
Port int `key:"port" json:"port"`
}
type ProviderComputeRequest ¶
type ProviderConfig ¶
type ProviderConfig struct {
EC2 EC2ProviderConfig `key:"ec2" json:"ec2"`
OCI OCIProviderConfig `key:"oci" json:"oci"`
LambdaLabs LambdaLabsProviderConfig `key:"lambda" json:"lambda"`
Crusoe CrusoeProviderConfig `key:"crusoe" json:"crusoe"`
Hydra HydraProviderConfig `key:"hydra" json:"hydra"`
Generic GenericProviderConfig `key:"generic" json:"generic"`
}
type ProviderMachine ¶
type ProviderMachine struct {
State *ProviderMachineState `json:"state"`
Metrics *ProviderMachineMetrics `json:"metrics"`
}
type ProviderMachineMetrics ¶
type ProviderMachineMetrics struct {
TotalCpuAvailable int `json:"total_cpu_available" redis:"total_cpu_available"`
TotalMemoryAvailable int `json:"total_memory_available" redis:"total_memory_available"`
TotalDiskSpaceBytes int `json:"total_disk_space_bytes" redis:"total_disk_space_bytes"`
CpuUtilizationPct float64 `json:"cpu_utilization_pct" redis:"cpu_utilization_pct"`
MemoryUtilizationPct float64 `json:"memory_utilization_pct" redis:"memory_utilization_pct"`
TotalDiskFreeBytes int `json:"total_disk_free_bytes" redis:"total_disk_free_bytes"`
WorkerCount int `json:"worker_count" redis:"worker_count"`
ContainerCount int `json:"container_count" redis:"container_count"`
FreeGpuCount int `json:"free_gpu_count" redis:"free_gpu_count"`
CacheUsagePct float64 `json:"cache_usage_pct" redis:"cache_usage_pct"`
CacheCapacity int `json:"cache_capacity" redis:"cache_capacity"`
CacheMemoryUsage int `json:"cache_memory_usage" redis:"cache_memory_usage"`
CacheCpuUsage float64 `json:"cache_cpu_usage" redis:"cache_cpu_usage"`
}
type ProviderMachineState ¶
type ProviderMachineState struct {
MachineId string `json:"machine_id" redis:"machine_id"`
PoolName string `json:"pool_name" redis:"pool_name"`
Status MachineStatus `json:"status" redis:"status"`
HostName string `json:"hostname" redis:"hostname"`
Token string `json:"token" redis:"token"`
Cpu int64 `json:"cpu" redis:"cpu"`
Memory int64 `json:"memory" redis:"memory"`
Gpu string `json:"gpu" redis:"gpu"`
GpuCount uint32 `json:"gpu_count" redis:"gpu_count"`
RegistrationToken string `json:"registration_token" redis:"registration_token"`
PrivateIP string `json:"private_ip" redis:"private_ip"`
Created string `json:"created" redis:"created"`
LastWorkerSeen string `json:"last_worker_seen" redis:"last_worker_seen"`
LastKeepalive string `json:"last_keepalive" redis:"last_keepalive"`
AutoConsolidate bool `json:"auto_consolidate" redis:"auto_consolidate"`
AgentVersion string `json:"agent_version" redis:"agent_version"`
}
type ProviderNotImplemented ¶
type ProviderNotImplemented struct {
// contains filtered or unexported fields
}
func (*ProviderNotImplemented) Error ¶
func (e *ProviderNotImplemented) Error() string
type ProxyConfig ¶
type ProxyConfig struct {
HTTPPort int `key:"httpPort" json:"http_port"`
Services []InternalService `key:"services" json:"services"`
}
type PythonStandaloneConfig ¶
type PythonVersion ¶
type PythonVersion string
const ( Python3 PythonVersion = "python3" Python38 PythonVersion = "python3.8" Python39 PythonVersion = "python3.9" Python310 PythonVersion = "python3.10" Python311 PythonVersion = "python3.11" Python312 PythonVersion = "python3.12" )
func (PythonVersion) String ¶
func (p PythonVersion) String() string
type QueryFilter ¶
type QueryFilter struct {
Field string
Value interface{}
}
type QuotaDoesNotExistError ¶
type QuotaDoesNotExistError struct{}
func (*QuotaDoesNotExistError) Error ¶
func (e *QuotaDoesNotExistError) Error() string
type RedisConfig ¶
type RedisConfig struct {
Addrs []string `key:"addrs" json:"addrs"`
Mode RedisMode `key:"mode" json:"mode"`
ClientName string `key:"clientName" json:"client_name"`
EnableTLS bool `key:"enableTLS" json:"enable_tls"`
InsecureSkipVerify bool `key:"insecureSkipVerify" json:"insecure_skip_verify"`
MinIdleConns int `key:"minIdleConns" json:"min_idle_conns"`
MaxIdleConns int `key:"maxIdleConns" json:"max_idle_conns"`
ConnMaxIdleTime time.Duration `key:"connMaxIdleTime" json:"conn_max_idle_time"`
ConnMaxLifetime time.Duration `key:"connMaxLifetime" json:"conn_max_lifetime"`
DialTimeout time.Duration `key:"dialTimeout" json:"dial_timeout"`
ReadTimeout time.Duration `key:"readTimeout" json:"read_timeout"`
WriteTimeout time.Duration `key:"writeTimeout" json:"write_timeout"`
MaxRedirects int `key:"maxRedirects" json:"max_redirects"`
MaxRetries int `key:"maxRetries" json:"max_retries"`
PoolSize int `key:"poolSize" json:"pool_size"`
Username string `key:"username" json:"username"`
Password string `key:"password" json:"password"`
RouteByLatency bool `key:"routeByLatency" json:"route_by_latency"`
}
type RunnerConfig ¶
type RunnerConfig struct {
BaseImageName string `key:"baseImageName" json:"base_image_name"`
BaseImageRegistry string `key:"baseImageRegistry" json:"base_image_registry"`
Tags map[string]string `key:"tags" json:"tags"`
PythonStandalone PythonStandaloneConfig `key:"pythonStandalone" json:"python_standalone"`
}
type RuntimeConfig ¶
type S3ImageRegistryConfig ¶
type S3ImageRegistryConfig struct {
BucketName string `key:"bucketName" json:"bucket_name"`
AccessKey string `key:"accessKey" json:"access_key"`
SecretKey string `key:"secretKey" json:"secret_key"`
Region string `key:"region" json:"region"`
Endpoint string `key:"endpoint" json:"endpoint"`
ForcePathStyle bool `key:"forcePathStyle" json:"force_path_style"`
}
type ScheduledJob ¶
type ScheduledJob struct {
Id uint64 `db:"id"`
ExternalId string `db:"external_id"`
JobId uint64 `db:"job_id"`
JobName string `db:"job_name"`
Schedule string `db:"job_schedule"`
Payload ScheduledJobPayload `db:"job_payload"`
StubId uint `db:"stub_id"`
DeploymentId uint `db:"deployment_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
DeletedAt sql.NullTime `db:"deleted_at"`
}
type ScheduledJobPayload ¶
type ScheduledJobPayload struct {
StubId string `json:"stub_id"`
WorkspaceName string `json:"workspace_name"`
TaskPayload TaskPayload `json:"task_payload"`
}
func (*ScheduledJobPayload) Scan ¶
func (p *ScheduledJobPayload) Scan(value interface{}) error
type Schema ¶
type Schema struct {
Fields map[string]SchemaField `json:"fields"`
}
func NewSchemaFromProto ¶
type SchemaField ¶
type Secret ¶
type Secret struct {
Id uint `db:"id" json:"-"`
ExternalId string `db:"external_id" json:"external_id,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at,omitempty"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at,omitempty"`
Name string `db:"name" json:"name"`
Value string `db:"value" json:"value,omitempty"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id,omitempty"`
LastUpdatedBy *uint `db:"last_updated_by" json:"last_updated_by,omitempty"`
}
type StopContainerArgs ¶
type StopContainerArgs struct {
ContainerId string `json:"container_id"`
Force bool `json:"force"`
Reason StopContainerReason `json:"reason"`
}
func ToStopContainerArgs ¶
func ToStopContainerArgs(m map[string]any) (*StopContainerArgs, error)
type StopContainerReason ¶
type StopContainerReason string
const ( // StopContainerReasonTtl is used when a container is stopped due to some TTL expiration StopContainerReasonTtl StopContainerReason = "TTL" // StopContainerReasonUser is used when a container is stopped by a user request StopContainerReasonUser StopContainerReason = "USER" // StopContainerReasonScheduler is used when a container is stopped by the scheduler StopContainerReasonScheduler StopContainerReason = "SCHEDULER" // StopContainerReasonAdmin is used when a container is stopped by an admin request (i.e. draining a worker) StopContainerReasonAdmin StopContainerReason = "ADMIN" StopContainerReasonUnknown StopContainerReason = "UNKNOWN" )
type StorageConfig ¶
type StorageConfig struct {
Mode string `key:"mode" json:"mode"`
FilesystemName string `key:"fsName" json:"filesystem_name"`
FilesystemPath string `key:"fsPath" json:"filesystem_path"`
ObjectPath string `key:"objectPath" json:"object_path"`
JuiceFS JuiceFSConfig `key:"juicefs" json:"juicefs"`
Geese GeeseConfig `key:"geese" json:"geese"`
Alluxio AlluxioConfig `key:"alluxio" json:"alluxio"`
MountPoint MountPointConfig `key:"mountpoint" json:"mountpoint"`
WorkspaceStorage WorkspaceStorageConfig `key:"workspaceStorage" json:"workspace_storage"`
}
type StringSlice ¶
type StringSlice []string
Custom type for a slice of strings
func (*StringSlice) UnmarshalParam ¶
func (s *StringSlice) UnmarshalParam(src string) error
UnmarshalParam implements the echo query parameter unmarshaler interface
type Stub ¶
type Stub struct {
Id uint `db:"id" json:"id,omitempty" serializer:"id,source:external_id"`
ExternalId string `db:"external_id" json:"external_id,omitempty" serializer:"external_id"`
Name string `db:"name" json:"name" serializer:"name"`
Type StubType `db:"type" json:"type" serializer:"type"`
Config string `db:"config" json:"config" serializer:"config"`
ConfigVersion uint `db:"config_version" json:"config_version" serializer:"config_version"`
ObjectId uint `db:"object_id" json:"object_id"` // Foreign key to Object
WorkspaceId uint `db:"workspace_id" json:"workspace_id"` // Foreign key to Workspace
CreatedAt Time `db:"created_at" json:"created_at" serializer:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at" serializer:"updated_at"`
Public bool `db:"public" json:"public" serializer:"public"`
AppId uint `db:"app_id" json:"app_id,omitempty"` // Foreign key to App
}
@go2proto
func NewStubFromProto ¶
func (*Stub) SanitizeConfig ¶
func (*Stub) UnmarshalConfig ¶
func (s *Stub) UnmarshalConfig() (*StubConfigV1, error)
type StubConfigLimitedValues ¶
type StubConfigLimitedValues struct {
Pricing *PricingPolicy `json:"pricing"`
Inputs *Schema `json:"inputs"`
Outputs *Schema `json:"outputs"`
TaskPolicy TaskPolicy `json:"task_policy"`
PythonVersion string `json:"python_version"`
Runtime Runtime `json:"runtime"`
}
type StubConfigV1 ¶
type StubConfigV1 struct {
Runtime Runtime `json:"runtime"`
Handler string `json:"handler"`
OnStart string `json:"on_start"`
OnDeploy string `json:"on_deploy"`
OnDeployStubId string `json:"on_deploy_stub_id"`
PythonVersion string `json:"python_version"`
KeepWarmSeconds uint `json:"keep_warm_seconds"`
MaxPendingTasks uint `json:"max_pending_tasks"`
CallbackUrl string `json:"callback_url"`
TaskPolicy TaskPolicy `json:"task_policy"`
Workers uint `json:"workers"`
ConcurrentRequests uint `json:"concurrent_requests"`
Authorized bool `json:"authorized"`
Volumes []*pb.Volume `json:"volumes"`
Secrets []Secret `json:"secrets,omitempty"`
Env []string `json:"env,omitempty"`
Autoscaler *Autoscaler `json:"autoscaler"`
Extra json.RawMessage `json:"extra"`
CheckpointEnabled bool `json:"checkpoint_enabled"`
WorkDir string `json:"work_dir"`
EntryPoint []string `json:"entry_point"`
Ports []uint32 `json:"ports"`
Pricing *PricingPolicy `json:"pricing"`
Inputs *Schema `json:"inputs"`
Outputs *Schema `json:"outputs"`
TCP bool `json:"tcp"`
BlockNetwork bool `json:"block_network"`
AllowList []string `json:"allow_list"`
DockerEnabled bool `json:"docker_enabled"`
}
func (*StubConfigV1) RequiresGPU ¶
func (c *StubConfigV1) RequiresGPU() bool
type StubFilter ¶
type StubFilter struct {
WorkspaceID string `query:"workspace_id"`
StubIds StringSlice `query:"stub_ids"` // The query parameter name is "values"
StubTypes StringSlice `query:"stub_types"`
Cursor string `query:"cursor"`
Pagination bool `query:"pagination"`
AppId string `query:"app_id"`
}
Struct that includes the custom type
type StubGetURLFilter ¶
type StubLimits ¶
type StubLimits struct {
Cpu uint64 `key:"cpu" json:"cpu"`
Memory uint64 `key:"memory" json:"memory"`
MaxReplicas uint64 `key:"maxReplicas" json:"max_replicas"`
MaxGpuCount uint32 `key:"maxGpuCount" json:"max_gpu_count"`
GPUBlackList GPUBlackListConfig `key:"gpuBlackList" json:"gpu_black_list"`
}
type StubWithRelated ¶
type StubWithRelated struct {
Stub
Workspace Workspace `db:"workspace" json:"workspace" serializer:"workspace"`
Object Object `db:"object" json:"object" serializer:"object"`
App *App `db:"app" json:"app" serializer:"app"`
}
@go2proto
func NewStubWithRelatedFromProto ¶
func NewStubWithRelatedFromProto(in *pb.StubWithRelated) *StubWithRelated
func (*StubWithRelated) ToProto ¶
func (s *StubWithRelated) ToProto() *pb.StubWithRelated
type TailscaleConfig ¶
type TailscaleConfig struct {
ControlURL string `key:"controlUrl" json:"control_url"`
User string `key:"user" json:"user"`
AuthKey string `key:"authKey" json:"auth_key"`
HostName string `key:"hostName" json:"host_name"`
Enabled bool `key:"enabled" json:"enabled"`
Debug bool `key:"debug" json:"debug"`
}
type Task ¶
type Task struct {
Id uint `db:"id" json:"id,omitempty" serializer:"id,source:external_id"`
ExternalId string `db:"external_id" json:"external_id,omitempty" serializer:"external_id"`
Status TaskStatus `db:"status" json:"status,omitempty" serializer:"status"`
ContainerId string `db:"container_id" json:"container_id,omitempty" serializer:"container_id"`
StartedAt NullTime `db:"started_at" json:"started_at,omitempty" serializer:"started_at"`
EndedAt NullTime `db:"ended_at" json:"ended_at,omitempty" serializer:"ended_at"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id,omitempty"` // Foreign key to Workspace
ExternalWorkspaceId *uint `db:"external_workspace_id" json:"external_workspace_id,omitempty"` // Foreign key to Workspace
StubId uint `db:"stub_id" json:"stub_id,omitempty"` // Foreign key to Stub
AppId *uint `db:"app_id" json:"app_id,omitempty"` // Foreign key to App
CreatedAt Time `db:"created_at" json:"created_at,omitempty" serializer:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at,omitempty" serializer:"updated_at"`
}
type TaskCancellationReason ¶
type TaskCancellationReason string
const ( TaskExpired TaskCancellationReason = "expired" TaskExceededRetryLimit TaskCancellationReason = "exceeded_retry_limit" TaskRequestCancelled TaskCancellationReason = "request_cancelled" TaskInvalidRequestPayload TaskCancellationReason = "invalid_request_payload" )
type TaskCountByTime ¶
type TaskCountByTime struct {
Time time.Time `db:"time" json:"time"`
Count uint `count:"count" json:"count"`
StatusCounts json.RawMessage `db:"status_counts" json:"status_counts"`
}
type TaskCountPerDeployment ¶
type TaskExecutor ¶
type TaskExecutor string
var ( ExecutorTaskQueue TaskExecutor = "taskqueue" ExecutorEndpoint TaskExecutor = "endpoint" ExecutorFunction TaskExecutor = "function" ExecutorContainer TaskExecutor = "container" ExecutorBot TaskExecutor = "bot" )
type TaskFilter ¶
type TaskFilter struct {
BaseFilter
WorkspaceID uint `query:"workspace_id"`
ExternalWorkspaceID uint `query:"external_workspace_id"`
TaskIds StringSlice `query:"task_ids"`
StubIds StringSlice `query:"stub_ids"`
StubNames StringSlice `query:"stub_names"`
StubTypes StringSlice `query:"stub_types"`
Status string `query:"status"`
ContainerIds StringSlice `query:"container_ids"`
CreatedAtStart string `query:"created_at_start"`
CreatedAtEnd string `query:"created_at_end"`
MinDuration uint `query:"min_duration"`
MaxDuration uint `query:"max_duration"`
Interval string `query:"interval"`
Cursor string `query:"cursor"`
AppId string `query:"app_id"`
Public bool `query:"public"`
All bool `query:"all"`
}
type TaskInterface ¶
type TaskMessage ¶
type TaskMessage struct {
TaskId string `json:"task_id" redis:"task_id"`
WorkspaceName string `json:"workspace_name" redis:"workspace_name"`
StubId string `json:"stub_id" redis:"stub_id"`
Executor string `json:"executor" redis:"executor"`
Args []interface{} `json:"args" redis:"args"`
Kwargs map[string]interface{} `json:"kwargs" redis:"kwargs"`
Policy TaskPolicy `json:"policy" redis:"policy"`
Retries uint `json:"retries" redis:"retries"`
Timestamp int64 `json:"timestamp" redis:"timestamp"`
}
TaskMessage represents a JSON serializable message to be added to the queue
func (*TaskMessage) Decode ¶
func (tm *TaskMessage) Decode(encodedData []byte) error
Decode initializes the TaskMessage fields from a byte array
func (*TaskMessage) Encode ¶
func (tm *TaskMessage) Encode() ([]byte, error)
Encode returns a binary representation of the TaskMessage
func (*TaskMessage) Reset ¶
func (tm *TaskMessage) Reset()
type TaskMetadata ¶
type TaskMetrics ¶
type TaskOutput ¶
type TaskParams ¶
type TaskPayload ¶
type TaskPayload struct {
Args []interface{} `json:"args"`
Kwargs map[string]interface{} `json:"kwargs"`
}
type TaskPolicy ¶
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusPending TaskStatus = "PENDING" TaskStatusRunning TaskStatus = "RUNNING" TaskStatusComplete TaskStatus = "COMPLETE" TaskStatusError TaskStatus = "ERROR" TaskStatusCancelled TaskStatus = "CANCELLED" TaskStatusExpired TaskStatus = "EXPIRED" TaskStatusTimeout TaskStatus = "TIMEOUT" TaskStatusRetry TaskStatus = "RETRY" )
func (TaskStatus) IsCompleted ¶
func (ts TaskStatus) IsCompleted() bool
func (TaskStatus) IsInflight ¶
func (ts TaskStatus) IsInflight() bool
type TaskWithRelated ¶
type TaskWithRelated struct {
Task
Deployment struct {
ExternalId *string `db:"external_id" json:"external_id" serializer:"id"`
Name *string `db:"name" json:"name" serializer:"name"`
Version *uint `db:"version" json:"version" serializer:"version"`
} `db:"deployment" json:"deployment" serializer:"deployment"`
Outputs []TaskOutput `json:"outputs" serializer:"outputs"`
Stats TaskStats `json:"stats" serializer:"stats"`
Result json.RawMessage `json:"result" serializer:"result"`
Workspace Workspace `db:"workspace" json:"workspace" serializer:"workspace"`
ExternalWorkspace *struct {
Id *uint `db:"id" json:"id"`
ExternalId *string `db:"external_id" json:"external_id"`
Name *string `db:"name" json:"name"`
} `db:"external_workspace" json:"external_workspace" serializer:"external_workspace"`
Stub Stub `db:"stub" json:"stub" serializer:"stub"`
App App `db:"app" json:"app" serializer:"app"`
}
type TelemetryConfig ¶
type TelemetryConfig struct {
Enabled bool `key:"enabled" json:"enabled"`
Endpoint string `key:"endpoint" json:"endpoint"`
MeterInterval time.Duration `key:"meterInterval" json:"meter_interval"`
TraceInterval time.Duration `key:"traceInterval" json:"trace_interval"`
TraceSampleRatio float64 `key:"traceSampleRatio" json:"trace_sample_ratio"`
}
type ThrottledByConcurrencyLimitError ¶
type ThrottledByConcurrencyLimitError struct {
Reason string
}
func (*ThrottledByConcurrencyLimitError) Error ¶
func (e *ThrottledByConcurrencyLimitError) Error() string
type Token ¶
type Token struct {
Id uint `db:"id" json:"id" serializer:"id,source:external_id"`
ExternalId string `db:"external_id" json:"external_id" serializer:"external_id"`
Key string `db:"key" json:"key" serializer:"key"`
Active bool `db:"active" json:"active" serializer:"active"`
Reusable bool `db:"reusable" json:"reusable" serializer:"reusable"`
WorkspaceId *uint `db:"workspace_id" json:"workspace_id,omitempty"` // Foreign key to Workspace
Workspace *Workspace `db:"workspace" json:"workspace,omitempty" serializer:"workspace,omitempty"` // Pointer to associated Workspace
TokenType string `db:"token_type" json:"token_type" serializer:"token_type"`
CreatedAt Time `db:"created_at" json:"created_at" serializer:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at" serializer:"updated_at"`
DisabledByClusterAdmin bool `db:"disabled_by_cluster_admin" json:"disabled_by_cluster_admin" serializer:"disabled_by_cluster_admin"`
}
type VictoriaLogsConfig ¶
type VictoriaMetricsConfig ¶
type VictoriaMetricsConfig struct {
PushURL string `key:"pushURL" json:"push_url"`
AuthToken string `key:"authToken" json:"auth_token"`
PushSecs int `key:"pushSecs" json:"push_secs"`
WriteURL string `key:"writeURL" json:"write_url"`
WriteUsername string `key:"writeUsername" json:"write_username"`
WritePassword string `key:"writePassword" json:"write_password"`
}
type Volume ¶
type Volume struct {
Id uint `db:"id" json:"id"`
ExternalId string `db:"external_id" json:"external_id"`
Name string `db:"name" json:"name"`
Size uint64 `json:"size"` // Populated by volume abstraction
WorkspaceId uint `db:"workspace_id" json:"workspace_id"` // Foreign key to Workspace
CreatedAt Time `db:"created_at" json:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at"`
}
type VolumeWithRelated ¶
type Worker ¶
type Worker struct {
Id string `json:"id" redis:"id"`
Status WorkerStatus `json:"status" redis:"status"`
TotalCpu int64 `json:"total_cpu" redis:"total_cpu"`
TotalMemory int64 `json:"total_memory" redis:"total_memory"`
TotalGpuCount uint32 `json:"total_gpu_count" redis:"total_gpu_count"`
FreeCpu int64 `json:"free_cpu" redis:"free_cpu"`
FreeMemory int64 `json:"free_memory" redis:"free_memory"`
FreeGpuCount uint32 `json:"free_gpu_count" redis:"gpu_count"`
Gpu string `json:"gpu" redis:"gpu"`
PoolName string `json:"pool_name" redis:"pool_name"`
MachineId string `json:"machine_id" redis:"machine_id"`
ResourceVersion int64 `json:"resource_version" redis:"resource_version"`
RequiresPoolSelector bool `json:"requires_pool_selector" redis:"requires_pool_selector"`
Priority int32 `json:"priority" redis:"priority"`
Preemptable bool `json:"preemptable" redis:"preemptable"`
BuildVersion string `json:"build_version" redis:"build_version"`
ActiveContainers []Container `json:"active_containers" redis:"active_containers"`
Runtime string `json:"runtime" redis:"runtime"`
}
@go2proto
func NewWorkerFromProto ¶
type WorkerConfig ¶
type WorkerConfig struct {
Pools map[string]WorkerPoolConfig `key:"pools" json:"pools"`
HostNetwork bool `key:"hostNetwork" json:"host_network"`
UseGatewayServiceHostname bool `key:"useGatewayServiceHostname" json:"use_gateway_service_hostname"`
UseHostResolvConf bool `key:"useHostResolvConf" json:"use_host_resolv_conf"`
ImageTag string `key:"imageTag" json:"image_tag"`
ImageName string `key:"imageName" json:"image_name"`
ImageRegistry string `key:"imageRegistry" json:"image_registry"`
ImagePullSecrets []string `key:"imagePullSecrets" json:"image_pull_secrets"`
Namespace string `key:"namespace" json:"namespace"`
ServiceAccountName string `key:"serviceAccountName" json:"service_account_name"`
JobResourcesEnforced bool `key:"jobResourcesEnforced" json:"job_resources_enforced"`
ContainerResourceLimits ContainerResourceLimitsConfig `key:"containerResourceLimits" json:"container_resource_limits"`
DefaultWorkerCPURequest int64 `key:"defaultWorkerCPURequest" json:"default_worker_cpu_request"`
DefaultWorkerMemoryRequest int64 `key:"defaultWorkerMemoryRequest" json:"default_worker_memory_request"`
ImagePVCName string `key:"imagePVCName" json:"image_pvc_name"`
CleanupWorkerInterval time.Duration `key:"cleanupWorkerInterval" json:"cleanup_worker_interval"`
CleanupPendingWorkerAgeLimit time.Duration `key:"cleanupPendingWorkerAgeLimit" json:"cleanup_pending_worker_age_limit"`
TerminationGracePeriod int64 `key:"terminationGracePeriod"`
BlobCacheEnabled bool `key:"blobCacheEnabled" json:"blob_cache_enabled"`
CRIU CRIUConfig `key:"criu" json:"criu"`
TmpSizeLimit string `key:"tmpSizeLimit" json:"tmp_size_limit"`
ContainerLogLinesPerHour int `key:"containerLogLinesPerHour" json:"container_log_lines_per_hour"`
Failover FailoverConfig `key:"failover" json:"failover"`
ContainerRuntime string `key:"containerRuntime" json:"container_runtime"`
}
type WorkerPoolConfig ¶
type WorkerPoolConfig struct {
GPUType string `key:"gpuType" json:"gpu_type"`
Runtime string `key:"runtime" json:"runtime"` // Kubernetes RuntimeClass for pod (e.g., "nvidia")
ContainerRuntime string `key:"containerRuntime" json:"container_runtime"` // Pool-specific container runtime: "runc" or "gvisor"
ContainerRuntimeConfig RuntimeConfig `key:"containerRuntimeConfig" json:"container_runtime_config"` // Pool-specific container runtime configuration
Mode PoolMode `key:"mode" json:"mode"`
Provider *MachineProvider `key:"provider" json:"provider"`
JobSpec WorkerPoolJobSpecConfig `key:"jobSpec" json:"job_spec"`
PoolSizing WorkerPoolJobSpecPoolSizingConfig `key:"poolSizing" json:"pool_sizing"`
DefaultMachineCost float64 `key:"defaultMachineCost" json:"default_machine_cost"`
RequiresPoolSelector bool `key:"requiresPoolSelector" json:"requires_pool_selector"`
Priority int32 `key:"priority" json:"priority"`
Preemptable bool `key:"preemptable" json:"preemptable"`
UserData string `key:"userData" json:"user_data"`
CRIUEnabled bool `key:"criuEnabled" json:"criu_enabled"`
TmpSizeLimit string `key:"tmpSizeLimit" json:"tmp_size_limit"`
ConfigGroup string `key:"configGroup" json:"config_group"`
K3sInstallDir string `key:"k3sInstallDir" json:"k3s_install_dir"`
StoragePath string `key:"storagePath" json:"storage_path"`
StorageMode string `key:"storageMode" json:"storage_mode"`
CheckpointPath string `key:"checkpointPath" json:"checkpoint_path"`
}
type WorkerPoolJobSpecConfig ¶
type WorkerPoolJobSpecConfig struct {
NodeSelector map[string]string `key:"nodeSelector" json:"node_selector"`
Env []corev1.EnvVar `key:"env" json:"env"`
// Mimics corev1.Volume since that type doesn't currently serialize correctly
Volumes []struct {
Name string `key:"name" json:"name"`
Secret struct {
SecretName string `key:"secretName" json:"secret_name"`
} `key:"secret" json:"secret"`
} `key:"volumes" json:"volumes"`
VolumeMounts []corev1.VolumeMount `key:"volumeMounts" json:"volume_mounts"`
}
type WorkerPoolJobSpecPoolSizingConfig ¶
type WorkerPoolJobSpecPoolSizingConfig struct {
DefaultWorkerCPU string `key:"defaultWorkerCPU" json:"default_worker_cpu"`
DefaultWorkerMemory string `key:"defaultWorkerMemory" json:"default_worker_memory"`
DefaultWorkerGpuType string `key:"defaultWorkerGPUType" json:"default_worker_gpu_type"`
DefaultWorkerGpuCount string `key:"defaultWorkerGpuCount" json:"default_worker_gpu_count"`
MinFreeCPU string `key:"minFreeCPU" json:"min_free_cpu"`
MinFreeMemory string `key:"minFreeMemory" json:"min_free_memory"`
MinFreeGPU string `key:"minFreeGPU" json:"min_free_gpu"`
}
type WorkerPoolSizingConfig ¶
type WorkerPoolSizingConfig struct {
MinFreeCpu int64
MinFreeMemory int64
MinFreeGpu uint
DefaultWorkerCpu int64
DefaultWorkerMemory int64
DefaultWorkerGpuType string
DefaultWorkerGpuCount uint32
}
func NewWorkerPoolSizingConfig ¶
func NewWorkerPoolSizingConfig() *WorkerPoolSizingConfig
type WorkerPoolState ¶
type WorkerPoolState struct {
Status WorkerPoolStatus `redis:"status" json:"status"`
SchedulingLatency int64 `redis:"scheduling_latency" json:"scheduling_latency"`
FreeGpu uint `redis:"free_gpu" json:"free_gpu"`
FreeCpu int64 `redis:"free_cpu" json:"free_cpu"`
FreeMemory int64 `redis:"free_memory" json:"free_memory"`
PendingWorkers int64 `redis:"pending_workers" json:"pending_workers"`
AvailableWorkers int64 `redis:"available_workers" json:"available_workers"`
PendingContainers int64 `redis:"pending_containers" json:"pending_containers"`
RunningContainers int64 `redis:"running_containers" json:"running_containers"`
RegisteredMachines int64 `redis:"registered_machines" json:"registered_machines"`
PendingMachines int64 `redis:"pending_machines" json:"pending_machines"`
ReadyMachines int64 `redis:"ready_machines" json:"ready_machines"`
}
@go2proto
func (*WorkerPoolState) ToProto ¶
func (w *WorkerPoolState) ToProto() *pb.WorkerPoolState
type WorkerPoolStatus ¶
type WorkerPoolStatus string
const ( WorkerPoolStatusHealthy WorkerPoolStatus = "HEALTHY" WorkerPoolStatusDegraded WorkerPoolStatus = "DEGRADED" )
type WorkerStatus ¶
type WorkerStatus string
type Workspace ¶
type Workspace struct {
Id uint `db:"id" json:"id,omitempty" serializer:"id,source:external_id"`
ExternalId string `db:"external_id" json:"external_id,omitempty" serializer:"external_id"`
Name string `db:"name" json:"name" serializer:"name"`
CreatedAt Time `db:"created_at" json:"created_at,omitempty" serializer:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at,omitempty" serializer:"updated_at"`
SigningKey *string `db:"signing_key" json:"signing_key" serializer:"signing_key"`
VolumeCacheEnabled bool `db:"volume_cache_enabled" json:"volume_cache_enabled" serializer:"volume_cache_enabled"`
MultiGpuEnabled bool `db:"multi_gpu_enabled" json:"multi_gpu_enabled" serializer:"multi_gpu_enabled"`
ConcurrencyLimitId *uint `db:"concurrency_limit_id" json:"concurrency_limit_id,omitempty"`
ConcurrencyLimit *ConcurrencyLimit `db:"concurrency_limit" json:"concurrency_limit" serializer:"concurrency_limit,omitempty"`
StorageId *uint `db:"storage_id" json:"storage_id,omitempty" serializer:"storage_id,from:storage.external_id,omitempty"`
Storage *WorkspaceStorage `db:"storage" json:"storage" serializer:"storage,omitempty"`
}
@go2proto
func NewWorkspaceFromProto ¶
func (*Workspace) StorageAvailable ¶
type WorkspaceStorage ¶
type WorkspaceStorage struct {
Id *uint `db:"id" json:"id"`
ExternalId *string `db:"external_id" json:"external_id"`
BucketName *string `db:"bucket_name" json:"bucket_name"`
AccessKey *string `db:"access_key" json:"access_key" encrypt:"true"`
SecretKey *string `db:"secret_key" json:"secret_key" encrypt:"true"`
EndpointUrl *string `db:"endpoint_url" json:"endpoint_url"`
Region *string `db:"region" json:"region"`
CreatedAt *time.Time `db:"created_at" json:"created_at,omitempty"`
UpdatedAt *time.Time `db:"updated_at" json:"updated_at,omitempty"`
}
@go2proto
func NewWorkspaceStorageFromProto ¶
func NewWorkspaceStorageFromProto(in *pb.WorkspaceStorage) *WorkspaceStorage
func (*WorkspaceStorage) ToProto ¶
func (w *WorkspaceStorage) ToProto() *pb.WorkspaceStorage
type WorkspaceStorageConfig ¶
type WorkspaceStorageConfig struct {
BaseMountPath string `key:"baseMountPath" json:"base_mount_path"`
DefaultStorageMode string `key:"defaultStorageMode" json:"default_storage_mode"`
DefaultBucketPrefix string `key:"defaultBucketPrefix" json:"default_bucket_prefix"`
DefaultAccessKey string `key:"defaultAccessKey" json:"default_access_key"`
DefaultSecretKey string `key:"defaultSecretKey" json:"default_secret_key"`
DefaultEndpointUrl string `key:"defaultEndpointUrl" json:"default_endpoint_url"`
DefaultRegion string `key:"defaultRegion" json:"default_region"`
// Storage mode configs
Geese GeeseConfig `key:"geese" json:"geese"`
Alluxio AlluxioConfig `key:"alluxio" json:"alluxio"`
}