Refactor NVIDIA Container runtime
This change refactors the NVIDIA container runtime. The primary focus is to allow for more complex modifications of the OCI spec than adding the nvidia-container-runtime-hook in future.
The refactor includes:
- Introduction of a
shimpackage with aRunnerinterface and an implementation of the interface that encapsulates thesyscall.Execcalls that are used to forward an intercepted command torunc. - Introduction of an
ocipackage to encapsulate an OCI spec and expose aReadWriteModifierinterface. An implementation that loads an OCI spec from file, modifies it, and writes back to the same file is provided and used by the runtime. - The refactor of the logic in
main.goto instantiate a shim, and invoke aRunmethod instead of having all the logic in the main function.
Signed-off-by: Evan Lezar elezar@nvidia.com