In an ECS task definition, you can set: ```"epheme...
# ask-community
d
In an ECS task definition, you can set:
Copy code
"ephemeralStorage": {
   "sizeInGiB": 200
}
k
yeah, you can add that to the task definition in work pool template
like
Copy code
"ephemeralStorage": {
   "sizeInGiB": "{{ ephemeral_storage }}"
}
to model it after the other templated settings there
d
@Kevin Grismore thanks! Perhaps a dense question: I'm editing the work pool in the UI and I don't see this option in the base job template?
k
under the advanced tab, you can edit the json. you'll need to add two things: the bit I shared above in the place it needs to go in the templated task definition, and an entry in the
variables
object with a name and type so it gets picked up as a job_variable. once you do that it'll show up in the defaults tab for the work pool too
d
Okay, thanks!
@Kevin Grismore I'm still a little confused about the exact structure. Do we put the ephemeral storage bit at the top level?
Copy code
{
  "ephemeralStorage": {
    "sizeInGiB": "{{ ephemeral_storage }}"
  },
  "variables": {
    "type": "object",
    "required": [
      "aws_credentials"
    ],
    "properties": {
      "ephemeral_storage": {
        "type": "integer",
        "title": "Ephemeral Storage (GiB)",
        "default": 20,
        "description": "The amount of ephemeral storage to provide the ECS task (valid amounts are between 20 and 200)."
      },
This is in the advanced JSON?
nvm we figured it out
😅
j
I suppose these messages may disappear soon but I'll close the loop to clarify for anyone else who happens to be interested: The ephemeral storage argument goes under "variables" -> "properties" as seen above:
Copy code
"variables": {
  "properties": {
    "ephemeral_storage": {
      "type": "integer",
      "title": "Ephemeral Storage (GiB)",
      "default": 21,
      "description": "..."
    },
    ...
  },
  ...
},
I chose
21
for the default since I got this boto3 error logged when I tried the default of 20:
Copy code
Flow run could not be submitted to infrastructure: An error occurred (ClientException) when calling the RegisterTaskDefinition operation: EphemeralStorage size should be at least 21
01:56:24 PM
prefect_cloud.push_work_pool
The argument gets plugged in under "job_configuration" -> "task_definition" within "ephemeralStorage" -> "sizeInGiB":
Copy code
"job_configuration": {
    ...
    "task_definition": {
      ...
      "ephemeralStorage": {
        "sizeInGiB": "{{ ephemeral_storage }}"
      },
      ...
    },
 }
I actually remember this was a problem I had with Prefect 2 almost two years ago. I'm surprised that it hasn't been included with the default template