<@ULVA73B9P> I'm having trouble figuring this out ...
# ask-marvin
j
@Marvin I'm having trouble figuring this out - if I have an ECS work pool that has a default task definition, is there a way i can override the cpu/memory for specific deployments from that work pool? What values do I use to do that?
m
To override the CPU and memory settings for specific deployments in an ECS work pool, you can use task overrides within your deployment configuration. This allows you to specify different resource requirements for individual deployments, even if they share the same default task definition in the work pool. Here's a concise approach to achieve this: 1. Task Definition Override: When you create a deployment, you can specify task overrides that adjust the CPU and memory settings. This is done by providing an override configuration in your deployment script. 2. Configuration Example: You will need to specify the
cpu
and
memory
parameters in your task override configuration. Unfortunately, the exact syntax wasn't available in the excerpts, but typically in ECS, these values are specified in the task definition or overrides as integers representing the amount of CPU units or MiB of memory. 3. Documentation: For detailed instructions and examples, you should refer to the ECS Worker Guide in the Prefect documentation: ECS Worker Guide. If you need more specifics on how to implement this in your deployment script, consulting the Prefect and AWS ECS documentation will be essential. If you have further questions or need examples, feel free to ask!
n
hmm i would expect specified job variables (cpu / memory are job variables on an ECS work pool) to be respected but im not sure of the precedence between the task definition and the job variables off the top - @Kevin Grismore do you happen to know?
k
ahh yes you can! the RunTask request can carry CPU/mem overrides. I walked through this with someone else not too long ago, let me see if I can find an example
🙌 1
j
I figured out my issue actually, I was putting cpu and memory under an "overrides" key instead of at the top level
✅ 2
Both a deployment and a flow run can override the work pools job variables as long as the keys are in the proper place, although I didn't test precedence between the two