jobdef

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersionV1 = "v1"
	KindJob      = "Job"

	TriggerCron      = "cron"
	TriggerHTTP      = "http"
	TriggerEvent     = "event"
	TriggerFreshness = "freshness"

	CallbackNotification = "notification"

	EngineDocker     = "docker"
	EngineKubernetes = "kubernetes"
	EnginePodman     = "podman"

	TriggerRuleAllSuccess = "all_success"
	TriggerRuleAllDone    = "all_done"
	TriggerRuleAllFailed  = "all_failed"
	TriggerRuleOneSuccess = "one_success"
	TriggerRuleAlways     = "always"

	StepTypeTask   = "task"
	StepTypeBranch = "branch"
)
View Source
const (
	SchemaValidationDisabled = ""
	SchemaValidationWarn     = "warn"
	SchemaValidationFail     = "fail"

	PriorityHigh   = "high"
	PriorityNormal = "normal"
	PriorityLow    = "low"

	ConcurrencyStrategyQueue   = "queue"
	ConcurrencyStrategyReplace = "replace"
	ConcurrencyStrategySkip    = "skip"
	ConcurrencyStrategyFail    = "fail"
)
View Source
const (
	FanOutOnEmptySkip = "skip"
	FanOutOnEmptyFail = "fail"

	FanOutFailureFailFast = "fail_fast"
	FanOutFailureContinue = "continue"

	DefaultFanOutEnv           = "CAESIUM_PARTITION"
	FanOutPartitionJSONEnv     = "CAESIUM_PARTITION_JSON"
	DefaultFanOutMaxPartitions = 1024
)
View Source
const (
	// DatasetDirectionProduces marks a dataset a step produces (carries the SLO).
	DatasetDirectionProduces = "produces"
	// DatasetDirectionConsumes marks a dataset a step consumes.
	DatasetDirectionConsumes = "consumes"
	// DatasetDirectionSource marks an external dataset declared under
	// metadata.datasets.sources that nobody in this instance produces.
	DatasetDirectionSource = "source"

	// DatasetSchemaFromOutput reuses the producing step's outputSchema as the
	// produced dataset schema.
	DatasetSchemaFromOutput = "output"
)

