Francois-DE
02/28/2022, 10:35 AM@job(tags = {
"ecs/cpu": "1024",
"ecs/memory": "2048"}
)
I've attached a screenshot of the Dagit UI reflecting the resources and also what the task(container) is currently showing/using.
Any idea of what else I can try to get the tags applied to the tasks?Francois-DE
02/28/2022, 10:35 AMjordan
02/28/2022, 3:00 PMRandy Coburn
02/28/2022, 3:41 PMjordan
02/28/2022, 4:44 PMimport boto3
ecs = boto3.client("ecs")
task = ecs.describe_tasks(tasks=[TASK_ID], cluster=CLUSTER_ID)["tasks"][0]
print(task["memory"], task["cpu"])
Does that show the cpu and memory you’d expect?Randy Coburn
02/28/2022, 5:26 PMRandy Coburn
02/28/2022, 5:27 PMjordan
02/28/2022, 5:29 PMRandy Coburn
02/28/2022, 5:31 PM{
'containers': [
{
'exitCode': 0,
'reason': 'OutOfMemoryError: Container killed due to memory usage',
'cpu': '256',
'memory': '512'
}
],
'cpu': '1024',
'memory': '4096',
'overrides': {
'containerOverrides': [
{
'name': 'code-container',
}
],
'cpu': '1024',
'memory': '4096'
},
'ephemeralStorage': {
'sizeInGiB': 20
}
}
Randy Coburn
02/28/2022, 5:32 PMjordan
02/28/2022, 5:38 PMcode-container
?jordan
02/28/2022, 5:38 PMjordan
02/28/2022, 5:39 PMRandy Coburn
02/28/2022, 5:39 PMRandy Coburn
02/28/2022, 5:41 PMjordan
02/28/2022, 5:42 PM**overrides
needs to move up a line - i’ll test real quickly and get a fix PRedRandy Coburn
02/28/2022, 5:43 PMjordan
02/28/2022, 5:44 PMRandy Coburn
02/28/2022, 5:44 PMRandy Coburn
02/28/2022, 5:44 PMRandy Coburn
02/28/2022, 5:45 PMjordan
02/28/2022, 5:56 PMThere are two general rules of thumb with containers:
• unless otherwise restricted and capped, a container that gets started on a given host (operating system) gets access to all the CPU and memory capacity available on that host.
• unless otherwise protected and guaranteed, all containers running on a given host (operating system) share CPU, memory, and other resources in the same way that other processes running on that host share those resources.My read of this is if you have a task definition with no constraints, it’ll get access to all of the memory/cpu available to the task. If your task definition has constraints, it’ll observe those constaints. Are you providing a custom task definition? I suspect what’s happening here is that the memory/cpu overrides work with the dagster-generated task definitions but not with custom ones. Either way, I’m going to open a PR that applies the overrides to both the task itself and to the individual container that the run launches inside of.
Randy Coburn
02/28/2022, 6:03 PMRandy Coburn
02/28/2022, 6:03 PMRandy Coburn
02/28/2022, 6:04 PMRandy Coburn
02/28/2022, 6:05 PMjordan
02/28/2022, 6:08 PMjordan
02/28/2022, 6:24 PMRandy Coburn
02/28/2022, 6:25 PMRandy Coburn
02/28/2022, 6:25 PMjordan
02/28/2022, 6:27 PMRandy Coburn
02/28/2022, 6:33 PM