From 0748cf965ddc34cdd476438a70ffdd6c29006edd Mon Sep 17 00:00:00 2001 From: HexToString <506181616@qq.com> Date: Mon, 25 Jan 2021 09:42:07 +0000 Subject: [PATCH] fix java doc and java client ip(default 127.0.0.1) --- java/README.md | 6 +++--- java/README_CN.md | 10 ++++------ java/examples/src/main/java/PipelineClientExample.java | 6 +++--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/java/README.md b/java/README.md index 2346d13e..a4934eb3 100644 --- a/java/README.md +++ b/java/README.md @@ -110,10 +110,10 @@ The first is that GPU Serving and Java Client are in the same image. After start The second is to deploy GPU Serving and Java Client separately. If they are on the same host, you can learn the IP address of the corresponding container through ifconfig, and then when you connect to client.connect in `examples/src/main/java/PaddleServingClientExample.java` Make changes to the endpoint, and then compile it again. Or select `--net=host` to bind the network device of docker and host when docker starts, so that it can run directly without customizing java code. -**It should be noted that in the example, all models need to use `--use_multilang` to start GRPC multi-programming language support, and the port number is 9393. If you need another port, you need to modify it in the java file** +**It should be noted that in the example, all models(not pipeline) need to use `--use_multilang` to start GRPC multi-programming language support, and the port number is 9393. If you need another port, you need to modify it in the java file** -**Currently Serving has launched the Pipeline mode (see [Pipeline Serving](../doc/PIPELINE_SERVING.md) for details). Pipeline Serving Client for Java is released, the next version multi-thread java client example will be released** +**Currently Serving has launched the Pipeline mode (see [Pipeline Serving](../doc/PIPELINE_SERVING.md) for details). Pipeline Serving Client for Java is released.** -**It should be noted that in the example, Java Pipeline Client code is in path /Java/Examples and /Java/src/main, and the Pipeline server code is in path /python/examples/pipeline/** +**It should be noted that in the example, Java Pipeline Client code is in path /Java/Examples and /Java/src/main, and the Pipeline server code is in path /python/examples/pipeline/ The Client IP and Port(which is configured in java/examples/src/main/java/PipelineClientExample.java) should be corresponding to the Pipeline Server IP and Port(which is configured in config.yaml) ** diff --git a/java/README_CN.md b/java/README_CN.md index 4c1df65f..8fb6edd1 100644 --- a/java/README_CN.md +++ b/java/README_CN.md @@ -111,11 +111,9 @@ java -cp paddle-serving-sdk-java-examples-0.0.1-jar-with-dependencies.jar Pipeli 第二种是GPU Serving和Java Client分开部署,如果在同一台宿主机,可以通过ifconfig了解对应容器的IP地址,然后在`examples/src/main/java/PaddleServingClientExample.java`当中对client.connect时的endpoint做修改,然后再编译一次。 或者在docker启动时选择 `--net=host`来绑定docker和宿主机的网络设备,这样不需要定制java代码可以直接运行。 -**需要注意的是,在示例中,所有模型都需要使用`--use_multilang`来启动GRPC多编程语言支持,以及端口号都是9393,如果需要别的端口,需要在java文件里修改** +**需要注意的是,在示例中,所有非Pipeline模型都需要使用`--use_multilang`来启动GRPC多编程语言支持,以及端口号都是9393,如果需要别的端口,需要在java文件里修改** -**目前Serving已推出Pipeline模式(详见[Pipeline Serving](../doc/PIPELINE_SERVING_CN.md)),面向Java的Pipeline Serving Client已发布,下个更新会发布Java版本的多线程用例敬请期待。** +**目前Serving已推出Pipeline模式(详见[Pipeline Serving](../doc/PIPELINE_SERVING_CN.md)),面向Java的Pipeline Serving Client已发布。** -**需要注意的是,Java Pipeline Client相关示例在/Java/Examples和/Java/src/main中,对应的Pipeline server在/python/examples/pipeline/中** - - -**目前Serving已推出Pipeline模式(详见[Pipeline Serving](../doc/PIPELINE_SERVING_CN.md)),下个版本(0.4.1)面向Java的Pipeline Serving Client将会发布,敬请期待。** +**需要注意的是,Java Pipeline Client相关示例在/Java/Examples和/Java/src/main中,对应的Pipeline server在/python/examples/pipeline/中 +注意java/examples/src/main/java/PipelineClientExample.java中的ip和port,需要与/python/examples/pipeline/中对应Pipeline server的config.yaml文件中配置的ip和port相对应。** diff --git a/java/examples/src/main/java/PipelineClientExample.java b/java/examples/src/main/java/PipelineClientExample.java index 378d2c0c..d279e00e 100644 --- a/java/examples/src/main/java/PipelineClientExample.java +++ b/java/examples/src/main/java/PipelineClientExample.java @@ -32,7 +32,7 @@ public class PipelineClientExample { System.out.println(fetch); if (StaticPipelineClient.succ != true) { - if(!StaticPipelineClient.initClient("172.17.0.2","18070")){ + if(!StaticPipelineClient.initClient("127.0.0.1","18070")){ System.out.println("connect failed."); return false; } @@ -57,7 +57,7 @@ public class PipelineClientExample { List fetch = Arrays.asList("prediction"); System.out.println(fetch); if (StaticPipelineClient.succ != true) { - if(!StaticPipelineClient.initClient("172.17.0.2","18070")){ + if(!StaticPipelineClient.initClient("127.0.0.1","18070")){ System.out.println("connect failed."); return false; } @@ -86,7 +86,7 @@ public class PipelineClientExample { }}; List fetch = Arrays.asList("prediction"); if (StaticPipelineClient.succ != true) { - if(!StaticPipelineClient.initClient("172.17.0.2","9998")){ + if(!StaticPipelineClient.initClient("127.0.0.1","9998")){ System.out.println("connect failed."); return false; } -- GitLab