ctx.setLocalResources(taskManagerLocalResources);
private ContainerLaunchContext newContainerLaunchContext(Container container, String helixInstanceName) throws IOException { Path appWorkDir = GobblinClusterUtils.getAppWorkDirPath(this.fs, this.applicationName, this.applicationId); Path containerWorkDir = new Path(appWorkDir, GobblinYarnConfigurationKeys.CONTAINER_WORK_DIR_NAME); Map<String, LocalResource> resourceMap = Maps.newHashMap(); addContainerLocalResources(new Path(appWorkDir, GobblinYarnConfigurationKeys.LIB_JARS_DIR_NAME), resourceMap); addContainerLocalResources(new Path(containerWorkDir, GobblinYarnConfigurationKeys.APP_JARS_DIR_NAME), resourceMap); addContainerLocalResources( new Path(containerWorkDir, GobblinYarnConfigurationKeys.APP_FILES_DIR_NAME), resourceMap); if (this.config.hasPath(GobblinYarnConfigurationKeys.CONTAINER_FILES_REMOTE_KEY)) { addRemoteAppFiles(this.config.getString(GobblinYarnConfigurationKeys.CONTAINER_FILES_REMOTE_KEY), resourceMap); } ContainerLaunchContext containerLaunchContext = Records.newRecord(ContainerLaunchContext.class); containerLaunchContext.setLocalResources(resourceMap); containerLaunchContext.setEnvironment(YarnHelixUtils.getEnvironmentVariables(this.yarnConfiguration)); containerLaunchContext.setCommands(Lists.newArrayList(buildContainerCommand(container, helixInstanceName))); if (UserGroupInformation.isSecurityEnabled()) { containerLaunchContext.setTokens(this.tokens.duplicate()); } return containerLaunchContext; }
/** * Given this generic description of an application, create the detailed YARN * application submission context required to launch the application. * * @param conf * the YARN configuration obtained by reading the Hadoop * configuration files * @return the completed application launch context for the given application * @throws IOException * if localized resources are not found in the distributed file * system (such as HDFS) */ public ContainerLaunchContext createLaunchContext(YarnConfiguration conf) throws IOException { // Set up the container launch context ContainerLaunchContext container = Records .newRecord(ContainerLaunchContext.class); // Set up the list of commands to run. Here, we assume that we run only // one command. container.setCommands(Collections.singletonList(getCommand())); // Add localized resources container.setLocalResources(resources); // Environment. container.setEnvironment(env); return container; }
amContainer.setLocalResources(localResources); fs.close();
LocalResourceType.FILE)); ctx.setLocalResources(resources);
amContainer.setLocalResources(Collections.singletonMap(IgniteYarnUtils.JAR_NAME, appMasterJar));
amContainerLaunchContext.setLocalResources(appMasterLocalResources); amContainerLaunchContext.setEnvironment(YarnHelixUtils.getEnvironmentVariables(this.yarnConfiguration)); amContainerLaunchContext.setCommands(Lists.newArrayList(buildApplicationMasterCommand(resource.getMemory())));
false, (int) job.taskManagerMemoryMb()); amContainer.setLocalResources(localResources);
@Override public void setLocalResources(Map<String, YarnLocalResource> localResources) { launchContext.setLocalResources(Maps.transformValues(localResources, RESOURCE_TRANSFORM)); }
@Override public void setLocalResources(Map<String, YarnLocalResource> localResources) { launchContext.setLocalResources(Maps.transformValues(localResources, RESOURCE_TRANSFORM)); }
@Override public void setLocalResources(Map<String, YarnLocalResource> localResources) { launchContext.setLocalResources(Maps.transformValues(localResources, RESOURCE_TRANSFORM)); }
/** * @return a ContainerLaunchContext with the given commands and LocalResources. */ public static final ContainerLaunchContext getContainerLaunchContext( final List<String> commands, final Map<String, LocalResource> localResources) { final ContainerLaunchContext context = Records.newRecord(ContainerLaunchContext.class); context.setLocalResources(localResources); context.setCommands(commands); return context; }
@Override public ContainerLaunchContext preLaunch(Container container, ContainerLaunchContext context) { ContainerCluster cluster = findContainerClusterByContainer(container); if (cluster != null) { Map<String, LocalResource> resources = buildLocalizedResources(cluster); context.setLocalResources(resources); Map<String, String> environment = new HashMap<String, String>(context.getEnvironment()); environment.putAll(getEnvironment(clusterIdToRef.get(cluster.getId()))); context.setEnvironment(environment); } return context; } }
public ContainerLaunchContext create(ContainerLaunchParameters parameters) { ContainerLaunchContext clc = Records.newRecord(ContainerLaunchContext.class); clc.setCommands(parameters.getCommands()); clc.setEnvironment(parameters.getEnvironment()); clc.setLocalResources(parameters.getLocalResources()); return clc; }
public static ContainerLaunchContext newContainerLaunchContext( Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls) { ContainerLaunchContext container = recordFactory .newRecordInstance(ContainerLaunchContext.class); container.setLocalResources(localResources); container.setEnvironment(environment); container.setCommands(commands); container.setServiceData(serviceData); container.setTokens(tokens); container.setApplicationACLs(acls); return container; }
public static ContainerLaunchContext newContainerLaunchContext( Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls) { ContainerLaunchContext container = recordFactory .newRecordInstance(ContainerLaunchContext.class); container.setLocalResources(localResources); container.setEnvironment(environment); container.setCommands(commands); container.setServiceData(serviceData); container.setTokens(tokens); container.setApplicationACLs(acls); return container; }
public static ContainerLaunchContext newContainerLaunchContext( Map<String, LocalResource> localResources, Map<String, String> environment, List<String> commands, Map<String, ByteBuffer> serviceData, ByteBuffer tokens, Map<ApplicationAccessType, String> acls) { ContainerLaunchContext container = recordFactory .newRecordInstance(ContainerLaunchContext.class); container.setLocalResources(localResources); container.setEnvironment(environment); container.setCommands(commands); container.setServiceData(serviceData); container.setTokens(tokens); container.setApplicationACLs(acls); return container; }
/** * Compose the ContainerLaunchContext for the Application Master. * * @return the CLC object populated and configured. */ private ContainerLaunchContext buildContainerLaunchContext() throws IOException { ContainerLaunchContext appMasterContainer = Records.newRecord(ContainerLaunchContext.class); appMasterContainer.setEnvironment(buildEnvironment()); appMasterContainer.setLocalResources(buildLocalResourceMap()); appMasterContainer.setCommands(buildAppMasterExecCommand()); setToken(appMasterContainer); return appMasterContainer; }
/** * Compose the ContainerLaunchContext for the Application Master. * * @return the CLC object populated and configured. */ private ContainerLaunchContext buildContainerLaunchContext() throws IOException { ContainerLaunchContext appMasterContainer = Records.newRecord(ContainerLaunchContext.class); appMasterContainer.setEnvironment(buildEnvironment()); appMasterContainer.setLocalResources(buildLocalResourceMap()); appMasterContainer.setCommands(buildAppMasterExecCommand()); setToken(appMasterContainer); return appMasterContainer; }
private ContainerLaunchContext prepareContainerLaunchContext() throws IOException { ContainerLaunchContext clc = Records.newRecord(ContainerLaunchContext.class); clc.setCommands(Arrays.asList("/bin/sleep 5")); if (UserGroupInformation.isSecurityEnabled()) { clc.setTokens(getTokens()); clc.setTokensConf(getTokensConf()); } clc.setLocalResources(getLocalResources()); clc.setEnvironment(getEnvironment()); clc.setContainerRetryContext(getContainerRetryContext()); clc.setServiceData(getServiceData()); return clc; }