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 shim package with a Runner interface and an implementation of the interface that encapsulates the syscall.Exec calls that are used to forward an intercepted command to runc.
  • Introduction of an oci package to encapsulate an OCI spec and expose a ReadWriteModifier interface. 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.go to instantiate a shim, and invoke a Run method instead of having all the logic in the main function.

Signed-off-by: Evan Lezar elezar@nvidia.com

Merge request reports

Loading