Documentation
¶
Index ¶
- Constants
- Variables
- func BackendRouteAddress(routeID string) string
- func BackendRouteID(machineID, workerID, containerID, kind string, port int32) string
- func ComputeDollarsToMicros(value float64) int64
- func ComputeMicrosToDollars(value int64) float64
- func ComputeWholeHours(d time.Duration) int64
- func EventSummaryKeyForLifecycle(id ContainerLifecycleID) string
- func GPUTypesToMap(gpuTypes []GpuType) map[string]int
- func GpuTypesToSlice(gpuTypes []GpuType) []string
- func GpuTypesToStrings(gpus []GpuType) []string
- func IsContainerRootCauseCandidate(id ContainerEventID) bool
- func IsDiskSnapshotFilesystemFormat(format string) bool
- func IsWorkerTokenType(tokenType string) bool
- func KnownGPUType(gpu GpuType) bool
- func MountPointCredentialKey(mountPath, bucketName string) string
- func NewProviderNotImplemented() error
- func NormalizeBackendRouteTransport(transport string) string
- func NormalizeDatabaseKind(kind string) string
- func NormalizeDurableDiskDriver(driver string) string
- func NormalizeEventReason(reason string) string
- func NormalizeGPUStrings(gpus []string) []string
- func ParseBackendRouteAddress(address string) (string, bool)
- func ParseComputeTTL(value string) (time.Duration, error)
- func ParseConditionFromQueryFilters(out interface{}, queryFilters ...QueryFilter)
- func SafeDurableDiskName(name string) string
- func StableStorageNodeID(machineID, workerID string) string
- func TempContainerWorkspace(containerId string) string
- func ValidateComputePoolName(name string) error
- func ValidateCpuAndMemory(cpu, memory int64, stubLimits StubLimits) (valid bool, errorMsg string)
- func WorkerStartConcurrency(workerConfig WorkerConfig, worker *Worker) int
- func WorkerStartConcurrencyForPool(poolConfig WorkerPoolConfig, globalRuntime, runtimeType string, ...) int
- func WorkspaceBucketName(prefix, workspaceID string) string
- type AbstractionConfig
- type AgentConfig
- type AgentJoinOptions
- type AlluxioConfig
- type App
- type AppConfig
- type AppFilter
- type Autoscaler
- type AutoscalerType
- type AvailableHost
- type BackendRoute
- type BaseFilter
- type BotConfig
- type BuildOptions
- type BuildRegistryCredentialsConfig
- type CORSConfig
- type CRIUConfig
- type CRIUConfigMode
- type CacheContentKind
- type CacheRequiredContentItem
- type CapacityUpdateType
- type Checkpoint
- type CheckpointStatus
- type ClipVersion
- type ComputeCapacitySource
- type ComputeDemand
- type ComputeOffer
- type ComputeOfferRequest
- type ComputePool
- type ComputeReservation
- type ComputeReservationRequest
- type ComputeReservationStatus
- type ComputeSolveAction
- type ComputeSolveActionType
- type ComputeSolveInput
- type ComputeSolvePlan
- type ComputeVendor
- type ConcurrencyLimit
- type ConfigmanConfig
- type Container
- type ContainerAlreadyScheduledError
- type ContainerCostHookConfig
- type ContainerEvent
- type ContainerEventDefinition
- type ContainerEventID
- type ContainerEventOptions
- type ContainerEventRecord
- type ContainerEventsResponse
- type ContainerExitCode
- type ContainerIpAssignment
- type ContainerLifecycleDefinition
- type ContainerLifecycleID
- type ContainerLifecycleOptions
- type ContainerNetworkPolicy
- type ContainerRequest
- func (c *ContainerRequest) Clone() *ContainerRequest
- func (c *ContainerRequest) HasDurableDiskMount() bool
- func (c *ContainerRequest) IsBuildRequest() bool
- func (c *ContainerRequest) NetworkPolicy() ContainerNetworkPolicy
- func (c *ContainerRequest) NetworkRestricted() bool
- func (c *ContainerRequest) PrivateWorkerRequest() *ContainerRequest
- func (c *ContainerRequest) RequiresGPU() bool
- func (c *ContainerRequest) StorageAvailable() bool
- func (c *ContainerRequest) ToProto() *pb.ContainerRequest
- func (c *ContainerRequest) VolumeCacheCompatible() bool
- type ContainerRequestStatus
- type ContainerResourceLimitsConfig
- type ContainerResourceUsage
- type ContainerRunnerEvent
- type ContainerRuntime
- type ContainerState
- type ContainerStatus
- type CrusoeProviderConfig
- type DatabaseConfig
- type DatabaseServingConfig
- type DeletedWorkerReason
- type Deployment
- type DeploymentFilter
- type DeploymentWithRelated
- type Disk
- type DiskSnapshot
- type DiskSnapshotChunk
- type DiskSnapshotFile
- type DiskSnapshotFilter
- type DiskSnapshotManifest
- type DiskSnapshotStatus
- type DiskWithRelated
- type DockerImageRegistryConfig
- type DurableDiskMountConfig
- type EC2ProviderConfig
- type ElasticSearchConfig
- type ErrCheckpointNotFound
- type ErrContainerStateNotFound
- type ErrDiskSnapshotNotFound
- type ErrExceededTaskLimit
- type ErrInvalidWorkerStatus
- type ErrNoSuitableWorkerFound
- type ErrWorkerNotFound
- type ErrWorkerPoolStateNotFound
- type EventCallbackConfig
- type EventClient
- type EventComputeSchema
- type EventContainerEventSchema
- type EventContainerLifecycleSchema
- type EventContainerLogSchema
- type EventContainerMetricsData
- type EventContainerMetricsSchema
- type EventDomain
- type EventGatewayEndpointSchema
- type EventHistoryResponse
- type EventLLMRouteSchema
- type EventMessage
- type EventPlatformCacheSchema
- type EventPlatformLogSchema
- type EventQuery
- type EventSink
- type EventSource
- type EventStubCacheRequiredContentSchema
- type EventStubSchema
- type EventStubStateSchema
- type EventTaskSchema
- type EventWorkerLifecycleSchema
- type EventWorkerPoolStateSchema
- type EventsConfig
- type ExitCodeError
- type FailoverConfig
- type FileInfo
- type FileSearchMatch
- type FileSearchPosition
- type FileSearchRange
- type FileSearchResult
- type FileServiceConfig
- type FilterFieldMapping
- type GPUBlackListConfig
- type GRPCConfig
- type GatewayServiceConfig
- type GeeseConfig
- type GenericProviderConfig
- type GpuType
- type HTTPConfig
- type HetznerPrivateNetworkConfig
- type HetznerProviderConfig
- type HetznerRegionConfig
- type HydraProviderConfig
- type Image
- type ImageRegistriesConfig
- type ImageServiceConfig
- type InternalService
- type JuiceFSConfig
- type LLMConfig
- type LambdaLabsProviderConfig
- type LogQuery
- type LogRecord
- type LogsResponse
- type MachineProvider
- type MachineStatus
- type ManagedComputeBYOCAWSConfig
- type ManagedComputeBYOCConfig
- type ManagedComputeBYOCPricingConfig
- type ManagedComputeBillingConfig
- func (c ManagedComputeBillingConfig) FailureGracePeriodOrDefault() time.Duration
- func (c ManagedComputeBillingConfig) MinimumCreditCentsOrDefault() int64
- func (c ManagedComputeBillingConfig) ReconcileIntervalOrDefault() time.Duration
- func (c ManagedComputeBillingConfig) TimeoutOrDefault() time.Duration
- type ManagedComputeConfig
- type MetricAverage
- type MetricsAggregationBucket
- type MetricsCollector
- type MetricsTimeseriesResponse
- type MonitoringConfig
- type Mount
- type MountPointConfig
- type NullTime
- type NvidiaCRIUConfig
- type OCIProviderConfig
- type Object
- type ObjectStoreConfig
- type OpenMeterConfig
- type PodConfig
- type PodTCPConfig
- type PoolConfig
- 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 S2Config
- type S3ImageRegistryConfig
- type ScheduledJob
- type ScheduledJobPayload
- type Schema
- type SchemaField
- type Secret
- type ServingConfig
- type ShadeformProviderConfig
- type StopContainerArgs
- type StopContainerReason
- type StorageConfig
- type StringSlice
- type Stub
- type StubConfigLimitedValues
- type StubConfigV1
- func (c *StubConfigV1) EffectiveAppKind() string
- func (c *StubConfigV1) EffectiveDatabaseConfig() *DatabaseServingConfig
- func (c *StubConfigV1) EffectiveLLMConfig() *LLMConfig
- func (c *StubConfigV1) EffectiveServingConfig() *ServingConfig
- func (c *StubConfigV1) EffectiveServingProtocol() string
- func (c *StubConfigV1) PoolSelector() string
- func (c *StubConfigV1) RequiresGPU() bool
- func (c *StubConfigV1) SetReplicaCount(containers uint)
- 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 VastProviderConfig
- type VictoriaLogsConfig
- type VictoriaMetricsConfig
- type Volume
- type VolumeWithRelated
- type Worker
- type WorkerConfig
- type WorkerKeepAlive
- type WorkerPoolCacheConfig
- type WorkerPoolCacheDiskConfig
- type WorkerPoolConfig
- type WorkerPoolJobSpecConfig
- type WorkerPoolJobSpecPoolSizingConfig
- type WorkerPoolSizingConfig
- type WorkerPoolState
- type WorkerPoolStatus
- type WorkerStatus
- type Workspace
- type WorkspaceStorage
- type WorkspaceStorageConfig
Constants ¶
const ( DefaultAgentName = "agent" DefaultAgentServiceName = "beam-agent" DefaultAgentServiceDescription = "Beam Agent" DefaultAgentBinaryPath = "/usr/local/bin/beam-agent" DefaultAgentBinaryPattern = "/usr/local/bin/beam-agent-%s-%s" DefaultAgentStateDir = "/var/lib/beam/agent" DefaultAgentServiceManager = "auto" AgentServiceManagerSystemd = "systemd" AgentServiceManagerLaunchd = "launchd" AgentServiceManagerNone = "none" AgentServiceUnitExtension = ".service" AgentSystemdNetworkOnlineTarget = "network-online.target" AgentSystemdDockerService = "docker.service" AgentSystemdUnitDir = "/etc/systemd/system" AgentSystemdRuntimeDir = "/run/systemd/system" AgentLaunchdUserDir = "Library/LaunchAgents" AgentLaunchdSystemDir = "/Library/LaunchDaemons" AgentLaunchdLabel = "dev.beam.agent" AgentLaunchdPlistExtension = ".plist" AgentLaunchdSystemDomain = "system" AgentLaunchdUserDomainPrefix = "gui/" AgentSystemctlCommand = "systemctl" AgentLaunchctlCommand = "launchctl" AgentPathEnv = "PATH" AgentServiceDefaultPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" AgentServiceLogFile = "agent.log" AgentServiceErrorLogFile = "agent.err.log" AgentHomeEnv = "HOME" AgentXDGConfigHomeEnv = "XDG_CONFIG_HOME" AgentRegistryAddr = "127.0.0.1:5000" AgentWorkerEntrypoint = "/usr/local/bin/worker" AgentTmpSizeLimit = "30Gi" AgentStateDirName = "agent" AgentLockFileName = "agent.lock" AgentJoinTokenFileName = "join-token" AgentRuntimeStateFileName = "agent-state.json" BeamStateDirName = "beam" LoopbackHost = "127.0.0.1" HostnameEnv = "HOSTNAME" PodNameEnv = "POD_NAME" GatewayTSNetHostnameEnv = "BETA9_GATEWAY_TSNET_HOSTNAME" CacheCoordinatorTokenEnv = "CACHE_COORDINATOR_TOKEN" NvidiaVisibleDevicesAll = "all" NvidiaVisibleDevicesEnv = "NVIDIA_VISIBLE_DEVICES" AgentDockerHostsEnv = "BEAM_AGENT_DOCKER_HOST_ALIASES" AgentInContainerEnv = "BEAM_AGENT_CONTAINER" AgentHostnameEnv = "BEAM_AGENT_HOSTNAME" AgentRegistryForwardEnv = "BEAM_AGENT_LOCAL_REGISTRY_FORWARD" AgentTargetHostEnv = "BEAM_AGENT_LOCAL_TARGET_HOST" AgentFingerprintEnv = "BEAM_AGENT_MACHINE_FINGERPRINT" AgentStateDirEnv = "BEAM_AGENT_STATE_DIR" AgentBinaryPathEnv = "BEAM_AGENT_BIN_PATH" AgentSourceDirEnv = "BEAM_AGENT_SOURCE_DIR" AgentBuildCacheDirEnv = "BEAM_AGENT_BUILD_CACHE_DIR" AgentWorkerImageEnv = "BEAM_WORKER_IMAGE" AgentDownloadURLEnv = "BEAM_AGENT_URL" AgentInstallDockerEnv = "BEAM_AGENT_INSTALL_DOCKER" AgentStorageModeEnv = "BEAM_AGENT_WORKSPACE_STORAGE_MODE" AgentWorkerPlatformEnv = "BEAM_AGENT_WORKER_PLATFORM" AgentVerboseEnv = "BEAM_AGENT_VERBOSE" AgentNoColorEnv = "NO_COLOR" AgentGatewayURLEnv = "BEAM_GATEWAY_HTTP_URL" AgentImagesPath = "/images" AgentImageCachePath = "/images/cache" AgentImageMountPattern = "/images/mnt/%s" AgentTmpPath = "/tmp" AgentDataPath = "/data" AgentWorkspacePath = "/workspace/data" AgentCachePath = "/var/lib/beta9/cache" AgentCheckpointPath = "/checkpoints" AgentLogsPath = "/var/log/worker" AgentConfigPath = "/etc/beam/agent-worker.json" AgentCacheFSMountPath = "/cache" HostKubeletDevicePluginsPath = "/var/lib/kubelet/device-plugins" HostKubeletDeviceCheckpointPath = "/var/lib/kubelet/device-plugins/kubelet_internal_checkpoint" HostNetnsPath = "/var/run/netns" HostCgroupPath = "/sys/fs/cgroup" HostFuseDevicePath = "/dev/fuse" AgentDockerLabelManaged = "dev.beam.agent.worker" AgentDockerLabelWorkerID = "dev.beam.agent.worker_id" AgentDockerLabelMachineID = "dev.beam.agent.machine_id" AgentDockerLabelPoolName = "dev.beam.agent.pool_name" AgentDockerLabelWorkerImageID = "dev.beam.agent.worker_image_id" AgentTelemetrySourceAgent = "agent" AgentTelemetrySourceWorker = "worker" AgentMachineStatusSchedulable = "schedulable" AgentMachineStatusDisconnected = "disconnected" AgentMachineStatusPreflightFail = "preflight_failed" )
const ( WorkerConfigPathEnv = "CONFIG_PATH" WorkerConfigJSONEnv = "CONFIG_JSON" WorkerIDEnv = "WORKER_ID" WorkerTokenEnv = "WORKER_TOKEN" WorkerPoolEnv = "WORKER_POOL_NAME" WorkerMachineEnv = "WORKER_MACHINE_ID" WorkerPersistentEnv = "WORKER_PERSISTENT" WorkerRouteTransportEnv = "WORKER_ROUTE_TRANSPORT" WorkerRouteTargetEnv = "WORKER_ROUTE_LOCAL_TARGET_HOST" WorkerCPUEnv = "CPU_LIMIT" WorkerMemoryEnv = "MEMORY_LIMIT" WorkerGPUEnv = "GPU_TYPE" WorkerGPUCountEnv = "GPU_COUNT" // The agent's GPU assignment ("all" or a device list); unlike // NVIDIA_VISIBLE_DEVICES it survives container toolkit rewrites. WorkerGPUDevicesEnv = "WORKER_GPU_DEVICES" WorkerPodHostEnv = "POD_HOSTNAME" WorkerPodIPEnv = "POD_IP" WorkerPodUIDEnv = "POD_UID" WorkerHostnameEnv = HostnameEnv WorkerNetworkPrefixEnv = "NETWORK_PREFIX" WorkerDefaultInterfaceEnv = "WORKER_DEFAULT_INTERFACE" WorkerIptablesModeEnv = "WORKER_IPTABLES_MODE" WorkerStartConcurrencyEnv = "WORKER_CONTAINER_START_CONCURRENCY" WorkerNetworkSlotsEnv = "CONTAINER_NETWORK_SLOT_POOL_SIZE" WorkerMinimalConfigEnv = "BEAM_WORKER_MINIMAL_CONFIG" WorkerCacheAdvertiseAddrEnv = "BEAM_WORKER_CACHE_ADVERTISE_ADDR" ContainerGatewayGRPCHostEnv = "BETA9_GATEWAY_HOST" ContainerGatewayGRPCPortEnv = "BETA9_GATEWAY_PORT" ContainerGatewayHTTPHostEnv = "BETA9_GATEWAY_HOST_HTTP" ContainerGatewayHTTPPortEnv = "BETA9_GATEWAY_PORT_HTTP" ContainerHostnameEnv = "CONTAINER_HOSTNAME" )
const ( CacheLocalityEnv = "CACHE_LOCALITY" CacheNodeEnv = "CACHE_NODE_ID" CacheHostNetworkEnv = "CACHE_HOST_NETWORK" CacheServerOnlyEnv = "CACHE_SERVER_ONLY" CacheServerPortEnv = "CACHE_SERVER_PORT" )
const ( PrivatePoolFallbackInternal = "internal" PrivatePoolFallbackWait = "wait" PrivatePoolFallbackFail = "fail" )
const ( TokenTypeClusterAdmin string = "admin" TokenTypeWorkspacePrimary string = "workspace_primary" TokenTypeWorkspace string = "workspace" TokenTypeWorker string = "worker" // TokenTypeWorkerPrivate is a worker token minted for private-pool (agent) // compute running on customer machines. It carries the pool owner's // workspace and marks the worker as untrusted customer compute, so the // gateway scopes its cache namespace and credential access by workspace. TokenTypeWorkerPrivate string = "worker_private" TokenTypeMachine string = "machine" TokenTypeWorkspaceRestricted string = "workspace_restricted" )
const ( DatabaseKindPostgres = "postgres" DatabaseKindPostgresAlias = "postgresql" DatabaseKindRedis = "redis" DatabaseKindValkey = "valkey" PostgresDataMountPath = "/var/lib/postgresql/data" )
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 ( BackendRouteScheme = "route" BackendRouteTransportDirect = "direct" BackendRouteTransportTSNet = "tsnet_restricted" BackendRouteTransportLocalDirect = "local_direct" BackendRouteStateOpening = "opening" BackendRouteStateReady = "ready" BackendRouteStateDegraded = "degraded" BackendRouteStateClosing = "closing" BackendRouteProtocolTCP = "tcp" BackendRouteKindWorker = "worker" BackendRouteKindContainer = "container" DefaultAgentTSNetRouteProxyPort = 29443 DefaultAgentWorkerContainerMode = "worker-container" DefaultAgentLocalDevMode = "local-dev" )
const ( ComputeSourceAutosolver ComputeCapacitySource = "autosolver" ComputeSourceCLIReservation ComputeCapacitySource = "cli_reservation" ComputeSourceAttached ComputeCapacitySource = "attached" ComputeSourceManual ComputeCapacitySource = "manual" ComputeSourceAWS ComputeCapacitySource = "aws" ComputeReservationPending ComputeReservationStatus = "pending" ComputeReservationActive ComputeReservationStatus = "active" ComputeReservationTerminating ComputeReservationStatus = "terminating" ComputeReservationDeleted ComputeReservationStatus = "deleted" ComputeReservationFailed ComputeReservationStatus = "failed" ComputeActionCreate ComputeSolveActionType = "create" ComputeActionKeep ComputeSolveActionType = "keep" ComputeActionDelete ComputeSolveActionType = "delete" )
const ( ManagedComputeDefaultMinimumCreditCents int64 = 2500 ManagedComputeDefaultBillableMarginPct float64 = 0.10 ManagedComputeDefaultBYOCMemoryHourlyMicrosPerGB int64 = 4_500 ManagedComputeDefaultBYOCCPUHourlyMicrosPerVCPU int64 = 9_500 )
const ( CacheAuditStatusMaterialized = "materialized" CacheAuditStatusMiss = "miss" CacheAuditStatusOriginFailure = "origin_failure" CacheAuditStatusReplicaFailure = "replica_failure" CacheAuditStatusSkipped = "skipped" )
Platform cache audit statuses for EventPlatformCacheSchema.Status.
const ( EventComputeActionPoolReserved = "pool.reserved" EventComputeActionPoolCreated = "pool.created" EventComputeActionPoolDeleted = "pool.deleted" EventComputeActionPoolExtended = "pool.extended" EventComputeActionPoolCreditExhausted = "pool.credit_exhausted" EventComputeActionPoolBillingDegraded = "pool.billing_degraded" EventComputeActionReservationUsageRecorded = "reservation.usage_recorded" EventComputeActionReservationRenewed = "reservation.renewed" EventComputeActionReservationTerminating = "reservation.terminating" EventComputeActionReservationStatusUpdated = "reservation.status_updated" EventComputeActionJoinTokenCreated = "join_token.created" EventComputeActionJoinTokenRevoked = "join_token.revoked" EventComputeActionMachineJoined = "machine.joined" EventComputeActionMachineHeartbeat = "machine.heartbeat" EventComputeActionMachineDisconnected = "machine.disconnected" EventComputeActionMachineReleased = "machine.released" EventComputeActionWorkerSlotCreated = "worker_slot.created" EventComputeActionWorkerSlotPruned = "worker_slot.pruned" EventComputeActionWorkerDisabled = "worker.disabled" EventComputeActionTransportCredentialVended = "transport.credential_vended" EventComputeActionTransportPrewarm = "transport.prewarm" EventComputeActionTransportSnapshot = "transport.snapshot" EventComputeActionRouteStatusUpdated = "route.status_updated" )
const ( EventAttrBytes = "bytes" EventAttrCause = "cause" EventAttrContainerID = "container_id" EventAttrContainerStatus = "container_status" EventAttrCurrentContainers = "current_containers" EventAttrDesiredContainers = "desired_containers" EventAttrAttempts = "attempts" EventAttrExitCode = "exit_code" EventAttrError = "error" EventAttrFailureClass = "failure_class" EventAttrFailureClasses = "failure_classes" EventAttrFailureCount = "failure_count" EventAttrFirstTCPReadyMs = "first_tcp_ready_ms" EventAttrForce = "force" EventAttrGracePeriodSeconds = "grace_period_seconds" EventAttrLifecycle = "lifecycle" EventAttrLastError = "last_error" EventAttrLockKey = "lock_key" EventAttrMode = "mode" EventAttrPreviousStatus = "previous_status" EventAttrMappedExitCode = "mapped_exit_code" EventAttrOOMKilled = "oom_killed" EventAttrRawExitCode = "raw_exit_code" EventAttrReason = "reason" EventAttrRuntime = "runtime" EventAttrRuntimePID = "runtime_pid" EventAttrExitReason = "exit_reason" EventAttrSource = "source" EventAttrStatus = "status" EventAttrTaskID = "task_id" EventAttrTimeoutSeconds = "timeout_seconds" EventAttrTotalRequests = "total_requests" EventAttrDurationUs = "duration_us" EventAttrDurationNs = "duration_ns" )
const ( EventCauseClientContextDone = "client_context_done" EventLogStreamStdout = "stdout" EventLogStreamStderr = "stderr" EventStreamSourceContainer = "container_stream" EventStreamSourceClient = "client_stream" RunnerEventTypeLifecycle = "lifecycle" RunnerEventTypeEvent = "event" )
const ( FunctionLifecycleCheckpointContainerRequestReady = "container_request_ready" FunctionLifecycleCheckpointStartTask = "start_task" FunctionLifecycleCheckpointGetArgs = "get_args" FunctionLifecycleCheckpointSetResult = "set_result" )
const ( GatewayObjectTypeDeployment = "BETA9_DEPLOYMENT" GatewayObjectTypeTask = "BETA9_TASK" GatewayObjectTypeStub = "BETA9_STUB" GatewayObjectTypeContainer = "BETA9_CONTAINER" GatewayObjectTypeWorkspace = "BETA9_WORKSPACE" GatewayObjectTypeApp = "BETA9_APP" GatewayObjectTypeMachine = "BETA9_MACHINE" )
const ( DefaultGatewayServiceName string = "gateway" DefaultExtractedObjectPath string = "/data/unpacked" DefaultVolumesPath string = "/data/volumes" DefaultDurableDisksPath string = "/var/lib/beta9/durable-disks" 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" MachineStatusAvailable MachineStatus = "available" MachineStatusDisabled MachineStatus = "disabled" MachinePendingExpirationS int = 3600 // 1 hour MachineKeepaliveExpirationS int = 300 // 5 minutes MachineEmptyConsolidationPeriodM time.Duration = 10 * time.Minute )
const ( DefaultServeContainerTimeout = time.Minute * 10 DefaultCPUWorkerPoolName = "default" ContainerRuntimeTokenEnv = "BETA9_TOKEN" )
const ( WorkerStatusAvailable WorkerStatus = "available" WorkerStatusPending WorkerStatus = "pending" WorkerStatusDisabled WorkerStatus = "disabled" WorkerStateTtlS int = 60 )
const ( DefaultRuncStartConcurrency int = 32 DefaultGvisorStartConcurrency int = 32 RuncStartConcurrencyPerCPU int64 = 2 GvisorStartConcurrencyPerCPU int64 = 4 )
const ( StubStateDegraded = "degraded" StubStateWarning = "warning" StubStateHealthy = "healthy" )
const ( ContainerDurationEmissionInterval time.Duration = 5 * time.Second ContainerResourceUsageEmissionInterval time.Duration = 3 * time.Second )
const ( StorageModeJuiceFS = "juicefs" StorageModeMountPoint = "mountpoint" StorageModeGeese = "geese" StorageModeAlluxio = "alluxio" StorageModeLocal = "local" StorageModeDurableDisk = "durable_disk" )
const ( DiskSnapshotStatusPending DiskSnapshotStatus = "pending" DiskSnapshotStatusAvailable DiskSnapshotStatus = "available" DiskSnapshotStatusFailed DiskSnapshotStatus = "failed" DiskSnapshotFormatDirV1 = "dir.v1" DiskSnapshotFormatPostgresWalV1 = "postgres.wal.v1" DiskSnapshotFormatRedisAOFV1 = "redis.aof.v1" )
const ( WorkerLifecycleStatsKey string = "beta9.worker.usage.spawner.lifecycle" WorkerDurationStatsKey string = "beta9.worker.usage.spawner.duration" WorkerEventHeartbeatID string = "__heartbeat__" 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 (
DurableDiskDriverSnapshot = "snapshot"
)
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" EventContainerEvent = "container.event" EventContainerLog = "container.log" EventPlatformLog = "platform.log" 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" EventLLMRoute = "llm.route" EventComputePool = "compute.pool" EventComputeJoinToken = "compute.join_token" EventComputeMachine = "compute.machine" EventComputeTransport = "compute.transport" EventComputeRoute = "compute.route" EventStubCacheRequiredContent = "stub.cache.required_content" EventPlatformCache = "platform.cache" )
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" UsageMetricsManagedComputeReservationSeconds = "managed_compute_reservation_seconds" UsageMetricsManagedComputeReservationCost = "managed_compute_reservation_cost_cents" UsageMetricsNodeUsage = "node_usage" )
var ContainerEventDefinitions = map[ContainerEventID]ContainerEventDefinition{ ContainerEventSchedulerStopRequested: {ID: ContainerEventSchedulerStopRequested, Domain: EventDomainScheduler, Label: "Scheduler stop requested"}, ContainerEventWorkerStopEventReceived: {ID: ContainerEventWorkerStopEventReceived, Domain: EventDomainWorker, Label: "Worker stop event received"}, ContainerEventWorkerOrphanStateMissing: {ID: ContainerEventWorkerOrphanStateMissing, Domain: EventDomainWorker, Label: "Worker orphan state missing"}, ContainerEventWorkerPendingReconciled: {ID: ContainerEventWorkerPendingReconciled, Domain: EventDomainWorker, Label: "Pending reconciled to running"}, ContainerEventWorkerStoppingGraceKill: {ID: ContainerEventWorkerStoppingGraceKill, Domain: EventDomainWorker, Label: "Stopping grace kill"}, ContainerEventRuntimeExited: {ID: ContainerEventRuntimeExited, Domain: EventDomainRuntime, Label: "Runtime exited"}, ContainerEventRuntimeOOMKilled: {ID: ContainerEventRuntimeOOMKilled, Domain: EventDomainRuntime, Label: "Runtime OOM killed"}, ContainerEventGatewayAttachDisconnected: {ID: ContainerEventGatewayAttachDisconnected, Domain: EventDomainGateway, Label: "Attach disconnected"}, ContainerEventGatewayServeLockDeleted: {ID: ContainerEventGatewayServeLockDeleted, Domain: EventDomainGateway, Label: "Serve lock deleted"}, ContainerEventGatewayServeLockPreserved: {ID: ContainerEventGatewayServeLockPreserved, Domain: EventDomainGateway, Label: "Serve lock preserved"}, ContainerEventAutoscalerScaleDecision: {ID: ContainerEventAutoscalerScaleDecision, Domain: EventDomainAutoscaler, Label: "Autoscaler scale decision"}, ContainerEventTaskCancelRequested: {ID: ContainerEventTaskCancelRequested, Domain: EventDomainTask, Label: "Task cancel requested"}, ContainerEventTaskCancelApplied: {ID: ContainerEventTaskCancelApplied, Domain: EventDomainTask, Label: "Task cancel applied"}, ContainerEventLogsFirstByte: {ID: ContainerEventLogsFirstByte, Domain: EventDomainLogs, Label: "First log byte"}, ContainerEventLogsLastByte: {ID: ContainerEventLogsLastByte, Domain: EventDomainLogs, Label: "Last log byte"}, ContainerEventLogsFlushCompleted: {ID: ContainerEventLogsFlushCompleted, Domain: EventDomainLogs, Label: "Log flush completed"}, ContainerEventLogsDropped: {ID: ContainerEventLogsDropped, Domain: EventDomainLogs, Label: "Log dropped"}, ContainerEventRunnerStartTask: {ID: ContainerEventRunnerStartTask, Domain: EventDomainRunner, Label: "Runner start task"}, ContainerEventRunnerGetArgs: {ID: ContainerEventRunnerGetArgs, Domain: EventDomainRunner, Label: "Runner get args"}, ContainerEventRunnerProcessStarted: {ID: ContainerEventRunnerProcessStarted, Domain: EventDomainRunner, Label: "Runner process started"}, ContainerEventRunnerModuleLoaded: {ID: ContainerEventRunnerModuleLoaded, Domain: EventDomainRunner, Label: "Runner module loaded"}, ContainerEventRunnerMainEntered: {ID: ContainerEventRunnerMainEntered, Domain: EventDomainRunner, Label: "Runner main entered"}, ContainerEventResultSetResult: {ID: ContainerEventResultSetResult, Domain: EventDomainResult, Label: "Result set"}, ContainerEventResultEndTask: {ID: ContainerEventResultEndTask, Domain: EventDomainResult, Label: "End task"}, ContainerEventResultLoadedByGateway: {ID: ContainerEventResultLoadedByGateway, Domain: EventDomainResult, Label: "Result loaded by gateway"}, ContainerEventResultSentToClient: {ID: ContainerEventResultSentToClient, Domain: EventDomainResult, Label: "Result sent to client"}, }
var ContainerLifecycleDefinitions = map[ContainerLifecycleID]ContainerLifecycleDefinition{ ContainerLifecycleStartup: {ID: ContainerLifecycleStartup, Domain: EventDomainRuntime, Label: "Container startup", Required: true}, ContainerLifecycleSchedulerQueuePush: {ID: ContainerLifecycleSchedulerQueuePush, Domain: EventDomainScheduler, ParentID: ContainerLifecycleStartup, Label: "Queue request"}, ContainerLifecycleSchedulerBacklogWait: {ID: ContainerLifecycleSchedulerBacklogWait, Domain: EventDomainScheduler, ParentID: ContainerLifecycleStartup, Label: "Scheduler backlog wait"}, ContainerLifecycleSchedulerWorkerList: {ID: ContainerLifecycleSchedulerWorkerList, Domain: EventDomainScheduler, ParentID: ContainerLifecycleSchedulerBacklogWait, Label: "Load workers"}, ContainerLifecycleSchedulerBatchPlan: {ID: ContainerLifecycleSchedulerBatchPlan, Domain: EventDomainScheduler, ParentID: ContainerLifecycleSchedulerBacklogWait, Label: "Plan batch"}, ContainerLifecycleSchedulerWorkerSelection: {ID: ContainerLifecycleSchedulerWorkerSelection, Domain: EventDomainScheduler, ParentID: ContainerLifecycleStartup, Label: "Worker selection"}, ContainerLifecycleSchedulerReserveCapacity: {ID: ContainerLifecycleSchedulerReserveCapacity, Domain: EventDomainScheduler, ParentID: ContainerLifecycleSchedulerBacklogWait, Label: "Reserve capacity"}, ContainerLifecycleSchedulerReservation: {ID: ContainerLifecycleSchedulerReservation, Domain: EventDomainScheduler, ParentID: ContainerLifecycleStartup, Label: "Capacity reservation"}, ContainerLifecycleSchedulerProvisionWorker: {ID: ContainerLifecycleSchedulerProvisionWorker, Domain: EventDomainScheduler, ParentID: ContainerLifecycleStartup, Label: "Worker provisioning"}, ContainerLifecycleSchedulerImageCredentials: {ID: ContainerLifecycleSchedulerImageCredentials, Domain: EventDomainScheduler, ParentID: ContainerLifecycleSchedulerBacklogWait, Label: "Attach image credentials"}, ContainerLifecycleSchedulerBuildCredentials: {ID: ContainerLifecycleSchedulerBuildCredentials, Domain: EventDomainScheduler, ParentID: ContainerLifecycleSchedulerBacklogWait, Label: "Attach build registry credentials"}, ContainerLifecycleSchedulerWorkerQueuePush: {ID: ContainerLifecycleSchedulerWorkerQueuePush, Domain: EventDomainScheduler, ParentID: ContainerLifecycleSchedulerBacklogWait, Label: "Push to worker queue"}, ContainerLifecycleWorkerQueueReceive: {ID: ContainerLifecycleWorkerQueueReceive, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Worker queue receive"}, ContainerLifecycleImageLoad: {ID: ContainerLifecycleImageLoad, Domain: EventDomainImage, ParentID: ContainerLifecycleStartup, Label: "Image load", Required: true}, ContainerLifecycleImageEmbeddedCacheMetadata: {ID: ContainerLifecycleImageEmbeddedCacheMetadata, Domain: EventDomainImage, ParentID: ContainerLifecycleImageLoad, Label: "Embedded image cache metadata copy"}, ContainerLifecycleImageEmbeddedCacheStore: {ID: ContainerLifecycleImageEmbeddedCacheStore, Domain: EventDomainImage, ParentID: ContainerLifecycleImageLoad, Label: "Embedded image cache store"}, ContainerLifecycleImageEmbeddedCacheWait: {ID: ContainerLifecycleImageEmbeddedCacheWait, Domain: EventDomainImage, ParentID: ContainerLifecycleImageLoad, Label: "Wait for embedded image cache"}, ContainerLifecycleImageEmbeddedCacheRestore: {ID: ContainerLifecycleImageEmbeddedCacheRestore, Domain: EventDomainImage, ParentID: ContainerLifecycleImageLoad, Label: "Embedded image cache restore"}, ContainerLifecycleSetWorkerAddress: {ID: ContainerLifecycleSetWorkerAddress, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Set worker address"}, ContainerLifecyclePortAllocation: {ID: ContainerLifecyclePortAllocation, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Port allocation"}, ContainerLifecycleReadBundleConfig: {ID: ContainerLifecycleReadBundleConfig, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Read bundle config"}, ContainerLifecycleSetupMounts: {ID: ContainerLifecycleSetupMounts, Domain: EventDomainMount, ParentID: ContainerLifecycleStartup, Label: "Setup mounts"}, ContainerLifecycleSpecFromRequest: {ID: ContainerLifecycleSpecFromRequest, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Spec from request"}, ContainerLifecycleSetContainerAddr: {ID: ContainerLifecycleSetContainerAddr, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Set container address"}, ContainerLifecycleSetAddressMap: {ID: ContainerLifecycleSetAddressMap, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Set address map"}, ContainerLifecycleOverlaySetup: {ID: ContainerLifecycleOverlaySetup, Domain: EventDomainMount, ParentID: ContainerLifecycleStartup, Label: "Overlay setup"}, ContainerLifecycleNetworkSetup: {ID: ContainerLifecycleNetworkSetup, Domain: EventDomainNetwork, ParentID: ContainerLifecycleStartup, Label: "Network setup"}, ContainerLifecycleNetworkCreateVeth: {ID: ContainerLifecycleNetworkCreateVeth, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkSetup, Label: "Create veth pair"}, ContainerLifecycleNetworkSetupBridge: {ID: ContainerLifecycleNetworkSetupBridge, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkSetup, Label: "Setup bridge"}, ContainerLifecycleNetworkCreateNamespace: {ID: ContainerLifecycleNetworkCreateNamespace, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkSetup, Label: "Create namespace"}, ContainerLifecycleNetworkConfigureNamespace: {ID: ContainerLifecycleNetworkConfigureNamespace, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkSetup, Label: "Configure namespace"}, ContainerLifecycleNetworkIPLock: {ID: ContainerLifecycleNetworkIPLock, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkConfigureNamespace, Label: "Acquire IP lock"}, ContainerLifecycleNetworkIPLoad: {ID: ContainerLifecycleNetworkIPLoad, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkConfigureNamespace, Label: "Load allocated IPs"}, ContainerLifecycleNetworkIPAssign: {ID: ContainerLifecycleNetworkIPAssign, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkConfigureNamespace, Label: "Assign container IP"}, ContainerLifecycleNetworkSetContainerIP: {ID: ContainerLifecycleNetworkSetContainerIP, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkConfigureNamespace, Label: "Persist container IP"}, ContainerLifecycleNetworkRestrictions: {ID: ContainerLifecycleNetworkRestrictions, Domain: EventDomainNetwork, ParentID: ContainerLifecycleNetworkSetup, Label: "Network restrictions"}, ContainerLifecycleGPUAssignment: {ID: ContainerLifecycleGPUAssignment, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "GPU assignment"}, ContainerLifecycleNetworkExpose: {ID: ContainerLifecycleNetworkExpose, Domain: EventDomainNetwork, ParentID: ContainerLifecycleStartup, Label: "Expose ports"}, ContainerLifecycleRuntimePrepare: {ID: ContainerLifecycleRuntimePrepare, Domain: EventDomainRuntime, ParentID: ContainerLifecycleStartup, Label: "Runtime prepare"}, ContainerLifecycleConfigWrite: {ID: ContainerLifecycleConfigWrite, Domain: EventDomainRuntime, ParentID: ContainerLifecycleStartup, Label: "Config write"}, ContainerLifecycleStartQueueWait: {ID: ContainerLifecycleStartQueueWait, Domain: EventDomainWorker, ParentID: ContainerLifecycleStartup, Label: "Worker start queue wait"}, ContainerLifecycleRuntimeStartToPID: {ID: ContainerLifecycleRuntimeStartToPID, Domain: EventDomainRuntime, ParentID: ContainerLifecycleStartup, Label: "Runtime start to PID", Required: true}, ContainerLifecycleSandboxApplyCPUQuota: {ID: ContainerLifecycleSandboxApplyCPUQuota, Domain: EventDomainRuntime, ParentID: ContainerLifecycleStartup, Label: "Apply sandbox CPU quota"}, ContainerLifecycleSandboxProcessManagerTCP: {ID: ContainerLifecycleSandboxProcessManagerTCP, Domain: EventDomainNetwork, ParentID: ContainerLifecycleSandboxProcessManagerReady, Label: "Sandbox process manager TCP ready"}, ContainerLifecycleSandboxProcessManagerReady: {ID: ContainerLifecycleSandboxProcessManagerReady, Domain: EventDomainRuntime, ParentID: ContainerLifecycleStartup, Label: "Sandbox process manager ready"}, ContainerLifecycleServeReady: {ID: ContainerLifecycleServeReady, Domain: EventDomainServe, ParentID: ContainerLifecycleStartup, Label: "Serve ready"}, ContainerLifecycleResultDelivery: {ID: ContainerLifecycleResultDelivery, Domain: EventDomainResult, ParentID: ContainerLifecycleStartup, Label: "Result delivery"}, ContainerLifecycleContainerRequestToStartTask: {ID: ContainerLifecycleContainerRequestToStartTask, Domain: EventDomainTask, Label: "Container request to runner start"}, ContainerLifecycleContainerRunningToStartTask: {ID: ContainerLifecycleContainerRunningToStartTask, Domain: EventDomainRunner, Label: "Container running to runner start"}, ContainerLifecycleRunnerStartToGetArgs: {ID: ContainerLifecycleRunnerStartToGetArgs, Domain: EventDomainRunner, Label: "Runner start to get args"}, ContainerLifecycleRunnerGetArgsToSetResult: {ID: ContainerLifecycleRunnerGetArgsToSetResult, Domain: EventDomainRunner, Label: "Get args to set result"}, ContainerLifecycleRunnerStartToSetResult: {ID: ContainerLifecycleRunnerStartToSetResult, Domain: EventDomainRunner, Label: "Runner start to set result"}, ContainerLifecycleResultSetToEndTask: {ID: ContainerLifecycleResultSetToEndTask, Domain: EventDomainResult, Label: "Set result to end task"}, ContainerLifecycleRunnerStartToEndTask: {ID: ContainerLifecycleRunnerStartToEndTask, Domain: EventDomainRunner, Label: "Runner start to end task"}, ContainerLifecycleRunnerGatewayChannelOpen: {ID: ContainerLifecycleRunnerGatewayChannelOpen, Domain: EventDomainRunner, Label: "Open gateway channel"}, ContainerLifecycleRunnerStartTaskRPC: {ID: ContainerLifecycleRunnerStartTaskRPC, Domain: EventDomainRunner, Label: "StartTask RPC"}, ContainerLifecycleRunnerGetArgsRPC: {ID: ContainerLifecycleRunnerGetArgsRPC, Domain: EventDomainRunner, Label: "GetArgs RPC"}, ContainerLifecycleRunnerUserCodeImport: {ID: ContainerLifecycleRunnerUserCodeImport, Domain: EventDomainRunner, Label: "Import user code"}, ContainerLifecycleRunnerHandlerExecution: {ID: ContainerLifecycleRunnerHandlerExecution, Domain: EventDomainRunner, Label: "Run handler"}, ContainerLifecycleRunnerSetResultRPC: {ID: ContainerLifecycleRunnerSetResultRPC, Domain: EventDomainRunner, Label: "SetResult RPC"}, ContainerLifecycleRunnerEndTaskRPC: {ID: ContainerLifecycleRunnerEndTaskRPC, Domain: EventDomainRunner, Label: "EndTask RPC"}, ContainerLifecycleClipRead: {ID: ContainerLifecycleClipRead, Domain: EventDomainClip, Label: "CLIP lazy read"}, ContainerLifecycleClipOCIRead: {ID: ContainerLifecycleClipOCIRead, Domain: EventDomainClip, Label: "CLIP OCI lazy read"}, ContainerLifecycleClipArchiveRead: {ID: ContainerLifecycleClipArchiveRead, Domain: EventDomainClip, ParentID: ContainerLifecycleClipRead, Label: "CLIP archive read"}, ContainerLifecycleClipDiskCacheRead: {ID: ContainerLifecycleClipDiskCacheRead, Domain: EventDomainClip, ParentID: ContainerLifecycleClipRead, Label: "CLIP disk cache read"}, ContainerLifecycleClipContentCacheRead: {ID: ContainerLifecycleClipContentCacheRead, Domain: EventDomainClip, ParentID: ContainerLifecycleClipRead, Label: "CLIP content cache read"}, ContainerLifecycleClipCheckpointRead: {ID: ContainerLifecycleClipCheckpointRead, Domain: EventDomainClip, ParentID: ContainerLifecycleClipRead, Label: "CLIP checkpoint read"}, ContainerLifecycleClipLayerDecompress: {ID: ContainerLifecycleClipLayerDecompress, Domain: EventDomainClip, ParentID: ContainerLifecycleClipRead, Label: "CLIP layer decompress"}, ContainerLifecycleClipLayerDecompressWait: {ID: ContainerLifecycleClipLayerDecompressWait, Domain: EventDomainClip, ParentID: ContainerLifecycleClipRead, Label: "CLIP layer decompress wait"}, }
var DefaultTaskPolicy = TaskPolicy{
MaxRetries: 3,
Timeout: 3600,
}
var EventComputeSchemaVersion = "1.0"
var EventContainerEventSchemaVersion = "1.0"
var EventContainerLifecycleSchemaVersion = "1.0"
var EventContainerLogSchemaVersion = "1.0"
var EventContainerMetricsSchemaVersion = "1.0"
var EventGatewayEndpointSchemaVersion = "1.0"
var EventLLMRouteSchemaVersion = "1.0"
var EventPlatformCacheSchemaVersion = "1.0"
var EventPlatformLogSchemaVersion = "1.0"
var EventStubCacheRequiredContentSchemaVersion = "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 BackendRouteAddress ¶
func BackendRouteID ¶
func ComputeDollarsToMicros ¶
func ComputeMicrosToDollars ¶
func ComputeWholeHours ¶
func EventSummaryKeyForLifecycle ¶
func EventSummaryKeyForLifecycle(id ContainerLifecycleID) string
func GPUTypesToMap ¶
func GpuTypesToSlice ¶
func GpuTypesToStrings ¶
func IsContainerRootCauseCandidate ¶
func IsContainerRootCauseCandidate(id ContainerEventID) bool
func IsWorkerTokenType ¶
IsWorkerTokenType reports whether the token type belongs to a worker process: cluster workers (in-cluster and external pools) or private-pool agent workers.
func KnownGPUType ¶
func MountPointCredentialKey ¶
func NewProviderNotImplemented ¶
func NewProviderNotImplemented() error
func NormalizeBackendRouteTransport ¶
NormalizeBackendRouteTransport canonicalizes transport names (dashes to underscores) and applies the default.
func NormalizeDatabaseKind ¶
func NormalizeEventReason ¶
func NormalizeGPUStrings ¶
func ParseConditionFromQueryFilters ¶
func ParseConditionFromQueryFilters(out interface{}, queryFilters ...QueryFilter)
func SafeDurableDiskName ¶
func StableStorageNodeID ¶
func TempContainerWorkspace ¶
func ValidateComputePoolName ¶
func ValidateCpuAndMemory ¶
func ValidateCpuAndMemory(cpu, memory int64, stubLimits StubLimits) (valid bool, errorMsg string)
ValidateCpuAndMemory enforces limits on CPU and memory (min and max)
func WorkerStartConcurrency ¶
func WorkerStartConcurrency(workerConfig WorkerConfig, worker *Worker) int
func WorkerStartConcurrencyForPool ¶
func WorkerStartConcurrencyForPool(poolConfig WorkerPoolConfig, globalRuntime, runtimeType string, workerCPU int64) int
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 AgentJoinOptions ¶
type AgentJoinOptions struct {
GatewayURL string
JoinToken string
JoinTokenFile string
DevMode bool
ExecutorOverride string
TransportOverride string
WorkerImage string
MaxCPU string
MaxMemory string
MaxGPUs uint
GPUIDs string
NetworkSlots uint
ContainerStartConcurrency uint
Stdout io.Writer
Stderr io.Writer
}
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"`
Events EventsConfig `key:"events" json:"events"`
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"`
ManagedCompute ManagedComputeConfig `key:"managedCompute" json:"managed_compute"`
Abstractions AbstractionConfig `key:"abstractions" json:"abstractions"`
Cache cache.Config `key:"cache" json:"cache"`
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" LLMTokenPressureAutoscaler AutoscalerType = "llm_token_pressure" )
type AvailableHost ¶
type BackendRoute ¶
type BackendRoute struct {
RouteID string `json:"route_id"`
WorkspaceID string `json:"workspace_id"`
PoolName string `json:"pool_name"`
MachineID string `json:"machine_id"`
WorkerID string `json:"worker_id"`
ContainerID string `json:"container_id"`
Kind string `json:"kind"`
Port int32 `json:"port"`
Protocol string `json:"protocol"`
Transport string `json:"transport"`
LocalTarget string `json:"local_target"`
ProxyTarget string `json:"proxy_target"`
State string `json:"state"`
Error string `json:"error"`
UpdatedAt int64 `json:"updated_at"`
}
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"`
Nvidia NvidiaCRIUConfig `key:"nvidia" json:"nvidia"`
}
type CRIUConfigMode ¶
type CRIUConfigMode string
var (
CRIUConfigModeNvidia CRIUConfigMode = "nvidia"
)
type CacheContentKind ¶
type CacheContentKind string
CacheContentKind identifies the source of a required-content report.
const ( CacheContentKindClipV1 CacheContentKind = "clip_v1" CacheContentKindClipV2 CacheContentKind = "clip_v2" CacheContentKindVolume CacheContentKind = "volume" CacheContentKindCheckpoint CacheContentKind = "checkpoint" CacheContentKindDiskSnapshot CacheContentKind = "disk_snapshot" )
type CacheRequiredContentItem ¶
type CacheRequiredContentItem struct {
Hash string `json:"hash"`
RoutingKey string `json:"routing_key"`
SizeBytes int64 `json:"size_bytes,omitempty"`
ExpectedHash string `json:"expected_hash,omitempty"`
ImageID string `json:"image_id,omitempty"`
Source string `json:"source,omitempty"`
SourceBucket string `json:"source_bucket,omitempty"`
Kind CacheContentKind `json:"kind,omitempty"`
CheckpointID string `json:"checkpoint_id,omitempty"`
Accelerator string `json:"accelerator,omitempty"`
}
CacheRequiredContentItem describes a single piece of content a stub needs. Locality-scoped recent-stub indexes decide where it is kept warm. Source is a non-secret descriptor (OCI layer identity or workspace object path) used to resolve an origin fetch; it never carries credentials.
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"`
CacheHash string `db:"cache_hash" json:"cache_hash" serializer:"cache_hash"`
CacheSizeBytes int64 `db:"cache_size_bytes" json:"cache_size_bytes" serializer:"cache_size_bytes"`
OriginKey string `db:"origin_key" json:"origin_key" serializer:"origin_key"`
Locality string `db:"locality" json:"locality" serializer:"locality"`
Accelerator string `db:"accelerator" json:"accelerator" serializer:"accelerator"`
}
@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 ClipVersion ¶
type ClipVersion uint32
const ( ClipVersion1 ClipVersion = 1 ClipVersion2 ClipVersion = 2 )
type ComputeCapacitySource ¶
type ComputeCapacitySource string
func (ComputeCapacitySource) Canonical ¶
func (s ComputeCapacitySource) Canonical() ComputeCapacitySource
func (ComputeCapacitySource) IsAttached ¶
func (s ComputeCapacitySource) IsAttached() bool
type ComputeDemand ¶
type ComputeDemand struct {
PoolName string
Selector string
GPUs []string
Nodes uint32
OfferID string
CPUMillicores int64
MemoryMB int64
TTL time.Duration
MaxSpendMicros int64
Providers []string
Regions []string
MinReliability float64
}
func (ComputeDemand) Pool ¶
func (d ComputeDemand) Pool() ComputePool
type ComputeOffer ¶
type ComputeOffer struct {
ID string
Provider string // aggregator/vendor (e.g. "shadeform"), used for pool filtering
Cloud string // underlying cloud the vendor sources from (e.g. "imwt")
InstanceType string
Region string
GPU string
GPUCount uint32
NodeCount uint32
CPUMillicores int64
MemoryMB int64
StorageMB int64
HourlyCostMicros int64
Reliability float64
Available uint32
DisplayName string
Category string
RegionDisplayName string
Latitude float64
Longitude float64
Labels map[string]string
Raw []byte
}
func (ComputeOffer) CostPerNode ¶
func (o ComputeOffer) CostPerNode() float64
type ComputeOfferRequest ¶
type ComputePool ¶
type ComputePool struct {
Name string
Selector string
GPUs []string
Nodes uint32
OfferID string
TTL time.Duration
MaxSpendMicros int64
Providers []string
Regions []string
MinReliability float64
Source ComputeCapacitySource
}
func (ComputePool) MatchesOffer ¶
func (p ComputePool) MatchesOffer(offer ComputeOffer) bool
func (ComputePool) NormalizedSelector ¶
func (p ComputePool) NormalizedSelector(workspaceID, stubID string) string
func (ComputePool) RequiresReservation ¶
func (p ComputePool) RequiresReservation() bool
func (ComputePool) Validate ¶
func (p ComputePool) Validate() error
type ComputeReservation ¶
type ComputeReservation struct {
ID string
PoolName string
Name string
Selector string
Provider string
Cloud string
Region string
OfferID string
InstanceType string
InstanceID string
MachineID string
GPU string
GPUCount uint32
NodeCount uint32
CPUMillicores int64
MemoryMB int64
StorageMB int64
HourlyCostMicros int64
CommittedMicros int64
Source ComputeCapacitySource
Status ComputeReservationStatus
CreatedAt time.Time
ExpiresAt time.Time
BillingRenewalAt time.Time
BillingCursorAt time.Time
LastStatusCheckAt time.Time
LastBillingCheckAt time.Time
LastReconcileAt time.Time
LastStatusMessage string
LastError string
TerminatingReason string
RegistrationTokenHash string
}
func (ComputeReservation) Managed ¶
func (r ComputeReservation) Managed() bool
func (ComputeReservation) Offer ¶
func (r ComputeReservation) Offer() ComputeOffer
type ComputeReservationStatus ¶
type ComputeReservationStatus string
type ComputeSolveAction ¶
type ComputeSolveAction struct {
Type ComputeSolveActionType
Offer ComputeOffer
Reservation ComputeReservation
Count uint32
CostMicros int64
Reason string
}
type ComputeSolveActionType ¶
type ComputeSolveActionType string
type ComputeSolveInput ¶
type ComputeSolveInput struct {
Demand ComputeDemand
Offers []ComputeOffer
Reservations []ComputeReservation
Now time.Time
MaxOffers int
}
type ComputeSolvePlan ¶
type ComputeVendor ¶
type ComputeVendor interface {
Name() string
ListOffers(ctx context.Context, req ComputeOfferRequest) ([]ComputeOffer, error)
CreateReservation(ctx context.Context, req ComputeReservationRequest) (*ComputeReservation, error)
GetReservation(ctx context.Context, id string) (*ComputeReservation, error)
// ExtendReservation pushes a new expiry to any provider-side auto-delete
// threshold so the provider cannot kill an instance our control plane
// still considers alive. Vendors without provider-side thresholds no-op.
ExtendReservation(ctx context.Context, id string, expiresAt time.Time) error
DeleteReservation(ctx context.Context, id string) error
}
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 ContainerEventDefinition ¶
type ContainerEventDefinition struct {
ID ContainerEventID `json:"id"`
Domain EventDomain `json:"domain"`
Label string `json:"label"`
Required bool `json:"required"`
}
type ContainerEventID ¶
type ContainerEventID string
const ( ContainerEventSchedulerStopRequested ContainerEventID = "scheduler.stop_requested" ContainerEventWorkerStopEventReceived ContainerEventID = "worker.stop_event_received" ContainerEventWorkerOrphanStateMissing ContainerEventID = "worker.orphan_state_missing" ContainerEventWorkerPendingReconciled ContainerEventID = "worker.pending_reconciled_running" ContainerEventWorkerStoppingGraceKill ContainerEventID = "worker.stopping_grace_kill" ContainerEventRuntimeExited ContainerEventID = "runtime.exited" ContainerEventRuntimeOOMKilled ContainerEventID = "runtime.oom_killed" ContainerEventGatewayAttachDisconnected ContainerEventID = "gateway.attach_disconnected" ContainerEventGatewayServeLockDeleted ContainerEventID = "gateway.serve_lock_deleted" ContainerEventGatewayServeLockPreserved ContainerEventID = "gateway.serve_lock_preserved" ContainerEventAutoscalerScaleDecision ContainerEventID = "autoscaler.scale_decision" ContainerEventTaskCancelRequested ContainerEventID = "task.cancel_requested" ContainerEventTaskCancelApplied ContainerEventID = "task.cancel_applied" ContainerEventLogsFirstByte ContainerEventID = "logs.first_byte" ContainerEventLogsLastByte ContainerEventID = "logs.last_byte" ContainerEventLogsFlushCompleted ContainerEventID = "logs.flush_completed" ContainerEventLogsDropped ContainerEventID = "logs.dropped" ContainerEventRunnerStartTask ContainerEventID = "runner.start_task" ContainerEventRunnerGetArgs ContainerEventID = "runner.get_args" ContainerEventRunnerProcessStarted ContainerEventID = "runner.process_started" ContainerEventRunnerModuleLoaded ContainerEventID = "runner.module_loaded" ContainerEventRunnerMainEntered ContainerEventID = "runner.main_entered" ContainerEventResultSetResult ContainerEventID = "result.set_result" ContainerEventResultEndTask ContainerEventID = "result.end_task" ContainerEventResultLoadedByGateway ContainerEventID = "result.loaded_by_gateway" ContainerEventResultSentToClient ContainerEventID = "result.sent_to_client" )
type ContainerEventOptions ¶
type ContainerEventOptions struct {
Source EventSource
Message EventMessage
Reason string
TaskID string
Attrs map[string]string
}
type ContainerEventRecord ¶
type ContainerEventRecord struct {
SeqNum uint64 `json:"seq_num"`
StoredAtNs uint64 `json:"stored_at_ns,omitempty"`
CloudEvent json.RawMessage `json:"cloud_event"`
Type string `json:"type"`
EventID string `json:"event_id,omitempty"`
Domain string `json:"domain,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
StartTime time.Time `json:"start_time,omitempty"`
EndTime time.Time `json:"end_time,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
Success *bool `json:"success,omitempty"`
Reason string `json:"reason,omitempty"`
Source string `json:"source,omitempty"`
Message string `json:"message,omitempty"`
Attrs map[string]string `json:"attrs,omitempty"`
Stream string `json:"stream,omitempty"`
Line string `json:"line,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
ContainerID string `json:"container_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
StubType string `json:"stub_type,omitempty"`
TaskID string `json:"task_id,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
AppID string `json:"app_id,omitempty"`
MachineID string `json:"machine_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
PID int32 `json:"pid,omitempty"`
ProcessArgs []string `json:"process_args,omitempty"`
ProcessCwd string `json:"process_cwd,omitempty"`
ProcessSeq uint64 `json:"process_seq,omitempty"`
}
type ContainerEventsResponse ¶
type ContainerEventsResponse struct {
ContainerID string `json:"container_id"`
WorkspaceID string `json:"workspace_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
Status string `json:"status,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
RootCauseEvent string `json:"root_cause_event,omitempty"`
Summary map[string]int64 `json:"summary"`
Events []ContainerEventRecord `json:"events"`
Missing []string `json:"missing"`
Streams []string `json:"streams,omitempty"`
}
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 ContainerIpAssignment ¶
type ContainerLifecycleDefinition ¶
type ContainerLifecycleDefinition struct {
ID ContainerLifecycleID `json:"id"`
Domain EventDomain `json:"domain"`
ParentID ContainerLifecycleID `json:"parent_id,omitempty"`
Label string `json:"label"`
Required bool `json:"required"`
}
func ContainerLifecycleDefinitionFor ¶
func ContainerLifecycleDefinitionFor(id ContainerLifecycleID) ContainerLifecycleDefinition
type ContainerLifecycleID ¶
type ContainerLifecycleID string
const ( ContainerLifecycleStartup ContainerLifecycleID = "container.startup" ContainerLifecycleSchedulerQueuePush ContainerLifecycleID = "scheduler.queue_push" ContainerLifecycleSchedulerBacklogWait ContainerLifecycleID = "scheduler.backlog_wait" ContainerLifecycleSchedulerWorkerList ContainerLifecycleID = "scheduler.worker_list" ContainerLifecycleSchedulerBatchPlan ContainerLifecycleID = "scheduler.batch_plan" ContainerLifecycleSchedulerWorkerSelection ContainerLifecycleID = "scheduler.worker_selection" ContainerLifecycleSchedulerReserveCapacity ContainerLifecycleID = "scheduler.reserve_capacity" ContainerLifecycleSchedulerReservation ContainerLifecycleID = "scheduler.reservation" ContainerLifecycleSchedulerProvisionWorker ContainerLifecycleID = "scheduler.provision_worker" ContainerLifecycleSchedulerImageCredentials ContainerLifecycleID = "scheduler.attach_image_credentials" ContainerLifecycleSchedulerBuildCredentials ContainerLifecycleID = "scheduler.attach_build_registry_credentials" ContainerLifecycleSchedulerWorkerQueuePush ContainerLifecycleID = "scheduler.worker_queue_push" ContainerLifecycleWorkerQueueReceive ContainerLifecycleID = "worker.queue_receive" ContainerLifecycleImageLoad ContainerLifecycleID = "image.load" ContainerLifecycleImageEmbeddedCacheMetadata ContainerLifecycleID = "image.embedded_cache_metadata_copy" ContainerLifecycleImageEmbeddedCacheStore ContainerLifecycleID = "image.embedded_cache_store" ContainerLifecycleImageEmbeddedCacheWait ContainerLifecycleID = "image.embedded_cache_wait" ContainerLifecycleImageEmbeddedCacheRestore ContainerLifecycleID = "image.embedded_cache_restore" ContainerLifecycleSetWorkerAddress ContainerLifecycleID = "worker.set_worker_address" ContainerLifecyclePortAllocation ContainerLifecycleID = "worker.port_allocation" ContainerLifecycleReadBundleConfig ContainerLifecycleID = "worker.read_bundle_config" ContainerLifecycleSetupMounts ContainerLifecycleID = "mount.setup" ContainerLifecycleSpecFromRequest ContainerLifecycleID = "worker.spec_from_request" ContainerLifecycleSetContainerAddr ContainerLifecycleID = "worker.set_container_address" ContainerLifecycleSetAddressMap ContainerLifecycleID = "worker.set_address_map" ContainerLifecycleOverlaySetup ContainerLifecycleID = "mount.overlay_setup" ContainerLifecycleNetworkSetup ContainerLifecycleID = "network.setup" ContainerLifecycleNetworkCreateVeth ContainerLifecycleID = "network.create_veth" ContainerLifecycleNetworkSetupBridge ContainerLifecycleID = "network.setup_bridge" ContainerLifecycleNetworkCreateNamespace ContainerLifecycleID = "network.create_namespace" ContainerLifecycleNetworkConfigureNamespace ContainerLifecycleID = "network.configure_namespace" ContainerLifecycleNetworkIPLock ContainerLifecycleID = "network.ip_lock" ContainerLifecycleNetworkIPLoad ContainerLifecycleID = "network.ip_load" ContainerLifecycleNetworkIPAssign ContainerLifecycleID = "network.ip_assign" ContainerLifecycleNetworkSetContainerIP ContainerLifecycleID = "network.set_container_ip" ContainerLifecycleNetworkRestrictions ContainerLifecycleID = "network.restrictions" ContainerLifecycleGPUAssignment ContainerLifecycleID = "worker.gpu_assignment" ContainerLifecycleNetworkExpose ContainerLifecycleID = "network.expose_ports" ContainerLifecycleRuntimePrepare ContainerLifecycleID = "runtime.prepare" ContainerLifecycleConfigWrite ContainerLifecycleID = "runtime.config_write" ContainerLifecycleStartQueueWait ContainerLifecycleID = "worker.start_queue_wait" ContainerLifecycleRuntimeStartToPID ContainerLifecycleID = "runtime.start_to_pid" ContainerLifecycleSandboxApplyCPUQuota ContainerLifecycleID = "sandbox.apply_cpu_quota" ContainerLifecycleSandboxProcessManagerTCP ContainerLifecycleID = "sandbox.process_manager_tcp_ready" ContainerLifecycleSandboxProcessManagerReady ContainerLifecycleID = "sandbox.process_manager_ready" ContainerLifecycleServeReady ContainerLifecycleID = "serve.ready" ContainerLifecycleResultDelivery ContainerLifecycleID = "result.delivery" ContainerLifecycleContainerRequestToStartTask ContainerLifecycleID = "function.container_request_to_start_task" ContainerLifecycleContainerRunningToStartTask ContainerLifecycleID = "container.running_to_start_task" ContainerLifecycleRunnerStartToGetArgs ContainerLifecycleID = "runner.start_task_to_get_args" ContainerLifecycleRunnerGetArgsToSetResult ContainerLifecycleID = "runner.get_args_to_set_result" ContainerLifecycleRunnerStartToSetResult ContainerLifecycleID = "runner.start_task_to_set_result" ContainerLifecycleResultSetToEndTask ContainerLifecycleID = "result.set_result_to_end_task" ContainerLifecycleRunnerStartToEndTask ContainerLifecycleID = "runner.start_task_to_end_task" ContainerLifecycleRunnerGatewayChannelOpen ContainerLifecycleID = "runner.gateway_channel_open" ContainerLifecycleRunnerStartTaskRPC ContainerLifecycleID = "runner.start_task_rpc" ContainerLifecycleRunnerGetArgsRPC ContainerLifecycleID = "runner.get_args_rpc" ContainerLifecycleRunnerUserCodeImport ContainerLifecycleID = "runner.user_code_import" ContainerLifecycleRunnerHandlerExecution ContainerLifecycleID = "runner.handler_execution" ContainerLifecycleRunnerSetResultRPC ContainerLifecycleID = "runner.set_result_rpc" ContainerLifecycleRunnerEndTaskRPC ContainerLifecycleID = "runner.end_task_rpc" ContainerLifecycleClipRead ContainerLifecycleID = "clip.read" ContainerLifecycleClipOCIRead ContainerLifecycleID = "clip.oci_read" ContainerLifecycleClipArchiveRead ContainerLifecycleID = "clip.archive_read" ContainerLifecycleClipDiskCacheRead ContainerLifecycleID = "clip.disk_cache_read" ContainerLifecycleClipContentCacheRead ContainerLifecycleID = "clip.content_cache_read" ContainerLifecycleClipCheckpointRead ContainerLifecycleID = "clip.checkpoint_read" ContainerLifecycleClipLayerDecompress ContainerLifecycleID = "clip.layer_decompress" ContainerLifecycleClipLayerDecompressWait ContainerLifecycleID = "clip.layer_decompress_wait" )
type ContainerLifecycleOptions ¶
type ContainerLifecycleOptions struct {
Source EventSource
TaskID string
Attrs map[string]string
}
type ContainerNetworkPolicy ¶
type ContainerNetworkPolicy string
const ( ContainerNetworkPolicyOpen ContainerNetworkPolicy = "open" ContainerNetworkPolicyBlock ContainerNetworkPolicy = "block" ContainerNetworkPolicyAllowList ContainerNetworkPolicy = "allowlist" )
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
RuntimeSecretNames []string `json:"runtime_secret_names,omitempty"`
RuntimeTokenRequired bool `json:"runtime_token_required,omitempty"`
}
@go2proto
func NewContainerRequestFromProto ¶
func NewContainerRequestFromProto(in *pb.ContainerRequest) *ContainerRequest
func (*ContainerRequest) Clone ¶
func (c *ContainerRequest) Clone() *ContainerRequest
func (*ContainerRequest) HasDurableDiskMount ¶
func (c *ContainerRequest) HasDurableDiskMount() bool
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) NetworkPolicy ¶
func (c *ContainerRequest) NetworkPolicy() ContainerNetworkPolicy
func (*ContainerRequest) NetworkRestricted ¶
func (c *ContainerRequest) NetworkRestricted() bool
func (*ContainerRequest) PrivateWorkerRequest ¶
func (c *ContainerRequest) PrivateWorkerRequest() *ContainerRequest
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 ContainerRunnerEvent ¶
type ContainerRunnerEvent struct {
Type string `json:"type"`
ID string `json:"id"`
Timestamp string `json:"timestamp"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
DurationMs int64 `json:"duration_ms"`
Success *bool `json:"success"`
ContainerID string `json:"container_id"`
StubID string `json:"stub_id"`
StubType string `json:"stub_type"`
TaskID string `json:"task_id"`
Message string `json:"message"`
Attrs map[string]string `json:"attrs"`
}
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"`
S2 S2Config `key:"s2" json:"s2"`
}
type DatabaseServingConfig ¶
type DatabaseServingConfig struct {
Kind string `json:"kind,omitempty" serializer:"kind,omitempty"`
Port uint32 `json:"port,omitempty" serializer:"port,omitempty"`
ReadinessProbe string `json:"readiness_probe,omitempty" serializer:"readiness_probe,omitempty"`
ConnectionEnvName string `json:"connection_env_name,omitempty" serializer:"connection_env_name,omitempty"`
ConnectionURL string `json:"connection_url,omitempty" serializer:"connection_url,omitempty"`
CredentialSecretNames []string `json:"credential_secret_names,omitempty" serializer:"credential_secret_names,omitempty"`
DurabilityMode string `json:"durability_mode,omitempty" serializer:"durability_mode,omitempty"`
UsernameSecretName string `json:"username_secret_name,omitempty" serializer:"username_secret_name,omitempty"`
PasswordSecretName string `json:"password_secret_name,omitempty" serializer:"password_secret_name,omitempty"`
DatabaseSecretName string `json:"database_secret_name,omitempty" serializer:"database_secret_name,omitempty"`
ConnectionURLSecretName string `json:"connection_url_secret_name,omitempty" serializer:"connection_url_secret_name,omitempty"`
}
func (*DatabaseServingConfig) ClearSecretNames ¶
func (d *DatabaseServingConfig) ClearSecretNames()
func (*DatabaseServingConfig) IsPostgres ¶
func (c *DatabaseServingConfig) IsPostgres() bool
func (*DatabaseServingConfig) IsRedisCompatible ¶
func (c *DatabaseServingConfig) IsRedisCompatible() bool
func (*DatabaseServingConfig) NormalizedKind ¶
func (c *DatabaseServingConfig) NormalizedKind() string
type DeletedWorkerReason ¶
type DeletedWorkerReason string
const ( DeletedWorkerReasonPodWithoutState DeletedWorkerReason = "pod_without_state" DeletedWorkerReasonPodExceededPendingAgeLimit DeletedWorkerReason = "pod_exceeded_pending_age_limit" DeletedWorkerReasonPodCompleted DeletedWorkerReason = "pod_completed" DeletedWorkerReasonWorkerStateWithoutJob DeletedWorkerReason = "worker_state_without_job" )
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"`
URL string `db:"-" json:"url,omitempty" serializer:"url,omitempty"`
InvokeURL string `db:"-" json:"invoke_url,omitempty" serializer:"invoke_url,omitempty"`
}
type Disk ¶
type Disk struct {
Id uint `db:"id" json:"id"`
ExternalId string `db:"external_id" json:"external_id"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id"`
Name string `db:"name" json:"name"`
Size string `db:"size" json:"size"`
Filesystem string `db:"filesystem" json:"filesystem"`
Driver string `db:"driver" json:"driver"`
MountPath string `db:"mount_path" json:"mount_path"`
CreatedAt Time `db:"created_at" json:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at"`
DeletedAt NullTime `db:"deleted_at" json:"deleted_at,omitempty"`
}
Disk is a first-class durable disk resource. Durable disks provide node-local durable state that is snapshotted to object storage. A disk is referenced by name when attached to a stub/service.
type DiskSnapshot ¶
type DiskSnapshot struct {
Id uint `db:"id" json:"id,omitempty"`
ExternalId string `db:"external_id" json:"external_id"`
WorkspaceId uint `db:"workspace_id" json:"workspace_id"`
StubId uint `db:"stub_id" json:"stub_id,omitempty"`
DiskName string `db:"disk_name" json:"disk_name"`
Format string `db:"format" json:"format"`
Status DiskSnapshotStatus `db:"status" json:"status"`
Reason string `db:"reason" json:"reason,omitempty"`
ParentSnapshotId string `db:"parent_snapshot_id" json:"parent_snapshot_id,omitempty"`
Generation int64 `db:"generation" json:"generation"`
SizeBytes int64 `db:"size_bytes" json:"size_bytes"`
Filesystem string `db:"filesystem" json:"filesystem"`
Driver string `db:"driver" json:"driver"`
ManifestKey string `db:"manifest_key" json:"manifest_key"`
ManifestDigest string `db:"manifest_digest" json:"manifest_digest"`
ManifestSizeBytes int64 `db:"manifest_size_bytes" json:"manifest_size_bytes"`
ChunkCount int64 `db:"chunk_count" json:"chunk_count"`
LogicalSizeBytes int64 `db:"logical_size_bytes" json:"logical_size_bytes"`
StoredSizeBytes int64 `db:"stored_size_bytes" json:"stored_size_bytes"`
BucketName string `db:"bucket_name" json:"bucket_name"`
ObjectPrefix string `db:"object_prefix" json:"object_prefix"`
SourcePool string `db:"source_pool" json:"source_pool,omitempty"`
SourceWorkerId string `db:"source_worker_id" json:"source_worker_id,omitempty"`
SourceStorageNodeId string `db:"source_storage_node_id" json:"source_storage_node_id,omitempty"`
CreatedAt Time `db:"created_at" json:"created_at"`
UpdatedAt Time `db:"updated_at" json:"updated_at"`
CompletedAt NullTime `db:"completed_at" json:"completed_at,omitempty"`
DeletedAt NullTime `db:"deleted_at" json:"deleted_at,omitempty"`
}
type DiskSnapshotChunk ¶
type DiskSnapshotFile ¶
type DiskSnapshotFile struct {
Path string `json:"path"`
Type string `json:"type"`
Mode int64 `json:"mode"`
Uid int `json:"uid,omitempty"`
Gid int `json:"gid,omitempty"`
SizeBytes int64 `json:"size_bytes,omitempty"`
ModTimeUnixNano int64 `json:"mtime_unix_nano,omitempty"`
ChangeUnixNano int64 `json:"ctime_unix_nano,omitempty"`
DeviceId uint64 `json:"device_id,omitempty"`
Inode uint64 `json:"inode,omitempty"`
LinkName string `json:"link_name,omitempty"`
Chunks []DiskSnapshotChunk `json:"chunks,omitempty"`
}
type DiskSnapshotFilter ¶
type DiskSnapshotFilter struct {
WorkspaceId uint
WorkspaceExternalId string
DiskName string
Statuses []DiskSnapshotStatus
Limit uint64
}
type DiskSnapshotManifest ¶
type DiskSnapshotManifest struct {
Version int `json:"version"`
Format string `json:"format"`
DiskName string `json:"disk_name"`
Filesystem string `json:"filesystem"`
Generation int64 `json:"generation"`
ParentSnapshotId string `json:"parent_snapshot_id,omitempty"`
LogicalSizeBytes int64 `json:"logical_size_bytes"`
StoredSizeBytes int64 `json:"stored_size_bytes"`
Files []DiskSnapshotFile `json:"files,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type DiskSnapshotStatus ¶
type DiskSnapshotStatus string
type DiskWithRelated ¶
type DurableDiskMountConfig ¶
type DurableDiskMountConfig struct {
Name string `json:"name"`
Size string `json:"size"`
Filesystem string `json:"filesystem"`
Driver string `json:"driver"`
}
@go2proto
func NewDurableDiskMountConfigFromProto ¶
func NewDurableDiskMountConfigFromProto(in *pb.DurableDisk) *DurableDiskMountConfig
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 ErrDiskSnapshotNotFound ¶
type ErrDiskSnapshotNotFound struct {
SnapshotId string
}
func (*ErrDiskSnapshotNotFound) Error ¶
func (e *ErrDiskSnapshotNotFound) Error() string
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 EventCallbackConfig ¶
type EventClient ¶
type EventClient interface {
PushEvent(event cloudevents.Event) error
}
type EventComputeSchema ¶
type EventComputeSchema struct {
Timestamp time.Time `json:"timestamp"`
WorkspaceID string `json:"workspace_id,omitempty"`
PoolName string `json:"pool_name,omitempty"`
MachineID string `json:"machine_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
ContainerID string `json:"container_id,omitempty"`
RouteID string `json:"route_id,omitempty"`
Action string `json:"action"`
Status string `json:"status,omitempty"`
Transport string `json:"transport,omitempty"`
Executor string `json:"executor,omitempty"`
Fallback string `json:"fallback,omitempty"`
Source string `json:"source,omitempty"`
Hostname string `json:"hostname,omitempty"`
OS string `json:"os,omitempty"`
Arch string `json:"arch,omitempty"`
CPUCount uint32 `json:"cpu_count,omitempty"`
MemoryMB uint64 `json:"memory_mb,omitempty"`
GPUCount uint32 `json:"gpu_count,omitempty"`
NodeCount uint32 `json:"node_count,omitempty"`
MachineCount uint32 `json:"machine_count,omitempty"`
GPUs []string `json:"gpus,omitempty"`
Schedulable *bool `json:"schedulable,omitempty"`
Message string `json:"message,omitempty"`
Attrs map[string]string `json:"attrs,omitempty"`
}
type EventContainerEventSchema ¶
type EventContainerEventSchema struct {
ID ContainerEventID `json:"id"`
Domain EventDomain `json:"domain"`
Timestamp time.Time `json:"timestamp"`
ContainerID string `json:"container_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
StubType string `json:"stub_type,omitempty"`
TaskID string `json:"task_id,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
AppID string `json:"app_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
CPU int64 `json:"cpu,omitempty"`
GPUCount uint32 `json:"gpu_count,omitempty"`
Reason string `json:"reason,omitempty"`
Source string `json:"source,omitempty"`
Message string `json:"message,omitempty"`
Attrs map[string]string `json:"attrs,omitempty"`
}
type EventContainerLifecycleSchema ¶
type EventContainerLifecycleSchema struct {
ID ContainerLifecycleID `json:"id"`
Domain EventDomain `json:"domain"`
ParentID ContainerLifecycleID `json:"parent_id,omitempty"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
ContainerID string `json:"container_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
StubType string `json:"stub_type,omitempty"`
TaskID string `json:"task_id,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
AppID string `json:"app_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
Success *bool `json:"success,omitempty"`
Source string `json:"source,omitempty"`
Attrs map[string]string `json:"attrs,omitempty"`
}
type EventContainerLogSchema ¶
type EventContainerLogSchema struct {
Timestamp time.Time `json:"timestamp"`
ContainerID string `json:"container_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
StubType string `json:"stub_type,omitempty"`
TaskID string `json:"task_id,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
AppID string `json:"app_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
Stream string `json:"stream,omitempty"`
Line string `json:"line"`
PID int32 `json:"pid,omitempty"`
ProcessArgs []string `json:"process_args,omitempty"`
ProcessCwd string `json:"process_cwd,omitempty"`
ProcessSeq uint64 `json:"process_seq,omitempty"`
}
type EventContainerMetricsData ¶
type EventContainerMetricsData struct {
SampleIntervalMs int64 `json:"sample_interval_ms,omitempty"`
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"`
StubType string `json:"stub_type,omitempty"`
AppID string `json:"app_id,omitempty"`
CPU int64 `json:"cpu,omitempty"`
GPUCount uint32 `json:"gpu_count,omitempty"`
ContainerMetrics EventContainerMetricsData `json:"metrics"`
}
type EventDomain ¶
type EventDomain string
const ( EventDomainGateway EventDomain = "gateway" EventDomainScheduler EventDomain = "scheduler" EventDomainWorker EventDomain = "worker" EventDomainImage EventDomain = "image" EventDomainClip EventDomain = "clip" EventDomainMount EventDomain = "mount" EventDomainNetwork EventDomain = "network" EventDomainRuntime EventDomain = "runtime" EventDomainRunner EventDomain = "runner" EventDomainLogs EventDomain = "logs" EventDomainResult EventDomain = "result" EventDomainServe EventDomain = "serve" EventDomainShutdown EventDomain = "shutdown" EventDomainTask EventDomain = "task" EventDomainAutoscaler EventDomain = "autoscaler" )
func ContainerEventDomain ¶
func ContainerEventDomain(id ContainerEventID) EventDomain
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 EventHistoryResponse ¶
type EventHistoryResponse struct {
Events []ContainerEventRecord `json:"events"`
Streams []string `json:"streams,omitempty"`
}
type EventLLMRouteSchema ¶
type EventLLMRouteSchema struct {
Timestamp time.Time `json:"timestamp"`
WorkspaceID string `json:"workspace_id,omitempty"`
AppID string `json:"app_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
StubType string `json:"stub_type,omitempty"`
ContainerID string `json:"container_id,omitempty"`
Method string `json:"method,omitempty"`
Path string `json:"path,omitempty"`
RequestID string `json:"request_id,omitempty"`
Model string `json:"model,omitempty"`
Engine string `json:"engine,omitempty"`
RouteReason string `json:"route_reason,omitempty"`
RouteScore int64 `json:"route_score,omitempty"`
CandidateCount int `json:"candidate_count,omitempty"`
ReadyContainerCount int `json:"ready_container_count,omitempty"`
SessionHash string `json:"session_hash,omitempty"`
PrefixHash string `json:"prefix_hash,omitempty"`
PrefixBlockCount int `json:"prefix_block_count,omitempty"`
PrefixCacheMatches int `json:"prefix_cache_matches,omitempty"`
PromptTokens int64 `json:"prompt_tokens,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
TokenPressure int64 `json:"token_pressure,omitempty"`
Stream bool `json:"stream,omitempty"`
TotalActiveStreams int64 `json:"total_active_streams,omitempty"`
TotalTokenPressure int64 `json:"total_token_pressure,omitempty"`
ContainerActiveStreams int64 `json:"container_active_streams,omitempty"`
ContainerTokenPressure int64 `json:"container_token_pressure,omitempty"`
EngineRunningRequests int64 `json:"engine_running_requests,omitempty"`
EngineWaitingRequests int64 `json:"engine_waiting_requests,omitempty"`
EngineTTFTMs int64 `json:"engine_ttft_ms,omitempty"`
EngineTPOTMs int64 `json:"engine_tpot_ms,omitempty"`
EngineDecodeTokensPerS int64 `json:"engine_decode_tokens_per_s,omitempty"`
EngineGPUCacheUsageMilli int64 `json:"engine_gpu_cache_usage_milli,omitempty"`
EnginePrefixCacheMilli int64 `json:"engine_prefix_cache_hit_milli,omitempty"`
QueueWaitMs int64 `json:"queue_wait_ms,omitempty"`
FirstResponseMs int64 `json:"first_response_ms,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
StatusCode int `json:"status_code,omitempty"`
BackendError bool `json:"backend_error,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
}
type EventMessage ¶
type EventMessage string
const ( EventMessageSchedulerStopRequested EventMessage = "scheduler received stop request" EventMessageAttachStreamEnded EventMessage = "container stream ended during attach" EventMessageAttachClientDisconnected EventMessage = "client attach stream disconnected" EventMessageServeLockPreserved EventMessage = "attach stream ended without deleting serve lock" EventMessageAutoscalerScaleDecision EventMessage = "endpoint autoscaler selected desired container count" EventMessageRunnerCalledStartTask EventMessage = "runner called start_task" EventMessageRunnerLoadedFunctionArgs EventMessage = "runner loaded function args" EventMessageFunctionResultStored EventMessage = "function result stored in redis" EventMessageFunctionResultLoadedByGateway EventMessage = "function result loaded by gateway" EventMessageFunctionResultSentToClient EventMessage = "function result sent to client" EventMessageFunctionStreamCancelRequested EventMessage = "function stream client disconnected before completion" EventMessageFunctionStreamCancelApplied EventMessage = "function stream cancellation applied" EventMessageTaskEndStatePersisted EventMessage = "task end state persisted" EventMessageGatewayTaskStopRequested EventMessage = "gateway task stop requested" EventMessageGatewayTaskCancellationApplied EventMessage = "gateway task cancellation applied" EventMessageHTTPTaskStopRequested EventMessage = "HTTP task cancellation requested" EventMessageHTTPTaskCancellationApplied EventMessage = "HTTP task cancellation applied" EventMessageLogCaptureFlushed EventMessage = "container log capture flushed" EventMessageLogBufferDroppedRateLimit EventMessage = "container log buffer dropped a rate limit message" EventMessageLogBufferDroppedMessage EventMessage = "container log buffer dropped a message" EventMessageLogBufferDroppedRawMessage EventMessage = "container log buffer dropped a raw message" EventMessageLogCaptureReceivedFirstByte EventMessage = "container log capture received first byte" EventMessageLogCaptureReceivedFinalByte EventMessage = "container log capture received final byte" EventMessageWorkerStopEventReceived EventMessage = "worker received stop event" EventMessageWorkerOrphanStateMissing EventMessage = "container state was missing during worker heartbeat" EventMessagePendingReconciledRunning EventMessage = "pending state reconciled to running after runtime start" EventMessageStoppingGraceKill EventMessage = "container exceeded stopping grace period and will be force killed" EventMessageRuntimeExited EventMessage = "runtime process exited" EventMessageRuntimeOOMKilled EventMessage = "runtime process was oom killed" )
func (EventMessage) String ¶
func (m EventMessage) String() string
type EventPlatformCacheSchema ¶
type EventPlatformCacheSchema struct {
Locality string `json:"locality"`
LogicalHost string `json:"logical_host,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
Hash string `json:"hash,omitempty"`
RoutingKey string `json:"routing_key,omitempty"`
Kind CacheContentKind `json:"kind,omitempty"`
Status string `json:"status"`
Source string `json:"source,omitempty"`
Message string `json:"message,omitempty"`
SizeBytes int64 `json:"size_bytes,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
EventPlatformCacheSchema is an operational/audit event for cache materialization status, persisted to the platform cache stream in S2.
type EventPlatformLogSchema ¶
type EventPlatformLogSchema struct {
Timestamp time.Time `json:"timestamp"`
WorkspaceID string `json:"workspace_id,omitempty"`
PoolName string `json:"pool_name,omitempty"`
MachineID string `json:"machine_id,omitempty"`
Service string `json:"service,omitempty"`
InstanceID string `json:"instance_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
Level string `json:"level,omitempty"`
Stream string `json:"stream,omitempty"`
Line string `json:"line"`
}
type EventQuery ¶
type EventQuery struct {
Limit uint64 `json:"limit,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
StubType string `json:"stub_type,omitempty"`
AppID string `json:"app_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
ContainerID string `json:"container_id,omitempty"`
EventTypes []string `json:"event_types,omitempty"`
// ExcludeEventTypes drops records of the given event types (wildcards
// supported); used so task reads from the multiplexed stub task stream do
// not return log records unless explicitly requested.
ExcludeEventTypes []string `json:"exclude_event_types,omitempty"`
// ExcludeActions drops records whose payload "action" field matches; used
// to keep dense actions (e.g. machine.heartbeat) from consuming the limit.
ExcludeActions []string `json:"exclude_actions,omitempty"`
StartTime *time.Time `json:"start_time,omitempty"`
EndTime *time.Time `json:"end_time,omitempty"`
SeqNum *uint64 `json:"seq_num,omitempty"`
Timestamp *uint64 `json:"timestamp,omitempty"`
TailOffset *int64 `json:"tail_offset,omitempty"`
Until *uint64 `json:"until,omitempty"`
WaitSeconds *int32 `json:"wait,omitempty"`
Clamp *bool `json:"clamp,omitempty"`
}
type EventSink ¶
type EventSink = func(event []cloudevents.Event)
type EventSource ¶
type EventSource string
const ( EventSourceScheduler EventSource = "scheduler" EventSourceSchedulerStop EventSource = "scheduler.stop" EventSourceGatewayAttach EventSource = "gateway.attach" EventSourceGatewayStartTask EventSource = "gateway.start_task" EventSourceGatewayEndTask EventSource = "gateway.end_task" EventSourceGatewayFunctionStream EventSource = "gateway.function_stream" EventSourceGatewayFunctionGetArgs EventSource = "gateway.function_get_args" EventSourceGatewayFunctionSetResult EventSource = "gateway.function_set_result" EventSourceGatewayStopTask EventSource = "gateway.stop_task" EventSourceAPITaskStop EventSource = "api.task.stop" EventSourceEndpointAutoscaler EventSource = "endpoint.autoscaler" EventSourceWorkerEventBus EventSource = "worker.event_bus" EventSourceWorkerEventStream EventSource = "worker.event_stream" EventSourceWorkerLogger EventSource = "worker.logger" EventSourceWorkerNetwork EventSource = "worker.network" EventSourceWorkerRuntime EventSource = "worker.runtime" EventSourceWorkerStatusHeartbeat EventSource = "worker.status_heartbeat" EventSourceRunnerStdout EventSource = "runner.stdout" EventSourceClipFUSE EventSource = "clip.fuse" )
func (EventSource) String ¶
func (s EventSource) String() string
type EventStubCacheRequiredContentSchema ¶
type EventStubCacheRequiredContentSchema struct {
WorkspaceID string `json:"workspace_id"`
StubID string `json:"stub_id"`
Locality string `json:"locality"`
Kind CacheContentKind `json:"kind"`
ItemCount int `json:"item_count"`
TotalBytes int64 `json:"total_bytes"`
Items []CacheRequiredContentItem `json:"items"`
Timestamp time.Time `json:"timestamp"`
}
EventStubCacheRequiredContentSchema is the coalesced required-content report for a stub, persisted to the stub cache stream in S2. Locality records where the content was observed; the reconciler uses the locality-scoped recent-stub index to decide where to materialize it.
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"`
StubType StubType `json:"stub_type,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
AppID string `json:"app_id"`
DeploymentID string `json:"deployment_id,omitempty"`
DeploymentName string `json:"deployment_name,omitempty"`
DeploymentVersion string `json:"deployment_version,omitempty"`
}
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 EventsConfig ¶
type EventsConfig struct {
Callbacks []EventCallbackConfig `key:"callbacks" json:"callbacks"`
}
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 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
HTTPTimeout time.Duration `key:"httpTimeout" json:"http_timeout"` // --http-timeout
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"`
CacheDirectIO bool `key:"cacheDirectIO" json:"cache_direct_io"`
CacheThroughEnabled bool `key:"cacheThroughEnabled" json:"cache_through_enabled"`
}
type GenericProviderConfig ¶
type GenericProviderConfig struct {
}
type GpuType ¶
type GpuType string
const ( GPU_A10 GpuType = "A10" GPU_A10G GpuType = "A10G" GPU_A100 GpuType = "A100" GPU_A100_40 GpuType = "A100-40" GPU_A100_80 GpuType = "A100-80" GPU_A16 GpuType = "A16" GPU_A30 GpuType = "A30" GPU_A40 GpuType = "A40" GPU_A4000 GpuType = "A4000" GPU_A5000 GpuType = "A5000" GPU_L4 GpuType = "L4" GPU_L40 GpuType = "L40" GPU_T4 GpuType = "T4" GPU_GAUDI2 GpuType = "GAUDI2" GPU_GH200 GpuType = "GH200" GPU_H100 GpuType = "H100" GPU_H200 GpuType = "H200" GPU_B200 GpuType = "B200" GPU_B300 GpuType = "B300" GPU_A6000 GpuType = "A6000" GPU_RTX4000_ADA GpuType = "RTX4000Ada" GPU_RTX4090 GpuType = "RTX4090" GPU_RTX5090 GpuType = "RTX5090" GPU_RTX6000 GpuType = "RTX6000" GPU_RTX6000_ADA GpuType = "RTX6000Ada" GPU_RTX_PRO6000 GpuType = "RTXPro6000" GPU_L40S GpuType = "L40S" GPU_V100 GpuType = "V100" GPU_V100_32 GpuType = "V100-32" NO_GPU GpuType = "NO_GPU" GPU_ANY GpuType = "any" )
func AllGPUTypes ¶
func AllGPUTypes() []GpuType
func GPUTypesFromString ¶
func NormalizeGPUType ¶
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 HetznerPrivateNetworkConfig ¶
type HetznerPrivateNetworkConfig struct {
ID int64 `key:"id" json:"id"`
Name string `key:"name" json:"name"`
RegionIDs map[string]int64 `key:"regionIds" json:"region_ids"`
RegionNames map[string]string `key:"regionNames" json:"region_names"`
RequireSubnet *bool `key:"requireSubnet" json:"require_subnet"`
}
type HetznerProviderConfig ¶
type HetznerProviderConfig struct {
ApiToken string `key:"apiToken" json:"api_token"`
BaseURL string `key:"baseURL" json:"base_url"`
Image string `key:"image" json:"image"`
ImageByRegion map[string]string `key:"imageByRegion" json:"image_by_region"`
SSHKeys []string `key:"sshKeys" json:"ssh_keys"`
SSHKeysByRegion map[string][]string `key:"sshKeysByRegion" json:"ssh_keys_by_region"`
PrivateNetwork HetznerPrivateNetworkConfig `key:"privateNetwork" json:"private_network"`
ServerTypePrices map[string]float64 `key:"serverTypePrices" json:"server_type_prices"`
ServerTypeCategories map[string]string `key:"serverTypeCategories" json:"server_type_categories"`
RegionMetadata map[string]HetznerRegionConfig `key:"regionMetadata" json:"region_metadata"`
DefaultRegions []string `key:"defaultRegions" json:"default_regions"`
}
type HetznerRegionConfig ¶
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 LLMConfig ¶
type LLMConfig struct {
ModelID string `json:"model_id,omitempty" serializer:"model_id,omitempty"`
Engine string `json:"engine,omitempty" serializer:"engine,omitempty"`
ServedModelName string `json:"served_model_name,omitempty" serializer:"served_model_name,omitempty"`
ContextLength int `json:"context_length,omitempty" serializer:"context_length,omitempty"`
Tokenizer string `json:"tokenizer,omitempty" serializer:"tokenizer,omitempty"`
MetricsPath string `json:"metrics_path,omitempty" serializer:"metrics_path,omitempty"`
SLOTier string `json:"slo_tier,omitempty" serializer:"slo_tier,omitempty"`
}
type LambdaLabsProviderConfig ¶
type LambdaLabsProviderConfig struct {
ApiKey string `key:"apiKey" json:"apiKey"`
}
type LogQuery ¶
type LogQuery struct {
Limit uint64 `json:"limit,omitempty"`
Page uint64 `json:"page,omitempty"`
ObjectID string `json:"object_id,omitempty"`
ObjectType string `json:"object_type,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
AppID string `json:"app_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
ContainerID string `json:"container_id,omitempty"`
MachineID string `json:"machine_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
Query string `json:"query,omitempty"`
StartTime *time.Time `json:"start_time,omitempty"`
EndTime *time.Time `json:"end_time,omitempty"`
SeqNum *uint64 `json:"seq_num,omitempty"`
TailOffset *int64 `json:"tail_offset,omitempty"`
WaitSeconds *int32 `json:"wait,omitempty"`
Clamp *bool `json:"clamp,omitempty"`
}
type LogRecord ¶
type LogRecord struct {
SeqNum uint64 `json:"seq_num"`
StoredAtNs uint64 `json:"stored_at_ns,omitempty"`
Timestamp time.Time `json:"timestamp"`
Message string `json:"message"`
Stream string `json:"stream,omitempty"`
ContainerID string `json:"container_id,omitempty"`
StubID string `json:"stub_id,omitempty"`
StubType string `json:"stub_type,omitempty"`
TaskID string `json:"task_id,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
AppID string `json:"app_id,omitempty"`
MachineID string `json:"machine_id,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
PID int32 `json:"pid,omitempty"`
ProcessArgs []string `json:"process_args,omitempty"`
ProcessCwd string `json:"process_cwd,omitempty"`
ProcessSeq uint64 `json:"process_seq,omitempty"`
}
type LogsResponse ¶
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 ManagedComputeBYOCConfig ¶
type ManagedComputeBYOCConfig struct {
Pricing ManagedComputeBYOCPricingConfig `key:"pricing" json:"pricing"`
AWS ManagedComputeBYOCAWSConfig `key:"aws" json:"aws"`
}
type ManagedComputeBYOCPricingConfig ¶
type ManagedComputeBYOCPricingConfig struct {
MemoryHourlyMicrosPerGB int64 `key:"memoryHourlyMicrosPerGB" json:"memory_hourly_micros_per_gb"`
CPUHourlyMicrosPerVCPU int64 `key:"cpuHourlyMicrosPerVCPU" json:"cpu_hourly_micros_per_vcpu"`
}
func (ManagedComputeBYOCPricingConfig) CPUHourlyMicrosPerVCPUOrDefault ¶
func (c ManagedComputeBYOCPricingConfig) CPUHourlyMicrosPerVCPUOrDefault() int64
func (ManagedComputeBYOCPricingConfig) MemoryHourlyMicrosPerGBOrDefault ¶
func (c ManagedComputeBYOCPricingConfig) MemoryHourlyMicrosPerGBOrDefault() int64
type ManagedComputeBillingConfig ¶
type ManagedComputeBillingConfig struct {
Mode string `key:"mode" json:"mode"`
Endpoint string `key:"endpoint" json:"endpoint"`
AuthToken string `key:"authToken" json:"auth_token"`
Required bool `key:"required" json:"required"`
Timeout time.Duration `key:"timeout" json:"timeout"`
ReconcileInterval time.Duration `key:"reconcileInterval" json:"reconcile_interval"`
MinimumCreditCents int64 `key:"minimumCreditCents" json:"minimum_credit_cents"`
// FailureGracePeriod is how long balance checks may fail before managed
// reservations are terminated.
FailureGracePeriod time.Duration `key:"failureGracePeriod" json:"failure_grace_period"`
}
func (ManagedComputeBillingConfig) FailureGracePeriodOrDefault ¶
func (c ManagedComputeBillingConfig) FailureGracePeriodOrDefault() time.Duration
func (ManagedComputeBillingConfig) MinimumCreditCentsOrDefault ¶
func (c ManagedComputeBillingConfig) MinimumCreditCentsOrDefault() int64
func (ManagedComputeBillingConfig) ReconcileIntervalOrDefault ¶
func (c ManagedComputeBillingConfig) ReconcileIntervalOrDefault() time.Duration
func (ManagedComputeBillingConfig) TimeoutOrDefault ¶
func (c ManagedComputeBillingConfig) TimeoutOrDefault() time.Duration
type ManagedComputeConfig ¶
type ManagedComputeConfig struct {
BillableMarginPct *float64 `key:"billableMarginPct" json:"billable_margin_pct"`
Billing ManagedComputeBillingConfig `key:"billing" json:"billing"`
BYOC ManagedComputeBYOCConfig `key:"byoc" json:"byoc"`
}
func (ManagedComputeConfig) BillableMarginPctOrDefault ¶
func (c ManagedComputeConfig) BillableMarginPctOrDefault() float64
type MetricAverage ¶
type MetricAverage struct {
Value float64 `json:"value"`
}
type MetricsAggregationBucket ¶
type MetricsAggregationBucket struct {
Key int64 `json:"key"`
KeyAsString string `json:"key_as_string"`
DocCount int `json:"doc_count"`
ContainerCount MetricAverage `json:"container_count"`
CPUConcurrency MetricAverage `json:"cpu_concurrency"`
GPUConcurrency MetricAverage `json:"gpu_concurrency"`
DiskReadBytesRateAvg MetricAverage `json:"disk_read_bytes_per_second_avg"`
DiskWriteBytesRateAvg MetricAverage `json:"disk_write_bytes_per_second_avg"`
NetworkRecvBytesRateAvg MetricAverage `json:"network_recv_bytes_per_second_avg"`
NetworkSentBytesRateAvg MetricAverage `json:"network_sent_bytes_per_second_avg"`
CPUPercentAvg MetricAverage `json:"cpu_pct_avg"`
CPUTotalAvg MetricAverage `json:"cpu_total_avg"`
CPUUsedAvg MetricAverage `json:"cpu_used_avg"`
DiskReadBytesAvg MetricAverage `json:"disk_read_bytes_avg"`
DiskWriteBytesAvg MetricAverage `json:"disk_write_bytes_avg"`
GPUMemoryTotalBytesAvg MetricAverage `json:"gpu_memory_total_bytes_avg"`
GPUMemoryUsedBytesAvg MetricAverage `json:"gpu_memory_used_bytes_avg"`
MemoryRSSBytesAvg MetricAverage `json:"memory_rss_bytes_avg"`
MemoryTotalBytesAvg MetricAverage `json:"memory_total_bytes_avg"`
MemoryVMSBytesAvg MetricAverage `json:"memory_vms_bytes_avg"`
MemorySwapBytesAvg MetricAverage `json:"memory_swap_bytes_avg"`
NetworkRecvBytesAvg MetricAverage `json:"network_recv_bytes_avg"`
NetworkSentBytesAvg MetricAverage `json:"network_sent_bytes_avg"`
NetworkRecvPacketsAvg MetricAverage `json:"network_recv_packets_avg"`
NetworkSentPacketsAvg MetricAverage `json:"network_sent_packets_avg"`
}
type MetricsCollector ¶
type MetricsCollector string
var ( MetricsCollectorPrometheus MetricsCollector = "prometheus" MetricsCollectorOpenMeter MetricsCollector = "openmeter" MetricsCollectorNone MetricsCollector = "none" )
type MetricsTimeseriesResponse ¶
type MetricsTimeseriesResponse struct {
Timeseries struct {
AggregationBuckets []MetricsAggregationBucket `json:"aggregation_buckets"`
} `json:"timeseries"`
}
type MonitoringConfig ¶
type MonitoringConfig struct {
MetricsCollector string `key:"metricsCollector" json:"metrics_collector"`
Prometheus PrometheusConfig `key:"prometheus" json:"prometheus"`
OpenMeter OpenMeterConfig `key:"openmeter" json:"openmeter"`
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"`
DurableDisk *DurableDiskMountConfig `json:"durable_disk,omitempty"`
}
@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
func (MountPointConfig) WithoutCredentials ¶
func (m MountPointConfig) WithoutCredentials() 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 PoolConfig ¶
type PoolConfig struct {
Name string `json:"name,omitempty"`
GPUs []string `json:"gpu,omitempty"`
Nodes uint32 `json:"nodes,omitempty"`
OfferID string `json:"offer_id,omitempty"`
TTL string `json:"ttl,omitempty"`
MaxSpend float64 `json:"max_spend,omitempty"`
Providers []string `json:"providers,omitempty"`
Regions []string `json:"regions,omitempty"`
MinReliability float64 `json:"min_reliability,omitempty"`
Selector string `json:"selector,omitempty"`
}
func (*PoolConfig) RequiresReservation ¶
func (p *PoolConfig) RequiresReservation() bool
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"`
Vast VastProviderConfig `key:"vast" json:"vast"`
Shadeform ShadeformProviderConfig `key:"shadeform" json:"shadeform"`
Hetzner HetznerProviderConfig `key:"hetzner" json:"hetzner"`
}
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 RuntimeConfig struct {
// gVisor-specific configuration
GVisorPlatform string `key:"gvisorPlatform" json:"gvisor_platform"` // "kvm", "systrap", or "ptrace"
GVisorRoot string `key:"gvisorRoot" json:"gvisor_root"` // Root directory for gVisor state (default: "/run/gvisor")
GVisorExtraArgs []string `key:"gvisorExtraArgs" json:"gvisor_extra_args"` // Additional runsc flags appended for this pool
}
type S2Config ¶
type S2Config struct {
ApiKey string `key:"apiKey" json:"api_key"`
Basin string `key:"basin" json:"basin"`
StreamPrefix string `key:"streamPrefix" json:"stream_prefix"`
LogApiKey string `key:"logApiKey" json:"log_api_key"`
LogStreamPrefix string `key:"logStreamPrefix" json:"log_stream_prefix"`
EventApiKey string `key:"eventApiKey" json:"event_api_key"`
EventStreamPrefix string `key:"eventStreamPrefix" json:"event_stream_prefix"`
}
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 ServingConfig ¶
type ServingConfig struct {
AppKind string `json:"app_kind,omitempty" serializer:"app_kind,omitempty"`
ServingProtocol string `json:"serving_protocol,omitempty" serializer:"serving_protocol,omitempty"`
LLM *LLMConfig `json:"llm,omitempty" serializer:"llm,omitempty"`
Database *DatabaseServingConfig `json:"database,omitempty" serializer:"database,omitempty"`
}
type ShadeformProviderConfig ¶
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 int `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"`
IsService bool `json:"is_service"`
Serving *ServingConfig `json:"serving,omitempty"`
Pool *PoolConfig `json:"pool,omitempty"`
Disks []*pb.DurableDisk `json:"disks,omitempty"`
}
func (*StubConfigV1) EffectiveAppKind ¶
func (c *StubConfigV1) EffectiveAppKind() string
func (*StubConfigV1) EffectiveDatabaseConfig ¶
func (c *StubConfigV1) EffectiveDatabaseConfig() *DatabaseServingConfig
func (*StubConfigV1) EffectiveLLMConfig ¶
func (c *StubConfigV1) EffectiveLLMConfig() *LLMConfig
func (*StubConfigV1) EffectiveServingConfig ¶
func (c *StubConfigV1) EffectiveServingConfig() *ServingConfig
func (*StubConfigV1) EffectiveServingProtocol ¶
func (c *StubConfigV1) EffectiveServingProtocol() string
func (*StubConfigV1) PoolSelector ¶
func (c *StubConfigV1) PoolSelector() string
func (*StubConfigV1) RequiresGPU ¶
func (c *StubConfigV1) RequiresGPU() bool
func (*StubConfigV1) SetReplicaCount ¶
func (c *StubConfigV1) SetReplicaCount(containers uint)
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"`
Limit uint32 `query:"limit"`
}
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"`
AgentAuthKey string `key:"agentAuthKey" json:"agent_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 VastProviderConfig ¶
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"`
CacheEnabled bool `key:"cacheEnabled" json:"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 WorkerKeepAlive ¶
type WorkerKeepAlive struct {
MachineId string `json:"machine_id"`
}
type WorkerPoolCacheConfig ¶
type WorkerPoolCacheConfig struct {
Enabled *bool `key:"enabled" json:"enabled"`
Disk WorkerPoolCacheDiskConfig `key:"disk" json:"disk"`
}
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
ContainerStartConcurrency int `key:"containerStartConcurrency" json:"container_start_concurrency"`
NetworkPreallocation *bool `key:"networkPreallocation" json:"network_preallocation"`
NetworkSlotPoolSize int `key:"networkSlotPoolSize" json:"network_slot_pool_size"`
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"`
ImagesPath string `key:"imagesPath" json:"images_path"` // Host path backing the worker's /images volume (clip layer cache + image mounts); defaults to /images
DurableDisksPath string `key:"durableDisksPath" json:"durable_disks_path"` // Host path backing durable disks; defaults to /var/lib/beta9/durable-disks
Cache WorkerPoolCacheConfig `key:"cache" json:"cache"`
}
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 ¶
func (Workspace) WithoutPrivateCredentials ¶
func (Workspace) WithoutSigningKey ¶
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"`
DefaultPresignedEndpointUrl string `key:"defaultPresignedEndpointUrl" json:"default_presigned_endpoint_url"`
DefaultRegion string `key:"defaultRegion" json:"default_region"`
// Storage mode configs
Geese GeeseConfig `key:"geese" json:"geese"`
Alluxio AlluxioConfig `key:"alluxio" json:"alluxio"`
}