skip to Main Content

I am trying to run Julia code in azure container app, but it fails for some reason.

docker file is pretty simple:

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:

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"

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

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…

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, e.g.

[ Info: API handler service: Running on thread 1

In Julia those are done with

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

But in logs those are in stderr stream. Could it be that the ACA treats any output to stderr as startup error?

UPDATE 2:

The very same code works without any issues or changes on Azure Container Instance and in Azure Kubernetes Service…

So for now I stopped investigating and decided to use ACI.

2

Answers


  1. 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:

    Azure Container Apps can’t run privileged containers. If your program
    attempts to run a process that requires root access, the application
    inside the container experiences a runtime error.

    Login or Signup to reply.
  2. Did you specify 8080 as your target port when configuring the HTTP ingress of your Container App? https://learn.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. If it receives no response, it will restart your app: https://learn.microsoft.com/en-us/azure/container-apps/health-probes?tabs=arm-template

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search