当我正常运行时,容器工作正常,但是当我使用task def通过ecs运行容器时,它的抛出错误

时间:2020-06-19 08:46:58

标签: python python-3.x docker amazon-ecs

当通过ECS运行时,docker容器向我抛出错误,但是当我正常运行时,该容器可以正常工作。

AttributeError: module 'pandas' has no attribute 'compat' 

在运行ECS时遇到上述错误,但在正常运行时可以正常工作。

我的TaskDef文件:

{
    "ipcMode": null,
    "executionRoleArn": "arn:aws:iam::123456789:role/ecsTaskExecutionRole",
    "containerDefinitions": [
        {
            "dnsSearchDomains": null,
            "environmentFiles": null,
            "logConfiguration": null,
            "entryPoint": [
                "serve"
            ],
            "portMappings": [
                {
                    "hostPort": 80,
                    "protocol": "tcp",
                    "containerPort": 8080
                }
            ],
            "linuxParameters": null,
            "cpu": 2000,
            "environment": [],
            "resourceRequirements": null,
            "ulimits": null,
            "dnsServers": null,
            "mountPoints": [
                {
                    "readOnly": null,
                    "containerPath": "/opt/ml/model",
                    "sourceVolume": "efs-mounted"
                }
            ],
            "workingDirectory": "/opt/program/",
            "secrets": null,
            "dockerSecurityOptions": null,
            "memory": null,
            "memoryReservation": 4000,
            "volumesFrom": [],
            "stopTimeout": null,
            "image": "123456789.dkr.ecr.us-east-1.amazonaws.com/dctts:GPU_TF2",
            "startTimeout": null,
            "firelensConfiguration": null,
            "dependsOn": null,
            "disableNetworking": null,
            "interactive": null,
            "healthCheck": null,
            "essential": true,
            "links": null,
            "hostname": null,
            "extraHosts": null,
            "pseudoTerminal": null,
            "user": null,
            "readonlyRootFilesystem": true,
            "dockerLabels": null,
            "systemControls": null,
            "privileged": null,
            "name": "dcttcsContainer"
        }
    ],
    "memory": null,
    "taskRoleArn": "arn:aws:iam::12345678:role/ecsTaskExecutionRole",
    "family": "web-ai-Taskdef",
    "pidMode": null,
    "requiresCompatibilities": [
        "EC2"
    ],
    "networkMode": "bridge",
    "cpu": null,
    "inferenceAccelerators": [],
    "proxyConfiguration": null,
    "volumes": [
        {
            "efsVolumeConfiguration": null,
            "name": "efs-mounted",
            "host": {
                "sourcePath": "/mnt/efs/ml/model"
            },
            "dockerVolumeConfiguration": null
        }
    ],
    "placementConstraints": [],
    "tags": []
}

1 个答案:

答案 0 :(得分:0)

我将其归为错误,因为内存和cpu单元不足以运行我的cpu模型。.我只是将我的任务def更改为:

{
"ipcMode": null,
"executionRoleArn": "arn:aws:iam::123456789:role/ecsTaskExecutionRole",
"containerDefinitions": [
    {
        "dnsSearchDomains": null,
        "environmentFiles": null,
        "logConfiguration": null,
        "entryPoint": [
            "serve"
        ],
        "portMappings": [
            {
                "hostPort": 80,
                "protocol": "tcp",
                "containerPort": 8080
            }
        ],
        "linuxParameters": null,
        "cpu": 2000,
        "environment": [],
        "resourceRequirements": null,
        "ulimits": null,
        "dnsServers": null,
        "mountPoints": [
            {
                "readOnly": null,
                "containerPath": "/opt/ml/model",
                "sourceVolume": "efs-mounted"
            }
        ],
        "workingDirectory": "/opt/program/",
        "secrets": null,
        "dockerSecurityOptions": null,
        "memory": null,
        "memoryReservation": 4000,
        "volumesFrom": [],
        "stopTimeout": null,
        "image": "123456789.dkr.ecr.us-east-1.amazonaws.com/dctts:GPU_TF2",
        "startTimeout": null,
        "firelensConfiguration": null,
        "dependsOn": null,
        "disableNetworking": null,
        "interactive": null,
        "healthCheck": null,
        "essential": true,
        "links": null,
        "hostname": null,
        "extraHosts": null,
        "pseudoTerminal": null,
        "user": null,
        "readonlyRootFilesystem": true,
        "dockerLabels": null,
        "systemControls": null,
        "privileged": null,
        "name": "dcttcsContainer"
    }
],
"memory": "16384",
"taskRoleArn": "arn:aws:iam::12345678:role/ecsTaskExecutionRole",
"family": "web-ai-Taskdef",
"pidMode": null,
"requiresCompatibilities": [
    "EC2"
],
"networkMode": "bridge",
"cpu": "8192",
"inferenceAccelerators": [],
"proxyConfiguration": null,
"volumes": [
    {
        "efsVolumeConfiguration": null,
        "name": "efs-mounted",
        "host": {
            "sourcePath": "/mnt/efs/ml/model"
        },
        "dockerVolumeConfiguration": null
    }
],
"placementConstraints": [],
"tags": []

}