pai icon indicating copy to clipboard operation
pai copied to clipboard

Submit job throws error "PortDefinitions is not empty, but local hadoop library doesn't support Port, please patch YARN-7481"

Open feng257 opened this issue 8 years ago • 18 comments

I installed PAI first, submitted job and then find this error. After that I followed your tutorial to patch hadoop-2.7.2.gpu-port.patch exactly, then rebuilt hadoop image, and re-deployed. But when I submit job, error still there. And I try re-deploy all service, still not work.
Could you guys give some advise about this issue? thx.

PS:
I find two patches in https://issues.apache.org/jira/browse/YARN-7481
hadoop-2.7.2.gpu-port.patch and hadoop-2.7.2.port-gpu.patch
I choose hadoop-2.7.2.gpu-port.patch, because this one is a newer version.

feng257 avatar May 31 '18 08:05 feng257

After rebuilding your hadoop binary, have you set the correct value in custom-hadoop-binary-path in services-configuration.yaml ? If this field is set with None, an official hadoop will be downloaded. And maybe you have to rebuild the hadoop image.

ydye avatar Jun 01 '18 02:06 ydye

Hi, thanks for your advice.
I'm sure I set the value in services-configuration.yaml.
I followed your tutorial to complied hadoop file, and put it in the directory which I set in yaml.
But the error is still there.
@ydye

feng257 avatar Jun 04 '18 07:06 feng257

Hi,

Did you build pai services' docker image on the dev-box container ,or your local host machine ? If you worked on the container, have you mounted the hadoop-binary path correctly?

@qinchen123 @yqwang-ms

ydye avatar Jun 04 '18 09:06 ydye

I deployed PAI on my own local host machine, and patched fellowed your tutorial:
https://github.com/Microsoft/pai/blob/master/pai-management/README-zh.md
https://github.com/Microsoft/pai/blob/master/hadoop-ai/README-zh.md
Can you give some detail about mounted the hadoop-binary path? thanks.

feng257 avatar Jun 06 '18 06:06 feng257

Hi @feng257 In this step following, you will setup a container as a dev-box. If you bypass this and work on your local host. You could ignore the hadoop mount problem.

Working on container(dev-box).

The dev-box setup: https://github.com/Microsoft/pai/blob/master/pai-management/README-zh.md#%E5%87%86%E5%A4%87-dev-box

sudo docker run -itd \
        -e COLUMNS=$COLUMNS -e LINES=$LINES -e TERM=$TERM \
        -v /path/to/configuration/directory:/cluster-configuration  \
        -v /var/lib/docker:/varl/lib/docker \
        -v /var/run/docker.sock:/var/run/docker.sock \
        -v /hadoop/binary/path:/hadoop/binary/path \
        --pid=host \
        --privileged=true \
        --net=host \
        --name=deployment \
        kubernetes-deployment

In this line -v /hadoop/binary/path:/hadoop/binary/path \

After the dev-box is setup,you should build image and deploy service in it.

Working on localhost.

If you are working on the local host instead of a container dev-box. You can check the webportal of Yarn. Usually its address is your-master-service-ip:8088. In this page you can check whether in the cluster-metric, there are 3 value GPUs Used | GPUs Total | GPUs Reserved. If yes, your have successfully built pai's image. If not, maybe the binary wasn't copied into the image hadoop-run. You should double check your configuration.

Some Question.

  1. Can you share us, how did you configure your hadoop's configuration in the this section.

ydye avatar Jun 06 '18 06:06 ydye

Hi, thanks for you answer.
I checked the service-ip:8088, and I saw the values:
_001
the hadoop configuration in service-configuration.yaml:
custom-hadoop-binary-path: /home/ubuntu/hadoop-2.7.2.tar.gz

I re-complied hadoop, put it in the path as configuration and rebuilt the image.

feng257 avatar Jun 06 '18 07:06 feng257

does frameworklauncher also need to be pathed ?

feng257 avatar Jun 06 '18 07:06 feng257

@feng257 You build process is okay.

My Questions.

  1. Which branch of pai are you working on now?
  2. Can you share us your json file which you submit your job.

My Answer:

Launcher only need port configuration.

frameworklauncher:
  frameworklauncher-port: 9086

@qinchen123 @abuccts @yqwang-ms Can you follow this issue. The user's build process is okay. And hadoop-run is based on our hadoop-ai binary.

ydye avatar Jun 06 '18 07:06 ydye

