Brian Stroh
02/16/2024, 5:50 PMScout
02/16/2024, 5:50 PMpython from dagster import job, op @op() def my_op(context): <http://context.log.info|context.log.info>('running') @job( tags={ "ecs/cpu": "2048", # 2 vCPUs, where 1024 CPU units = 1 vCPU "ecs/memory": "16384", # 16 GB of memory, specified in MiB } ) def my_job(): my_op()
In this example, the ecs/cpu
tag is set to "2048"
to represent 2 vCPUs (since 1 vCPU is 1024 CPU units in ECS), and the ecs/memory
tag is set to "16384"
to represent 16 GB of memory, specified in MiB (since 1 GiB is 1024 MiB). These tags will instruct ECS to allocate the specified amount of CPU and memory resources for every run of the my_job
.