java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.OCIContainerRuntime
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.RuncContainerRuntime
All Implemented Interfaces:
LinuxContainerRuntime, ContainerRuntime

@Private @Unstable public class RuncContainerRuntime extends OCIContainerRuntime

This class is an extension of OCIContainerRuntime that uses the native container-executor binary via a PrivilegedOperationExecutor instance to launch processes inside Runc containers.

The following environment variables are used to configure the Runc engine:

  • YARN_CONTAINER_RUNTIME_TYPE ultimately determines whether a runC container will be used. If the value is runc, a runC container will be used. Otherwise a regular process tree container will be used. This environment variable is checked by the isRuncContainerRequested(org.apache.hadoop.conf.Configuration, java.util.Map<java.lang.String, java.lang.String>) method, which is called by the DelegatingLinuxContainerRuntime.
  • YARN_CONTAINER_RUNTIME_RUNC_IMAGE names which image will be used to launch the Runc container.
  • YARN_CONTAINER_RUNTIME_RUNC_MOUNTS allows users to specify additional volume mounts for the runC container. The value of the environment variable should be a comma-separated list of mounts. All such mounts must be given as source:dest[:mode] and the mode must be "ro" (read-only) or "rw" (read-write) to specify the type of access being requested. If neither is specified, read-write will be assumed. The requested mounts will be validated by container-executor based on the values set in container-executor.cfg for runc.allowed.ro-mounts and runc.allowed.rw-mounts.
  • YARN_CONTAINER_RUNTIME_RUNC_CONTAINER_HOSTNAME sets the hostname to be used by the Runc container. If not specified, a hostname will be derived from the container ID and set as default hostname for networks other than 'host'.