-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run multiple processes in a container #274
Comments
SupervisorOne popular solution to the multi-process problem is using Supervisor as the container entry point. The container process tree would be roughly like this:
It is even possible to listen for
The one drawback with this approach is the fact that the Wazuh API performs a restart of the manager on rule reloads, which could be interpreted as a crash event from supervisor POV, leading to a complete container shutdown. Requirements compliance:
Cons:
This is a process tree of Wazuh Manager, API and Filebeat running under Supervisor. SummarySupervisor works as expected but due to the nature of Wazuh services (no single process, API will restart the manager), we can't take advantage of all its benefits. Still, I'd put it on hold until we research some of the other options, but not discarding it yet. |
BashThis is a minimal but highly effective approach. Using a bash entrypoint to launch every process as a background job and then only waiting for API and Filebeat to die (
Requirements compliance:
Cons
Tini + BashAnother approach which improves on the previous is using Requirements compliance:
Cons
SummaryThe Bash + Tini method looks efficient and pragmatic, with great requirement compliance and a low memory footprint. There's a branch with this method available for testing. |
S6 OverlayS6 is a process supervision suite, s6-overlay is a rework to make it more usable inside containers. Highlights
S6 defines a directory structure on
On the
Requirements compliance:
The process tree looks like this, with SummaryBeing prepared specifically for containers gives this approach a great advantage. Written in C, S6 is fast and nimble with great feature support. There's a testing branch with this approach on the repo, working great so far. |
RunitRunit is very similar to S6, as both are based on daemontools. Highlights
Runit also defines a directory structure on
It's also possible for a complete server shutdown in the event of a process failure. Requirements compliance:
Cons:
Runit's process tree: SummaryRunit doesn't look bad but I don't like the fact that the code repository (and hence it's development process) is nowhere to be found, the author only publishes the sources on the website when there's a new release. Also, last release was 4 years ago. There's a testing branch with runit here. |
Overall comparisonHere's a quick comparison table of the previous methods:
Table legend:* Partially supported ConclusionFrom a purely technical POV it's possible to provide a solution with virtually all these methods (applying workarounds in some cases) but S6 Overlay stands out as the most container friendly, feature rich and straightforward to use. |
Description
Due to the implementation details of Wazuh (running multiple services) and in order to simplify the deployment it is required to define a methodology to start multiple processes on the same container and still behave as expected in a container-enabled environment.
We're currently using
phusion/baseimage
as base image which shipsmy_init
as a process manager, but with the current Docker rework we need to take a step back and rethink this model.Behavior requirements:
Tasks
Approaches to try:
The text was updated successfully, but these errors were encountered: