Sorry to ask multiple questions but I have a flow ...
# ask-community
r
Sorry to ask multiple questions but I have a flow that is running on ECR which fails with the following message
Copy code
An error occurred (ClientException) when calling the RegisterTaskDefinition operation: Invalid setting for container 'flow'. At least one of 'memory' or 'memoryReservation' must be specified.
I have set memory (and cpu) in the ECSRun task_definition (both quoted and unquoted) and still get this error. Does anyone know what I might try?
discourse 1
k
No worries! Here to help. Can I see your task definition?
a
ECS is super specific about what you need to set there. We saw a similar issue when the image was not set explicitly - you need to check the required arguments for an ECS task definition and you need to set them all explicitly unless you let Prefect create and register a task definition for you - if you need some examples, check out those here with the name "ecs" in it
r
thank you. I think it's the lack of the explicit image then.
👍 1
k
no no. yours says memory. I think it was some memory also specified in the task definition
r
currently I have this
Copy code
with Flow("flow-name",
          state_handlers=[run_name_ts],
          storage=Module("scheduling.flows"),
          run_config=ECSRun(
              task_definition={
                  'containerDefinitions': [
                      {
                          'name': 'flow',
                          'image': '<http://some-string.amazonaws.com/container:0.1.0|some-string.amazonaws.com/container:0.1.0>'
                      }
                  ]
              },
              memory=512,
              cpu=256,
              labels=["dev", "other-string"])) as flow:
k
It wants a memory value inside containerDefnitions
upvote 1
But with just setup, so need to give task definition, just give the
image
to ECSRun and you should be good. Prefect makes that flow container by default anyway
r
excellent. Thank you