Run podman
socket and use its API instead of calling it directly
#456
Replies: 3 comments
-
With respect to separation of concerns there something I always say: "even if I have many hats (concerns) but I only wear one hat at a time."
This is was very simimlar to the vision of original docker compose but it no longer the case when they merged swarm into docker daemon Basically they wanted to compete with kubernetes (multi-host container orchestration) as opposed to podman model which is the process model, do one thing and do it right yes, one can start a podman socket (podman daemon) and use docker-compose v1 (python) or v2 (go versions) what podman-compose do and what it should not dopodman-compose is focused on:
in my opinion
after the last command there will be no running podman-compose (because exec replaced it) and the podamn process will be following the logs and this is not yet the case, but this is what I'm aiming for.
the current code is slow, because we run into a race condition in podman 1.x (most likely it's solved in 3.x), but adding sleep 1 back then was a quick fix. I bet you, just exec the process is way faster and efficient than running a fat daemon.
a cli process calling another cli process is part of the unix philosophy, each cli command "do one thing and do it right"
the only reason for threads to exists is if those are fixed, there will be no threads in podman compose and it will be replaced with
|
Beta Was this translation helpful? Give feedback.
-
from the discussion here there are two advantages of process model vs. daemon
|
Beta Was this translation helpful? Give feedback.
-
I agree with this and like the approach more! Podman-compose being just a simpler and declarative way to run podman is exactly right. |
Beta Was this translation helpful? Give feedback.
-
We have been asked to re-implement
podman-compose
using Podman API instead of calling it directlyMany people run podman socket daemon then use stock docker-compose and it worked for them
I do NOT agree with this and we are going to discuss why.
Examples
here we will discuss this issue
Quote from @Elkasitu
Context
Currently, all podman operations done by
podman-compose
are done by executingpodman
as a program and passing it various command-line arguments.Podman
offers a REST API exposed through unix sockets, I believe it's possible to use this API for most if not allpodman
operations currently used bypodman-compose
.Rationale
I think using the API would result in many benefits, including but not limited to:
podman start
) to libpodNotes
systemctl --user start podman.socket
) or running whatever program requires access to the socket as sudo. There's probably a way to config with udev rules so that a non-root user can use the socket, this should be documented if the rest API support is green lit.Are there any reasons not to use the REST API exposed by
libpod
? (other than it consuming a lot of time? :^))Any comments, questions, etc. welcome
END OF QUOTE
Beta Was this translation helpful? Give feedback.
All reactions