@ydye

  1. the branch I used is master branch of yesterday.
  2. json file:
{
  "jobName": "jobName_4",
  "image": "192.168.2.212:5000/pai-images/demo4pai:chenc1.4",
  "dataDir": "$PAI_DEFAULT_FS_URI/demo4pai/data",
  "outputDir": "$PAI_DEFAULT_FS_URI/demo4pai/output",
  "codeDir": "$PAI_DEFAULT_FS_URI/demo4pai/code",
  "taskRoles": [
    {
      "name": "demo4pai",
      "taskNumber": 1,
      "cpuNumber": 1,
      "memoryMB": 512,
      "gpuNumber": 0,
      "portList": [
        {
          "label": "http",
          "beginAt": 20000,
          "portNumber": 1
        },
        {
          "label": "ssh",
          "beginAt": 20001,
          "portNumber": 1
        }
      ],
      "command": "sleep 12000;"
    }
  ]
}

feng257 avatar Jun 06 '18 07:06 feng257

by default, the port range is 1-19999, "beginAt": 20000 will fail at port allocation.

qinchen123 avatar Jun 06 '18 07:06 qinchen123

@qinchen123 Do we have any document to notify user about this? Or maybe the error log should be more meaningful.

ydye avatar Jun 06 '18 08:06 ydye

Hi, @qinchen123. Thanks for your answer. I changed the port to 9000 & 9001, but error still there.

[Launcher] 400 {"exception":"BadRequestException","message":"com.microsoft.frameworklauncher.common.exceptions.BadRequestException: javax.validation.ConstraintViolationException: taskRoles[demo4pai].taskService.resource: PortDefinitions is not empty, but local hadoop library doesn't support Port, please patch YARN-7481 first: PortDefinitions: [{<http = 9000,1>, <ssh = 9001,1>}]\n\tat com.microsoft.frameworklauncher.common.validation.CommonValidation.validate(CommonValidation.java:49)\n\tat com.microsoft.frameworklauncher.webserver.LauncherModule.putFramework(LauncherModule.java:318)\n\tat sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\n\tat com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)\n\tat com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)\n\tat com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n\tat com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n\tat com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)\n\tat com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:886)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:834)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:795)\n\tat com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)\n\tat com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)\n\tat com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)\n\tat com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)\n\tat org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)\n\tat org.apache.hadoop.http.HttpServer2$QuotingInputFilter.doFilter(HttpServer2.java:1243)\n\tat org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)\n\tat org.apache.hadoop.http.NoCacheFilter.doFilter(NoCacheFilter.java:45)\n\tat org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)\n\tat org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)\n\tat org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)\n\tat org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)\n\tat org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)\n\tat org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)\n\tat org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)\n\tat org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)\n\tat org.mortbay.jetty.Server.handle(Server.java:322)\n\tat org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)\n\tat org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)\n\tat org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)\n\tat org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)\n\tat org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)\n\tat org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)\n\tat org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)\nCaused by: javax.validation.ConstraintViolationException: taskRoles[demo4pai].taskService.resource: PortDefinitions is not empty, but local hadoop library doesn't support Port, please patch YARN-7481 first: PortDefinitions: [{<http = 9000,1>, <ssh = 9001,1>}]\n\t... 46 more\n","javaClassName":"com.microsoft.frameworklauncher.common.exceptions.BadRequestException"}

feng257 avatar Jun 06 '18 08:06 feng257

@feng257 In the address service-ip:8088/conf, check whether this property exists or not.

<property>
     <name>yarn.ports_as_resource.enable</name>
    <value>true</value>
    <source>yarn-default.xml</source>
</property>

ydye avatar Jun 06 '18 08:06 ydye

it exists.
_004

feng257 avatar Jun 06 '18 08:06 feng257

@feng257 Can you re-build frameworklauncher's binary with hadoop-run? And then have a try?

ydye avatar Jun 06 '18 08:06 ydye

I tried re-build them, the command like this:

sudo ./docker_build.py -p ../cluster-configuration -n frameworklauncher  
sudo ./docker_build.py -p ../cluster-configuration -n hadoop-run

then submit success. Thanks.

feng257 avatar Jun 06 '18 08:06 feng257

Yes, and then restart hadoop and frameworklauncher with the command

1) stop service
sudo ./bootstrap/service/clean.sh
2) start service
sudo ./deploy -p /path/to/configuration/directory -d -s your_service_name

ydye avatar Jun 06 '18 08:06 ydye

@feng257
The relation of hadoop-run image and frameworklauncher image. base-image -> hadoop-run -> frameworklauncher.

launcher will check hadoop-version by the local hadoop binary on the container. So if you use the old version launcher based on other hadoop version. It will throw this error.

This issue is solved. I will close this it.

ydye avatar Jun 06 '18 09:06 ydye