You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Weiwei Yang (JIRA)" <ji...@apache.org> on 2019/01/30 10:03:00 UTC

[jira] [Comment Edited] (YARN-9060) [YARN-8851] Phase 1 - Support device isolation and use the Nvidia GPU plugin as an example

    [ https://issues.apache.org/jira/browse/YARN-9060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16755941#comment-16755941 ] 

Weiwei Yang edited comment on YARN-9060 at 1/30/19 10:02 AM:
-------------------------------------------------------------

 Hi [~tangzhankun]

Please take a look at my comments:

*NvidiaGPUPlugin*

1) NvidiaGPUPlugin#getDevices
{code:java}
for (String oneLine : lines) {
  String[] tokensEachLine = oneLine.split(",");
  String minorNumber = tokensEachLine[0].trim();
  String busId = tokensEachLine[1].trim();
  ...
}
{code}
The parsing code assumes the array len is 2, which can potentially throw out of index. Pls add a check here.

2) NvidiaGPUPlugin#searchBinary

We should use consistent logging, pls replace "script" with "binary".

and the log
{code:java}
if (!found) {
  LOG.error("No binary found in below path" + DEFAULT_BINARY_SEARCH_DIRS.toString());
  throw new Exception("No binary found for " + NvidiaGPUPlugin.class);
}
{code}
A more comprehensive logging can be something like

No binary found from env variable ENV_BINARY_PATH or path " + DEFAULT_BINARY_SEARCH_DIRS.toString()

3) Could u pls rename {{MyShellExecutor}} to something like {{NvidiaCommandExecutor}} 
{code:java}
if (yarnRuntime == YarnRuntimeType.RUNTIME_DEFAULT) {
  return null;
}
{code}
this can be removed

4) I think we need to catch the {{NumberFormateException}} here when parsing failed, and throw a IOException. Otherwise it might crash the NM.
{code:java}
output = Integer.toString(Integer.parseInt(strs[0], 16));
{code}
5)  Can we add version to the class implementation, in case in future there are multiple version implementations for GPU resource plugin?

*DeviceResourceDockerRuntimePluginImpl*

1)  DeviceResourceDockerRuntimePluginImpl#getCleanupDockerVolumesCommand
{code:java}
LOG.warn("Exception thrown onDeviceReleased of " + devicePlugin.getClass() + e.getMessage());
{code}
can be changed to
{code:java}
LOG.warn("Exception thrown onDeviceReleased of " + devicePlugin.getClass(), e);
{code}
*Misc*

Pls wrap LOG.DEBUG with
{code:java}
if (LOG.isDebugEnabled()){
  LOG.DEBUG("...")
}
{code}
Thanks


was (Author: cheersyang):
 

Hi [~tangzhankun]

Please take a look at my comments:

*NvidiaGPUPlugin*

1) NvidiaGPUPlugin#getDevices
{code:java}
for (String oneLine : lines) {
  String[] tokensEachLine = oneLine.split(",");
  String minorNumber = tokensEachLine[0].trim();
  String busId = tokensEachLine[1].trim();
  ...
}
{code}
The parsing code assumes the array len is 2, which can potentially throw out of index. Pls add a check here.

2) NvidiaGPUPlugin#searchBinary

We should use consistent logging, pls replace "script" with "binary".

and the log
{code:java}
if (!found) {
  LOG.error("No binary found in below path" + DEFAULT_BINARY_SEARCH_DIRS.toString());
  throw new Exception("No binary found for " + NvidiaGPUPlugin.class);
}
{code}
A more comprehensive logging can be something like

No binary found from env variable ENV_BINARY_PATH or path " + DEFAULT_BINARY_SEARCH_DIRS.toString()

3) Could u pls rename {{MyShellExecutor}} to something like {{NvidiaCommandExecutor}} 
{code:java}
if (yarnRuntime == YarnRuntimeType.RUNTIME_DEFAULT) {
  return null;
}
{code}
this can be removed

4) I think we need to catch the {{NumberFormateException}} here when parsing failed, and throw a IOException. Otherwise it might crash the NM.

{code}

output = Integer.toString(Integer.parseInt(strs[0], 16));

{code}

5)  Can we add version to the class implementation, in case in future there are multiple version implementations for GPU resource plugin?

*DeviceResourceDockerRuntimePluginImpl*

1)  DeviceResourceDockerRuntimePluginImpl#getCleanupDockerVolumesCommand

{code}

LOG.warn("Exception thrown onDeviceReleased of " + devicePlugin.getClass() + e.getMessage());

{code}

can be changed to

{code}

LOG.warn("Exception thrown onDeviceReleased of " + devicePlugin.getClass(), e);

{code}

*Misc*

Pls wrap LOG.DEBUG with

{code}

if (LOG.isDebugEnabled()){

  LOG.DEBUG("...")

}

{code}

Thanks

> [YARN-8851] Phase 1 - Support device isolation and use the Nvidia GPU plugin as an example
> ------------------------------------------------------------------------------------------
>
>                 Key: YARN-9060
>                 URL: https://issues.apache.org/jira/browse/YARN-9060
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Zhankun Tang
>            Assignee: Zhankun Tang
>            Priority: Major
>         Attachments: YARN-9060-trunk.001.patch, YARN-9060-trunk.002.patch, YARN-9060-trunk.003.patch, YARN-9060-trunk.004.patch, YARN-9060-trunk.005.patch, YARN-9060-trunk.006.patch, YARN-9060-trunk.007.patch, YARN-9060-trunk.008.patch, YARN-9060-trunk.009.patch, YARN-9060-trunk.010.patch, YARN-9060-trunk.011.patch, YARN-9060-trunk.012.patch
>
>
> Due to the cgroups v1 implementation policy in linux kernel, we cannot update the value of the device cgroups controller unless we have the root permission ([here|https://github.com/torvalds/linux/blob/6f0d349d922ba44e4348a17a78ea51b7135965b1/security/device_cgroup.c#L604]). So we need to support this in container-executor for Java layer to invoke.
> This Jira will have three parts:
>  # native c-e module
>  # Java layer code to isolate devices for container (docker and non-docker)
>  # A sample Nvidia GPU plugin



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org