Problem
Currently, dstackai/dstack image starts dstack server as a child of entrypoint, which is written in Bash, meaning that PID 1 is the Bash process.
The problem is that Bash doesn't forward signals to its children, making graceful shutdown of dstack server not possible (the container runtime usually sends SIGTERM, which does not reach the server, waits for some time – for Docker, it's 10 seconds by default, and then sends SIGKILL).
But when dstack server is started as PID 1, another problem appears – zombie processes, see this issue and this temporary fix for the details.
Solution
Add an init process to the image. It should:
- Reap orphan processes
- Forward signals to its child (
dstack server)
tini is a good candidate.
Workaround
No response
Would you like to help us implement this feature by sending a PR?
Yes
Problem
Currently, dstackai/dstack image starts
dstackserver as a child of entrypoint, which is written in Bash, meaning that PID 1 is the Bash process.The problem is that Bash doesn't forward signals to its children, making graceful shutdown of
dstackserver not possible (the container runtime usually sendsSIGTERM, which does not reach the server, waits for some time – for Docker, it's 10 seconds by default, and then sendsSIGKILL).But when
dstackserver is started as PID 1, another problem appears – zombie processes, see this issue and this temporary fix for the details.Solution
Add an init process to the image. It should:
dstackserver)tini is a good candidate.
Workaround
No response
Would you like to help us implement this feature by sending a PR?
Yes