container

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesClaimTemplate

type KubernetesClaimTemplate struct {
	StorageClass string            `json:"storageClass,omitempty" yaml:"storageClass,omitempty"`
	Size         string            `json:"size,omitempty" yaml:"size,omitempty"`
	AccessMode   string            `json:"accessMode,omitempty" yaml:"accessMode,omitempty"`
	Labels       map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Annotations  map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}

KubernetesClaimTemplate captures the fields Caesium needs to build an inline ephemeral Kubernetes PVC claim template.

type KubernetesSpec

type KubernetesSpec struct {
	ServiceAccountName           string            `json:"serviceAccountName,omitempty" yaml:"serviceAccountName,omitempty"`
	PodAnnotations               map[string]string `json:"podAnnotations,omitempty" yaml:"podAnnotations,omitempty"`
	AutomountServiceAccountToken *bool             `json:"automountServiceAccountToken,omitempty" yaml:"automountServiceAccountToken,omitempty"`
	// QueueName is the Kueue LocalQueue this task is admitted through. When set,
	// the Kubernetes engine stamps the `kueue.x-k8s.io/queue-name` label on the
	// created pod and delegates admission to Kueue, which gates scheduling until
	// quota is available. It is pure scheduling metadata — Caesium never
	// bin-packs or schedules itself — and is therefore deliberately EXCLUDED
	// from the cache identity hash (see internal/cache/hash.go): two otherwise
	// identical tasks that differ only in queue must share one cache identity.
	QueueName string `json:"queueName,omitempty" yaml:"queueName,omitempty"`
}

KubernetesSpec captures Kubernetes-only pod settings that can be derived from job definitions without forcing the public container package to depend on Kubernetes API types.

func (*KubernetesSpec) HasIdentityFields

func (k *KubernetesSpec) HasIdentityFields() bool

HasIdentityFields reports whether the spec carries any field that contributes to a task's cache identity (service account, pod annotations, automount). QueueName is excluded: it is scheduling metadata, not an execution input, so a spec whose only populated field is QueueName has no identity content and the cache hash must treat it the same as an absent KubernetesSpec.

type Mount

type Mount struct {
	Type     MountType `json:"type" yaml:"type"`
	Source   string    `json:"source" yaml:"source"`
	Target   string    `json:"target" yaml:"target"`
	ReadOnly bool      `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
}

Mount describes a filesystem mount to inject into a container.

type MountType

type MountType string

MountType enumerates supported mount driver types.

const (
	// MountTypeBind represents a bind mount from the host filesystem.
	MountTypeBind MountType = "bind"
	// MountTypeVolume represents a Docker/Podman named volume.
	MountTypeVolume MountType = "volume"
	// MountTypeTmpfs represents a tmpfs mount.
	MountTypeTmpfs MountType = "tmpfs"
)

type Spec

type Spec struct {
	Env                  map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
	WorkDir              string            `json:"workdir,omitempty" yaml:"workdir,omitempty"`
	Mounts               []Mount           `json:"mounts,omitempty" yaml:"mounts,omitempty"`
	ResolvedVolumeMounts []VolumeMount     `json:"resolvedVolumeMounts,omitempty" yaml:"-"`
	Kubernetes           *KubernetesSpec   `json:"kubernetes,omitempty" yaml:"-"`
}

Spec captures shared container runtime knobs regardless of engine.

func (Spec) HasEnv

func (s Spec) HasEnv() bool

HasEnv reports whether any environment variables are defined.

func (Spec) HasMounts

func (s Spec) HasMounts() bool

HasMounts reports whether any mounts are defined.

type TmpfsOptions

type TmpfsOptions struct {
	SizeBytes int64 `json:"sizeBytes,omitempty" yaml:"sizeBytes,omitempty"`
	Mode      *int  `json:"mode,omitempty" yaml:"mode,omitempty"`
}

TmpfsOptions captures the portable tmpfs options Caesium understands.

type VolumeMount

type VolumeMount struct {
	Name          string                   `json:"name,omitempty" yaml:"name,omitempty"`
	Type          VolumeMountType          `json:"type" yaml:"type"`
	Source        string                   `json:"source,omitempty" yaml:"source,omitempty"`
	Target        string                   `json:"target" yaml:"target"`
	ReadOnly      bool                     `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
	SubPath       string                   `json:"subPath,omitempty" yaml:"subPath,omitempty"`
	Tmpfs         *TmpfsOptions            `json:"tmpfs,omitempty" yaml:"tmpfs,omitempty"`
	ClaimTemplate *KubernetesClaimTemplate `json:"claimTemplate,omitempty" yaml:"claimTemplate,omitempty"`
	VolumeSource  map[string]any           `json:"volumeSource,omitempty" yaml:"volumeSource,omitempty"`
}

VolumeMount describes a resolved named volume mount in a runtime-neutral form. Engines map the type-specific fields into native Docker, Podman, or Kubernetes mount structures.

type VolumeMountType

type VolumeMountType string

VolumeMountType enumerates resolved volume sources. These are produced from job-level volumes and consumed by engine adapters.

const (
	VolumeMountTypeBind          VolumeMountType = "bind"
	VolumeMountTypeVolume        VolumeMountType = "volume"
	VolumeMountTypeTmpfs         VolumeMountType = "tmpfs"
	VolumeMountTypePVC           VolumeMountType = "pvc"
	VolumeMountTypeClaimTemplate VolumeMountType = "claimTemplate"
	VolumeMountTypeVolumeSource  VolumeMountType = "volumeSource"
)

Jump to

Keyboard shortcuts

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