-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix handling of static/volume dir #20088
Conversation
Marked as a draft for now as it's vendoring containers/common#1660. Once green and Acked we can merge containers/common#1660 and do the dance. |
d6c569a
to
4bd5ca0
Compare
Cockpit tests failed for commit 020c8dd6e96d9e95a5144c2444e229ddf7056abb. @martinpitt, @jelly, @mvollmer please check. |
Cockpit tests failed for commit 6156986252c282035bcddd2056dea7483a22350d. @martinpitt, @jelly, @mvollmer please check. |
@mheon PTAL |
Thanks @vrothberg for fixing. Tests previously failed on
It's a bit curious that no other test picked this up. The test setup script doesn't do anything super weird though. Anyway, water under the bridge! |
Thanks, @martinpitt ! The |
@@ -540,7 +540,7 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) { | |||
_ = pFlags.MarkHidden(networkBackendFlagName) | |||
|
|||
rootFlagName := "root" | |||
pFlags.StringVar(&podmanConfig.ContainersConf.Engine.StaticDir, rootFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.StaticDir, "Path to the root directory in which data, including images, is stored") | |||
pFlags.StringVar(&podmanConfig.GraphRoot, rootFlagName, "", "Path to the graph root directory where images, containers, etc. are stored") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we concerned about this breaking folks? Setting --root
is now doing something very different than it did before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly don't know. This stuff is really broken :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good to go. It essentially overrode the graph root before as well (that's how it was being used).
4bd5ca0
to
a4b1cf1
Compare
@@ -1328,6 +1328,9 @@ func (r *ConmonOCIRuntime) configureConmonEnv(runtimeDir string) []string { | |||
if conf, ok := os.LookupEnv("CONTAINERS_CONF"); ok { | |||
env = append(env, fmt.Sprintf("CONTAINERS_CONF=%s", conf)) | |||
} | |||
if conf, ok := os.LookupEnv("CONTAINERS_CONF_OVERRIDE"); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mheon do you recall why we're not passing all env variables to conmon? I feel like we should do this since there is a growing number of those which I do not see being passed down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it dates back to before we forked off Conmon, so this is probably older than my involvement in the project. I don't see a good reason not to forward on full environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I will open a follow-up PR 👍
a4b1cf1
to
712a9db
Compare
OK, this is ready from end ✔️ |
If this is fully rebased on the latest c/common I expect the machine tests to fail: #20094 |
This is the 2nd time in 24 hours that a commit in common got merged and broke Podman CI :( I'll take a look at fixing the machine tests. |
712a9db
to
ba70184
Compare
Repushed and commented out the failures. I let @ashley-cui adjust the tests once this PR here got in. |
ba70184
to
35ad588
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Luap99, 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 |
sqlite behaves differently than boltdb :( Not sure whether I can get this fixed in time today, apologies. |
Opened containers/common#1663 to revert my two commits, so I can work on the remaining issues in peace. |
35ad588
to
422dbe6
Compare
Found the issue. The problem was that the sqlite DB was always placed on the graph root and not on the static dir. Now, since the static dir can really be configured it blew up. |
Sorry about that, opened #20101 and will rebase/adjust once this PR goes in. |
Thanks! In case this PR here fails again, feel free to just merge yours and I will rebase this one here on Monday :) |
The fight is still not over. Transient store e2e tests are crying. I'll calm them Monday morning. |
422dbe6
to
a1519a4
Compare
Hitting #20119 now |
a1519a4
to
5b285ed
Compare
The processing and setting of the static and volume directories was scattered across the code base (including c/common) leading to subtle errors that surfaced in containers#19938. There were multiple issues that I try to summarize below: - c/common loaded the graphroot from c/storage to set the defaults for static and volume dir. That ignored Podman's --root flag and surfaced in containers#19938 and other bugs. c/common does not set the defaults anymore which gives Podman the ability to detect when the user/admin configured a custom directory (not empty value). - When parsing the CLI, Podman (ab)uses containers.conf structures to set the defaults but also to override them in case the user specified a flag. The --root flag overrode the static dir which is wrong and broke a couple of use cases. Now there is a dedicated field for in the "PodmanConfig" which also includes a containers.conf struct. - The defaults for static and volume dir and now being set correctly and adhere to --root. - The CONTAINERS_CONF_OVERRIDE env variable has not been passed to the cleanup process. I believe that _all_ env variables should be passed to conmon to avoid such subtle bugs. Overall I find that the code and logic is scattered and hard to understand and follow. I refrained from larger refactorings as I really just want to get containers#19938 fixed and then go back to other priorities. containers/common#1659 broke three pkg/machine tests. Those have been commented out until getting fixed. Fixes: containers#19938 Signed-off-by: Valentin Rothberg <[email protected]>
5b285ed
to
6293ec2
Compare
code LGTM |
/lgtm |
The processing and setting of the static and volume directories was scattered across the code base (including c/common) leading to subtle errors that surfaced in #19938.
There were multiple issues that I try to summarize below:
c/common loaded the graphroot from c/storage to set the defaults for static and volume dir. That ignored Podman's --root flag and surfaced in podman with custom
static_dir
slow to tear-down containers #19938 and other bugs. c/common does not set the defaults anymore which gives Podman the ability to detect when the user/admin configured a custom directory (not empty value).When parsing the CLI, Podman (ab)uses containers.conf structures to set the defaults but also to override them in case the user specified a flag. The --root flag overrode the static dir which is wrong and broke a couple of use cases. Now there is a dedicated field for in the "PodmanConfig" which also includes a containers.conf struct.
The defaults for static and volume dir and now being set correctly and adhere to --root.
The CONTAINERS_CONF_OVERRIDE env variable has not been passed to the cleanup process. I believe that all env variables should be passed to conmon to avoid such subtle bugs.
Overall I find that the code and logic is scattered and hard to understand and follow. I refrained from larger refactorings as I really just want to get #19938 fixed and then go back to other priorities.
Fixes: #19938
Does this PR introduce a user-facing change?