Skip to main content

WorkflowSpec

Struct WorkflowSpec 

Source
pub struct WorkflowSpec {
Show 18 fields pub entrypoint: String, pub templates: Vec<Template>, pub arguments: Option<Arguments>, pub workflow_template_ref: Option<WorkflowTemplateRef>, pub service_account_name: String, pub node_selector: BTreeMap<String, String>, pub hooks: BTreeMap<String, LifecycleHook>, pub ttl_strategy: Option<TtlStrategy>, pub pod_gc: Option<PodGc>, pub active_deadline_seconds: Option<i64>, pub synchronization: Option<Synchronization>, pub priority: Option<i32>, pub tolerations: Vec<Toleration>, pub affinity: Option<Value>, pub pod_spec_patch: Option<String>, pub image_pull_secrets: Vec<LocalObjectReference>, pub parallelism: Option<i64>, pub volume_claim_templates: Vec<PersistentVolumeClaim>,
}

Fields§

§entrypoint: String§templates: Vec<Template>§arguments: Option<Arguments>§workflow_template_ref: Option<WorkflowTemplateRef>

Set on a runnable Workflow that just invokes a WorkflowTemplate.

§service_account_name: String§node_selector: BTreeMap<String, String>

Root-scoped pod scheduling for the submitted Workflow (Argo applies it to every pod). Only cargo athena submit --node-selector sets this; emit never does (skip-empty ⇒ existing goldens unaffected).

§hooks: BTreeMap<String, LifecycleHook>

Whole-workflow lifecycle hooks. Key exit is the exit handler (runs once when the Workflow finishes). We use this (with a templateRef) rather than the legacy spec.onExit string, which only resolves a local template name — unusable across the one-WT-per-template wormhole.

§ttl_strategy: Option<TtlStrategy>

Workflow-scoped TTL GC (#[…(ttl(..))]).

§pod_gc: Option<PodGc>

Workflow-scoped pod GC (#[…(pod_gc(strategy=..))]). camelCase of pod_gc is podGc, but Argo’s field is podGC — the argo! macro forwards this explicit rename ahead of its rename_all, so it wins.

§active_deadline_seconds: Option<i64>

Root-scoped Argo WorkflowSpec.activeDeadlineSeconds — the genuine whole-workflow runtime cap, from #[…(active_deadline_if_root=..)]. (int64 in Argo; camelCase of the field name already matches.) skip-empty ⇒ existing goldens stay byte-identical.

§synchronization: Option<Synchronization>

Root-scoped Synchronization — workflow-level mutexes (#[…(mutexes_if_root = [{ name = … }])]). Argo’s sync manager keys on <ns>/Mutex/<name> globally per controller, so two SEPARATE Workflow runs (not just templateRef’d sub-workflows in one run) contend on the same name — empirically verified on v4.0.5, holder key <ns>/<wf>.

§priority: Option<i32>

Workflow priority (int32). The Argo controller schedules higher-priority workflows first when its parallelism limit is hit. Today only cargo athena submit --priority sets this; emit never does (skip-empty ⇒ existing goldens stay byte-identical). A future #[workflow(priority_if_root=N)] would land here too (spec-scoped, hence the _if_root convention).

§tolerations: Vec<Toleration>

Root-scoped tolerations (3rd tier of Argo’s tmpl → boundary → wfSpec pod-scheduling lookup). From #[…(tolerations_if_root = [...])]. Applies to every pod in the run that doesn’t have its own template- or boundary-level override (same cascade as node_selector).

§affinity: Option<Value>

Root-scoped pod affinity (3rd tier). Opaque YAML/JSON value from #[…(affinity_if_root = "...")]; athena does NOT model the deeply-nested apiv1.Affinity schema by design.

§pod_spec_patch: Option<String>

Root-scoped strategic-merge patch applied to every pod in the run after Argo renders the podSpec. From #[workflow(pod_spec_patch_if_root = "...")]. Substituted at pod-creation time (workflow/controller/workflowpod.go:89 processPodSpecPatchProcessArgs) so {{workflow.parameters.X}} resolves; per-template Template.pod_spec_patch is concat’d onto this one. The universal escape hatch for any podSpec field athena hasn’t lifted to a first-class attr.

§image_pull_secrets: Vec<LocalObjectReference>

Root-only WorkflowSpec.ImagePullSecrets — Secret references the kubelet uses to authenticate against private image registries when pulling each pod’s image. From #[…(image_pull_secrets_if_root = ["regcred", ...])]. K8s/Argo expose this only at workflow scope (no per-template knob); per-container needs go through pod_spec_patch. skip-empty ⇒ existing goldens stay byte-identical.

§parallelism: Option<i64>

Root-scoped pod-concurrency cap. From #[workflow(parallelism_if_root = N)]. Argo’s CRD enforces +kubebuilder:validation:Minimum=1 so the macro rejects <= 0 at compile time (would otherwise be rejected by the API server at submit anyway).

§volume_claim_templates: Vec<PersistentVolumeClaim>

PVCs Argo creates per workflow run and deletes when it finishes. One entry per #[ephemeral_pvc] type reachable from the submitted root. Each pod mounts them via claimName: <metadata.name>. Root-only by Argo’s design (only the submitted Workflow’s spec is honored).

Trait Implementations§

Source§

impl Clone for WorkflowSpec

Source§

fn clone(&self) -> WorkflowSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkflowSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WorkflowSpec

Source§

fn default() -> WorkflowSpec

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for WorkflowSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for WorkflowSpec

Source§

fn eq(&self, other: &WorkflowSpec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for WorkflowSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for WorkflowSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.