Joshua Grant
11/16/2022, 3:22 PMDockerRegistry
block with AWS ECR?Dev Dabke
11/16/2022, 3:58 PMJoshua Grant
11/16/2022, 3:59 PMAnna Geller
Nikhil Jain
12/13/2022, 9:00 PMAnna Geller
Nikhil Jain
12/13/2022, 9:08 PMAnna Geller
prefect deployment build -n dev -a -ib ecs-task/dev myflow.py:myflow --path /opt/prefect/flows --skip-upload
Nikhil Jain
12/13/2022, 9:14 PMtask_definition_arn
to my ECSTask block, which all of the settings in the task_definition be applied automatically? or do I have to supply some of the settings in the ECSTask block settings?
2. e.g. where should I add the ECR image url? in the ECSTask block? or in the task_definition
(which I am creating using terraform).Anna Geller
Nikhil Jain
12/13/2022, 9:24 PMcommand
to run in the ECS Task? Do I have to hardcode the command in the ECR image (or in the task-definition)? Or will the agent automatically add a command
override when creating the task?Anna Geller
ENTRYPOINT ["prefect", "agent", "start", "-q", "default"]
any Infrastructure block by default overrides it to
["python", "-m", "prefect.engine"]
Nikhil Jain
12/13/2022, 9:54 PMagent
logs:
File "/usr/local/lib/python3.10/site-packages/prefect_aws/ecs.py", line 693, in _create_task_and_wait_for_start
network_config = self._load_vpc_network_config(self.vpc_id, boto_session)
File "/usr/local/lib/python3.10/site-packages/prefect_aws/ecs.py", line 1228, in _load_vpc_network_config
vpcs = ec2_client.describe_vpcs(**describe)["Vpcs"]
File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 508, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 915, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (UnauthorizedOperation) when calling the DescribeVpcs operation: You are not authorized to perform this operation.
My flow is setup to run on FARGATE. I noticed that this stack trace is using ec2_client
. Is this expected? The task_execution_role
for my agent does not have any ec2:*
capabilities, and used to work fine on Prefect1 with the same network config.Anna Geller
Nikhil Jain
12/13/2022, 10:17 PMnetworkConfiguration
as task_customizations.
3. turns out ECSTask calls ec2_client.describe_vpcs
even when vpc_id is provided explicitly. So had to add that policy to the task_execution_role.Anna Geller