Hi is there any Guide for the AWS setup necessary ...
# prefect-community
v
Hi is there any Guide for the AWS setup necessary for a Prefect
ECSAgent
? I don't quite manage to get it right. Thank you! The Agent registration is successful, I start the Flow, in AWS the task is created but the TaskDefinition is INACTIVE and the Task itself is PENDING
1
This is the client code (part of it)
Copy code
flow.run_config = ECSRun(
        env={
            "S3_ENDPOINT_URL": os.getenv('S3_ENDPOINT_URL'),
            "AWS_ACCESS_KEY_ID": os.getenv('AWS_ACCESS_KEY_ID'),
            "AWS_SECRET_ACCESS_KEY": os.getenv('AWS_SECRET_ACCESS_KEY'),
            "AWS_DEFAULT_REGION": os.getenv('AWS_DEFAULT_REGION')
        },
        execution_role_arn=os.getenv('EXECUTION_ROLE_ARN'),
        task_definition={
            'containerDefinitions': [
                {
                    'name': 'flow',
                    'image': os.getenv('FLOW_IMAGE')
                }
            ]
        }
    )

    <http://logging.info|logging.info>('Created flow')
    flow.register(project_name=PROJECT_NAME, labels=[LABEL], add_default_labels=False)

    <http://logging.info|logging.info>('Creating Agent...')
    agent = ECSAgent(
        labels=[LABEL],
        task_role_arn=os.getenv('TASK_ROLE_ARN'),
        execution_role_arn=os.getenv('EXECUTION_ROLE_ARN'),
        cluster=os.getenv('CLUSTER_ID')
    )
    agent.start()
r
v
Hi, after a while after starting the Prefect Task, I see that in the AWS console I get the following error:
Copy code
CannotPullContainerError: ref pull has been retried 1 time(s): failed to extract layer sha256:487367a2eb13892e11f575ff9cc592a425570e400364f64e08244367877d2ba1: write /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/230/fs/usr/local/lib/python3.8/dist-packages/matplotlib/ft2font.cpython-38-x86_64-linux-gnu.so: no space left on device: unknown
r
Do you have memory and cpu configurations set in your ECSRun? May want to increase those numbers as it looks like the image is too big to pull
1
v
This was an issue, too. Thanks!
👍 1