Skip to main content

Crate cargo_athena_api

Crate cargo_athena_api 

Source
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) and cargo-athena-macros (proc-macro / user-build side).
ser
skip_serializing_if support: one generic “is this empty?” predicate so every field can share #[serde(skip_serializing_if = "ser::skip")].

Structs§

ArchiveStrategy
Arguments
Artifact
Backoff
Exponential back-off between retries.
Container
ContinueOn
Proceed to dependents even if this task fails/errors.
DagTask
DagTemplate
EmptyDirVolumeSource
Present (and empty) => a pod-scoped scratch dir (emptyDir: {}).
EnvVar
EnvVarSource
Argo EnvVarSource. Only secretKeyRef is exposed today; this can grow as we surface more (configMapKeyRef, fieldRef, …).
HostPathVolumeSource
Inputs
LifecycleHook
A hook that runs a template on a lifecycle event. expression empty == the special exit hook (runs on completion).
LocalObjectReference
K8s LocalObjectReference — just a Secret name in the workflow’s own namespace. Argo’s ImagePullSecrets is []LocalObjectReference.
Mutex
Argo Mutex: a named lock. namespace defaults to the workflow’s namespace if empty (per workflow/sync/lock_name.go:58-67); set it to coordinate across namespaces (lock key becomes <namespace>/Mutex/<name>).
NoneStrategy
ObjectMeta
Outputs
Parameter
PersistentVolumeClaim
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.
PersistentVolumeClaimSpec
PersistentVolumeClaimVolumeSource
PodGc
Argo podGC: when to delete the Workflow’s pods.
RetryStrategy
Argo retryStrategy: re-run the template on failure. Nil limit == unlimited; retry_policy empty == Argo default (OnFailure).
S3Artifact
Mirrors Argo’s S3Artifact.
SecretKeySelector
Mirrors a k8s SecretKeySelector — a key in a Secret. optional is K8s’s “don’t fail pod-start if missing” flag, surfaced by cargo_athena::secret_opt! (skip-serialized when false, so existing S3Artifact users stay byte-identical).
SecurityContext
K8s SecurityContext on 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
TemplateRef
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". value is required only when operator is Equal; toleration_seconds only meaningful for NoExecute.
TtlStrategy
Argo ttlStrategy: delete the finished Workflow after the given seconds. Each bound is independent (#[…(ttl(after_completion=…, after_success=…, after_failure=…))]).
ValueFrom
Volume
VolumeMount
VolumeResourceRequirements
PersistentVolumeClaimSpec.resources — only requests.storage matters for a PVC; we don’t model limits here. The k8s API field is resources: ResourceRequirements; this is a trimmed shape that serializes identically.
Workflow
WorkflowSpec
WorkflowTemplate
A reusable, independently-addressable template resource. Every #[workflow]/#[container] emits one; cross-template calls reference it by name via TemplateRef.
WorkflowTemplateRef
Points a runnable Workflow at a WorkflowTemplate resource.

Constants§

API_VERSION
Argo’s apiVersion for Workflow/WorkflowTemplate resources.
KIND_WORKFLOW
Argo’s kind for Workflow resources.
KIND_WORKFLOW_TEMPLATE
Argo’s kind for WorkflowTemplate resources.