prefect_kubernetes.jobs
Module to define tasks for interacting with Kubernetes jobs.
Functions
create_namespaced_job
kubernetes_credentials:KubernetesCredentialsblock holding authentication needed to generate the required API client.new_job: A KubernetesV1Jobspecification.namespace: The Kubernetes namespace to create this job in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty"\: "...", "dry_run"\: "..."}).
- A Kubernetes
V1Jobobject.
delete_namespaced_job
kubernetes_credentials:KubernetesCredentialsblock holding authentication needed to generate the required API client.job_name: The name of a job to delete.delete_options: A KubernetesV1DeleteOptionsobject.namespace: The Kubernetes namespace to delete this job in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty"\: "...", "dry_run"\: "..."}).
- A Kubernetes
V1Statusobject.
list_namespaced_job
kubernetes_credentials:KubernetesCredentialsblock holding authentication needed to generate the required API client.namespace: The Kubernetes namespace to list jobs from.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty"\: "...", "dry_run"\: "..."}).
- A Kubernetes
V1JobListobject.
patch_namespaced_job
kubernetes_credentials: KubernetesCredentials block holding authentication needed to generate the required API client.job_name: The name of a job to patch.job_updates: A KubernetesV1Jobspecification.namespace: The Kubernetes namespace to patch this job in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty"\: "...", "dry_run"\: "..."}).
ValueError: ifjob_nameisNone.
- A Kubernetes
V1Jobobject.
read_namespaced_job
kubernetes_credentials:KubernetesCredentialsblock holding authentication needed to generate the required API client.job_name: The name of a job to read.namespace: The Kubernetes namespace to read this job in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty"\: "...", "dry_run"\: "..."}).
ValueError: ifjob_nameisNone.
- A Kubernetes
V1Jobobject.
replace_namespaced_job
kubernetes_credentials:KubernetesCredentialsblock holding authentication needed to generate the required API client.job_name: The name of a job to replace.new_job: A KubernetesV1Jobspecification.namespace: The Kubernetes namespace to replace this job in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty"\: "...", "dry_run"\: "..."}).
- A Kubernetes
V1Jobobject.
read_namespaced_job_status
kubernetes_credentials:KubernetesCredentialsblock holding authentication needed to generate the required API client.job_name: The name of a job to fetch status for.namespace: The Kubernetes namespace to fetch status of job in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API (e.g.{"pretty"\: "...", "dry_run"\: "..."}).
- A Kubernetes
V1JobStatusobject.
Classes
KubernetesJobRun
A container representing a run of a Kubernetes job.
Methods:
afetch_result
- The logs from each of the pods in the job.
ValueError: If this method is called when the job has a non-terminal state.
await_for_completion
delete_after_completion set to True,
the job will be deleted if it is observed by this method
to enter a completed state.
Raises:
RuntimeError: If the Kubernetes job fails.KubernetesJobTimeoutError: If the Kubernetes job times out.
fetch_result
- The logs from each of the pods in the job.
ValueError: If this method is called when the job has a non-terminal state.
v1_job_model
wait_for_completion
delete_after_completion set to True,
the job will be deleted if it is observed by this method
to enter a completed state.
Raises:
RuntimeError: If the Kubernetes job fails.KubernetesJobTimeoutError: If the Kubernetes job times out.
KubernetesJob
A block representing a Kubernetes job configuration.
Methods:
atrigger
KubernetesJobRun object.
from_yaml_file
KubernetesJob from a YAML file.
Args:
manifest_path: The YAML file to create theKubernetesJobfrom.
- A KubernetesJob object.
trigger
KubernetesJobRun object.