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

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


The following commit(s) were added to refs/heads/DLAB-1467 by this push:
     new 0b16e34  [DLAB-1467]: Added terraform scripts for deploying DLab 
endpoint
0b16e34 is described below

commit 0b16e34cae0d1856e8e84c780381170ed643618f
Author: Oleh Martushevskyi <[email protected]>
AuthorDate: Wed Feb 5 14:12:42 2020 +0200

    [DLAB-1467]: Added terraform scripts for deploying DLab endpoint
---
 .../src/general/scripts/aws/ssn_configure.py                |  4 ++++
 .../src/general/scripts/azure/ssn_configure.py              |  4 ++++
 .../src/general/scripts/gcp/ssn_configure.py                |  4 ++++
 .../terraform/bin/deploy/endpoint_fab.py                    | 13 ++++++++++++-
 .../terraform/bin/deploy/provisioning.yml                   |  1 +
 5 files changed, 25 insertions(+), 1 deletion(-)

diff --git 
a/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py 
b/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
index 7d3a328..a4d6dbc 100644
--- a/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/aws/ssn_configure.py
@@ -472,6 +472,10 @@ if __name__ == "__main__":
             {
                 'key': 'CONF_IMAGE_ENABLED',
                 'value': os.environ['conf_image_enabled']
+            },
+            {
+                'key': "AZURE_AUTH_FILE_PATH",
+                'value': ""
             }
         ]
         if os.environ['conf_duo_vpc_enable'] == 'true':
diff --git 
a/infrastructure-provisioning/src/general/scripts/azure/ssn_configure.py 
b/infrastructure-provisioning/src/general/scripts/azure/ssn_configure.py
index 2faa7ed..406eef4 100644
--- a/infrastructure-provisioning/src/general/scripts/azure/ssn_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/azure/ssn_configure.py
@@ -336,6 +336,10 @@ if __name__ == "__main__":
             {
                 'key': 'CONF_IMAGE_ENABLED',
                 'value': os.environ['conf_image_enabled']
+            },
+            {
+                'key': "AZURE_AUTH_FILE_PATH",
+                'value': ""
             }
         ]
 
diff --git 
a/infrastructure-provisioning/src/general/scripts/gcp/ssn_configure.py 
b/infrastructure-provisioning/src/general/scripts/gcp/ssn_configure.py
index 9915f5e..cc9f170 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/ssn_configure.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/ssn_configure.py
@@ -407,6 +407,10 @@ if __name__ == "__main__":
             {
                 'key': 'CONF_IMAGE_ENABLED',
                 'value': os.environ['conf_image_enabled']
+            },
+            {
+                'key': "AZURE_AUTH_FILE_PATH",
+                'value': ""
             }
         ]
         if os.environ['conf_stepcerts_enabled'] == 'true':
diff --git a/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py 
b/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
index 47ead50..72ff1d7 100644
--- a/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
+++ b/infrastructure-provisioning/terraform/bin/deploy/endpoint_fab.py
@@ -253,6 +253,10 @@ def create_key_dir_endpoint():
     try:
         if not exists(conn, '/home/{}/keys'.format(args.os_user)):
             conn.run('mkdir /home/{}/keys'.format(args.os_user))
+            if args.auth_file_path:
+                conn.put(args.auth_file_path, '/tmp/azure_auth.json')
+                conn.sudo('mv /tmp/azure_auth.json 
/home/{}/keys/'.format(args.os_user))
+                args.auth_file_path = 
'/home/{}/keys/azure_auth.json'.format(args.os_user)
     except Exception as err:
         logging.error('Failed create keys directory as ~/keys: ', str(err))
         traceback.print_exc()
@@ -317,10 +321,12 @@ def 
configure_supervisor_endpoint(endpoint_keystore_password):
                      .format(dlab_conf_dir))
             if args.resource_group_name == '':
                 args.resource_group_name = args.service_base_name
+            if args.cloud_provider == 'azure':
+                args.region = args.region.lower().replace(' ', '')
             cloud_properties = [
                 {
                     'key': "OS_USER",
-                    'value': args.os_user
+                    'value': args.os_userd
                 },
                 {
                     'key': "KEYNAME",
@@ -501,6 +507,10 @@ def 
configure_supervisor_endpoint(endpoint_keystore_password):
                 {
                     'key': "KEYCLOAK_PASSWORD",
                     'value': args.keycloak_user_password
+                },
+                {
+                    'key': "AZURE_AUTH_FILE_PATH",
+                    'value': args.auth_file_path
                 }
             ]
             for param in cloud_properties:
@@ -761,6 +771,7 @@ def init_args():
     parser.add_argument('--step_ca_url', type=str, default='')
     parser.add_argument('--shared_image_enabled', type=str, default='true')
     parser.add_argument('--image_enabled', type=str, default='true')
+    parser.add_argument('--auth_file_path', type=str, default='')
 
     # TEMPORARY
     parser.add_argument('--ssn_k8s_nlb_dns_name', type=str, default='')
diff --git a/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml 
b/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml
index 2187c80..9d65fa2 100644
--- a/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml
+++ b/infrastructure-provisioning/terraform/bin/deploy/provisioning.yml
@@ -172,6 +172,7 @@ cloudProperties:
   azureClientId: AZURE_CLIENT_ID
   gcpProjectId: GCP_PROJECT_ID
   imageEnabled: CONF_IMAGE_ENABLED
+  azureAuthFile: AZURE_AUTH_FILE_PATH
   ldap:
     host: LDAP_HOST
     dn: LDAP_DN


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

Reply via email to