https://prefect.io logo
Title
c

Chris

05/17/2023, 4:15 PM
I've run into the "too-many-revisions" issue using ECS Task Block in Prefect2. I've removed everything from the Task Definition property and added an explicit Task Definition ARN, but I'm still getting new revisions of the definition. Is there something I'm missing to prevent new revisions?
z

Zanie

05/17/2023, 4:48 PM
You can see the diff that causes a new definition to be registered by enabling debug logs
c

Chris

05/17/2023, 6:19 PM
@Zanie Thanks for the direction. It looks like "awslogs-stream-prefix": in logConfiguration is being populated with the randomly generated Flow run name. Is there a way to set a standard prefix?
z

Zanie

05/17/2023, 7:20 PM
You can use
cloudwatch_logs_options
to override that value
It’s merged like this
if self.configure_cloudwatch_logs:
            container["logConfiguration"] = {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-create-group": "true",
                    "awslogs-group": "prefect",
                    "awslogs-region": region,
                    "awslogs-stream-prefix": self.name or "prefect",
                    **self.cloudwatch_logs_options,
                },
            }
You could also disable configuration of cloudwatch logs and do it yourself if you want more control
c

Chris

05/17/2023, 7:22 PM
I accidentally saved my ECS Task block with values in 'Task Customizations', deleted the values after a failed run, but am still getting the error: task_customizations instance of JsonPatch expected (type=type_error.arbitrary_type; expected_arbitrary_type=JsonPatch)
After futile attempts to correct the issue I decided to just create a new ECS Task and update the Deployment, but even trying to update the deployment gives me the Task Customizations error. Is there a simple fix for this?
z

Zanie

05/17/2023, 7:36 PM
Hm that’s weird
I don’t fully understand unfortunately 😕
Perhaps using
prefect deployment inspect
can you more insight?
c

Chris

05/18/2023, 12:19 PM
It turns out if you save a value in Task Customization then delete the value and save again the task_customizations property gets saved without the empty array []. To fix the ECS Task block I had to put the value of an empty array in Task Customization and save. This looks like a bug in the code, but the work-around is working.
I'm moving back on to the logging setting and will keep you posted.
Cloudwatch Log Options did the trick. Thanks for pointing me in the right direction