From d41f9038f1341cbfb0d3a1c243b49f96dafa0628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=99=A8?= Date: Fri, 16 Oct 2020 14:22:27 +0800 Subject: [PATCH] refactor and modify configurations --- doc/Dockerfile | 6 ------ pom.xml | 4 ++-- src/main/java/com/cntryroa/{ => envoylb}/App.java | 2 +- src/main/java/com/cntryroa/{ => envoylb}/Client.java | 2 +- src/main/java/com/cntryroa/{ => envoylb}/Client2.java | 2 +- src/main/java/com/cntryroa/{ => envoylb}/Client3.java | 2 +- src/main/proto/greeter.proto | 4 +--- src/scripts/Dockerfile | 6 ++++++ {doc => src/scripts}/envoy-resources.yaml | 0 {doc => src/scripts}/envoy.yaml | 0 {doc => src/scripts}/grpcserver-resources.yaml | 2 +- 11 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 doc/Dockerfile rename src/main/java/com/cntryroa/{ => envoylb}/App.java (98%) rename src/main/java/com/cntryroa/{ => envoylb}/Client.java (97%) rename src/main/java/com/cntryroa/{ => envoylb}/Client2.java (97%) rename src/main/java/com/cntryroa/{ => envoylb}/Client3.java (97%) create mode 100644 src/scripts/Dockerfile rename {doc => src/scripts}/envoy-resources.yaml (100%) rename {doc => src/scripts}/envoy.yaml (100%) rename {doc => src/scripts}/grpcserver-resources.yaml (93%) diff --git a/doc/Dockerfile b/doc/Dockerfile deleted file mode 100644 index d2c8016..0000000 --- a/doc/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM harbor.zetyun.com/aps5.1.0/service/base/jre-aps:5.1.0 - -COPY lib /opt/workdir/lib -COPY envoy-1.0-SNAPSHOT.jar /opt/workdir - -CMD ["/jre1.8.0_202/bin/java","-jar","envoy-1.0-SNAPSHOT.jar"] diff --git a/pom.xml b/pom.xml index 09d62ba..ef6d8cd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.cntryroa envoy_loadbalance 1.0-SNAPSHOT - envoy Tapestry 5 Application + envoy loadbalance 1.8 2.1.3.RELEASE @@ -92,7 +92,7 @@ true lib/ - com.cntryroa.App + com.cntryroa.envoylb.App diff --git a/src/main/java/com/cntryroa/App.java b/src/main/java/com/cntryroa/envoylb/App.java similarity index 98% rename from src/main/java/com/cntryroa/App.java rename to src/main/java/com/cntryroa/envoylb/App.java index 25717bb..c472656 100644 --- a/src/main/java/com/cntryroa/App.java +++ b/src/main/java/com/cntryroa/envoylb/App.java @@ -1,4 +1,4 @@ -package com.cntryroa; +package com.cntryroa.envoylb; import io.grpc.Server; import io.grpc.ServerBuilder; diff --git a/src/main/java/com/cntryroa/Client.java b/src/main/java/com/cntryroa/envoylb/Client.java similarity index 97% rename from src/main/java/com/cntryroa/Client.java rename to src/main/java/com/cntryroa/envoylb/Client.java index 12e8005..9f4abcb 100644 --- a/src/main/java/com/cntryroa/Client.java +++ b/src/main/java/com/cntryroa/envoylb/Client.java @@ -1,4 +1,4 @@ -package com.cntryroa; +package com.cntryroa.envoylb; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; diff --git a/src/main/java/com/cntryroa/Client2.java b/src/main/java/com/cntryroa/envoylb/Client2.java similarity index 97% rename from src/main/java/com/cntryroa/Client2.java rename to src/main/java/com/cntryroa/envoylb/Client2.java index 090caaf..f36a2fa 100644 --- a/src/main/java/com/cntryroa/Client2.java +++ b/src/main/java/com/cntryroa/envoylb/Client2.java @@ -1,4 +1,4 @@ -package com.cntryroa; +package com.cntryroa.envoylb; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; diff --git a/src/main/java/com/cntryroa/Client3.java b/src/main/java/com/cntryroa/envoylb/Client3.java similarity index 97% rename from src/main/java/com/cntryroa/Client3.java rename to src/main/java/com/cntryroa/envoylb/Client3.java index 3c37e29..b44d3d1 100644 --- a/src/main/java/com/cntryroa/Client3.java +++ b/src/main/java/com/cntryroa/envoylb/Client3.java @@ -1,4 +1,4 @@ -package com.cntryroa; +package com.cntryroa.envoylb; import io.grpc.ManagedChannel; import io.grpc.ManagedChannelBuilder; diff --git a/src/main/proto/greeter.proto b/src/main/proto/greeter.proto index 3770d54..1b04526 100644 --- a/src/main/proto/greeter.proto +++ b/src/main/proto/greeter.proto @@ -7,13 +7,11 @@ option objc_class_prefix = "WY"; package onlytest; -//定义服务 service Greeter { - //注意:这里是returns 不是return rpc TestSomeThing (TestRequest) returns (TestResponse) { } } -//定义消息类型 + message TestRequest { string name = 1; } diff --git a/src/scripts/Dockerfile b/src/scripts/Dockerfile new file mode 100644 index 0000000..49883a2 --- /dev/null +++ b/src/scripts/Dockerfile @@ -0,0 +1,6 @@ +FROM registry.cntryroa.com/javaruntime:5.1.0 + +COPY lib /opt/workdir/lib +COPY envoy_loadbalance-1.0-SNAPSHOT.jar /opt/workdir + +CMD ["/jre1.8.0_202/bin/java","-jar","envoy-1.0-SNAPSHOT.jar"] diff --git a/doc/envoy-resources.yaml b/src/scripts/envoy-resources.yaml similarity index 100% rename from doc/envoy-resources.yaml rename to src/scripts/envoy-resources.yaml diff --git a/doc/envoy.yaml b/src/scripts/envoy.yaml similarity index 100% rename from doc/envoy.yaml rename to src/scripts/envoy.yaml diff --git a/doc/grpcserver-resources.yaml b/src/scripts/grpcserver-resources.yaml similarity index 93% rename from doc/grpcserver-resources.yaml rename to src/scripts/grpcserver-resources.yaml index 1d6b7eb..889e213 100644 --- a/doc/grpcserver-resources.yaml +++ b/src/scripts/grpcserver-resources.yaml @@ -16,7 +16,7 @@ spec: spec: containers: - name: grpcserver - image: registry.aps.datacanvas.com:5000/aps/test/envoy:0.1.0 + image: registry.cntryroa.com:5000/aps/test/envoy:0.1.0 imagePullPolicy: Always ports: - containerPort: 35001