Michael Ludwig
07/20/2020, 11:44 AMclass ECSFargateAgent:
def __init__(self, config: PrefectAgentConfig):
self._env = config.env
self._agent = FargateAgent(
labels=[f"reco-{self._env}"],
enable_task_revisions=True,
launch_type="FARGATE",
taskRoleArn=config.task_role_arn,
executionRoleArn=config.execution_role_arn,
cluster=config.ecs_cluster_arn,
networkConfiguration={
"awsvpcConfiguration": {
"assignPublicIp": "ENABLED",
"subnets": config.subnets,
"securityGroups": [config.security_group],
}
},
cpu="1024", # 1 vCPU
memory="3072", # 3 GB
containerDefinitions=[
{
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": config.log_group,
"awslogs-region": "eu-west-1",
"awslogs-stream-prefix": "flows",
},
},
}
],
)
def run(self):
"""Start the agent"""
self._agent.start()
e.g. we switched memory
from 16GB to 3GB but the agent still fires off flows with 16GB. Only deleting the old task definitions manually solves this for us. Anybody seen something similiar or has a solution?Ben Davison
07/20/2020, 12:10 PMenable_task_revisions
is doing the opposite of what you expect it todo:
https://github.com/PrefectHQ/prefect/blob/653478e6140a79a54fb4cba5d5f1a1f92e236ae5/src/prefect/agent/fargate/agent.py#L83-L89
My reading of that, is that if you set it to True
it will use the flow_name instead of the flow_id which won't change.Michael Ludwig
07/20/2020, 12:30 PM