-
Notifications
You must be signed in to change notification settings - Fork 485
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
Create pods and containers such that generated systemd unit files are cohesive #443
Comments
I have posted in the mailing list regarding this one suggestion was to use
without any systemd for each container another suggest is to use the above @rhatdan we can use systemd's
we might also use |
I guess what I don't understand is: in what way do the containers and pods that |
try to add a network and define different hostnames
basically compose spec is more complex than the simple example you have shown so the command we end with is You can try to remove |
As a note, I am interested in developing a library/command to convert directly from compose files to systemd units for podman. That way podman-compose would not have to be invoked in the systemd unit files. This would be facilitated by #445 |
@jayache80 you can no choose to not create pod or create pod with whatever arguments you want
|
after last push, please check my comment @jayache80 @Aposhian your feedback is highly appreciated |
Generic pod troubleshooting@muayyad-alsadi Thanks for addressing this. I tried to get an iteration of this "hello world" to work, but the pod always comes up as degraded as I've seen mentioned. This is foo.yaml:
And I try to start it with:
The pod starts but the I tried adding I tried adding:
blocks to the yaml, but I'm fairly certain that's not supported, as that yields Clearly I don't know what I'm doing so any suggestions on how to modify this toy yaml such that I can get a grasp on this basic use case would be much appreciated. New
|
I prefer having a pod with no infra and nothing shared (that's why I made it the default)
please use
I've just adjust the unit file to make it you might need to recreate the unit file and daemon reload
|
Thanks for assisting @muayyad-alsadi
Unfortunately even with
Indeed this allows the service to be restarted. So I have to do something like this:
every time I want the service stopped and started. Is that expected? If so, I would argue that the fact that I have to keep track of such a thing and run an intermediate |
this should not be the case. commands like the following should work normally
and even if you typed
the following should report proper status even though it was stopped outside
yes this is the objective and it works for me I've just added a command to help you list registered compose stacks
which gives list of registered compose files
as you can see below the status is running (no infra, all defaults and it's running)
|
Glad to hear this. Perhaps it's an incompatible set of images/containers that I'm working with. By chance, do you have no problems which such a docker-compose.yaml:
or does it reproduce the issue that I'm getting? |
regarding the degraded problem, it's not related to infra, it's because your compose has two containers and one of them is dead
your app (python container) exited because it does not run any command, I've change it to run something like
and now it works perfectly
my first attempt systemd failed because it was pulling the images in background until some timedout
I'll solve this by printing that you should do a also I noted that changes to compose are not applied unless you use |
#409 is now fixed, changes are detected and applied automatically. |
Describe the bug
Somehow, generated systemd unit files from a pod and containers using
podman-compose
are not cohesive; if I start the pod service, all containers will start, but if I stop the pod service, not all containers stop and the pod is left in a "degraded" state.To Reproduce
Create a compose file called
foo.yaml
with these contents:then modify the
podman-compose
script such that pods are created with--infra=true
. Then create the pod/containers and generate systemd files with:Install the unit files to
~/.config/systemd/user/
and start the pod with:and stop the pod with:
Expected behavior
systemctl --user stop pod-pod_foo.service
will stop the pod and all containers therein.Actual behavior
systemctl --user stop pod-pod_foo.service
only stops the infra container, and all other containers are left running and the pod is in a "degraded" state.Output
For reference, the same deployment can be created with only
podman
commands using the following:That generates systemd unit files that work as expected, and look like this:
Notice that the units for the containers have
BindsTo
andAfter
referencingpod-foo.service
.However, with the
podman-compose
reproduction steps above, I get systemd unit files that look like this:(Using latest master)
Environment:
Additional context
containers/podman#13368 (comment)
The text was updated successfully, but these errors were encountered: