pai icon indicating copy to clipboard operation
pai copied to clipboard

Failed to submit job from VS Code

Open scarlett2018 opened this issue 8 years ago • 22 comments

problem met by customer

Customer's env 1 master node and 1 worker node, end-2-end test job跑成功了

Problem 按照github教程通过VScode提交job的时候, 发现上传到默认hdfs失败, 提交任务一直被卡在code uploading. 但是存放code的任务名文件夹可以被建立成功。只是一个python文件, 14k左右.

访问master的50070端口, 开web hdfs界面。 在这里试着上传code, 还是失败.

就是来自官方github的example。如果直接从PAI的web界面提交可以run成功。 但是从VScode提交会一直卡在code上传。

接着上面描述, 访问master的50070端口, 开web hdfs界面。 在这里试着上传code, 还是失败。开network调试发现两个request, 第一个请求看起来像是request上传地址, 但是服务器返回一个内网ip地址。第一个请求看起来像是request上传地址, 但是服务器返回一个内网ip地址。这个10.0.1.6是部署在Azure上worker节点, 而code在我本地, 访问不到.

scarlett2018 avatar Nov 05 '18 09:11 scarlett2018

谢谢scarlett2018帮我创建ISSUE, 补充一下:

  1. PAI的master和worker都部署在Azure上, 我从本地VS code提交job。

  2. 从web hdfs尝试上传的时候, 通过network调试发现两个request。 第一个request(http://master_xxxx.westus2.cloudapp.azure.com:50070/webhdfs/v1/admin/mnist-k1_49eb87bc/mnist.py?op=CREATE&noredirect=true)返回的是一个内网地址, 指向worker的ip:10.0.1.6。 {"Location":"http://10.0.1.6:5075/webhdfs/v1/admin/mnist-k1_49eb87bc/mnist.py?op=CREATE&namenoderpcaddress=10.0.1.5:9000&createflag=&createparent=true&overwrite=false"}

    而第二个request直接访问这内网地址导致失败。( 因为我从我本地上传,访问不到这个Azure的内网ip)

JimEverest avatar Nov 05 '18 09:11 JimEverest

@JimEverest
I have encountered some problems with my deployment on Azure VM. The load-balance-ip configuration in the kubernetes-configuration.yaml file is the external network ip or the internal network ip?

NothingLZ avatar Nov 05 '18 09:11 NothingLZ

@JimEverest I have encountered some problems with my deployment on Azure VM. The load-balance-ip configuration in the kubernetes-configuration.yaml file is the external network ip or the internal network ip?

the value of the load-balance-ip configuration is an internal network IP, 10.0.1.5 .

JimEverest avatar Nov 05 '18 10:11 JimEverest

First of all, I have two hosts. I use A to deploy B. So in the quick-start.yaml file, is the master's ip an intranet ip or an extranet ip?

NothingLZ avatar Nov 05 '18 10:11 NothingLZ

I have 3 nodes deployed dev-box, master & worker1 seperately. both master's ip and worker1's ip are intranet ip in quick-start.yaml .

JimEverest avatar Nov 05 '18 10:11 JimEverest

I just create a new windows10 VM within the same vpn sub-net on Azure, and managed to upload a txt file via web-hdfs (master:50070), but failed again. Server didn't return any exception message but the UI appears "Cound't upload the file xxx.txt. ". Btw I can access the hdfs nodes through intranet ip from browser in the windows VM.

JimEverest avatar Nov 05 '18 10:11 JimEverest

Then can you access the cluster through the external network ip?

NothingLZ avatar Nov 05 '18 10:11 NothingLZ

Yes, I can access kubernetes, Pai, webhdfs through external ip in browser, as well as Pai cluster within VS code. However I just can't upload files to Pai hdfs in neither browser nor Vscode.

JimEverest avatar Nov 05 '18 14:11 JimEverest

Need to open those ports?

image

NothingLZ avatar Nov 06 '18 01:11 NothingLZ

I've added all these inbound port rules for master node: wechat image_20181106181053

and rules for worker: wechat image_20181106181046

Still stuck at HDFS uploading in VScode. wechat image_20181106181404

JimEverest avatar Nov 06 '18 10:11 JimEverest

Is it necessary to open swap? image

image

NothingLZ avatar Nov 07 '18 06:11 NothingLZ

@NothingLZ , swap is not needed. Can you check if the port 5075 is accessible on worker node?

DongZhaoYu avatar Nov 07 '18 06:11 DongZhaoYu

The webhdfs data upload works in two step. First the client sends a request to the name node and it will return a uri to a worker node to store the data. Then the client will use the returned uri to put the data. So in Azure environment, the client cannot directly access the worker node. The upload will fail.

DongZhaoYu avatar Nov 07 '18 06:11 DongZhaoYu

image

NothingLZ avatar Nov 07 '18 06:11 NothingLZ

image

NothingLZ avatar Nov 07 '18 07:11 NothingLZ

If your data node has external IP, can you have a check why the hdfs always return the interal ip URI?

In our new release v0.8.0, we have configured pylon to redirect the hdfs requests. You can use webhdfs api to create a file: curl -i -X PUT "http://master_address:80/webhdfs/api/v1/test/test_file?op=CREATE" The returned URI will be redirected by pylon to the datanode. So internal IP wouldn't be a problem.

DongZhaoYu avatar Nov 07 '18 11:11 DongZhaoYu

image

NothingLZ avatar Nov 08 '18 00:11 NothingLZ

image

Do you have a small demo and I want to test it.Because of the official demo, it always fails.

NothingLZ avatar Nov 08 '18 00:11 NothingLZ

@NothingLZ you cannot open that URI by web browser. It is a PUT request, not GET.

DongZhaoYu avatar Nov 08 '18 06:11 DongZhaoYu

@Gerhut , can you check if this is due to Pylon config issue?

fanyangCS avatar Nov 21 '18 10:11 fanyangCS