【发布时间】:2019-11-14 20:58:19
【问题描述】:
我正在尝试使用自定义 Dockerfile 来构建 LUIS 容器并将应用程序文件(从 Luis 门户导出的应用程序)复制到容器中。出于这个原因,我真的不需要挂载点,因为 .gz 文件已经存在于容器中。这可能吗?似乎总是需要挂载点...
我必须将文件复制到容器中并在运行时将它们移动到input 位置(使用 init.sh 脚本)。但是,即便如此,容器似乎也无法正确加载应用程序。与仅将文件放入主机文件夹并将其挂载到容器相比,它的行为与该场景不同。
更新:当我尝试在内部(在容器的开头)移动文件时,LUIS 会给出以下输出:
Using '/input' for reading models and other read-only data.
Using '/output/luis/fbfb798892fd' for writing logs and other output data.
Logging to console.
Submitting metering to 'https://southcentralus.api.cognitive.microsoft.com/'.
warn: Microsoft.AspNetCore.Server.Kestrel[0]
Overriding address(es) 'http://+:80'. Binding to endpoints defined in UseKestrel() instead.
Hosting environment: Production
Content root path: /app
Now listening on: http://0.0.0.0:5000
Application started. Press Ctrl+C to shut down.
fail: Luis[0]
Failed while prefetching App: AppId: d6fa5fd3-c32a-44d5-bb7f-d563775cf6ee - Slot: PRODUCTION Could not find file '/input/d6fa5fd3-c32a-44d5-bb7f-d563775cf6ee_PRODUCTION.gz'.
fail: Luis[0]
Failed while getting response for AppId: d6fa5fd3-c32a-44d5-bb7f-d563775cf6ee - Slot: PRODUCTION. Error: Could not find file '/input/d6fa5fd3-c32a-44d5-bb7f-d563775cf6ee_PRODUCTION.gz'.
warn: Microsoft.CloudAI.Containers.Controllers.LuisControllerV3[0]
Response status code: 404
Exception: Could not find file '/input/d6fa5fd3-c32a-44d5-bb7f-d563775cf6ee_PRODUCTION.gz'. SubscriptionId='' RequestId='d7dfee25-05d9-4af6-804d-58558f55465e' Timestamp=''
^C
nuc@nuc-NUC8i7BEK:/tmp/input$ sudo docker exec -it luis bash
root@fbfb798892fd:/app# cd /input
root@fbfb798892fd:/input# ls
d6fa5fd3-c32a-44d5-bb7f-d563775cf6ee_production.gz
root@fbfb798892fd:/input# ls -l
total 8
-rwxrwxrwx 1 root root 4960 Dec 2 17:35 d6fa5fd3-c32a-44d5-bb7f-d563775cf6ee_production.gz
root@fbfb798892fd:/input#
请注意,即使我可以登录到容器并浏览模型文件的位置并且它们存在,LUIS 也无法加载/找到它们。
更新 #2 - 发布我的 Dockerfile:
FROM mcr.microsoft.com/azure-cognitive-services/luis:latest
ENV Eula=accept
ENV Billing=https://southcentralus.api.cognitive.microsoft.com/
ENV ApiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ENV Logging:Console:LogLevel:Default=Debug
RUN mkdir /app/inputfiles/
RUN chmod 777 /app/inputfiles/
COPY *.gz /app/inputfiles/
WORKDIR /app
COPY init.sh .
RUN chmod 777 /app/init.sh
ENTRYPOINT /app/init.sh && dotnet Microsoft.CloudAI.Containers.Luis.dll
【问题讨论】:
-
您是说您正在尝试构建您自己的 mcr.microsoft.com/azure-cognitive-services/luis 映像版本,其中包含您导出的 .gz 文件吗?你希望通过这样做来实现什么?
-
你还在做这个吗?
-
我发现这个问题没有解决方法。我很想知道绕过这个约束的方法。但是,我在当前容器中看不到一个。所以,是的,这仍然是一个问题,但我现在正在按照它需要的方式提交。
-
您的
init.sh文件是什么样的?此外,容器指的是 /input 并且您的文件被复制到 /inputfiles - 这有关系吗? -
@DavidPine - 是的,.gz 文件需要复制到 /input 而不是 /app/inputFiles 才能正常工作
标签: docker dockerfile containers azure-language-understanding azure-cognitive-services