YARN-9419. Log a warning if GPU isolation is enabled but LinuxContainerExecutor is disabled. Contribued by Andras Gyori
This commit is contained in:
parent
c734d69a55
commit
44afe1154d
@ -20,9 +20,12 @@
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
||||||
import org.apache.hadoop.yarn.exceptions.YarnException;
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
||||||
|
import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.Context;
|
import org.apache.hadoop.yarn.server.nodemanager.Context;
|
||||||
|
import org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationExecutor;
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.privileged.PrivilegedOperationExecutor;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.CGroupsHandler;
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.CGroupsHandler;
|
||||||
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandler;
|
import org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandler;
|
||||||
@ -59,6 +62,7 @@ public GpuResourcePlugin(GpuNodeResourceUpdateHandler resourceDiscoverHandler,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(Context context) throws YarnException {
|
public void initialize(Context context) throws YarnException {
|
||||||
|
validateExecutorConfig(context.getConf());
|
||||||
this.gpuDiscoverer.initialize(context.getConf(),
|
this.gpuDiscoverer.initialize(context.getConf(),
|
||||||
new NvidiaBinaryHelper());
|
new NvidiaBinaryHelper());
|
||||||
this.dockerCommandPlugin =
|
this.dockerCommandPlugin =
|
||||||
@ -66,6 +70,17 @@ public void initialize(Context context) throws YarnException {
|
|||||||
context.getConf());
|
context.getConf());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void validateExecutorConfig(Configuration conf) {
|
||||||
|
Class<? extends ContainerExecutor> executorClass = conf.getClass(
|
||||||
|
YarnConfiguration.NM_CONTAINER_EXECUTOR, DefaultContainerExecutor.class,
|
||||||
|
ContainerExecutor.class);
|
||||||
|
|
||||||
|
if (executorClass.equals(DefaultContainerExecutor.class)) {
|
||||||
|
LOG.warn("Using GPU plugin with disabled LinuxContainerExecutor" +
|
||||||
|
" is considered to be unsafe.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceHandler createResourceHandler(
|
public ResourceHandler createResourceHandler(
|
||||||
Context context, CGroupsHandler cGroupsHandler,
|
Context context, CGroupsHandler cGroupsHandler,
|
||||||
|
Loading…
Reference in New Issue
Block a user