Patricio Navarro
07/23/2024, 10:09 AMMarvin
07/23/2024, 10:09 AMprefect work-pool
commands to list and inspect your work pools.
- Set concurrency limits with set-concurrency-limit
and clear them with clear-concurrency-limit
.
- Configure advanced settings like work queue priorities and specific concurrency limits per queue.
For specific examples and configuration, please check the relevant sections in the documentation:
- Work Pools
- Managed ExecutionMarvin
07/23/2024, 10:12 AMI have the following base job template:```{ "variables": { "type": "object", "properties": { "env": { "type": "object", "title": "Environment Variables", "description": "Environment variables to set when starting a flow run.", "additionalProperties": { "type": "string" } }, "name": { "type": "string", "title": "Name", "default": "prefect-infra", "description": "Name given to infrastructure created by a worker." }, "image": { "type": "string", "title": "Image", "example": "docker.io/prefecthq/prefect:2-latest", "description": "The image reference of a container image to use for created jobs. If not set, the latest Prefect image will be used." }, "labels": { "type": "object", "title": "Labels", "description": "Labels applied to infrastructure created by a worker.", "additionalProperties": { "type": "string" } }, "command": { "type": "string", "title": "Command", "description": "The command to use when starting a flow run. In most cases, this
Patricio Navarro
07/23/2024, 10:15 AM...
"definitions": {
"KubernetesClusterConfig": {
"type": "object",
"title": "KubernetesClusterConfig",
"required": [
"config",
"context_name"
],
"properties": {
"config": {
"type": "object",
"title": "Config",
"description": "The entire contents of a kubectl config file."
},
"context_name": {
"type": "string",
"title": "Context Name",
"description": "The name of the kubectl context to use."
}
},
"description": "Stores configuration for interaction with Kubernetes clusters.\n\nSee `from_file` for creation.",
"secret_fields": [],
"block_type_slug": "kubernetes-cluster-config",
"block_schema_references": {}
}
},
"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."
},
...
Can you modify it to include :
• Run only in nodegroup "nodegroup-prefect"
• Memory request: 1GB
• Memory limit: 2GB
• CPU request: 0.2
• CPU limit : 1Marvin
07/23/2024, 10:15 AMKubernetesClusterConfig
to include the configuration requirements. Here is the modified code snippet for your job template:
{
"definitions": {
"KubernetesClusterConfig": {
"type": "object",
"title": "KubernetesClusterConfig",
"required": [
"config",
"context_name"
],
"properties": {
"config": {
"type": "object",
"title": "Config",
"description": "The entire contents of a kubectl config file."
},
"context_name": {
"type": "string",
"title": "Context Name",
"description": "The name of the kubectl context to use."
}
},
"description": "Stores configuration for interaction with Kubernetes clusters.\n\nSee `from_file` for creation.",
"secret_fields": [],
"block_type_slug": "kubernetes-cluster-config",
"block_schema_references": {}
}
},
"properties": {
"template": {
"type": "object",
"properties": {
"spec": {
"type": "object",
"properties": {
"template": {
"type": "object",
"properties": {
"spec": {
"type": "object",
"properties": {
"nodeSelector": {
"type": "object",
"properties": {
"<http://kubernetes.io/nodegroup|kubernetes.io/nodegroup>": {
"type": "string",
"default": "nodegroup-prefect"
}
}
},
"containers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"resources": {
"type": "object",
"properties": {
"requests": {
"type": "object",
"properties": {
"memory": {
"type": "string",
"default": "1Gi"
},
"cpu": {
"type": "string",
"default": "200m"
}
}
},
"limits": {
"type": "object",
"properties": {
"memory": {
"type": "string",
"default": "2Gi"
},
"cpu": {
"type": "string",
"default": "1"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
"description": "Default variables for the Kubernetes worker.\n\nThe schema for this class is used to populate the `variables` section of the default base job template."
}
Marvin
07/23/2024, 10:15 AM