Skip to content

[Feature]: Add init to dstack server Docker images #3302

@un-def

Description

@un-def

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions