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

dmysakovets pushed a commit to branch odahu-integration
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/odahu-integration by this push:
     new 875c5e0  [odahu-integration] Bugfixing
875c5e0 is described below

commit 875c5e0a48388658a8d9440a3097211aa2c75806
Author: Demyan Mysakovets <[email protected]>
AuthorDate: Mon Feb 17 10:53:39 2020 +0200

    [odahu-integration] Bugfixing
---
 .../src/general/conf/dlab.ini                      |  2 +-
 .../src/general/files/gcp/ssn_policy.json          |  1 +
 .../src/general/lib/gcp/meta_lib.py                |  6 ++++--
 .../src/general/scripts/gcp/odahu_deploy.py        | 23 ++++++++++++++++++++--
 4 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/infrastructure-provisioning/src/general/conf/dlab.ini 
b/infrastructure-provisioning/src/general/conf/dlab.ini
index 397c217..a6b99f6 100644
--- a/infrastructure-provisioning/src/general/conf/dlab.ini
+++ b/infrastructure-provisioning/src/general/conf/dlab.ini
@@ -341,7 +341,7 @@ istio_helm_repo = 
https://storage.googleapis.com/istio-release/releases/1.2.2/ch
 ###
 k8s_version = 1.13.12
 ###
-helm_repo = https://github.com/odahu/odahu-helm
+helm_repo =  https://raw.githubusercontent.com/odahu/odahu-helm/master
 ###
 infra_version = 1.0.0
 ###
diff --git a/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json 
b/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json
index 35e8307..fc06a3a 100644
--- a/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json
+++ b/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json
@@ -31,6 +31,7 @@
     "container.serviceAccounts.delete",
     "iam.serviceAccountKeys.create",
     "iam.serviceAccountKeys.delete",
+    "iam.serviceAccountKeys.get",
     "dns.resourceRecordSets.list",
     "dns.managedZones.get"
 ]
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py 
b/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py
index ce623cc..36efea4 100644
--- a/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py
+++ b/infrastructure-provisioning/src/general/lib/gcp/meta_lib.py
@@ -701,15 +701,17 @@ class GCPMeta:
     def get_available_zones(self):
         try:
             request = self.service.regions().get(project=self.project, 
region=os.environ['gcp_region'])
+            gpu_zones = ['asia-east1-a', 'asia-east1-c', 'australia1-c', 
'us-central1-c', 'us-central1-f', 'us-east1-b', 'us-east1-c', 'us-west1-a', 
'us-west1-b', 'europe-west1-b', 'europe-west1-d', 'europe-west4-a']
             zone_list = []
             response = request.execute()
             for zone in response['zones']:
-                zone_list.append(str(zone.split('/')[-1]))
+                if zone in gpu_zones:
+                    zone_list.append(str(zone.split('/')[-1]))
             return zone_list
         except Exception as err:
             logging.info(
                 "Error with getting available zones: " + str(err) + "\n 
Traceback: " + traceback.print_exc(
-                    file=sys.stdout))
+                    file=sys.stdout) + "\n T")
             append_result(str({"error": "Error with getting available zones",
                                "error_message": str(err) + "\n Traceback: " + 
traceback.print_exc(file=sys.stdout)}))
             traceback.print_exc(file=sys.stdout)
diff --git 
a/infrastructure-provisioning/src/general/scripts/gcp/odahu_deploy.py 
b/infrastructure-provisioning/src/general/scripts/gcp/odahu_deploy.py
index b5ca560..ab6ba85 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/odahu_deploy.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/odahu_deploy.py
@@ -72,7 +72,7 @@ if __name__ == "__main__":
     odahu_conf['istio_helm_repo'] = os.environ['odahu_istio_helm_repo']
     odahu_conf['helm_repo'] = os.environ['odahu_helm_repo']
     odahu_conf['k8s_version'] = os.environ['odahu_k8s_version']
-    odahu_conf['oauth_oidc_issuer_url'] = 
"{}realms/{}".format(os.environ['keycloak_auth_server_url'], 
os.environ['keycloak_realm_name'])
+    odahu_conf['oauth_oidc_issuer_url'] = 
"{}/realms/{}".format(os.environ['keycloak_auth_server_url'], 
os.environ['keycloak_realm_name'])
     odahu_conf['oauth_client_id'] = os.environ['keycloak_client_name']
     odahu_conf['oauth_client_secret'] = os.environ['keycloak_client_secret']
     odahu_conf['oauth_cookie_secret'] = id_generator()
@@ -91,6 +91,7 @@ if __name__ == "__main__":
     odahu_conf['dns_project_id'] = os.environ['odahu_dns_project_id']
     odahu_conf['decrypt_token'] = id_generator()
     odahu_conf['infra_vpc_peering'] = os.environ['odahu_infra_vpc_peering']
+    response_file 
="/response/odahu_{}_{}.json".format(odahu_conf['odahu_cluster_name'], 
os.environ['request_id'])
 
     print('Preparing parameters file')
     try:
@@ -141,8 +142,26 @@ if __name__ == "__main__":
         sys.exit(1)
 
     try:
-        local('tf_runner create -o /response')
+        local('tf_runner create -o 
/response/odahu_{}_{}.json'.format(odahu_conf['odahu_cluster_name'], 
os.environ['request_id']))
     except Exception as err:
         traceback.print_exc()
         append_result("Failed to deploy Odahu cluster.", str(err))
         sys.exit(1)
+
+    # generating output information
+    try:
+        local("sed -e 's|name = |"description": |g' result")
+        local("sed -e 's|url = |"url": |g' result")
+        odahu_urls = local("cat result")
+    except Exception as err:
+        traceback.print_exc()
+        append_result("Failed to generate output information.", str(err))
+        sys.exit(1)
+
+    print('[SUMMARY]')
+    logging.info('[SUMMARY]')
+    print('Cluster name: {}'.format(odahu_conf['odahu_cluster_name']))
+
+    with open("/root/result.json", 'w') as result:
+        res = {"odahu_urls": [odahu_urls]}
+        result.write(json.dumps(res))
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to