UST-QuAntiL / qhana-backend

The new REST backend for QHAna (see also qhana-plugin-runner)
Apache License 2.0
1 stars 2 forks source link

Fix Dockerfile: start_proxy.sh not found #48

Closed infacc closed 1 year ago

infacc commented 1 year ago

The backend docker container exits with the error /bin/sh: 1: ./start_proxy.sh: not found when deployed with docker-compose up. The start_proxy.sh script seems to be put into the /app/data directory, which is overwritten (I think) on startup. Moving the script up one directory works for me.

Edit:

/app/data is a mounted directory. Therefore, the contents (start_proxy.sh) of this directory are missing after startup.

https://github.com/UST-QuAntiL/qhana-backend/blob/e52ee9a46555f13bd95cb02ef0ab41b60fb37064/docker-compose.yml#L8-L9

infacc commented 1 year ago

I moved the corresponding lines, but kept the install_proxy.sh script in /app.

To make sure the issue is not caused by some file structure on my machine I ran a fresh container in an empty directory:

docker run --volume ./experimentData:/app/data ghcr.io/ust-quantil/qhana-backend:main

If this still can't reproduce the issue, it may be caused by my setup. I tested it on Windows (WSL2).

PhilWun commented 1 year ago

I can reproduce the problem with your command. Before that I used docker compose which doesn't seem to override the /app/data folder when the volume gets mounted.

buehlefs commented 1 year ago

The workdir for the final ballerina command should still be /app/data so that relative path will end up in the data folder for ballerina.

infacc commented 1 year ago

I get the following error: /app/start_proxy.sh: line 8: Caddyfile.template: No such file or directory You can try to switch the workdir to /app before the CMD line at the end.

My mistake, I tested without setting the LOCALHOST_PROXY_PORTS environment variable. Now, the start_proxy.sh is called from a subshell in the /app directory.

https://github.com/UST-QuAntiL/qhana-backend/blob/d9937b61a0594fd50b641a981ec7bc2aeb32d1af/Dockerfile#L69

Is that a reasonable solution?