Dataset direction constants describe how a declaration relates a step (or the job's metadata) to a dataset. They are the canonical values persisted on the DatasetDeclaration registry model and read by the cross-job lint.

View Source
const (
	RemediationClassTransientInfra  = "transient_infra"
	RemediationClassSchemaViolation = "schema_violation"
	RemediationClassSLARisk         = "sla_risk"
	RemediationClassDataUnavailable = "data_unavailable"
	RemediationClassAuthFailure     = "auth_failure"
	RemediationClassOOM             = "oom"
	RemediationClassQuota           = "quota"
	RemediationClassUnknown         = "unknown"
)

Failure class names accepted by metadata.remediation.classes and the keys of metadata.remediation.autonomy.perClass. These must stay in sync with internal/incident.FailureClass (the deterministic classifier, Stream A); pkg/jobdef duplicates the vocabulary rather than importing internal/incident so offline `caesium job lint` (and this package generally) stays free of a dependency on the incident runtime.

View Source
const (
	RemediationActionAutoRetryBackoff         = "auto_retry_backoff"
	RemediationActionSnoozeUntilCron          = "snooze_until_cron"
	RemediationActionSnoozeRetry              = "snooze_retry"
	RemediationActionRetryFromFailure         = "retry_from_failure"
	RemediationActionRetryCallbacks           = "retry_callbacks"
	RemediationActionNotify                   = "notify"
	RemediationActionQuarantineReplay         = "quarantine_replay"
	RemediationActionRerunWithParams          = "rerun_with_params"
	RemediationActionPauseJob                 = "pause_job"
	RemediationActionUnpauseJob               = "unpause_job"
	RemediationActionClearCacheEntry          = "clear_cache_entry"
	RemediationActionSuppressDownstreamAlerts = "suppress_downstream_alerts"
	RemediationActionExtendSLAOnce            = "extend_sla_once"
	RemediationActionSkipTask                 = "skip_task"
	RemediationActionOverrideSchemaGate       = "override_schema_gate"
	RemediationActionApplyJobdefPatch         = "apply_jobdef_patch"
	RemediationActionEscalate                 = "escalate"
)

Remediation action names accepted by metadata.remediation.autonomy.allow, .perClass[].allow, and .requireApproval. These name the typed action catalog docs/design-agent-in-the-loop.md defines for Stream B's executor (tier 1/2 autonomous actions, tier-3 approval-gated producers, plus the terminal `escalate`); pkg/jobdef validates job-declared policy names against this list without depending on Stream B's executor package.

View Source
const (
	// CacheChainTransitive is the default and preserves the historical hash
	// exactly: every predecessor's identity hash is folded into this step's key,
	// so any upstream change — including one that produced identical outputs —
	// cascades to every downstream step.
	CacheChainTransitive = "transitive"
	// CacheChainValues excludes predecessor identity hashes from the key while
	// still hashing predecessor OUTPUTS. The meaning is "my key is what I
	// consume, not my predecessors' internal churn": an upstream step whose own
	// inputs moved (a git ref, a timestamp) no longer invalidates this step, but
	// a changed upstream *output* still does. It is a sharper knife than the
	// default — an upstream change that alters behaviour without altering
	// outputs leaves consumers cached (see docs/job-definitions.md).
	CacheChainValues = "values"
	// CacheTTLNever is the literal `ttl: never`, which maps to a nil ExpiresAt
	// on the cache entry: a step keyed purely on a content fingerprint should
	// not expire on a wall clock.
	CacheTTLNever = "never"
)

Cache chain modes select whether a step's identity hash folds in its predecessors' identity hashes.

Variables

This section is empty.

Functions

func DeriveStepSuccessors

func DeriveStepSuccessors(steps []Step) (map[string][]string, error)

DeriveStepSuccessors builds the adjacency list for the provided steps. It assumes the caller has validated the definition (Validate) beforehand.

func NormalizeCacheChain

func NormalizeCacheChain(raw string) (string, bool)

NormalizeCacheChain canonicalizes a user-supplied cache.chain value. It returns the canonical form and whether the value is a known mode; unknown values are rejected by Validate() and ignored (leaving the inherited default, which is the byte-identical-to-today transitive behaviour) at resolve time, so a manifest that somehow bypassed validation still fails safe.

func SkipWhenFreshEnabled

func SkipWhenFreshEnabled(datasets *MetadataDatasets) bool

SkipWhenFreshEnabled applies the metadata.datasets.skipWhenFresh default. A nil metadata.datasets block also defaults to true so step-level datasets declared without job-level sources still opt into skip-when-fresh.

func ValidateTriggerSpec

func ValidateTriggerSpec(t *Trigger, defs ...*Definition) error

ValidateTriggerSpec validates a trigger, optionally against the job definition(s) it belongs to. A freshness trigger derives its runs from the job's declared dataset graph (a consumed input plus a produced dataset with a freshness SLO), which lives on the definition rather than the trigger. Callers that own the definition (the apply path validates it via Definition.Validate) pass it here so the dataset requirement is enforced; the trigger-create/update API validates with the trigger alone and therefore has no dataset context. A bare freshness trigger (no definition supplied) is rejected: it cannot satisfy the dataset requirement, so it must be declared on a job definition instead.

Types

type Arrival

type Arrival struct {
	Event     *ArrivalEvent `yaml:"event,omitempty" json:"event,omitempty"`
	Watermark string        `yaml:"watermark,omitempty" json:"watermark,omitempty"`
}

Arrival binds an external event to a source dataset advance: when an ingested event matches Event, Watermark (a JSONPath into the event payload) is extracted as the new watermark value.

type ArrivalEvent

type ArrivalEvent struct {
	Type   string            `yaml:"type,omitempty" json:"type,omitempty"`
	Filter map[string]string `yaml:"filter,omitempty" json:"filter,omitempty"`
}

ArrivalEvent is the event pattern a source dataset's arrival binds to. It mirrors the shipped event-trigger matcher shape (type + string filter).

type CacheConfig

type CacheConfig struct {
	Enabled bool
	TTL     time.Duration
	Version int
	// Chain selects how predecessor identity enters this step's cache key:
	// CacheChainTransitive (default, today's behaviour) or CacheChainValues.
	// It layers job -> step exactly like PinDigests, so `metadata.cache.chain`
	// is a job-wide default.
	Chain string
	// TTLNever records the literal `ttl: never`, which suppresses the expiry
	// entirely (nil ExpiresAt) regardless of any inherited TTL default. It is
	// distinct from TTL == 0, which means "inherit / no explicit TTL" and is
	// still subject to the CAESIUM_CACHE_TTL default.
	TTLNever bool
	// PinDigests resolves each step's image tag to its content digest and folds
	// the digest (not the mutable tag) into the cache key, so a moving :latest
	// produces a cache miss rather than a stale hit.
	PinDigests bool
	// DigestTTL bounds how long a resolved tag->digest mapping is reused before
	// re-resolution. It is a perf cache: within the window a moved tag is not
	// re-detected. 0 means "re-resolve every check" (immediate moved-tag
	// detection, at a registry round-trip per check). Defaults to
	// CAESIUM_CACHE_DIGEST_TTL; only meaningful when PinDigests is on.
	DigestTTL time.Duration
}

CacheConfig is the resolved cache configuration for a step.

func ResolveCacheConfig

func ResolveCacheConfig(stepCache, metaCache any, envEnabled bool, envTTL time.Duration, envPinDigests bool, envDigestTTL time.Duration) CacheConfig

ResolveCacheConfig resolves the cache configuration for a step, considering step-level config, job-level defaults, and environment settings.

envPinDigests / envDigestTTL are the global CAESIUM_CACHE_PIN_DIGESTS and CAESIUM_CACHE_DIGEST_TTL defaults; a job- or step-level cache entry overrides them. Resolution is layered env -> job -> step so the most specific declaration wins for each field.

type Callback

type Callback struct {
	Type          string         `yaml:"type" json:"type"`
	Configuration map[string]any `yaml:"configuration" json:"configuration"`
}

Callback defines a job callback (notification, etc.).

type ClaimTemplate

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

ClaimTemplate configures a Kubernetes inline ephemeral PVC claim template.

type Concurrency

type Concurrency struct {
	MaxRuns  int    `yaml:"maxRuns,omitempty" json:"maxRuns,omitempty"`
	Strategy string `yaml:"strategy,omitempty" json:"strategy,omitempty"`
}

Concurrency controls admission of new runs for the same job.

type ConsumedDataset

type ConsumedDataset struct {
	// Name is the dataset identity this step reads.
	Name string `yaml:"name" json:"name"`
	// Schema is the JSON Schema subset this consumer requires from the dataset.
	// Optional: a consumer without a declared schema participates in name-level
	// contract edges only.
	Schema map[string]any `yaml:"schema,omitempty" json:"schema,omitempty"`
}

ConsumedDataset declares a dataset a step reads. Legacy YAML may use a plain scalar name; the object form carries the consumer's required JSON Schema.

func (*ConsumedDataset) UnmarshalJSON

func (c *ConsumedDataset) UnmarshalJSON(data []byte) error

UnmarshalJSON mirrors YAML compatibility for API callers while MarshalJSON uses the struct shape by default.

func (*ConsumedDataset) UnmarshalYAML

func (c *ConsumedDataset) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML accepts the shipped freshness shape (`consumes: [orders]`) and the contract-enforcement object shape (`{name: orders, schema: {...}}`).

type Definition

type Definition struct {
	Schema     string     `yaml:"$schema,omitempty" json:"$schema,omitempty"`
	APIVersion string     `yaml:"apiVersion" json:"apiVersion"`
	Kind       string     `yaml:"kind" json:"kind"`
	Metadata   Metadata   `yaml:"metadata" json:"metadata"`
	Trigger    Trigger    `yaml:"trigger" json:"trigger"`
	Callbacks  []Callback `yaml:"callbacks,omitempty" json:"callbacks,omitempty"`
	Volumes    []Volume   `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Steps      []Step     `yaml:"steps" json:"steps"`
}

Definition models the root job document.

func Parse

func Parse(data []byte) (*Definition, error)

Parse parses YAML bytes into a Definition.

func (*Definition) EffectiveReplaySafeForStep

func (d *Definition) EffectiveReplaySafeForStep(step *Step) bool

EffectiveReplaySafeForStep returns the per-task replay safety value that must be snapshotted when the task run is created. A job-level mark applies to every step; a step-level mark applies only to that step.

func (*Definition) RuntimeSpecForStep

func (d *Definition) RuntimeSpecForStep(step *Step) (container.Spec, error)

RuntimeSpecForStep resolves definition-level fields into the container spec persisted on the step's atom. The returned spec contains only runtime-native data and does not require the worker to reload the original job definition.

func (*Definition) Validate

func (d *Definition) Validate() error

Validate performs semantic validation on the definition.

type FanOut

type FanOut struct {
	From          string `yaml:"from" json:"from"`
	Env           string `yaml:"env,omitempty" json:"env,omitempty"`
	MaxPartitions int    `yaml:"maxPartitions" json:"maxPartitions"`
	MaxParallel   int    `yaml:"maxParallel,omitempty" json:"maxParallel,omitempty"`
	OnEmpty       string `yaml:"onEmpty,omitempty" json:"onEmpty,omitempty"`
	FailurePolicy string `yaml:"failurePolicy,omitempty" json:"failurePolicy,omitempty"`
}

FanOut declares that a step materializes N parallel task instances from a predecessor's ##caesium::partitions marker. It is scheduling metadata and is excluded from the cache identity hash.

type Kueue

type Kueue struct {
	// QueueName is the Kueue LocalQueue (in the pod's namespace) to admit
	// through. It is the value of the `kueue.x-k8s.io/queue-name` label.
	// omitempty keeps the marshaled form symmetric with
	// container.KubernetesSpec.QueueName; an empty value is unreachable through
	// normal parsing because Validate() rejects a blank queueName.
	QueueName string `yaml:"queueName,omitempty" json:"queueName,omitempty"`
}

Kueue declares that a step delegates admission to Kueue. When set on a kubernetes step, Caesium stamps the `kueue.x-k8s.io/queue-name` label on the created pod so Kueue gates scheduling against the named LocalQueue's quota and admits the task only when capacity is available. Caesium never bin-packs or prioritizes itself — it delegates scheduling to Kueue — so this field is pure scheduling metadata and is excluded from the cache identity hash.

type Metadata

type Metadata struct {
	Alias            string            `yaml:"alias" json:"alias"`
	Labels           map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	Annotations      map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
	MaxParallelTasks int               `yaml:"maxParallelTasks,omitempty" json:"maxParallelTasks,omitempty"`
	TaskTimeout      time.Duration     `yaml:"taskTimeout,omitempty" json:"taskTimeout,omitempty"`
	RunTimeout       time.Duration     `yaml:"runTimeout,omitempty" json:"runTimeout,omitempty"`
	Priority         string            `yaml:"priority,omitempty" json:"priority,omitempty"`
	Concurrency      *Concurrency      `yaml:"concurrency,omitempty" json:"concurrency,omitempty"`
	RateLimits       []RateLimit       `yaml:"rateLimits,omitempty" json:"rateLimits,omitempty"`
	// SLA defines the service-level agreement for this job. It supports two
	// modes that may be used independently or together:
	//   duration    — max run duration before an SLA miss alert (relative to
	//                 run start; does not cancel execution).
	//   completedBy — wall-clock time of day ("HH:MM", UTC) by which the job
	//                 must have a successfully completed run. Alerts even if
	//                 no run has started.
	SLA *SLAConfig `yaml:"sla,omitempty" json:"sla,omitempty"`
	// SchemaValidation controls runtime output schema validation.
	// Values: "" (disabled), "warn" (log violations), "fail" (fail task on violation).
	SchemaValidation string `yaml:"schemaValidation,omitempty" json:"schemaValidation,omitempty"`
	// ReplaySafe marks every step in this job as eligible for quarantined replay.
	// The effective per-step value is snapshotted onto TaskRun when the task runs.
	ReplaySafe                   bool              `yaml:"replaySafe,omitempty" json:"replaySafe,omitempty"`
	Cache                        any               `yaml:"cache,omitempty" json:"cache"`
	ServiceAccountName           string            `yaml:"serviceAccountName,omitempty" json:"serviceAccountName,omitempty"`
	PodAnnotations               map[string]string `yaml:"podAnnotations,omitempty" json:"podAnnotations,omitempty"`
	AutomountServiceAccountToken *bool             `yaml:"automountServiceAccountToken,omitempty" json:"automountServiceAccountToken,omitempty"`
	// Datasets declares the external source datasets this job's steps consume.
	// It is scheduling metadata for freshness and does not affect the cache hash.
	Datasets *MetadataDatasets `yaml:"datasets,omitempty" json:"datasets,omitempty"`
	// Remediation declares this job's opt-in to autonomous incident
	// remediation (agent-in-the-loop-remediation Stream E): which
	// AgentProfile to use, which failure classes are in scope, the tiered
	// action catalog the agent (or a deterministic rule) may exercise
	// autonomously, and the escalation fallback. It is server-enforced
	// scheduling/policy metadata, not a step-execution input, and does not
	// affect the cache hash.
	Remediation *MetadataRemediation `yaml:"remediation,omitempty" json:"remediation,omitempty"`
}

Metadata contains descriptive data for the job.

type MetadataDatasets

type MetadataDatasets struct {
	Sources []SourceDataset `yaml:"sources,omitempty" json:"sources,omitempty"`
	// SkipWhenFresh controls P1 cron skipping. Nil means the default: true when a
	// job declares datasets. This is scheduling metadata and does not affect cache
	// identity.
	SkipWhenFresh *bool `yaml:"skipWhenFresh,omitempty" json:"skipWhenFresh,omitempty"`
}

MetadataDatasets is the job-level datasets surface: the external source datasets the job's steps consume plus scheduling controls for freshness.

type MetadataRemediation

type MetadataRemediation struct {
	// Profile references an AgentProfile by name. AgentProfile is
	// server-side state (api/rest/controller/agentprofile), so offline
	// `caesium job lint` cannot verify this reference — it emits a scope
	// note instead. Server-side lint (POST /v1/jobdefs/lint) and the apply
	// transaction both verify it.
	Profile string `yaml:"profile" json:"profile"`
	// Classes lists the failure classes this policy applies to.
	Classes []string `yaml:"classes,omitempty" json:"classes,omitempty"`
	// MaxAttempts bounds how many remediation attempts an incident may take
	// before it force-escalates.
	MaxAttempts int `yaml:"maxAttempts,omitempty" json:"maxAttempts,omitempty"`
	// Autonomy declares which actions may run without a human and under what
	// constraints.
	Autonomy *RemediationAutonomy `yaml:"autonomy,omitempty" json:"autonomy,omitempty"`
	// Escalation configures the forced hand-off when remediation doesn't
	// resolve the incident within Escalation.After.
	Escalation *RemediationEscalation `yaml:"escalation,omitempty" json:"escalation,omitempty"`
}

MetadataRemediation is the job-level opt-in to autonomous incident remediation (docs/design-agent-in-the-loop.md "Declarative policy"). It is policy metadata enforced server-side by the incident manager and executor (Streams A-D); it never participates in step-execution cache identity.

type ProducedDataset

type ProducedDataset struct {
	// Name is the dataset identity (keyed on name in v1; namespace is reserved).
	Name string `yaml:"name" json:"name"`
	// Schema is an inline JSON Schema describing the dataset this step produces.
	Schema map[string]any `yaml:"schema,omitempty" json:"schema,omitempty"`
	// SchemaFrom names a step-local schema source. The only supported value is
	// "output", which reuses this step's outputSchema.
	SchemaFrom string `yaml:"schemaFrom,omitempty" json:"schemaFrom,omitempty"`
	// Version is bumped by authors when an intentional dataset contract break is
	// introduced.
	Version int `yaml:"version,omitempty" json:"version,omitempty"`
	// Freshness is the target staleness SLO as a Go duration string (e.g. "6h").
	Freshness string `yaml:"freshness,omitempty" json:"freshness,omitempty"`
	// MaxStaleness is the hard bound whose breach emits freshness_violated.
	MaxStaleness string `yaml:"maxStaleness,omitempty" json:"maxStaleness,omitempty"`
	// Watermark names the output key this step emits to advance the dataset.
	Watermark *Watermark `yaml:"watermark,omitempty" json:"watermark,omitempty"`
}

ProducedDataset declares a dataset a step produces plus the freshness SLO consumers care about. The SLO fields are scheduling metadata, not execution inputs — they never enter the cache identity hash.

type RateLimit

type RateLimit struct {
	Resource string `yaml:"resource" json:"resource"`
	Limit    int    `yaml:"limit" json:"limit"`
	Window   string `yaml:"window" json:"window"`
}

RateLimit declares a shared resource budget for task scheduling.

type RemediationAutonomy

type RemediationAutonomy struct {
	// Allow lists the actions this job permits to run autonomously (subject
	// to each action's own tier semantics — tier 3 always creates an
	// ApprovalRequest no matter what allow contains).
	Allow []string `yaml:"allow,omitempty" json:"allow,omitempty"`
	// ParamOverrides whitelists the rerun_with_params values allowed per
	// trigger.defaultParams key. Every key must name an existing
	// trigger.defaultParams entry.
	ParamOverrides map[string][]string `yaml:"paramOverrides,omitempty" json:"paramOverrides,omitempty"`
	// PerClass optionally narrows the allow list for a specific failure class.
	PerClass map[string]RemediationClassPolicy `yaml:"perClass,omitempty" json:"perClass,omitempty"`
	// RequireApproval lists actions that must create an ApprovalRequest for
	// this job even if the action's own default tier would otherwise permit
	// autonomous execution.
	RequireApproval []string `yaml:"requireApproval,omitempty" json:"requireApproval,omitempty"`
}

RemediationAutonomy is the tiered-autonomy policy within a remediation block: which actions may execute without a human, the whitelist of rerun_with_params overrides, per-class narrowing, and which actions always require approval regardless of tier.

type RemediationClassPolicy

type RemediationClassPolicy struct {
	Allow []string `yaml:"allow,omitempty" json:"allow,omitempty"`
}

RemediationClassPolicy narrows the allowed action set for one failure class, e.g. metadata.remediation.autonomy.perClass.auth_failure.allow.

type RemediationEscalation

type RemediationEscalation struct {
	// Channel names a NotificationChannel (server-side state; unverified by
	// offline lint, same posture as Profile).
	Channel string `yaml:"channel,omitempty" json:"channel,omitempty"`
	// After is the wall-clock cap, as a Go duration string, before the
	// incident is force-escalated to Channel.
	After string `yaml:"after,omitempty" json:"after,omitempty"`
}

RemediationEscalation configures the forced hand-off when remediation does not resolve an incident within the wall-clock cap.

type SLAConfig

type SLAConfig struct {
	// Duration is the maximum time a run may take before an SLA miss alert is
	// emitted, measured from the run's start time. Does not cancel execution.
	Duration time.Duration `yaml:"duration,omitempty" json:"duration,omitempty"`

	// CompletedBy is a wall-clock time of day in "HH:MM" format (UTC) by
	// which the job must have a successfully completed run. If no run has
	// completed by this time, an SLA miss alert is emitted — even if the job
	// was never triggered.
	CompletedBy string `yaml:"completedBy,omitempty" json:"completedBy,omitempty"`
}

SLAConfig defines the service-level agreement for a job.

func (*SLAConfig) HasSLA

func (s *SLAConfig) HasSLA() bool

HasSLA returns true if any SLA constraint is configured.

type SourceDataset

type SourceDataset struct {
	Name          string   `yaml:"name" json:"name"`
	ExpectedEvery string   `yaml:"expectedEvery,omitempty" json:"expectedEvery,omitempty"`
	Arrival       *Arrival `yaml:"arrival,omitempty" json:"arrival,omitempty"`
	// External marks the dataset as intentionally produced outside Caesium so
	// the cross-job lint does not demand a producing job.
	External bool `yaml:"external,omitempty" json:"external,omitempty"`
}

SourceDataset declares an external dataset nobody in Caesium produces — the upstream a consuming step depends on. expectedEvery is a cadence expectation; a late arrival surfaces as stale-upstream rather than a failed run.

type Step

type Step struct {
	Name         string            `yaml:"name" json:"name"`
	Type         string            `yaml:"type,omitempty" json:"type,omitempty"`
	Engine       string            `yaml:"engine,omitempty" json:"engine,omitempty"`
	Image        string            `yaml:"image" json:"image"`
	Command      []string          `yaml:"command,omitempty" json:"command,omitempty"`
	NodeSelector map[string]string `yaml:"nodeSelector,omitempty" json:"nodeSelector,omitempty"`
	Next         []string          `yaml:"next,omitempty" json:"next,omitempty"`
	DependsOn    []string          `yaml:"dependsOn,omitempty" json:"dependsOn,omitempty"`
	Retries      int               `yaml:"retries,omitempty" json:"retries,omitempty"`
	RetryDelay   time.Duration     `yaml:"retryDelay,omitempty" json:"retryDelay,omitempty"`
	RetryBackoff bool              `yaml:"retryBackoff,omitempty" json:"retryBackoff,omitempty"`
	TriggerRule  string            `yaml:"triggerRule,omitempty" json:"triggerRule,omitempty"`
	// ReplaySafe marks this step as eligible for quarantined replay. It is
	// control-plane metadata, not a runtime input or cache identity field.
	ReplaySafe                   bool              `yaml:"replaySafe,omitempty" json:"replaySafe,omitempty"`
	VolumeMounts                 []VolumeMount     `yaml:"volumeMounts,omitempty" json:"volumeMounts,omitempty"`
	ServiceAccountName           string            `yaml:"serviceAccountName,omitempty" json:"serviceAccountName,omitempty"`
	PodAnnotations               map[string]string `yaml:"podAnnotations,omitempty" json:"podAnnotations,omitempty"`
	AutomountServiceAccountToken *bool             `yaml:"automountServiceAccountToken,omitempty" json:"automountServiceAccountToken,omitempty"`
	// Kueue delegates this step's admission to a Kueue LocalQueue (kubernetes
	// engine only). It is scheduling metadata and does not affect the cache hash.
	Kueue *Kueue `yaml:"kueue,omitempty" json:"kueue,omitempty"`
	// RateLimit references a job-level shared resource budget for this step.
	// It is scheduling metadata and does not affect the cache hash.
	RateLimit *StepRateLimit `yaml:"rateLimit,omitempty" json:"rateLimit,omitempty"`
	// FanOut materializes N parallel instances from a predecessor's partition
	// marker. Scheduling metadata; excluded from the cache identity hash.
	FanOut *FanOut `yaml:"fanOut,omitempty" json:"fanOut,omitempty"`
	// OutputSchema is a JSON Schema describing this step's expected output keys.
	OutputSchema map[string]any `yaml:"outputSchema,omitempty" json:"outputSchema,omitempty"`
	// InputSchema maps predecessor step names to JSON Schema fragments describing
	// which keys this step requires from each predecessor's output.
	InputSchema map[string]map[string]any `yaml:"inputSchema,omitempty" json:"inputSchema,omitempty"`
	// Datasets declares the datasets this step consumes and produces. It is
	// scheduling metadata for freshness and does not affect the cache hash.
	Datasets       *StepDatasets `yaml:"datasets,omitempty" json:"datasets,omitempty"`
	Cache          any           `yaml:"cache,omitempty" json:"cache"`
	container.Spec `yaml:",inline" json:",inline"`
}

Step defines an execution step.

func (*Step) UnmarshalJSON

func (s *Step) UnmarshalJSON(data []byte) error

UnmarshalJSON mirrors the YAML defaults so REST/UI JSON apply requests behave the same as YAML manifests loaded from disk.

func (*Step) UnmarshalYAML

func (s *Step) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML sets defaults while deserialising a step.

type StepDatasets

type StepDatasets struct {
	Consumes []ConsumedDataset `yaml:"consumes,omitempty" json:"consumes,omitempty"`
	Produces []ProducedDataset `yaml:"produces,omitempty" json:"produces,omitempty"`
}

StepDatasets is the per-step datasets surface: the datasets a step consumes and the datasets it produces (with their freshness SLOs).

type StepRateLimit

type StepRateLimit struct {
	Resource string `yaml:"resource" json:"resource"`
	Units    int    `yaml:"units" json:"units"`
}

StepRateLimit declares the units of a job-level rate limit a step consumes.

type TmpfsSource

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

TmpfsSource configures a Docker/Podman tmpfs source.

type Trigger

type Trigger struct {
	Type          string            `yaml:"type" json:"type"`
	Configuration map[string]any    `yaml:"configuration" json:"configuration"`
	DefaultParams map[string]string `yaml:"defaultParams,omitempty" json:"defaultParams,omitempty"`
}

Trigger defines how the job is triggered.

type Volume

type Volume struct {
	Name       string                  `yaml:"name" json:"name"`
	Source     *VolumeSource           `yaml:"source,omitempty" json:"source,omitempty"`
	Sources    map[string]VolumeSource `yaml:"sources,omitempty" json:"sources,omitempty"`
	AccessMode string                  `yaml:"accessMode,omitempty" json:"accessMode,omitempty"`
}

Volume declares a named BYO storage source that steps can mount by name.

type VolumeMount

type VolumeMount struct {
	Volume   string `yaml:"volume" json:"volume"`
	Path     string `yaml:"path" json:"path"`
	ReadOnly bool   `yaml:"readOnly,omitempty" json:"readOnly,omitempty"`
	SubPath  string `yaml:"subPath,omitempty" json:"subPath,omitempty"`
}

VolumeMount references a job-level volume from a step.

type VolumeSource

type VolumeSource struct {
	PVC           string         `yaml:"pvc,omitempty" json:"pvc,omitempty"`
	ClaimTemplate *ClaimTemplate `yaml:"claimTemplate,omitempty" json:"claimTemplate,omitempty"`
	VolumeSource  map[string]any `yaml:"volumeSource,omitempty" json:"volumeSource,omitempty"`
	Bind          string         `yaml:"bind,omitempty" json:"bind,omitempty"`
	Volume        string         `yaml:"volume,omitempty" json:"volume,omitempty"`
	Tmpfs         *TmpfsSource   `yaml:"tmpfs,omitempty" json:"tmpfs,omitempty"`
}

VolumeSource describes one concrete engine-specific source kind.

type Watermark

type Watermark struct {
	Key string `yaml:"key,omitempty" json:"key,omitempty"`
}

Watermark identifies the ##caesium::output key a producing step emits to advance its dataset. It is not a JSONPath — it names an output key on the existing zero-SDK output contract (echo '##caesium::output {"<key>": ...}').

Directories

Path Synopsis
Package schemacompat compares the pragmatic JSON Schema subset Caesium uses for cross-job contract enforcement.
Package schemacompat compares the pragmatic JSON Schema subset Caesium uses for cross-job contract enforcement.

Jump to

Keyboard shortcuts

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