Braun Reyes
04/04/2023, 5:42 PMprefect deployment build example_flow.py:flow_1 -n base -sb s3/common-utils-dev-test/flow-group-1/flow-1 -ib ecs-task/common-utils-flow-1-dev-test --override 'task_customizations=[{"op": "replace", "path": "/overrides/cpu", "value": "512"}, {"op": "replace", "path": "/overrides/memory", "value": "1024"}]' -q prefect-v2-queue-dev-test -v dev --params '{"param_name": "param_value"}' -t common-utils -t flow-group-1 -a --cron '0 0 * * *'
It results in this infra override in deployments
{
"task_customizations": "[{\"op\": \"replace\", \"path\": \"/overrides/cpu\", \"value\": \"512\"}, {\"op\": \"replace\", \"path\": \"/overrides/memory\", \"value\": \"1024\"}]"
}
however when I submit the flow run I get this error
Submission failed. pydantic.error_wrappers.ValidationError: 1 validation error for ECSTask task_customizations instance of JsonPatch expected (type=type_error.arbitrary_type; expected_arbitrary_type=JsonPatch)
anyone know why this would not work.Braun Reyes
04/04/2023, 7:52 PM@validator("task_customizations", pre=True)
def cast_customizations_to_a_json_patch(
cls, value: Union[List[Dict], JsonPatch]
) -> JsonPatch:
"""
Casts lists to JsonPatch instances.
"""
if isinstance(value, str):
value = json.loads(value)
if isinstance(value, list):
return JsonPatch(value)
return value
Yaron Levi
04/30/2023, 5:13 AMBraun Reyes
05/01/2023, 5:49 PMYaron Levi
05/02/2023, 10:58 AMYaron Levi
05/02/2023, 10:58 AMBraun Reyes
05/02/2023, 8:39 PMYaron Levi
05/03/2023, 7:12 AMYaron Levi
05/03/2023, 7:43 AMYaron Levi
05/03/2023, 7:43 AMYaron Levi
05/03/2023, 7:43 AMYaron Levi
05/03/2023, 7:43 AMYaron Levi
05/03/2023, 7:44 AMYaron Levi
05/03/2023, 7:54 AMYaron Levi
05/03/2023, 7:54 AMYaron Levi
05/03/2023, 7:55 AMBraun Reyes
05/03/2023, 9:06 PM{
"task_customizations": "[{\"op\": \"add\", \"path\": \"/overrides/cpu\", \"value\": \"1024\"}, {\"op\": \"add\", \"path\": \"/overrides/memory\", \"value\": \"4096\"}, {\"op\": \"add\", \"path\": \"/networkConfiguration/awsvpcConfiguration/subnets\", \"value\": [\"subnet-xxx\", \"subnet-xxx\", \"subnet-xxx\", \"subnet-xxx\"]}, {\"op\": \"add\", \"path\": \"/networkConfiguration/awsvpcConfiguration/securityGroups\", \"value\": [\"sg-xxx\"]}, {\"op\": \"add\", \"path\": \"/networkConfiguration/awsvpcConfiguration/assignPublicIp\", \"value\": \"DISABLED\"}]"
}
Braun Reyes
05/03/2023, 9:07 PMYaron Levi
05/06/2023, 6:57 PM