Vasco Leitão
03/08/2023, 11:23 AMSubmission failed. KeyError: "No class found for dispatch key 'ecs-task' in registry for type 'Block'."
, though I have two ECS blocks registered (one with VPC definition, and other without them). I tried the solution described in this thread - installing prefect-aws
in the agent, but to no avail. Does someone has other possible solutions to this issue? I'm adding the ECS task definition, Prefect versions, in the thread. Thank you!---
) - I also log stuff in DataDog for easier debugging.
{
"taskDefinitionArn": "---:task-definition/Prefect2-Production-8vpid:30",
"containerDefinitions": [
{
"name": "app",
"image": "prefecthq/prefect:2.8-python3.9",
"cpu": 512,
"memory": 1024,
"portMappings": [
{
"name": "app-8080-tcp",
"containerPort": 8080,
"hostPort": 8080,
"protocol": "tcp"
}
],
"essential": true,
"entryPoint": [
"prefect",
"agent",
"start",
"--pool",
"default-agent-pool",
"-q",
"production"
],
"environment": [
{
"name": "EXTRA_PIP_PACKAGES",
"value": "prefect-aws"
},
{
"name": "env",
"value": "production"
},
{
"name": "PREFECT_API_KEY",
"value": "---"
},
{
"name": "PREFECT_API_URL",
"value": "---"
}
],
"mountPoints": [],
"volumesFrom": [],
"linuxParameters": {
"initProcessEnabled": true
},
"logConfiguration": {
"logDriver": "awsfirelens",
"options": {
"Host": "<http://http-intake.logs.datadoghq.eu|http-intake.logs.datadoghq.eu>",
"Name": "datadog",
"TLS": "on",
"compress": "gzip",
"dd_service": "prefect2",
"dd_source": "prefect2",
"dd_tags": "project:prefect,env:production",
"provider": "ecs"
},
"secretOptions": [
{
"name": "apikey",
"valueFrom": "/datadog/apikey"
}
]
}
},
{
"name": "log_router",
"image": "public.ecr.aws/aws-observability/aws-for-fluent-bit:latest",
"cpu": 0,
"portMappings": [],
"essential": true,
"environment": [],
"mountPoints": [],
"volumesFrom": [],
"user": "0",
"firelensConfiguration": {
"type": "fluentbit",
"options": {
"enable-ecs-log-metadata": "true"
}
}
}
],
"family": "Prefect2-Production-8vpid",
"taskRoleArn": "---",
"executionRoleArn": "---",
"networkMode": "awsvpc",
"revision": 30,
"volumes": [],
"status": "ACTIVE",
"requiresAttributes": [
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
},
{
"name": "ecs.capability.firelens.fluentbit"
},
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.17"
},
{
"name": "com.amazonaws.ecs.capability.logging-driver.awsfirelens"
},
{
"name": "ecs.capability.secrets.ssm.bootstrap.log-driver"
},
{
"name": "com.amazonaws.ecs.capability.task-iam-role"
},
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.25"
},
{
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
},
{
"name": "ecs.capability.task-eni"
}
],
"placementConstraints": [],
"compatibilities": [
"EC2",
"FARGATE"
],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "512",
"memory": "1024",
"registeredAt": "2023-03-07T18:05:48.635Z",
"registeredBy": "---",
"tags": []
}
prefect
version: 2.8.4
prefect-aws
version: 0.2.4
prefect block register -m prefect_aws.ecs
before building deployments, and it tells me it has registered successfully blocks for Credentials and ECS task, though I don't understand if I need to do anything else in the Cloud.prefect deployment build -n test_deploy -q production -ib ecs-task/ecsconfig -a flows/tableau_query_fetch/query_fetch_v2.py:flow
Zanie
03/09/2023, 3:34 PMpip show prefect-aws
?Vasco Leitão
03/09/2023, 3:36 PMpip show prefect-aws
returns:
Name: prefect-aws
Version: 0.2.4
Summary: Prefect collection of tasks and subflows to integrate with AWS
Home-page: <https://github.com/PrefectHQ/prefect-aws>
Author: Prefect Technologies, Inc.
Author-email: <mailto:help@prefect.io|help@prefect.io>
License: Apache License 2.0
Location: /usr/local/lib/python3.10/site-packages
Requires: boto3, botocore, mypy-boto3-s3, mypy-boto3-secretsmanager, prefect
Required-by:
Zanie
03/09/2023, 3:38 PMprefect version
? Is it installed in the same Python environment?Vasco Leitão
03/09/2023, 3:52 PMprefect version == 2.8.4
, same env.
15:49:55.602 | INFO | prefect.agent - Submitting flow run '3c401746-d01a-4625-b847-c468b7dde7b1'
15:49:57.107 | INFO | prefect.infrastructure.ecs-task - ECSTask 'neat-potoo': Retrieving task definition 'prefect__tableau_custom_query_fetch__test_deploy'...
15:49:58.602 | INFO | prefect.infrastructure.ecs-task - ECSTask 'neat-potoo': Creating task run...
15:49:59.145 | INFO | prefect.infrastructure.ecs-task - ECSTask 'neat-potoo': Waiting for task run to start...
15:49:59.214 | INFO | prefect.infrastructure.ecs-task - ECSTask 'neat-potoo': Status is PROVISIONING.
15:50:09.357 | INFO | prefect.infrastructure.ecs-task - ECSTask 'neat-potoo': Status is PENDING.
15:50:24.576 | INFO | prefect.infrastructure.ecs-task - ECSTask 'neat-potoo': Status is DEPROVISIONING.
15:50:34.720 | INFO | prefect.infrastructure.ecs-task - ECSTask 'neat-potoo': Status is STOPPED.
15:50:34.722 | ERROR | prefect.agent - Failed to submit flow run '3c401746-d01a-4625-b847-c468b7dde7b1' to infrastructure.
(...)
prefect_aws.ecs.TaskFailedToStart: CannotPullContainerError: pull image manifest has been retried 1 time(s): failed to resolve ref <http://771426788622.dkr.ecr.eu-west-1.amazonaws.com/prefect2-custom:test|771426788622.dkr.ecr.eu-west-1.amazonaws.com/prefect2-custom:test>: pulling from host <http://771426788622.dkr.ecr.eu-west-1.amazonaws.com|771426788622.dkr.ecr.eu-west-1.amazonaws.com> failed with status code [manifests test]: 403 Forbidden
Zanie
03/09/2023, 3:57 PMVasco Leitão
03/09/2023, 5:10 PMZanie
03/09/2023, 5:13 PMecs-task
block is retrieved successfullyVasco Leitão
03/09/2023, 5:22 PMprefect-aws
to the task definition in ECS, but I'm looking for other possibilitiesZanie
03/09/2023, 5:22 PMEXTRA_PIP_PACKAGES
is ignoredVasco Leitão
03/14/2023, 10:23 AMprefect-aws
and registers blocks, it solved the issue. Thank you for helping out!