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

Add support for Libpod configuration file #430

Closed
wants to merge 8 commits into from

Conversation

mheon
Copy link
Member

@mheon mheon commented Mar 1, 2018

Add a configuration file (/etc/containerd/libpod.conf) that we can read to override our default configuration. This file is optional, and if not present we'll use our baked-in defaults as before.

This allows more graceful handling of multiple paths in a config
file.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
@rhatdan
Copy link
Member

rhatdan commented Mar 1, 2018

I would prefer that we did not have to add a configuration file, because the goal of all these tools is to share content. So I don't want to have a libpod.conf, buildah.conf, skopeo.conf and would love to get rid of most of crio.conf. If we decide we really need a libpod.conf, it should be stored in /usr/lib/containers/libpod.conf and should have everything commented out so that it shares storage.conf, policy.conf ... with the other tools.

I don't see many users ever editing this file, so it brings little value, and is likely to cause us issues where crio, buildah, podman, and skopeo don't work together.

@mheon
Copy link
Member Author

mheon commented Mar 1, 2018

This does not override c/storage or c/image configuration. It exists solely for libpod-specific configuration (paths for runc, conmon, where to store the DB, etc).

@mheon
Copy link
Member Author

mheon commented Mar 1, 2018

The big driver for this one is going to be different distributions, we can't know where runc and conmon will be, so we need to give the ability to customize those paths. Same for the libpod database.

@rhatdan
Copy link
Member

rhatdan commented Mar 1, 2018

Ok as long as we stick to those libpod specific paths and don't venture into conflicting with other config, I am fine with it. But it should be installed in /usr/share/containers/libpod.conf with the overide in /etc/containers/libpod.conf

The standard config has moved to /usr/share/containers/ per
discussion. An override configuration file is allowed at the
previous /etc/containers/ location. This override will be used in
place of the normal config if both are present, and exists to
override distro packaged configs without modifying the standard
config.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
@mheon
Copy link
Member Author

mheon commented Mar 1, 2018

Default location changed to /usr/share/containers with override path of /etc/containers allowed.

// images
ImageDefaultTransport string `toml:"image_default_transport"`
// SignaturePolicyPath is the path to a signature policy to use for
// validationg images
Copy link
Member

Choose a reason for hiding this comment

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

nit validtiong to validating

// Overwrite it with user-given configuration options
// Check to see if the given configuration file exists
if _, err := os.Stat(configPath); err != nil {
return nil, errors.Wrapf(err, "error stating configuration file %s", configPath)
Copy link
Member

Choose a reason for hiding this comment

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

might be me, but I'd pref getting rid of 'stating'. Perhaps:

"error performing stat on configuration file"
"error unable to determine status of configuration file"

When I saw stating, my first thought is you had trouble starting the config file.

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, OK with follow up PR for nits (or not)

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
libpod.conf Outdated
cgroup_manager = "cgroupfs"

# Directory for persistent libpod files (database, etc)
static_dir = "/var/lib/containers/storage/libpod"
Copy link
Member

Choose a reason for hiding this comment

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

Can this be commented out, and we just get it relative to where container storage is configured in /etc/containers/storage.conf, also have a reference to that here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed. We already set it relative to containers/storage in the baked-in defaults, so just commenting this out is enough to get a path relative to containers/storage

@@ -101,7 +101,11 @@ func WithOCIRuntime(runtimePath string) RuntimeOption {
return ErrRuntimeFinalized
}

rt.config.RuntimePath = runtimePath
if runtimePath == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Should check if the path exists also?

Copy link
Member Author

Choose a reason for hiding this comment

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

Runtime will do that when it starts up

Copy link
Member

Choose a reason for hiding this comment

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

Ok

if path != "" {
rt.config.ConmonPath = path

if path == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Ditto, should check if the path exists.

Copy link
Member Author

Choose a reason for hiding this comment

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

Runtime will do that when it starts up

Copy link
Member

Choose a reason for hiding this comment

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

ok

@@ -394,3 +549,15 @@ func (r *Runtime) Info() ([]InfoData, error) {

return info, nil
}

// SaveDefaultConfig saves a copy of the default config at the given path
func SaveDefaultConfig(path string) error {
Copy link
Member

Choose a reason for hiding this comment

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

What do you plan to do with this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Mostly there just in case we ever change the config and need to regenerate a default one. It seems useful to keep around

Copy link
Member

Choose a reason for hiding this comment

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

Ok

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
@mheon
Copy link
Member Author

mheon commented Mar 5, 2018

Should be ready now

@rhatdan
Copy link
Member

rhatdan commented Mar 6, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit 8e59371 has been approved by rhatdan

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit 8e59371 with merge c1ffafc...

rh-atomic-bot pushed a commit that referenced this pull request Mar 6, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
rh-atomic-bot pushed a commit that referenced this pull request Mar 6, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
rh-atomic-bot pushed a commit that referenced this pull request Mar 6, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
rh-atomic-bot pushed a commit that referenced this pull request Mar 6, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
rh-atomic-bot pushed a commit that referenced this pull request Mar 6, 2018
The standard config has moved to /usr/share/containers/ per
discussion. An override configuration file is allowed at the
previous /etc/containers/ location. This override will be used in
place of the normal config if both are present, and exists to
override distro packaged configs without modifying the standard
config.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
rh-atomic-bot pushed a commit that referenced this pull request Mar 6, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
rh-atomic-bot pushed a commit that referenced this pull request Mar 6, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #430
Approved by: rhatdan
@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr
Approved by: rhatdan
Pushing c1ffafc to master...

lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
This allows more graceful handling of multiple paths in a config
file.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
The standard config has moved to /usr/share/containers/ per
discussion. An override configuration file is allowed at the
previous /etc/containers/ location. This override will be used in
place of the normal config if both are present, and exists to
override distro packaged configs without modifying the standard
config.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
lsm5 pushed a commit to lsm5/podman that referenced this pull request Mar 22, 2018
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: containers#430
Approved by: rhatdan
baude pushed a commit to baude/podman that referenced this pull request Aug 31, 2019
Wondering if this is still a proposal?
@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 27, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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 this pull request may close these issues.

None yet

4 participants