workload

package
v0.0.0-...-06cc741 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelWorkloadID   = "explorer.chunks.cloud/workload-id"
	LabelWorkloadName = "explorer.chunks.cloud/workload-name"
	LabelWorkloadType = "explorer.chunks.cloud/workload-type"

	LabelChunkID   = "explorer.chunks.cloud/chunk-id"
	LabelChunkName = "explorer.chunks.cloud/chunk-name"

	LabelFlavorVersionID = "explorer.chunks.cloud/flavor-version-id"

	LabelWorkloadPort = "explorer.chunks.cloud/workload-port"
)

Variables

View Source
var ErrMaxPortTriesReached = errors.New("maximum number of retries reached")

Functions

func InstanceLabels

func InstanceLabels(instance *instancev1alpha1.Instance) map[string]string

func SystemWorkloadLabels

func SystemWorkloadLabels(name string) map[string]string

SystemWorkloadLabels returns the labels used by system workloads

Types

type PortAllocator

type PortAllocator struct {
	// contains filtered or unexported fields
}

func NewPortAllocator

func NewPortAllocator(portMin, portMax uint16) *PortAllocator

func (*PortAllocator) Allocate

func (a *PortAllocator) Allocate() (uint16, error)

func (*PortAllocator) Free

func (a *PortAllocator) Free(port uint16)

type Server

type Server struct {
	workloadv1alpha2.UnimplementedWorkloadServiceServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(store status.Store) *Server

type Service

type Service interface {
	RunWorkload(ctx context.Context, w Workload, attempt uint) error
	RemoveWorkload(ctx context.Context, id string) error
	GetWorkloadHealth(ctx context.Context, id string) (status.WorkloadHealthStatus, error)
}

func NewService

func NewService(
	logger *slog.Logger,
	criService cri.Service,
	registryAuth cri.RegistryAuth,
) Service

type Workload

type Workload struct {
	ID              string
	CheckpointImage string
	BaseImage       string

	// below map directly to pod fields
	Name             string
	Namespace        string
	Hostname         string
	Labels           map[string]string
	CPUPeriod        uint64
	CPUQuota         uint64
	MemoryLimitBytes uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL