<@ULVA73B9P>, what's the minimal base job template...
# ask-marvin
j
@Marvin, what's the minimal base job template i need to use prefect work-pool update --base-job-template myfile.json
m
thought for 38.7 seconds
Based on the research and examples from GitHub issues, I can provide you with the minimal base job template structure. Here's what you need:
Copy code
json
{
  "variables": {
    "property_name": "default_value"
  },
  "job_configuration": {
    "property_name": "{{ variables.property_name }}"
  }
}
A few important points: 1. The file must contain both
variables
and
job_configuration
sections 2. Any variable you want to use in
job_configuration
must be defined in the
variables
section 3. Variables in the
job_configuration
section must be referenced using the format
{{ variables.property_name }}
For example, if you wanted to set a default Docker image pull policy, your minimal template might look like:
Copy code
json
{
  "variables": {
    "image_pull_policy": "IfNotPresent"
  },
  "job_configuration": {
    "image_pull_policy": "{{ variables.image_pull_policy }}"
  }
}
For more complex configurations, you can copy the full template from the work pool's Advanced tab in the UI and modify it. This ensures you have access to all available configuration options while maintaining compatibility with your work pool type. Note that the exact properties available in
job_configuration
will depend on your work pool type (Docker, Kubernetes, etc.). The structure above is the minimal template that will work with the CLI command.
j
@Marvin what's the minimal template for the ecs worker?
m
thought for 72.3 seconds
Based on the research and examples, here's the minimal base job template for an ECS worker:
Copy code
json
{
  "variables": {
    "cpu": "1024",
    "memory": "2048",
    "task_role_arn": "",
    "execution_role_arn": "",
    "launch_type": "FARGATE",
    "network_configuration": {
      "awsvpcConfiguration": {
        "subnets": [],
        "assignPublicIp": "ENABLED"
      }
    }
  },
  "job_configuration": {
    "cpu": "{{ variables.cpu }}",
    "memory": "{{ variables.memory }}",
    "task_role_arn": "{{ variables.task_role_arn }}",
    "execution_role_arn": "{{ variables.execution_role_arn }}",
    "launch_type": "{{ variables.launch_type }}",
    "network_configuration": "{{ variables.network_configuration }}"
  }
}
Important notes: 1. The
network_configuration
must use lowercase field names (
subnets
, not
Subnets
) as Prefect uses boto3 under the hood 2. You'll need to fill in your specific: - Task role ARN - Execution role ARN (needs AmazonECSTaskExecutionRolePolicy at minimum) - Subnet IDs in the network configuration 3. The CPU and memory values shown are examples - adjust them based on your needs 4. The template uses FARGATE as the default launch type, which is the most common choice This is the minimal structure needed to get an ECS work pool running. You can add more configuration options like
tags
,
cluster
, or custom
container_definitions
as needed, but these are the essential components to get started. Remember that any values you don't set in the base job template can still be configured later through deployment configuration or the work pool UI.