<@ULVA73B9P> Can I set cpuArchitecture to arm64 in...
# marvin-ai
j
@Marvin Can I set cpuArchitecture to arm64 in base_job_template for an esc push pool config?
m
thought for 286.0 seconds
Yes. In an ECS push work pool (Prefect 3.x), you can set the ECS task definition’s runtimePlatform to ARM64 via the base_job_template. The correct place is under `job_configuration.task_definition.runtimePlatform`: - Key path:
job_configuration.task_definition.runtimePlatform.cpuArchitecture
- Value:
ARM64
- Also set:
job_configuration.task_definition.runtimePlatform.operatingSystemFamily
to
LINUX
Example base_job_template snippet (showing just the relevant parts you can merge into your template):
Copy code
{
  "job_configuration": {
    "task_definition": {
      "runtimePlatform": {
        "cpuArchitecture": "ARM64",
        "operatingSystemFamily": "LINUX"
      },
      "containerDefinitions": [
        {
          "image": "{{ image }}",
          "name": "{{ container_name }}"
        }
      ],
      "cpu": "{{ cpu }}",
      "memory": "{{ memory }}",
      "family": "{{ family }}",
      "executionRoleArn": "{{ execution_role_arn }}"
    },
    "task_run_request": {
      "launchType": "FARGATE",
      "platformVersion": "1.4.0",
      "cluster": "{{ cluster }}",
      "overrides": {
        "containerOverrides": [
          {
            "name": "{{ container_name }}",
            "command": "{{ command }}",
            "environment": "{{ env }}",
            "cpu": "{{ cpu }}",
            "memory": "{{ memory }}"
          }
        ],
        "cpu": "{{ cpu }}",
        "memory": "{{ memory }}",
        "taskRoleArn": "{{ task_role_arn }}"
      },
      "taskDefinition": "{{ task_definition_arn }}"
    }
  }
}
Notes and constraints: - Fargate: ARM64 is supported for Linux on Fargate. Use platform version 1.4.0+ (or "LATEST"). Ensure your container image is built for linux/arm64 (or is multi-arch). - EC2: If you use EC2 launch type/capacity providers, make sure your ECS container instances are ARM-based (e.g., Graviton) and the AMI supports ARM64. - You can fetch the default ECS base job template to see where to add this:
Copy code
prefect work-pool get-default-base-job-template --type ecs
- Prefect will pass through any valid ECS task definition fields you include under
task_definition
. Docs: - Prefect ECS guide: Prefect 3 ECS guide Are you running on Fargate or EC2? If Fargate, I can show a minimal full base_job_template with the ARM64 and platformVersion fields filled in.
j
ty