From a2fe5de4f5cbb8865c77e3cb3fed9b1326d1c9c3 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Sun, 5 Jan 2025 06:47:30 +0000 Subject: [PATCH] revert controller activate --- sky/cloud_stores.py | 4 +++- sky/clouds/gcp.py | 7 ------- sky/utils/controller_utils.py | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sky/cloud_stores.py b/sky/cloud_stores.py index 445bd970839..0b5ec82f29f 100644 --- a/sky/cloud_stores.py +++ b/sky/cloud_stores.py @@ -115,7 +115,9 @@ def _gsutil_command(self): gsutil_alias, alias_gen = data_utils.get_gsutil_command() return (f'{alias_gen}; GOOGLE_APPLICATION_CREDENTIALS=' f'{gcp.DEFAULT_GCP_APPLICATION_CREDENTIAL_PATH}; ' - f'{gcp.ACTIVATE_SERVICE_ACCOUNT_COMMAND}; ' + 'gcloud auth activate-service-account ' + '--key-file=$GOOGLE_APPLICATION_CREDENTIALS ' + '2> /dev/null || true; ' f'{gsutil_alias}') def is_directory(self, url: str) -> bool: diff --git a/sky/clouds/gcp.py b/sky/clouds/gcp.py index 015524e4686..ff200f84147 100644 --- a/sky/clouds/gcp.py +++ b/sky/clouds/gcp.py @@ -75,13 +75,6 @@ source ~/google-cloud-sdk/path.bash.inc >> {_GCLOUD_INSTALLATION_LOG} 2>&1; }}; }} && \ popd &>/dev/null' -ACTIVATE_SERVICE_ACCOUNT_COMMAND: str = ( - 'GOOGLE_APPLICATION_CREDENTIALS=' - f'{DEFAULT_GCP_APPLICATION_CREDENTIAL_PATH} && ' - 'gcloud auth activate-service-account ' - '--key-file=$GOOGLE_APPLICATION_CREDENTIALS ' - '2> /dev/null || true') - # TODO(zhwu): Move the default AMI size to the catalog instead. DEFAULT_GCP_IMAGE_GB = 50 diff --git a/sky/utils/controller_utils.py b/sky/utils/controller_utils.py index 2199b86249e..39623085bbb 100644 --- a/sky/utils/controller_utils.py +++ b/sky/utils/controller_utils.py @@ -227,8 +227,7 @@ def _get_cloud_dependencies_installation_commands( elif isinstance(cloud, clouds.GCP): step_prefix = prefix_str.replace('', str(len(commands) + 1)) commands.append(f'echo -en "\\r{step_prefix}GCP SDK{empty_str}" &&' - f'{gcp.GOOGLE_SDK_INSTALLATION_COMMAND} && ' - f'{{ {gcp.ACTIVATE_SERVICE_ACCOUNT_COMMAND}; }}') + f'{gcp.GOOGLE_SDK_INSTALLATION_COMMAND}') elif isinstance(cloud, clouds.Kubernetes): step_prefix = prefix_str.replace('', str(len(commands) + 1)) commands.append(