gpt4 book ai didi

amazon-web-services - 无法在 ECS Fargate 中使用 ephemeralStorage 参数注册任务定义

转载 作者:行者123 更新时间:2023-12-05 02:39:59 24 4
gpt4 key购买 nike

我想在存储大于默认 21GB 的 Fargate 上的 ECS 中旋转任务。首先,我在没有 ephemeralStorage

的情况下从门户创建了一个任务定义

在验证任务运行后,我尝试从 cli 注册一个新版本,并添加来自 https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html 的参数 ephemeralStorage

我的任务定义是这样的

{
"containerDefinitions": [
{
"name": "python-container",
"image": "xxxx/python-trial:v1.0",
"cpu": 0,
"portMappings": [],
"essential": true,
"environment": [],
"mountPoints": [],
"volumesFrom": [],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/python-trial-td",
"awslogs-region": "eu-east-1",
"awslogs-stream-prefix": "ecs"
}
}
}
],
"family": "python-trial-td",
"taskRoleArn": "arn:aws:iam::xxxx:role/ecsTaskExecutionRole",
"executionRoleArn": "arn:aws:iam::xxxx:role/ecsTaskExecutionRole",
"networkMode": "awsvpc",
"volumes": [],
"placementConstraints": [],
"requiresCompatibilities": [
"FARGATE"
],
"cpu": "256",
"memory": "512",
"ephemeralStorage": {"sizeInGiB": 100 }
}

运行 aws cli

aws ecs register-task-definition --family python-trial-td --cli-input-json file://task-definition-python.json

给予

Parameter validation failed:
Unknown parameter in input: "ephemeralStorage", must be one of: family, taskRoleArn, executionRoleArn, networkMode, containerDefinitions, volumes, placementConstraints, requiresCompatibilities, cpu, memory, tags, pidMode, ipcMode, proxyConfiguration, inferenceAccelerators

如果我通过 Configure via JSON 选项从门户尝试,我会得到相同的结果 issue

语法错误吗?该参数是否不允许操作?

最佳答案

以下 json 对我有用:

{
...
...
"cpu": "256",
"memory": "512",
"ephemeralStorage": {"sizeInGiB": 100 }
}

我怀疑您的 AWS CLI 可能处于低级别,可能需要升级到最新版本才能了解(相对)最近的新参数。

关于amazon-web-services - 无法在 ECS Fargate 中使用 ephemeralStorage 参数注册任务定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68833000/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com