You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by my...@apache.org on 2020/03/05 14:27:56 UTC

[incubator-dlab] branch DLAB-1565 updated: [DLAB-1565]: Convey billing for remote endpoints - [GCP] implemented

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

mykolabodnar pushed a commit to branch DLAB-1565
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/DLAB-1565 by this push:
     new c40ec2e  [DLAB-1565]: Convey billing for remote endpoints - [GCP] implemented
c40ec2e is described below

commit c40ec2e584b8f5ceafc90a383cf54b486bde8daf
Author: Mykola_Bodnar1 <bo...@gmail.com>
AuthorDate: Thu Mar 5 16:24:45 2020 +0200

    [DLAB-1565]: Convey billing for remote endpoints - [GCP] implemented
---
 .../terraform/bin/deploy/billing_gcp.yml           | 36 +++++++++++++++-----
 .../terraform/bin/deploy/endpoint_fab.py           | 38 ++++++++++++++++++----
 .../terraform/bin/deploy/renew_certificates.sh     |  2 +-
 .../billing-gcp/src/main/resources/application.yml |  2 +-
 4 files changed, 60 insertions(+), 18 deletions(-)

diff --git a/infrastructure-provisioning/terraform/bin/deploy/billing_gcp.yml b/infrastructure-provisioning/terraform/bin/deploy/billing_gcp.yml
index 522c7ad..bc75bc3 100644
--- a/infrastructure-provisioning/terraform/bin/deploy/billing_gcp.yml
+++ b/infrastructure-provisioning/terraform/bin/deploy/billing_gcp.yml
@@ -1,20 +1,38 @@
-server:
-  port: 8088
 spring:
+  main:
+    allow-bean-definition-overriding: true
   data:
     mongodb:
       username: admin
-      password: <MONGO_PASSWORD>
-      database: dlabdb
+      password: MONGO_PASSWORD
+      database: MONGO_PORT
       port: 27017
-      host: localhost
+      host: MONGO_HOST
 dlab:
-  sbn: <CONF_SERVICE_BASE_NAME>
-  bigQueryDataset: <BILLING_DATASET_NAME>
-  cron: 0 0 */1 * * *
+  sbn: SERVICE_BASE_NAME
+  bigQueryDataset: DATASET_NAME
+  cron: 0 * * * * *
+
+server:
+  port: 8088
+  servlet:
+    contextPath: /api/billing
+
+server.ssl.key-store-type: JKS
+server.ssl.key-store: /home/OS_USER/keys/endpoint.keystore.jks
+server.ssl.key-store-password: KEY_STORE_PASSWORD
+server.ssl.key-alias: endpoint
 
 logging:
   file: /var/opt/dlab/log/ssn/billing.log
   level:
     com:
-      epam: trace
\ No newline at end of file
+      epam: trace
+
+keycloak:
+  bearer-only: true
+  realm: dlab
+  resource: KEYCLOAK_CLIENT_ID
+  credentials.secret: CLIENT_SECRET
+  ssl-required: none
+  auth-server-url: KEYCLOAK_AUTH_SERVER_URL
\ No newline at end of file
diff --git a/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py b/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
index 9a85578..8a4e6be 100644
--- a/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
+++ b/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
@@ -658,23 +658,47 @@ def configure_billing_endpoint():
                     args.tag_resource_id = 'resourceTags' + ':' + args.tag_resource_id
                 billing_properties = [
                     {
-                        'key': "<BILLING_BUCKET_NAME>",
+                        'key': "BILLING_BUCKET_NAME",
                         'value': args.billing_bucket
                     }
                 ]
             elif args.cloud_provider == 'gcp':
                 billing_properties = [
                     {
-                        'key': "<CONF_SERVICE_BASE_NAME>",
-                        'value': args.billing_bucket
+                        'key': "OS_USER",
+                        'value': args.os_user
                     },
                     {
-                        'key': "<MONGO_PASSWORD>",
-                        'value': args.billing_bucket
+                        'key': "MONGO_PASSWORD",
+                        'value': args.mongo_password
                     },
                     {
-                        'key': "<BILLING_DATASET_NAME>",
-                        'value': args.billing_bucket
+                        'key': "MONGO_PORT",
+                        'value': args.mongo_port
+                    },
+                    {
+                        'key': "MONGO_HOST",
+                        'value': args.mongo_host
+                    },
+                    {
+                        'key': "KEYSTORE_PASSWORD",
+                        'value': endpoint_keystore_password
+                    },
+                    {
+                        'key': "DATASET_NAME",
+                        'value': args.billing_dataset_name
+                    },
+                    {
+                        'key': "KEYCLOAK_CLIENT_ID",
+                        'value': args.keycloak_client_id
+                    },
+                    {
+                        'key': "CLIENT_SECRET",
+                        'value': args.keycloak_client_secret
+                    },
+                    {
+                        'key': "KEYCLOAK_AUTH_SERVER_URL",
+                        'value': args.keycloak_auth_server_url
                     }
                 ]
             for param in billing_properties:
diff --git a/infrastructure-provisioning/terraform/bin/deploy/renew_certificates.sh b/infrastructure-provisioning/terraform/bin/deploy/renew_certificates.sh
index 90f0e5f..ff3e46d 100644
--- a/infrastructure-provisioning/terraform/bin/deploy/renew_certificates.sh
+++ b/infrastructure-provisioning/terraform/bin/deploy/renew_certificates.sh
@@ -40,4 +40,4 @@ keytool -importcert -trustcacerts -alias RESOURCE_TYPE -file /etc/ssl/certs/dlab
 keytool -importcert -trustcacerts -alias step-ca -file /etc/ssl/certs/root_ca.crt -noprompt -storepass changeit -keystore JAVA_HOME/lib/security/cacerts
 
 # Restarting service
-supervisorctl restart provserv
\ No newline at end of file
+supervisorctl restart all
\ No newline at end of file
diff --git a/services/billing-gcp/src/main/resources/application.yml b/services/billing-gcp/src/main/resources/application.yml
index 81ac3d6..c84ed68 100644
--- a/services/billing-gcp/src/main/resources/application.yml
+++ b/services/billing-gcp/src/main/resources/application.yml
@@ -14,7 +14,7 @@ dlab:
   cron: 0 * * * * *
 
 server:
-  port: 8081
+  port: 8088
   servlet:
     contextPath: /api/billing
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org