简体   繁体   English

Azure 容器应用无法启动 Julia 映像

[英]Azure container App fails to start with Julia image

I am trying to run Julia code in azure container app, but it fails for some reason.我正在尝试在 azure 容器应用程序中运行 Julia 代码,但由于某种原因它失败了。

docker file is pretty simple: docker 文件非常简单:

FROM julia:1.7-bullseye
COPY . /

EXPOSE 8080

RUN julia --project='/' -e 'using Pkg; Pkg.build()'
ENTRYPOINT julia --project='/' main.jl "0.0.0.0" "8080"

"0.0.0.0" and "8080" there is the host and port on which HTTP is served: "0.0.0.0" 和 "8080" 是提供 HTTP 的主机和端口:

HTTP.serve(GENERAL_ROUTER, host, port_restful_api)

The app supposed to run a simple HTTP server that is served over port 8080, GET to / is the health check that returns simple "Up"该应用程序应该运行一个通过端口 8080 提供服务的简单 HTTP 服务器,GET to / 是返回简单“Up”的健康检查

When I run that same image locally with docker run -p 8080:8080 my-test:latest it works fine and hitting localhost:8080 gives me my expected response当我使用docker run -p 8080:8080 my-test:latest在本地运行相同的图像时,它工作正常并且点击 localhost:8080 给了我预期的响应

But when I have it in container app - revision fails to be provisioned (and no extra errors provided).但是当我在容器应用程序中拥有它时 - 无法提供修订(并且没有提供额外的错误)。 In the ingress I added availability to accept traffic from anywhere and target port is 8080...在入口中,我添加了接受来自任何地方的流量的可用性,目标端口是 8080...

What I am missing?我错过了什么?

UPDATE更新

At the same time in log analytics I can see my output to console that should indicate that the app is supposedly running fine, eg同时在日志分析中,我可以看到我的控制台输出应该表明该应用程序运行良好,例如

[ Info: API handler service: Running on thread 1 [信息:API 处理程序服务:在线程 1 上运行

In Julia those are done with在 Julia 中,这些都完成了

@info "API Server: Running on thread $(Threads.threadid())"

But in logs those are in stderr stream.但在日志中,那些在stderr流中。 Could it be that the ACA treats any output to stderr as startup error?会不会是 ACA 将任何输出到 stderr 视为启动错误?

UPDATE 2:更新 2:

The very same code works without any issues or changes on Azure Container Instance and in Azure Kubernetes Service...完全相同的代码在 Azure 容器实例和 Azure Kubernetes 服务中运行,没有任何问题或更改......

So for now I stopped investigating and decided to use ACI.所以现在我停止调查并决定使用 ACI。

You should verify if any process inside the julia image needs root privileges as ACA do not support running privileged containers based on the docs :您应该验证 julia 映像中的任何进程是否需要 root 权限,因为 ACA 不支持基于文档运行特权容器:

Azure Container Apps can't run privileged containers. Azure 容器应用无法运行特权容器。 If your program attempts to run a process that requires root access, the application inside the container experiences a runtime error.如果您的程序尝试运行需要 root 访问权限的进程,则容器内的应用程序会遇到运行时错误。

Did you specify 8080 as your target port when configuring the HTTP ingress of your Container App?您在配置容器应用的 HTTP 入口时是否指定 8080 作为目标端口? https://docs.microsoft.com/en-us/azure/container-apps/ingress?tabs=bash https://docs.microsoft.com/en-us/azure/container-apps/ingress?tabs=bash

The platform will try to ping your app at the specified port due to the default health probes.由于默认的运行状况探测,平台将尝试在指定端口对您的应用程序执行 ping 操作。 If it receives no response, it will restart your app: https://docs.microsoft.com/en-us/azure/container-apps/health-probes?tabs=arm-template如果没有收到响应,它将重新启动您的应用程序: https ://docs.microsoft.com/en-us/azure/container-apps/health-probes?tabs=arm-template

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM