<@ULVA73B9P> in ecs workpool setup unlike docker w...
# ask-marvin
r
@Marvin in ecs workpool setup unlike docker workpool/process workpool the worker doesn’t do actual work. it delegates the work to ecs task isnt it?
m
thought for 45.9 seconds
thought for 159.8 seconds
Yes — that’s correct. - In Prefect 3.x, an ECS worker does not execute your flow code itself. It polls for scheduled runs, then submits them to AWS by starting an ECS task (Fargate or EC2) and monitors that task’s status. Your code runs inside the ECS task container. - Docker worker: the worker launches a Docker container on the same machine where the worker is running (using the local Docker daemon). The compute is the worker host. - Process worker: the worker executes the flow directly as a subprocess on the same machine. More details: - ECS worker behavior and config: Prefect ECS guide - Overview of work pools and workers: Prefect blog: Work pools and workers
Short answer: yes. With an ECS work pool, the worker’s job is to submit and monitor your flow run as an ECS task; the user code actually runs inside the ECS task’s container(s), not inside the worker process. Quick comparison: - ECS work pool: the worker polls for flow runs, creates/starts an ECS task (Fargate or EC2), then monitors it. Your flow executes inside that ECS task. - Docker work pool: the worker polls for flow runs and starts a Docker container on the host where the worker is running. Your flow executes inside that container. - Process work pool: the worker polls for flow runs and spawns a local subprocess on the same machine. Your flow executes in that subprocess. Relevant docs: - ECS work pool guide - Work pools and workers overview
n
> unlike docker workpool/process workpool its not really unlike the other two. the workers job is never to execute the job itself, even though it might be the parent process in the case of the process worker a workers job is to submit flow runs to the execution environment defined by the work pool's base job template
r
got it. its the word
worker
that confused me since in many other setups workers are the ones that do the job. eg: celery workers, gunicorn workers etc
n
yea i can see how that’s a bit a confusing in our case