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

Deprecate podman generate systemd #19414

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jul 28, 2023

Now that Quadlets are fully supported, it is time to Depracate podman generate systemd command.

Does this PR introduce a user-facing change?

The `podman generate systemd` command is deprecated.  Use Quadlet for running containers and pods under systemd. 

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 28, 2023
@rhatdan
Copy link
Member Author

rhatdan commented Jul 28, 2023

@vrothberg PTAL

@rhatdan rhatdan force-pushed the systemd branch 2 times, most recently from 411c0ca to 090eb8e Compare July 30, 2023 13:07
cmd/podman/generate/systemd.go Show resolved Hide resolved
docs/source/markdown/podman-generate-systemd.1.md Outdated Show resolved Hide resolved
@@ -306,7 +310,7 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS
bb310a0780ae docker.io/library/alpine:latest /bin/sh 3 minutes ago Created busy_moser
```
## SEE ALSO
**[podman(1)](podman.1.md)**, **[podman-container(1)](podman-container.1.md)**, **systemctl(1)**, **systemd.unit(5)**, **systemd.service(5)**, **[conmon(8)](https://github.com/containers/conmon/blob/main/docs/conmon.8.md)**
**[podman(1)](podman.1.md)**, **[podman-container(1)](podman-container.1.md)**, **systemctl(1)**, **systemd.unit(5)**, **systemd.service(5)**, **[conmon(8)](https://github.com/containers/conmon/blob/main/docs/conmon.8.md)**, [Quadlet](https://github.com/containers/conmon/blob/main/docs/podman-systemd.unit.5.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since quadlet docs are packaged with podman, can't we use the other syntax?

@rhatdan rhatdan force-pushed the systemd branch 2 times, most recently from 158d4c5 to c58141b Compare August 1, 2023 10:10
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI isn't happy yet:

hack/man-page-checker

Inconsistent subcommand descriptions:
podman-generate-systemd.1.md = 'Generate systemd unit file(s) for a container or pod'
podman-generate.1.md = '[DEPRECATED] Generate systemd unit file(s) for a container or pod'

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle I think this is the right direction, we should get users into quadlet.
However we should have actual docs on how to convert to quadlet before advertising this as deprecated. Just looking at podman-systemd.unit(5) is not super helpful as there is no description of a migration part.

Also AFAIK quadlet has no pod support besides k8s yaml and I don't agree that this is a perfect replacement. K8s yaml lacks some podman specific options so migration may not be possible for all users. And then everything is run as part of one unit which totally changes the way on how to monitor and interact with these units.

As soon as people know it is deprecated people will look into it and possibly get frustrated due lacking docs on what they should do. I know we have decent docs on what quadlet is and what options we support but as user I would expect some form step by step instructions on how to convert from the old units to quadlet.

cmd/podman/generate/systemd.go Outdated Show resolved Hide resolved
@@ -119,6 +127,7 @@ func init() {
}

func systemd(cmd *cobra.Command, args []string) error {
fmt.Fprint(os.Stderr, deprecation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to print this? I am personally not the biggest fan of the warnings. I mean its great to get the message out but it is also very annoying.
Not a blocker for me just saying.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's indeed very annoying but I think it may be worth giving a shot. I think that many users are still not familiar with Quadlet and that's a way to let them know about it - very loudly :)

In case users bark back, we can revert.

@vrothberg
Copy link
Member

Improving docs SGTM

Also AFAIK quadlet has no pod support besides k8s yaml and I don't agree that this is a perfect replacement. K8s yaml lacks some podman specific options so migration may not be possible for all users. And then everything is run as part of one unit which totally changes the way on how to monitor and interact with these units.

That probably boils down to documenting some of the limitations.

@edsantiago
Copy link
Collaborator

One possible fix:

diff --git a/docs/source/markdown/podman-generate-systemd.1.md b/docs/source/markdown/podman-generate-systemd.1.md
index 5a6452f69..3fc491246 100644
--- a/docs/source/markdown/podman-generate-systemd.1.md
+++ b/docs/source/markdown/podman-generate-systemd.1.md
@@ -1,7 +1,7 @@
 % podman-generate-systemd 1
 
 ## NAME
-podman\-generate\-systemd - Generate systemd unit file(s) for a container or pod
+podman\-generate\-systemd - [DEPRECATED] Generate systemd unit file(s) for a container or pod
 
 ## SYNOPSIS
 **podman generate systemd** [*options*] *container|pod*
@@ -310,7 +310,7 @@ CONTAINER ID  IMAGE                            COMMAND  CREATED        STATUS
 bb310a0780ae  docker.io/library/alpine:latest  /bin/sh  3 minutes ago  Created                  busy_moser

 ## SEE ALSO
-**[podman(1)](podman.1.md)**, **[podman-container(1)](podman-container.1.md)**, **systemctl(1)**, **systemd.unit(5)**, **systemd.service(5)**, **[conmon(8)](https://github.com/containers/conmon/blob/main/docs/conmon.8.md)**, [Quadlet](podman-systemd.unit.5.md)
+**[podman(1)](podman.1.md)**, **[podman-container(1)](podman-container.1.md)**, **systemctl(1)**, **systemd.unit(5)**, **systemd.service(5)**, **[conmon(8)](https://github.com/containers/conmon/blob/main/docs/conmon.8.md)**, **[podman-systemd.unit(5)](podman-systemd.unit.5.md)**
 
 ## HISTORY
 April 2020, Updated details and added use case to use generated .service files as root and non-root, by Sujil Shah (sushah at redhat dot com)

@rhatdan rhatdan force-pushed the systemd branch 4 times, most recently from eeda7bb to 82ccb1c Compare August 2, 2023 10:09
@rhatdan
Copy link
Member Author

rhatdan commented Aug 2, 2023

@Luap99 Bottom line it is depracated, everyone who reports an issue on podman generate systemd is told to look at Quadlet.
If there are some shortcomings of running k8s under quadlet versus generate systemd, we need to know what users are hitting and work on improving them in Quadlet.

We need to move people to quadlet and the best way to do this is by telling them that generate systemd is deprecated.
In podman 4.8, I plan on hiding the options altogether, and then dropping it in podman 5.0.

@Luap99
Copy link
Member

Luap99 commented Aug 2, 2023

As said I have nothing against this but users need docs, we cannot expect them to understand how to migrate on their own.
So I argue we first need to create such a doc before telling everyone that it is deprecated. There is not a single time the word pod in the quadlet man page. I would be very frustrated as a user if I have a pod unit, it is not trivial to migrate.
There are easy steps to make this simple, i.e. run podman kube generate in the existing pod and then create a kube unit based on that. But this still needs to written out somewhere.
I am not expecting you to fix all shortcomings before saying it is deprecated, I just want a simple docs where we can point people to if they have questions.

@rhatdan
Copy link
Member Author

rhatdan commented Aug 2, 2023

Do you see this as something to add to the quadlet man page?

@vrothberg
Copy link
Member

Do you see this as something to add to the quadlet man page?

That makes sense, yes. The deprecation warnings should point to the quadlet man page where we could add a "migration" section or something similar.

Hiding the generate systemd command SGTM. Entirely removing is always risky; it's used internally and externally a lot. Such breaking changes are always painful - as much as I want the code and command to go away.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last nit, then I think we can merge.

Let's move the migration parts into another PR. I can volunteer to open it and then we can improve.

cmd/podman/generate/systemd.go Outdated Show resolved Hide resolved
@@ -119,6 +127,7 @@ func init() {
}

func systemd(cmd *cobra.Command, args []string) error {
fmt.Fprint(os.Stderr, deprecation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's indeed very annoying but I think it may be worth giving a shot. I think that many users are still not familiar with Quadlet and that's a way to let them know about it - very loudly :)

In case users bark back, we can revert.

@rhatdan rhatdan force-pushed the systemd branch 2 times, most recently from c529902 to e55ade9 Compare August 3, 2023 10:01
Now that Quadlets are fully supported, it is time to Depracate
podman generate systemd command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan, vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member Author

rhatdan commented Aug 4, 2023

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TomSweeneyRedHat
Copy link
Member

/lgtm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants