【发布时间】:2020-10-09 11:47:43
【问题描述】:
docker 容器在通过 ECS 运行时向我抛出错误,但是当我正常运行该容器时,该容器工作正常。
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": []
}
【问题讨论】:
-
一个原因可能是将
"/opt/*"作为第三方二进制中继安装在此路径/opt上,删除此路径并尝试检查您的应用程序 -
iam 在容器中的路径 /opt/ml/model 上挂载卷..
标签: python python-3.x docker amazon-ecs