Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GCP] fix application key upload #3234

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions sky/clouds/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,20 +765,23 @@ def get_credential_file_mounts(self) -> Dict[str, str]:
# credential, which causes problem for ray up multiple nodes, tracked
# in #494, #496, #483.
# We only add the existing credential files. It should be safe to ignore
# the missing files, as we successfully created the VM at this point,
# meaning the authentication is successful.
# the missing files, as we have checked the cloud credentials in
# `check_credentials()` when the user calls `sky check`.
credentials = {
f'~/.config/gcloud/{filename}': f'~/.config/gcloud/{filename}'
for filename in _CREDENTIAL_FILES
if os.path.exists(os.path.expanduser(
f'~/.config/gcloud/{filename}'))
}
application_key_path = self._find_application_key_path()
if os.path.exists(os.path.expanduser(application_key_path)):
try:
application_key_path = self._find_application_key_path()
# Upload the application key path to the default path, so that
# autostop and GCS can be accessed on the remote cluster.
credentials[DEFAULT_GCP_APPLICATION_CREDENTIAL_PATH] = (
application_key_path)
except FileNotFoundError:
# Skip if the application key path is not found.
pass
return credentials

@classmethod
Expand Down
Loading