Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
6000ce0b
S
Serving
项目概览
PaddlePaddle
/
Serving
大约 1 年 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6000ce0b
编写于
6月 22, 2020
作者:
B
barrierye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add pom.xml
上级
0b661a57
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
404 addition
and
0 deletion
+404
-0
java/paddle-serving-sdk-java/pom.xml
java/paddle-serving-sdk-java/pom.xml
+301
-0
java/paddle-serving-sdk-java/src/main/java/io/paddle/serving/client/App.java
...-sdk-java/src/main/java/io/paddle/serving/client/App.java
+15
-0
java/paddle-serving-sdk-java/src/main/proto/multi_lang_general_model_service.proto
...ava/src/main/proto/multi_lang_general_model_service.proto
+68
-0
java/paddle-serving-sdk-java/src/test/java/io/paddle/serving/client/AppTest.java
...-java/src/test/java/io/paddle/serving/client/AppTest.java
+20
-0
未找到文件。
java/paddle-serving-sdk-java/pom.xml
0 → 100644
浏览文件 @
6000ce0b
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
io.paddle.serving.client
</groupId>
<artifactId>
paddle-serving-sdk-java
</artifactId>
<version>
0.0.1
</version>
<packaging>
jar
</packaging>
<name>
paddle-serving-sdk-java
</name>
<description>
Java SDK for Paddle Sering Client.
</description>
<url>
https://github.com/PaddlePaddle/Serving
</url>
<licenses>
<license>
<name>
Apache License, Version 2.0
</name>
<url>
http://www.apache.org/licenses/LICENSE-2.0.txt
</url>
<distribution>
repo
</distribution>
</license>
</licenses>
<!--
<developers>
<developer>
<name>Zhiru Zhu</name>
<email>zhiru.zhu@zilliz.com</email>
<organization>Milvus</organization>
<organizationUrl>http://www.milvus.io</organizationUrl>
</developer>
<developer>
<name>Xiaohai Xu</name>
<email>xiaohai.xu@zilliz.com</email>
<organization>Milvus</organization>
<organizationUrl>http://www.milvus.io</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/milvus-io/milvus-sdk-java.git</connection>
<developerConnection>scm:git:https://github.com/milvus-io/milvus-sdk-java.git</developerConnection>
<url>https://github.com/milvus-io/milvus-sdk-java</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
-->
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<grpc.version>
1.27.2
</grpc.version>
<protobuf.version>
3.11.0
</protobuf.version>
<protoc.version>
3.11.0
</protoc.version>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.target>
1.8
</maven.compiler.target>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
io.grpc
</groupId>
<artifactId>
grpc-bom
</artifactId>
<version>
${grpc.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-gpg-plugin
</artifactId>
<version>
1.6
</version>
</dependency>
<dependency>
<groupId>
io.grpc
</groupId>
<artifactId>
grpc-netty-shaded
</artifactId>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
io.grpc
</groupId>
<artifactId>
grpc-protobuf
</artifactId>
</dependency>
<dependency>
<groupId>
io.grpc
</groupId>
<artifactId>
grpc-stub
</artifactId>
</dependency>
<dependency>
<groupId>
javax.annotation
</groupId>
<artifactId>
javax.annotation-api
</artifactId>
<version>
1.2
</version>
<scope>
provided
</scope>
<!-- not needed at runtime -->
</dependency>
<dependency>
<groupId>
io.grpc
</groupId>
<artifactId>
grpc-testing
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
com.google.protobuf
</groupId>
<artifactId>
protobuf-java-util
</artifactId>
<version>
${protobuf.version}
</version>
</dependency>
<dependency>
<groupId>
com.google.errorprone
</groupId>
<artifactId>
error_prone_annotations
</artifactId>
<version>
2.3.4
</version>
<!-- prefer to use 2.3.3 or later -->
</dependency>
<dependency>
<groupId>
org.junit.jupiter
</groupId>
<artifactId>
junit-jupiter
</artifactId>
<version>
5.5.2
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-text
</artifactId>
<version>
1.6
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-collections4
</artifactId>
<version>
4.4
</version>
</dependency>
<dependency>
<groupId>
org.json
</groupId>
<artifactId>
json
</artifactId>
<version>
20190722
</version>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
<version>
1.7.30
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-slf4j-impl
</artifactId>
<version>
2.12.1
</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>
release
</id>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-source-plugin
</artifactId>
<version>
3.1.0
</version>
<executions>
<execution>
<id>
attach-sources
</id>
<goals>
<goal>
jar-no-fork
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<version>
3.1.1
</version>
<configuration>
<javadocExecutable>
${java.home}/bin/javadoc
</javadocExecutable>
</configuration>
<executions>
<execution>
<id>
attach-javadocs
</id>
<goals>
<goal>
jar
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-gpg-plugin
</artifactId>
<version>
1.6
</version>
<executions>
<execution>
<id>
sign-artifacts
</id>
<phase>
verify
</phase>
<goals>
<goal>
sign
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<extensions>
<extension>
<groupId>
kr.motd.maven
</groupId>
<artifactId>
os-maven-plugin
</artifactId>
<version>
1.6.2
</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>
org.sonatype.plugins
</groupId>
<artifactId>
nexus-staging-maven-plugin
</artifactId>
<version>
1.6.8
</version>
<extensions>
true
</extensions>
<configuration>
<serverId>
ossrh
</serverId>
<nexusUrl>
https://oss.sonatype.org/
</nexusUrl>
<autoReleaseAfterClose>
true
</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-release-plugin
</artifactId>
<version>
2.5.3
</version>
<configuration>
<autoVersionSubmodules>
true
</autoVersionSubmodules>
<useReleaseProfile>
false
</useReleaseProfile>
<releaseProfiles>
release
</releaseProfiles>
<goals>
deploy
</goals>
</configuration>
</plugin>
<plugin>
<groupId>
org.xolstice.maven.plugins
</groupId>
<artifactId>
protobuf-maven-plugin
</artifactId>
<version>
0.6.1
</version>
<configuration>
<protocArtifact>
com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}
</protocArtifact>
<pluginId>
grpc-java
</pluginId>
<pluginArtifact>
io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>
compile
</goal>
<goal>
compile-custom
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-enforcer-plugin
</artifactId>
<version>
3.0.0-M2
</version>
<executions>
<execution>
<id>
enforce
</id>
<configuration>
<rules>
<requireUpperBoundDeps/>
</rules>
</configuration>
<goals>
<goal>
enforce
</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
Package dependencies into the jar:
https://stackoverflow.com/questions/37732086/maven-compile-cause-classnotfoundexception
-->
<plugin>
<artifactId>
maven-assembly-plugin
</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>
true
</addClasspath>
<mainClass>
my.fully.qualified.class.Main
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>
make-my-jar-with-dependencies
</id>
<phase>
package
</phase>
<goals>
<goal>
single
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
java/paddle-serving-sdk-java/src/main/java/io/paddle/serving/client/App.java
0 → 100644
浏览文件 @
6000ce0b
package
io.paddle.serving.client
;
import
io.paddle.serving.grpc.*
;
public
class
App
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Hello World!"
);
SimpleResponse
tmp
=
SimpleResponse
.
newBuilder
()
.
setErrCode
(
1
)
.
build
();
System
.
out
.
println
(
"Hello World!"
);
}
}
java/paddle-serving-sdk-java/src/main/proto/multi_lang_general_model_service.proto
0 → 100644
浏览文件 @
6000ce0b
// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax
=
"proto2"
;
option
java_multiple_files
=
true
;
option
java_package
=
"io.paddle.serving.grpc"
;
option
java_outer_classname
=
"ServingProto"
;
package
paddle
.
serving.grpc
;
message
Tensor
{
optional
bytes
data
=
1
;
repeated
int32
int_data
=
2
;
repeated
int64
int64_data
=
3
;
repeated
float
float_data
=
4
;
optional
int32
elem_type
=
5
;
repeated
int32
shape
=
6
;
repeated
int32
lod
=
7
;
// only for fetch tensor currently
};
message
FeedInst
{
repeated
Tensor
tensor_array
=
1
;
};
message
FetchInst
{
repeated
Tensor
tensor_array
=
1
;
};
message
InferenceRequest
{
repeated
FeedInst
insts
=
1
;
repeated
string
feed_var_names
=
2
;
repeated
string
fetch_var_names
=
3
;
required
bool
is_python
=
4
[
default
=
false
];
};
message
InferenceResponse
{
repeated
ModelOutput
outputs
=
1
;
optional
string
tag
=
2
;
required
int32
err_code
=
3
;
};
message
ModelOutput
{
repeated
FetchInst
insts
=
1
;
optional
string
engine_name
=
2
;
}
message
SetTimeoutRequest
{
required
int32
timeout_ms
=
1
;
}
message
SimpleResponse
{
required
int32
err_code
=
1
;
}
message
GetClientConfigRequest
{}
message
GetClientConfigResponse
{
required
string
client_config_str
=
1
;
}
service
MultiLangGeneralModelService
{
rpc
Inference
(
InferenceRequest
)
returns
(
InferenceResponse
)
{}
rpc
SetTimeout
(
SetTimeoutRequest
)
returns
(
SimpleResponse
)
{}
rpc
GetClientConfig
(
GetClientConfigRequest
)
returns
(
GetClientConfigResponse
)
{}
};
java/paddle-serving-sdk-java/src/test/java/io/paddle/serving/client/AppTest.java
0 → 100644
浏览文件 @
6000ce0b
package
io.paddle.serving.client
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.Test
;
/**
* Unit test for simple App.
*/
public
class
AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public
void
shouldAnswerWithTrue
()
{
assertTrue
(
true
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录