Search in sources :

Example 1 with DockerClient

use of org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker.DockerClient in project hadoop by apache.

the class DockerLinuxContainerRuntime method initialize.

@Override
public void initialize(Configuration conf) throws ContainerExecutionException {
    this.conf = conf;
    dockerClient = new DockerClient(conf);
    allowedNetworks.clear();
    allowedNetworks.addAll(Arrays.asList(conf.getTrimmedStrings(YarnConfiguration.NM_DOCKER_ALLOWED_CONTAINER_NETWORKS, YarnConfiguration.DEFAULT_NM_DOCKER_ALLOWED_CONTAINER_NETWORKS)));
    defaultNetwork = conf.getTrimmed(YarnConfiguration.NM_DOCKER_DEFAULT_CONTAINER_NETWORK, YarnConfiguration.DEFAULT_NM_DOCKER_DEFAULT_CONTAINER_NETWORK);
    if (!allowedNetworks.contains(defaultNetwork)) {
        String message = "Default network: " + defaultNetwork + " is not in the set of allowed networks: " + allowedNetworks;
        if (LOG.isWarnEnabled()) {
            LOG.warn(message + ". Please check " + "configuration");
        }
        throw new ContainerExecutionException(message);
    }
    privilegedContainersAcl = new AccessControlList(conf.getTrimmed(YarnConfiguration.NM_DOCKER_PRIVILEGED_CONTAINERS_ACL, YarnConfiguration.DEFAULT_NM_DOCKER_PRIVILEGED_CONTAINERS_ACL));
}
Also used : AccessControlList(org.apache.hadoop.security.authorize.AccessControlList) ContainerExecutionException(org.apache.hadoop.yarn.server.nodemanager.containermanager.runtime.ContainerExecutionException) DockerClient(org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker.DockerClient)

Aggregations

AccessControlList (org.apache.hadoop.security.authorize.AccessControlList)1 DockerClient (org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.runtime.docker.DockerClient)1 ContainerExecutionException (org.apache.hadoop.yarn.server.nodemanager.containermanager.runtime.ContainerExecutionException)1