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

Pre-create config manipulation? #1828

Closed
wking opened this issue Nov 19, 2018 · 4 comments
Closed

Pre-create config manipulation? #1828

wking opened this issue Nov 19, 2018 · 4 comments
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@wking
Copy link
Contributor

wking commented Nov 19, 2018

There's been a lot of discussion over in opencontainers/runc#1811 about how to support the NVIDIA folks and others who want to be able to create devices (possibly after having loaded kernel modules) and bind userspace libraries into the container. Currently that's happening in the middle of run's create-time mount handling before the container pivots to its new root directory with runc's incorrectly-timed prestart hook trigger (opencontainers/runc#1710). My preferred approach would be to have a directory with runtime-config filters (in the stdin/stdout filter sense) to allow trusted parties to manipulate the config JSON before calling the runtime's create. I've mocked up a proof-of-concept runtime wrapper here. I'd like to get something like this landed in libpod (maybe here?). Is there enough interest among libpod maintainers for it to be worth me spending some time putting that together (you can always reject it once you see it ;), or can you already reject the proposal now based on the proof-of-concept?

@wking wking changed the title Pre-create config manipulation Pre-create config manipulation? Nov 19, 2018
@mheon
Copy link
Member

mheon commented Nov 19, 2018 via email

@rhatdan
Copy link
Member

rhatdan commented Nov 21, 2018

I agree, this has to be optional by configuration. We also need information back in podman info to tell us whether one of these is installed.

@wking
Copy link
Contributor Author

wking commented Nov 21, 2018

I agree, this has to be optional by configuration.

The in-flight #1830 already has that covered.

We also need information back in podman info to tell us whether one of these is installed.

Can someone give me some pointers on this. I dunno how info is fed, and I dunno what sort of information you're looking for. Do we already list matching hooks there for other stages?

@mheon
Copy link
Member

mheon commented Nov 21, 2018

I think what you're already doing in #1830 (reporting literal changes to the spec) is plenty sufficient - should be enough to clue us in if anything goes wrong.

wking added a commit to wking/libpod that referenced this issue Jan 9, 2019
There's been a lot of discussion over in [1] about how to support the
NVIDIA folks and others who want to be able to create devices
(possibly after having loaded kernel modules) and bind userspace
libraries into the container.  Currently that's happening in the
middle of runc's create-time mount handling before the container
pivots to its new root directory with runc's incorrectly-timed
prestart hook trigger [2].  With this commit, we extend hooks with a
'precreate' stage to allow trusted parties to manipulate the config
JSON before calling the runtime's 'create'.

I'm recycling the existing Hook schema from pkg/hooks for this,
because we'll want Timeout for reliability and When to avoid the
expense of fork/exec when a given hook does not need to make config
changes [3].

[1]: opencontainers/runc#1811
[2]: opencontainers/runc#1710
[3]: containers#1828 (comment)

Signed-off-by: W. Trevor King <[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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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

No branches or pull requests

3 participants