workload

package
v1.0.0-cli.0...-421df98 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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"

	LabelInstanceOrderedBy = "explorer.chunks.cloud/ordered-by"
)
View Source
const (
	AnnotationInstance = "explorer.chunks.cloud/instance"
)

Variables

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

Functions

func InstanceLabels

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

func MetadataToTransport

func MetadataToTransport(meta Metadata) *workloadv1alpha2.WorkloadMetadata

func SystemWorkloadLabels

func SystemWorkloadLabels(name string) map[string]string

SystemWorkloadLabels returns the labels used by system workloads

Types

type Config

type Config struct {
	MCManagementAPIToken   string
	ServerMonImage         string
	PlatformdListenSockURL *url.URL
	PlatformdSocketUID     uint64
	PlatformdSocketGID     uint64
}

type Metadata

type Metadata struct {
	ID            string
	Chunk         resource.Chunk
	FlavorVersion resource.FlavorVersion
	OrderedBy     string
}

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, service Service) *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)
	WorkloadMetadata(ctx context.Context, id string) (Metadata, error)
}

func NewService

func NewService(
	logger *slog.Logger,
	cfg Config,
	criService cri.Service,
	registryAuth cri.RegistryAuth,
	newRemoteCMDExecutor logreader.RemoteCMDExecutorFactory,
) Service

type Workload

type Workload struct {
	ID              string
	CheckpointImage string
	BaseImage       string
	Instance        *instancev1alpha1.Instance

	// 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