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

Quadlet - add support for global arguments #20253

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

ygalblum
Copy link
Contributor

@ygalblum ygalblum commented Oct 4, 2023

Add support for adding podman level arguments before subcommand Add specific key for Containers Conf Modules
Adjust testing environment
Add tests
Add to man page

Does this PR introduce a user-facing change?

Yes

Quadlet - add support for podman level arguments

Resolves: #20246

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 4, 2023
@@ -72,6 +73,7 @@ const (
KeyExec = "Exec"
KeyExitCodePropagation = "ExitCodePropagation"
KeyExposeHostPort = "ExposeHostPort"
KeyGlobalOptions = "GlobalOptions"
Copy link
Member

Choose a reason for hiding this comment

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

We use PodmanArgs for flags to the command. To have a symmetric name, could name this GlobalArgs or RootArgs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since both you and @Luap99 suggested GlobalArgs, I went with that.

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.

That was super quick, thanks!

I think that both, --module and the other root flags need to be added to all invocations of Podman. That includes the ExecStop{Post} as well. Podman may be pointed to a completely different graph root, so the podman rms won't work without sharing the flags.

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

1 similar comment
@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@packit-as-a-service
Copy link

Cockpit tests failed for commit c33bf3f2e51cf296dde886ea16322f3a91410623. @martinpitt, @jelly, @mvollmer please check.

@TomSweeneyRedHat
Copy link
Member

All kinds of test unhappiness

@lsm5
Copy link
Member

lsm5 commented Oct 4, 2023

FATAL: docs/source/markdown/podman-systemd.unit.5.md has a too-long table column; use 'man -l docs/build/man/podman-systemd.unit.5' and look for empty table cells.
make: *** [Makefile:498: docs/source/markdown/podman-systemd.unit.5] Error 1

@ygalblum ygalblum force-pushed the quadlet-command-args branch from c33bf3f to addefec Compare October 5, 2023 07:10
@ygalblum
Copy link
Contributor Author

ygalblum commented Oct 5, 2023

That was super quick, thanks!

I think that both, --module and the other root flags need to be added to all invocations of Podman. That includes the ExecStop{Post} as well. Podman may be pointed to a completely different graph root, so the podman rms won't work without sharing the flags.

You're right, thanks. I've updated the code and tests accordingly

@ygalblum
Copy link
Contributor Author

ygalblum commented Oct 5, 2023

@TomSweeneyRedHat @lsm5 yes I've seen this error, though, I don't know how to fix it. It's not the first time this happens but I don't remember how I fixed it before as it was the result of trial-and-error cycles.

The issue is caused by the table line added for ContainersConfModule:

| ContainersConfModule=/etc/1.conf | --module=/etc/1.conf                                 |

So, I was wondering if you know what needs to change in order to fix this error.

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

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.

To pass the docs build, the 1.conf needs to be escaped to 1\.conf. The error is quite misleading

@vrothberg
Copy link
Member

To pass the docs build, the 1.conf needs to be escaped to 1\.conf. The error is quite misleading

Maybe replace it to nvidia\.conf?

@ygalblum ygalblum force-pushed the quadlet-command-args branch 2 times, most recently from e07ce99 to 752c9c6 Compare October 5, 2023 09:58
@ygalblum
Copy link
Contributor Author

ygalblum commented Oct 5, 2023

@vrothberg Thanks for your help (and I've changed to nvidia\.conf as you suggested

@ygalblum ygalblum force-pushed the quadlet-command-args branch from 752c9c6 to 515277b Compare October 5, 2023 11:36
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

@vrothberg
Copy link
Member

Linter isn't happy yet

@ygalblum ygalblum force-pushed the quadlet-command-args branch from 515277b to 941337e Compare October 5, 2023 14:56
@mheon
Copy link
Member

mheon commented Oct 5, 2023

Code LGTM

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
/hold
Restarted the flaked jobs; transient errors on Quay.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2023
Comment on lines 424 to 438
service.Add(ServiceGroup, "ExecStopPost", "-"+podmanBinary()+" rm -v -f -i --cidfile=%t/%N.cid")
serviceStopCmd.Args = append([]string{"-"}, serviceStopCmd.Args...)
Copy link
Member

Choose a reason for hiding this comment

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

This change does not look right, it will result in - binary not the old (correct) -binary, notice the extra space.

The fact that none of the test catches that worries me, testing locally I see

Empty path in command line, ignoring: '- /usr/bin/podman rm -v -f -i --cidfile=%t/%N.cid'

as warning in the journal so it is not accepted by systemd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for finding this.
The issue was in the regex being checked as it was not forcing non white space after the - sign. I've fixed it and the code.

@Luap99 Luap99 removed the lgtm Indicates that a PR is ready to be merged. label Oct 6, 2023
Add support for adding podman level arguments before subcommand
Add specific key for Containers Conf Modules
Global arguments are added for both start and stop commands
Adjust testing environment
Add tests
Add to man page

Signed-off-by: Ygal Blum <[email protected]>
@ygalblum ygalblum force-pushed the quadlet-command-args branch from 941337e to d321d42 Compare October 8, 2023 07:14
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.

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 9, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, vrothberg, ygalblum

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:
  • OWNERS [Luap99,vrothberg,ygalblum]

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

@Luap99
Copy link
Member

Luap99 commented Oct 9, 2023

/lgtm
/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 9, 2023
@openshift-ci openshift-ci bot merged commit 6e7e875 into containers:main Oct 9, 2023
95 of 97 checks passed
@ygalblum ygalblum deleted the quadlet-command-args branch October 9, 2023 11:56
@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 Jan 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2024
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.

Please support --module feature in quadlet
6 participants