Skip to content
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

Prettify also pod units, move container image below #14897

Closed
AlphaJack opened this issue Jul 11, 2022 · 7 comments · Fixed by #15837
Closed

Prettify also pod units, move container image below #14897

AlphaJack opened this issue Jul 11, 2022 · 7 comments · Fixed by #15837
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@AlphaJack
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

Hey there, thank you for implementing #13337.
I would suggest to expand the improvement also to pod units, and if possible placing the container line in a new line istead of the one used by the last option in container units.

Pod units

BEFORE:

# pod-appname.service
# autogenerated by Podman 4.1.1
# Mon Jul 11 16:13:49 CEST 2022

[Unit]
Description=Podman pod-appname.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=
Requires=container-appname-server.service
Before=container-appname-server.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-appname.pid %t/pod-appname.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-appname.pid --pod-id-file %t/pod-appname.pod-id --name appname --publish 127.0.0.1:40080:8080 --publish 127.0.0.1:40081:8081 --userns keep-id --replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-appname.pod-id
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-appname.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-appname.pod-id
PIDFile=%t/pod-appname.pid
Type=forking

[Install]
WantedBy=default.target%

AFTER:

# pod-appname.service
# autogenerated by Podman 4.1.1
# Mon Jul 11 16:13:49 CEST 2022

[Unit]
Description=Podman pod-appname.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=
Requires=container-appname-server.service container-appname-redis.service
Before=container-appname-server.service container-appname-redis.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-appname.pid %t/pod-appname.pod-id
ExecStartPre=/usr/bin/podman pod create \
             --infra-conmon-pidfile %t/pod-appname.pid \
             --pod-id-file %t/pod-appname.pod-id \
             --name appname \
             --publish 127.0.0.1:40080:8080 \
             --publish 127.0.0.1:40081:8081 \
             --userns keep-id \
             --replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-appname.pod-id
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-appname.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-appname.pod-id
PIDFile=%t/pod-appname.pid
Type=forking

[Install]
WantedBy=default.target%

Container units

BEFORE:

# container-appname-server.service
# autogenerated by Podman 4.1.1
# Mon Jul 11 16:13:49 CEST 2022

[Unit]
Description=Podman container-appname-server.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
BindsTo=pod-appname.service container-appname-redis.service
After=pod-appname.service container-appname-redis.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run \
        --cidfile=%t/%n.ctr-id \
        --cgroups=no-conmon \
        --rm \
        --pod-id-file %t/pod-appname.pod-id \
        --sdnotify=conmon \
        -d \
        --replace \
        --name appname-server \
        --requires appname-redis \
        --label io.containers.autoupdate=registry \
        --memory 1G \
        --volume /home/podman/containers/storage/appname/server/cache:/cache \
        --volume /home/podman/containers/storage/appname/server/data:/data docker.io/library/appname:latest
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all

[Install]
WantedBy=default.target

AFTER:

# container-appname-server.service
# autogenerated by Podman 4.1.1
# Mon Jul 11 16:13:49 CEST 2022

[Unit]
Description=Podman container-appname-server.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
BindsTo=pod-appname.service container-appname-redis.service
After=pod-appname.service container-appname-redis.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%n.ctr-id
ExecStart=/usr/bin/podman run \
        --cidfile=%t/%n.ctr-id \
        --cgroups=no-conmon \
        --rm \
        --pod-id-file %t/pod-appname.pod-id \
        --sdnotify=conmon \
        -d \
        --replace \
        --name appname-server \
        --requires appname-redis \
        --label io.containers.autoupdate=registry \
        --memory 1G \
        --volume /home/podman/containers/storage/appname/server/cache:/cache \
        --volume /home/podman/containers/storage/appname/server/data:/data \
        docker.io/library/appname:latest
ExecStop=/usr/bin/podman stop --ignore --cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all

[Install]
WantedBy=default.target

Output of podman version:

Client:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.3
Git Commit:   f73d8f8875c2be7cd2049094c29aff90b1150241
Built:        Fri Jun 24 10:38:04 2022
OS/Arch:      linux/arm64
@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 11, 2022
@rhatdan
Copy link
Member

rhatdan commented Jul 12, 2022

This sounds good to me, are you interested in opening a PR?

@rhatdan
Copy link
Member

rhatdan commented Jul 12, 2022

@cdoern Interested in taking a look?

@cdoern
Copy link
Contributor

cdoern commented Jul 15, 2022

sure, I can take this one. Just to be clear @AlphaJack the before/after is what the units look like now and what you want them to look like?

@cdoern
Copy link
Contributor

cdoern commented Jul 15, 2022

/assign cdoern

@AlphaJack
Copy link
Author

Just to be clear @AlphaJack the before/after is what the units look like now and what you want them to look like?

Yes, exactly

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan rhatdan assigned rhatdan and unassigned cdoern Sep 16, 2022
rhatdan added a commit to rhatdan/podman that referenced this issue Sep 21, 2022
Fixes: containers#14897

Followup to containers#13814

Signed-off-by: Daniel J Walsh <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants