Skip to content

Commit

Permalink
Update aggregate worker metadata with prefect-kubernetes v0.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Feb 24, 2025
1 parent bd5674e commit f322e2e
Showing 1 changed file with 111 additions and 51 deletions.
162 changes: 111 additions & 51 deletions views/aggregate-worker-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1561,30 +1561,30 @@
"apiVersion": "batch/v1",
"kind": "Job",
"metadata": {
"generateName": "{{ name }}-",
"labels": "{{ labels }}",
"namespace": "{{ namespace }}",
"generateName": "{{ name }}-"
"namespace": "{{ namespace }}"
},
"spec": {
"backoffLimit": 0,
"ttlSecondsAfterFinished": "{{ finished_job_ttl }}",
"template": {
"spec": {
"parallelism": 1,
"completions": 1,
"restartPolicy": "Never",
"serviceAccountName": "{{ service_account_name }}",
"containers": [
{
"name": "prefect-job",
"args": "{{ command }}",
"env": "{{ env }}",
"image": "{{ image }}",
"imagePullPolicy": "{{ image_pull_policy }}",
"args": "{{ command }}"
"name": "prefect-job"
}
]
],
"parallelism": 1,
"restartPolicy": "Never",
"serviceAccountName": "{{ service_account_name }}"
}
}
},
"ttlSecondsAfterFinished": "{{ finished_job_ttl }}"
}
},
"cluster_config": "{{ cluster_config }}",
Expand All @@ -1594,118 +1594,178 @@
},
"variables": {
"description": "Default variables for the Kubernetes worker.\n\nThe schema for this class is used to populate the `variables` section of the default\nbase job template.",
"type": "object",
"properties": {
"name": {
"title": "Name",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Name given to infrastructure created by a worker.",
"type": "string"
"title": "Name"
},
"env": {
"title": "Environment Variables",
"description": "Environment variables to set when starting a flow run.",
"type": "object",
"additionalProperties": {
"type": "string"
}
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"description": "Environment variables to set when starting a flow run.",
"title": "Environment Variables",
"type": "object"
},
"labels": {
"title": "Labels",
"description": "Labels applied to infrastructure created by a worker.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"description": "Labels applied to infrastructure created by a worker.",
"title": "Labels",
"type": "object"
},
"command": {
"title": "Command",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The command to use when starting a flow run. In most cases, this should be left blank and the command will be automatically generated by the worker.",
"type": "string"
"title": "Command"
},
"namespace": {
"title": "Namespace",
"description": "The Kubernetes namespace to create jobs within.",
"default": "default",
"description": "The Kubernetes namespace to create jobs within.",
"title": "Namespace",
"type": "string"
},
"image": {
"title": "Image",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The image reference of a container image to use for created jobs. If not set, the latest Prefect image will be used.",
"example": "docker.io/prefecthq/prefect:2-latest",
"type": "string"
"examples": [
"docker.io/prefecthq/prefect:3-latest"
],
"title": "Image"
},
"service_account_name": {
"title": "Service Account Name",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The Kubernetes service account to use for job creation.",
"type": "string"
"title": "Service Account Name"
},
"image_pull_policy": {
"title": "Image Pull Policy",
"description": "The Kubernetes image pull policy to use for job containers.",
"default": "IfNotPresent",
"description": "The Kubernetes image pull policy to use for job containers.",
"enum": [
"IfNotPresent",
"Always",
"Never"
],
"title": "Image Pull Policy",
"type": "string"
},
"finished_job_ttl": {
"title": "Finished Job TTL",
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "The number of seconds to retain jobs after completion. If set, finished jobs will be cleaned up by Kubernetes after the given delay. If not set, jobs will be retained indefinitely.",
"type": "integer"
"title": "Finished Job TTL"
},
"job_watch_timeout_seconds": {
"title": "Job Watch Timeout Seconds",
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of seconds to wait for each event emitted by a job before timing out. If not set, the worker will wait for each event indefinitely.",
"type": "integer"
"title": "Job Watch Timeout Seconds"
},
"pod_watch_timeout_seconds": {
"title": "Pod Watch Timeout Seconds",
"description": "Number of seconds to watch for pod creation before timing out.",
"default": 60,
"description": "Number of seconds to watch for pod creation before timing out.",
"title": "Pod Watch Timeout Seconds",
"type": "integer"
},
"stream_output": {
"title": "Stream Output",
"description": "If set, output will be streamed from the job to local standard output.",
"default": true,
"description": "If set, output will be streamed from the job to local standard output.",
"title": "Stream Output",
"type": "boolean"
},
"cluster_config": {
"title": "Cluster Config",
"description": "The Kubernetes cluster config to use for job creation.",
"allOf": [
"anyOf": [
{
"$ref": "#/definitions/KubernetesClusterConfig"
},
{
"type": "null"
}
]
],
"default": null,
"description": "The Kubernetes cluster config to use for job creation."
}
},
"type": "object",
"definitions": {
"KubernetesClusterConfig": {
"title": "KubernetesClusterConfig",
"block_schema_references": {},
"block_type_slug": "kubernetes-cluster-config",
"description": "Stores configuration for interaction with Kubernetes clusters.\n\nSee `from_file` for creation.",
"type": "object",
"properties": {
"config": {
"title": "Config",
"description": "The entire contents of a kubectl config file.",
"title": "Config",
"type": "object"
},
"context_name": {
"title": "Context Name",
"description": "The name of the kubectl context to use.",
"title": "Context Name",
"type": "string"
}
},
"required": [
"config",
"context_name"
],
"block_type_slug": "kubernetes-cluster-config",
"secret_fields": [],
"block_schema_references": {}
"title": "KubernetesClusterConfig",
"type": "object"
}
}
}
Expand Down

0 comments on commit f322e2e

Please sign in to comment.