You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2021/06/01 03:03:32 UTC

[airavata-data-lake] 25/42: Add drms rest proxy

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-data-lake.git

commit 139ce8f1f8ee01a4f2c85a031272fb5d161e2354
Author: Isuru Ranawaka <ir...@gmail.com>
AuthorDate: Fri Mar 26 23:35:17 2021 -0400

    Add drms rest proxy
---
 .../drms-rest-proxy/Dockerfile                     |   3 ++
 .../drms-rest-proxy/pom.xml                        |  16 +++++++
 .../drms-rest-proxy/src/main/resources/README.MD   |   7 +++
 .../drms-rest-proxy/src/main/resources/drms.pb     | Bin 0 -> 101906 bytes
 .../drms-rest-proxy/src/main/resources/envoy.yaml  |  48 +++++++++++++++++++++
 5 files changed, 74 insertions(+)

diff --git a/data-resource-management-service/drms-rest-proxy/Dockerfile b/data-resource-management-service/drms-rest-proxy/Dockerfile
new file mode 100644
index 0000000..b630694
--- /dev/null
+++ b/data-resource-management-service/drms-rest-proxy/Dockerfile
@@ -0,0 +1,3 @@
+FROM envoyproxy/envoy:v1.14.1
+COPY src/main/resources/drms.pb /data/drms.pb
+COPY src/main/resources/envoy.yaml  /etc/envoy/envoy.yaml
\ No newline at end of file
diff --git a/data-resource-management-service/drms-rest-proxy/pom.xml b/data-resource-management-service/drms-rest-proxy/pom.xml
new file mode 100644
index 0000000..cd2339f
--- /dev/null
+++ b/data-resource-management-service/drms-rest-proxy/pom.xml
@@ -0,0 +1,16 @@
+<?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>org.example</groupId>
+    <artifactId>drms-rest-proxy</artifactId>
+    <version>1.0-SNAPSHOT</version>
+
+    <properties>
+        <maven.compiler.source>11</maven.compiler.source>
+        <maven.compiler.target>11</maven.compiler.target>
+    </properties>
+
+</project>
\ No newline at end of file
diff --git a/data-resource-management-service/drms-rest-proxy/src/main/resources/README.MD b/data-resource-management-service/drms-rest-proxy/src/main/resources/README.MD
new file mode 100644
index 0000000..f83c252
--- /dev/null
+++ b/data-resource-management-service/drms-rest-proxy/src/main/resources/README.MD
@@ -0,0 +1,7 @@
+#  Run DRMS envoy proxy locally
+1. Build docker image 
+ `docker build -t drms-rest-proxy .`
+   
+2. Run docker image 
+   `docker run --rm -it       -p 10000:50000        drms-rest-proxy:latest      -c /etc/envoy/envoy.yaml `
+    
\ No newline at end of file
diff --git a/data-resource-management-service/drms-rest-proxy/src/main/resources/drms.pb b/data-resource-management-service/drms-rest-proxy/src/main/resources/drms.pb
new file mode 100644
index 0000000..bb14862
Binary files /dev/null and b/data-resource-management-service/drms-rest-proxy/src/main/resources/drms.pb differ
diff --git a/data-resource-management-service/drms-rest-proxy/src/main/resources/envoy.yaml b/data-resource-management-service/drms-rest-proxy/src/main/resources/envoy.yaml
new file mode 100644
index 0000000..3340da0
--- /dev/null
+++ b/data-resource-management-service/drms-rest-proxy/src/main/resources/envoy.yaml
@@ -0,0 +1,48 @@
+admin:
+  access_log_path: /tmp/admin_access.log
+  address:
+    socket_address: { address: 0.0.0.0, port_value: 9901 }
+
+static_resources:
+  listeners:
+    - name: main-listener
+      address:
+        socket_address: { address: 0.0.0.0, port_value: 50000 }
+      filter_chains:
+        - filters:
+            - name: envoy.http_connection_manager
+              config:
+                stat_prefix: grpc_json
+                codec_type: AUTO
+                route_config:
+                  name: local_route
+                  virtual_hosts:
+                    - name: local_service
+                      domains: ["*"]
+                      routes:
+                        - match: { prefix: "/", grpc: {} }
+                          route: { cluster: grpc-backend-services, timeout: { seconds: 60 } }
+                http_filters:
+                  - name: envoy.grpc_json_transcoder
+                    config:
+                      proto_descriptor: "/data/drms.pb"
+                      services: ["org.apache.airavata.datalake.drms.groups.GroupService", "org.apache.airavata.datalake.drms.storage.StoragePreferenceService",
+                                 "org.apache.airavata.datalake.drms.storage.ResourceService","org.apache.airavata.datalake.drms.storage.StorageService"]
+                      convert_grpc_status: true
+                      print_options:
+                        add_whitespace: true
+                        always_print_primitive_fields: true
+                        always_print_enums_as_ints: false
+                        preserve_proto_field_names: true
+                  - name: envoy.router
+  clusters:
+    - name: grpc-backend-services
+      connect_timeout: 1.25s
+      type: logical_dns
+      lb_policy: round_robin
+      dns_lookup_family: V4_ONLY
+      http2_protocol_options: {}
+      hosts:
+        - socket_address:
+            address: host.docker.internal
+            port_value: 6565
\ No newline at end of file