nvidia-container-runtime-hook: Get hook stage from stdin's 'status' value#14
nvidia-container-runtime-hook: Get hook stage from stdin's 'status' value#14wking wants to merge 51 commits intoNVIDIA:masterfrom
Conversation
Signed-off-by: Felix Abecassis <[email protected]>
It gives the opportunity to perform cleanup in the main function.
Any environment variable with the prefix "NVIDIA_REQUIRE_" will have its value passed to nvidia-container-cli. NVIDIA_CUDA_VERSION is no longer used and the CUDA images will be replaced by a NVIDIA_REQUIRE_CUDA variable. Those checks can be disabled globally in the configuration file or for each container using NVIDIA_DISABLE_REQUIRE.
Implement "-debug"
Signed-off-by: Christy Norman <[email protected]> Signed-off-by: Felix Abecassis <[email protected]>
See opencontainers/runc@db093f6 We now let debuild detect and add the dependency for older versions of runc.
Signed-off-by: Christy Norman <[email protected]> Signed-off-by: Felix Abecassis <[email protected]>
Tools like CRI-O or Red Hat's fork of Docker only need the OCI hook, not the full runtime. The hook is also likely to move at a different cadence than the full runtime, which is tied to the upstream Docker releases.
…alue
Instead of using CRI-O-specific arguments, use the state's REQUIRED
'status' property [1] to ensure we're being called on a created
container (and not a running container or a stopped container).
We could potentially have:
args := flag.Args()
if len(args) != 0 {
flag.Usage()
os.Exit(2)
}
but to stay compatible with folks using the hook with older CRI-O
(including the 1.9.x branch), I've just ignored flag.Args() for now.
Also add 'fallthrough' statements [2] to the no-op switch cases, since
that appeared to be the intention.
[1]: https://github.com/opencontainers/runtime-spec/blame/v1.0.1/runtime.md#L16
[2]: https://golang.org/ref/spec#Fallthrough_statements
73467ad to
f5d786e
Compare
It's not, really. As long as it's setup properly, for instance it works fine with docker since we inject the hook + Initially the syntax was |
|
In addition, |
|
Some notes on runc support here. |
|
Uh, the right struct from the OCI spec was pulled in, but it still doesn't seem to be set inside of runc before the prestart hooks, right? |
Heh, nice. I'll file runc and runtime-tools validation PRs later. Probably table this PR for now. |
Instead of using CRI-O-specific arguments, use the state's REQUIRED
statusproperty to ensure we're being called on a created container (and not a running container or a stopped container).Also add
fallthroughstatements to the no-op switch cases, since that appeared to be the intention.This is ground-work for dropping the stage environment variable from CRI-O (cri-o/cri-o#1360), and should work for any CRI-O version. The
args[0]approach I'm replacing was dropped from CRI-O in cri-o/cri-o#1244.