Matthew Millendorf
04/07/2021, 6:12 PMKevin Kho
Kevin Kho
Matthew Millendorf
04/07/2021, 6:26 PMMatthew Millendorf
04/07/2021, 6:29 PMKevin Kho
Kevin Kho
Matthew Millendorf
04/07/2021, 6:36 PMMatthew Millendorf
04/07/2021, 6:39 PMMatthew Millendorf
04/07/2021, 6:40 PMKevin Kho
Kevin Kho
Kevin Kho
Matthew Millendorf
04/07/2021, 8:11 PMKevin Kho
Kevin Kho
Kevin Kho
Kevin Kho
Matthew Millendorf
04/07/2021, 8:25 PM[2021-04-07 20:23:19,677] INFO - agent | Waiting for flow runs...
[2021-04-07 20:24:05,617] INFO - agent | Found 1 flow run(s) to submit for execution.
[2021-04-07 20:24:05,712] INFO - agent | Deploying flow run '840c7de3-e8a0-4d28-892c-4f66f7f0ddbe'
yep local agent is picking it up. I see my task on my ECS console, it is just stuck in pending state.Matthew Millendorf
04/07/2021, 8:26 PMKevin Kho
Matthew Millendorf
04/07/2021, 8:30 PMKevin Kho
Kevin Kho
Matthew Millendorf
04/07/2021, 8:42 PMKevin Kho
Matthew Millendorf
04/07/2021, 8:43 PMEddie Obropta
04/09/2021, 5:59 PMEddie Obropta
04/09/2021, 5:59 PMEddie Obropta
04/09/2021, 6:01 PM{
"ipcMode": null,
"executionRoleArn": "arn:aws:iam::XXXXX:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": null,
"entryPoint": null,
"portMappings": [],
"command": null,
"linuxParameters": null,
"cpu": 0,
"environment": [
{
"name": "PREFECT__CONTEXT__IMAGE",
"value": "prefecthq/prefect:latest-python3.6"
}
],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memory": null,
"memoryReservation": null,
"volumesFrom": [],
"stopTimeout": null,
"image": "prefecthq/prefect:latest-python3.6",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "flow"
}
],
"placementConstraints": [],
"memory": "2048",
"taskRoleArn": null,
"compatibilities": [
"EC2",
"FARGATE"
],
"taskDefinitionArn": "arn:aws:ecs:us-west-2:XXXXXXX:task-definition/prefect-hello-flow:4",
"family": "prefect-hello-flow",
"requiresAttributes": [
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.task-eni"
}
],
"pidMode": null,
"requiresCompatibilities": [
"FARGATE"
],
"networkMode": "awsvpc",
"cpu": "1024",
"revision": 4,
"status": "INACTIVE",
"inferenceAccelerators": null,
"proxyConfiguration": null,
"volumes": [],
"statusString": "(INACTIVE)"
}
I “xxx’d” out our aws account number.Eddie Obropta
04/09/2021, 6:02 PMEddie Obropta
04/09/2021, 6:03 PMprefect agent ecs start --cluster arn:aws:ecs:us-west-2:XXXXX:cluster/prefect-cluster --execution-role-arn arn:aws:iam::XXXXX:role/ecsTaskExecutionRole --label Raptor-Macbook-Raptor-2.local
And here’s how I started my ECS agent.
^ I think with those messages you have everything you need to help us debug.Eddie Obropta
04/09/2021, 6:05 PMKevin Kho
Eddie Obropta
04/09/2021, 6:06 PMflow.run_config = ECSRun(
image="prefecthq/prefect:latest-python3.6")
Eddie Obropta
04/09/2021, 6:06 PMKevin Kho
Eddie Obropta
04/09/2021, 6:09 PMEddie Obropta
04/09/2021, 6:12 PMKevin Kho
prefect diagnostics
?Kevin Kho
Eddie Obropta
04/09/2021, 6:25 PM$ prefect diagnostics
{
"config_overrides": {
"cloud": {
"agent": {
"auth_token": true
}
}
},
"env_vars": [],
"system_information": {
"platform": "Darwin-19.6.0-x86_64-i386-64bit",
"prefect_backend": "cloud",
"prefect_version": "0.14.15",
"python_version": "3.6.8"
}
}
Kevin Kho
Kevin Kho
LocalStorage
. By default LocalStorage will save your serialized flow in Users/username/. If you combine LocalRun
with LocalStorage
, what happens is you’re telling Prefect that the serialized script lives in that Users/username location. The agent will find that serialized Flow and unpickle it and run it.Kevin Kho
LocalStorage
along with the ECSRun
config. It downloads the image and tries to find that serialized flow inside the Docker container. But it doesn’t live there because it’s on LocalStorage
. For your specific example, we need to configure a Storage
that your Agent can each. Since you’re already on AWS, we recommend S3 Storage . Specifying the S3 storage will store your script when you register the flow. Now your ECSRun will be able to grab that script correctly (the error is because it incorrectly tried to grab it from Users/username/)Kevin Kho
LocalStorage
.Eddie Obropta
04/09/2021, 7:48 PMKevin Kho
Kevin Kho