runtraj.execution.KubernetesConfig#

class runtraj.execution.KubernetesConfig(*, image: str | None = None, completions: Annotated[int, Ge(ge=1)] = 1, parallelism: Annotated[int | None, Ge(ge=1)] = None, cpus: Annotated[int, Ge(ge=1)] = 1, memory: str | None = None, namespace: str | None = None, inputs: str | None = None, volumes: list[runtraj.execution.config.Volume] = <factory>, secrets: list[str] = <factory>, service_account: str | None = None, active_deadline_seconds: Annotated[int | None, Ge(ge=1)] = None, fetch: bool = False) → None[source]#

The Kubernetes indexed Job a project’s releases run as: the kubernetes block of execution.

The releases are split among completions tasks, each a pod that runs cpus of them at once. The settings use Kubernetes’ own names and units. image is required: runtraj publishes no image, since an image has to carry the transport model (HYSPLIT’s hycs_std) and the stages a project names.

Parameters#

Parameter

Description

Default

image

Container image of the pods, with runtraj, the transport model and the project’s stages. Required with backend: kubernetes.

None

completions

Number of tasks (pods to complete), which the releases are split evenly among.

1

parallelism

Most pods running at once. Unset runs every task at once.

None

cpus

Releases each pod runs at once, and the CPUs each pod requests.

1

memory

Memory each pod requests, and its limit, in Kubernetes’ binary units such as 8Gi or 512Mi.

None

namespace

Namespace of the Job. Unset is kubectl’s current one.

None

inputs

Bucket URL the project’s inputs (config.yaml, releases.csv, tables/, sites.csv) are copied to at submit, such as s3://bucket/projects/my_project; each pod copies them back. Unset, the pods open the project folder at the path it has here, so it must be on a volume they mount at that path.

None

volumes

PersistentVolumeClaims mounted in every pod (Volume), such as the met archive.

[]

secrets

Secrets whose keys become each pod’s environment variables, such as a bucket’s credentials.

[]

service_account

Service account of the pods, on a cluster that grants bucket access through one.

None

active_deadline_seconds

Seconds the whole Job may run before Kubernetes stops it. Unset lets it run as long as its simulations take.

None

fetch

Get the met files once, before the pods run, for a met with download whose directory is on a volume every pod mounts: each pod first gets the files of every unfinished simulation, one pod at a time (a lock where the inputs are), so the first downloads them and the others find them. Leave it false when each pod has its own met directory.

False