Expand description
Argo Workflows API types — a hand-owned, curated subset.
We only emit a narrow, stable slice of Argo (WorkflowTemplate/Workflow;
templates with container/dag/steps; artifacts/volumes/params/
nodeSelector/SA). These are plain serde structs (no protobuf/prost):
the IDL bought us nothing here, and conformance is guarded empirically
by the kind e2e (scripts/e2e-test.sh) running against a real Argo.
Serialization rules (so the emitted YAML is Argo-correct):
every struct is rename_all = "camelCase", every field is
skip_serializing_if = "ser::skip" (omit empties) + default (for
round-trip deserialization).
Also re-exports the munge module of pure name/path/env-var
derivers shared between cargo-athena-core (emit side) and
cargo-athena-macros (proc-macro / user-build side). Living here
lets the proc-macro crate depend on api for these helpers
without pulling in any runtime-only crates (kube, reqwest, etc.),
so both sides compute the same string for the same input by
construction rather than via mirrored copies + pin tests.
Modules§
- munge
- Pure name / path / env-var derivers shared by
cargo-athena-core(emit side) andcargo-athena-macros(proc-macro / user-build side). - ser
skip_serializing_ifsupport: one generic “is this empty?” predicate so every field can share#[serde(skip_serializing_if = "ser::skip")].
Structs§
- Archive
Strategy - Arguments
- Artifact
- Backoff
- Exponential back-off between retries.
- Container
- Continue
On - Proceed to dependents even if this task fails/errors.
- DagTask
- DagTemplate
- Empty
DirVolume Source - Present (and empty) => a pod-scoped scratch dir (
emptyDir: {}). - EnvVar
- EnvVar
Source - Argo
EnvVarSource. OnlysecretKeyRefis exposed today; this can grow as we surface more (configMapKeyRef, fieldRef, …). - Host
Path Volume Source - Inputs
- Lifecycle
Hook - A hook that runs a template on a lifecycle event.
expressionempty == the specialexithook (runs on completion). - Local
Object Reference - K8s
LocalObjectReference— just a Secret name in the workflow’s own namespace. Argo’sImagePullSecretsis[]LocalObjectReference. - Mutex
- Argo
Mutex: a named lock.namespacedefaults to the workflow’s namespace if empty (perworkflow/sync/lock_name.go:58-67); set it to coordinate across namespaces (lock key becomes<namespace>/Mutex/<name>). - None
Strategy - Object
Meta - Outputs
- Parameter
- Persistent
Volume Claim WorkflowSpec.volumeClaimTemplates[]entry: a PVC Argo dynamically creates per workflow run (and deletes when it finishes). Athena emits one per#[ephemeral_pvc]reachable from the submitted root.- Persistent
Volume Claim Spec - Persistent
Volume Claim Volume Source - PodGc
- Argo
podGC: when to delete the Workflow’s pods. - Retry
Strategy - Argo
retryStrategy: re-run the template on failure. Nillimit== unlimited;retry_policyempty == Argo default (OnFailure). - S3Artifact
- Mirrors Argo’s S3Artifact.
- Secret
KeySelector - Mirrors a k8s SecretKeySelector — a key in a Secret.
optionalis K8s’s “don’t fail pod-start if missing” flag, surfaced bycargo_athena::secret_opt!(skip-serialized when false, so existing S3Artifact users stay byte-identical). - Security
Context - K8s
SecurityContexton a container. Minimal: only the fields we expose. Each field skip-serializes its default so the produced YAML stays terse. - Synchronization
- Argo
Synchronization: workflow- or template-scoped mutex / semaphore registry. We surface mutexes only (semaphores TBD);database(Argo’s per-cluster mutex DB toggle) is deferred. - Template
- Template
Ref - A DAG task’s reference to a template in another WorkflowTemplate.
- Toleration
- K8s
Toleration: tolerate a node taint. Operator ∈"Equal" | "Exists"; effect ∈"NoSchedule" | "PreferNoSchedule" | "NoExecute".valueis required only when operator isEqual;toleration_secondsonly meaningful forNoExecute. - TtlStrategy
- Argo
ttlStrategy: delete the finished Workflow after the given seconds. Each bound is independent (#[…(ttl(after_completion=…, after_success=…, after_failure=…))]). - Value
From - Volume
- Volume
Mount - Volume
Resource Requirements PersistentVolumeClaimSpec.resources— onlyrequests.storagematters for a PVC; we don’t modellimitshere. The k8s API field isresources: ResourceRequirements; this is a trimmed shape that serializes identically.- Workflow
- Workflow
Spec - Workflow
Template - A reusable, independently-addressable template resource. Every
#[workflow]/#[container]emits one; cross-template calls reference it by name viaTemplateRef. - Workflow
Template Ref - Points a runnable Workflow at a WorkflowTemplate resource.
Constants§
- API_
VERSION - Argo’s
apiVersionforWorkflow/WorkflowTemplateresources. - KIND_
WORKFLOW - Argo’s
kindforWorkflowresources. - KIND_
WORKFLOW_ TEMPLATE - Argo’s
kindforWorkflowTemplateresources.