Ritabrata Moitra
05/25/2023, 1:03 PM12:30:23.877 | INFO | Flow run 'refreshing-coyote' - Downloading flow code from storage at ''
12:30:36.187 | ERROR | Flow run 'refreshing-coyote' - Flow could not be retrieved from deployment.
....
socket.gaierror: [Errno -5] No address associated with hostname
...
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host <bucket-name>.<http://s3.eu-west-1.amazonaws.com:443|s3.eu-west-1.amazonaws.com:443> ssl:default [No address associated with hostname]
...
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "https://<bucket-name>.<http://s3.eu-west-1.amazonaws.com/?list-type=2&prefix=&delimiter=&encoding-type=url|s3.eu-west-1.amazonaws.com/?list-type=2&prefix=&delimiter=&encoding-type=url>"
...
I am using a ECS task infra block ( definition in comments ) and building my deployment like this - prefect deployment build ecr_flow.py:ecr_flow -n ecr_flow_path -sb s3/prefect-s3-storage --path opt/prefect/flows -a -q rito
Any pointers where I could be going wrong?Ritabrata Moitra
05/25/2023, 1:04 PMfrom prefect import flow
from prefect_aws import AwsCredentials
from prefect_aws.ecs import ECSTask
@flow
def ecr_flow():
ecr_task = ECSTask(
image="<http://xxx.dkr.ecr.eu-west-1.amazonaws.com/test-prefect:latest|xxx.dkr.ecr.eu-west-1.amazonaws.com/test-prefect:latest>",
credentials=AwsCredentials.load("xxx"),
cluster="arn:aws:ecs:eu-west-1:xxx:cluster/prefect-agent-cluster-2",
stream_output=True,
configure_cloudwatch_logs=True,
region="eu-west-1",
vpc_id="vpc-xxx",
command=["python3", "/opt/prefect/flows/sample_deployment.py"],
execution_role_arn="arn:aws:iam::xxx:role/test-iam-role-prefect",
task_role_arn="arn:aws:iam::xxx:role/test-iam-role-prefect",
auto_deregister_task_definition=True
)
return ecr_task.run()
if __name__ == '__main__':
ecr_flow()
Christopher Boyd
05/25/2023, 1:52 PMsocket.gaierror: [Errno -5] No address associated with hostname
...
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host <bucket-name>.<http://s3.eu-west-1.amazonaws.com:443|s3.eu-west-1.amazonaws.com:443> ssl:default [No address associated with hostname]
Christopher Boyd
05/25/2023, 1:52 PMRitabrata Moitra
05/25/2023, 1:54 PMs3fs
to download the flow
My infra config looks like this -
1. Server - EKS Cluster
2. Agent - Local docker container ( has the AWS credentials volume mounted )
3. ECS Task
I actually can’t resolve that address manually. Seems to be something malformed.Christopher Boyd
05/25/2023, 1:56 PMChristopher Boyd
05/25/2023, 1:56 PMChristopher Boyd
05/25/2023, 1:57 PMChristopher Boyd
05/25/2023, 1:57 PMChristopher Boyd
05/25/2023, 1:57 PMRitabrata Moitra
05/25/2023, 1:59 PMChristopher Boyd
05/25/2023, 1:59 PMChristopher Boyd
05/25/2023, 2:00 PMChristopher Boyd
05/25/2023, 2:01 PMRitabrata Moitra
05/25/2023, 2:11 PM