You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2021/08/06 07:38:31 UTC

[incubator-datalab] branch DATALAB-408 updated: [DATALAB-408]: moved azure auth file copy

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

lfrolov pushed a commit to branch DATALAB-408
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git


The following commit(s) were added to refs/heads/DATALAB-408 by this push:
     new 403d84d  [DATALAB-408]: moved azure auth file copy
403d84d is described below

commit 403d84d0bcb2f4659022352417ebce778998ab9c
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Fri Aug 6 10:38:16 2021 +0300

    [DATALAB-408]: moved azure auth file copy
---
 .../src/ssn/scripts/configure_docker.py                  | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
index 849bce0..253ab25 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_docker.py
@@ -113,6 +113,14 @@ def login_in_gcr(os_user, gcr_creds, odahu_image, datalab_path, cloud_provider):
 
 def build_docker_images(image_list, region, datalab_path):
     try:
+        host_string = '{}@{}'.format(args.os_user, args.hostname)
+        if os.environ['conf_cloud_provider'] == 'azure':
+            conn.local('scp -i {} /root/azure_auth.json {}:{}sources/infrastructure-provisioning/src/base/'
+                       'azure_auth.json'.format(args.keyfile, host_string, args.datalab_path))
+            conn.sudo('cp {0}sources/infrastructure-provisioning/src/base/azure_auth.json '
+                      '/home/{1}/keys/azure_auth.json'.format(args.datalab_path, args.os_user))
+        if region == 'cn-north-1':
+            add_china_repository(datalab_path)
         if 'conf_repository_user' in os.environ and 'conf_repository_pass' in os.environ and 'conf_repository_address' in os.environ:
             conn.sudo('sudo docker login -u {0} -p {1} {2}:8083'
                       .format(os.environ['conf_repository_user'], os.environ['conf_repository_pass'], os.environ['conf_repository_address']))
@@ -127,14 +135,6 @@ def build_docker_images(image_list, region, datalab_path):
                           .format(os.environ['conf_repository_address'], os.environ['conf_cloud_provider'], name, tag))
             return True
         else:
-            host_string = '{}@{}'.format(args.os_user, args.hostname)
-            if os.environ['conf_cloud_provider'] == 'azure':
-                conn.local('scp -i {} /root/azure_auth.json {}:{}sources/infrastructure-provisioning/src/base/'
-                      'azure_auth.json'.format(args.keyfile, host_string, args.datalab_path))
-                conn.sudo('cp {0}sources/infrastructure-provisioning/src/base/azure_auth.json '
-                     '/home/{1}/keys/azure_auth.json'.format(args.datalab_path, args.os_user))
-            if region == 'cn-north-1':
-                add_china_repository(datalab_path)
             for image in image_list:
                 name = image['name']
                 tag = image['tag']

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