Skip to content

[Core] Add NO_UPLOAD for remote_identity #4307

New issue

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

By clicking “No 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? No Sign in to your account

Merged
merged 7 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions docs/source/reference/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ Available fields and semantics:
# instances. SkyPilot will auto-create and reuse a service account (IAM
# role) for AWS instances.
#
# SKIP: Skip setting the remote identity. No credentials will be uploaded to
# the instances. Useful for avoiding overriding any existing credentials
# that may be automounted on the cluster.
#
# Customized service account (IAM role): <string> or <list of single-element dict>
# - <string>: apply the service account with the specified name to all instances.
# Example:
Expand Down Expand Up @@ -406,6 +410,10 @@ Available fields and semantics:
# instances. SkyPilot will auto-create and reuse a service account for GCP
# instances.
#
# SKIP: Skip setting the remote identity. No credentials will be uploaded to
# the instances. Useful for avoiding overriding any existing credentials
# that may be automounted on the cluster.
#
# Two caveats of SERVICE_ACCOUNT for multicloud users:
#
# - This only affects GCP instances. Local GCP credentials will still be
Expand Down Expand Up @@ -491,6 +499,10 @@ Available fields and semantics:
# SkyPilot will auto-create and reuse a service account with necessary roles
# in the user's namespace.
#
# SKIP: Skip setting the remote identity. No credentials will be uploaded to
# the pods. Useful for avoiding overriding any existing credentials that may
# be automounted on the cluster.
#
# <string>: The name of a service account to use for all Kubernetes pods.
# This service account must exist in the user's namespace and have all
# necessary permissions. Refer to https://skypilot.readthedocs.io/en/latest/cloud-setup/cloud-permissions/kubernetes.html
Expand Down
8 changes: 8 additions & 0 deletions sky/backends/backend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,14 @@ def write_cluster_config(
'is not supported by this cloud. Remove the config or set: '
'`remote_identity: LOCAL_CREDENTIALS`.')
excluded_clouds = [cloud]

for cloud_str, cloud_obj in cloud_registry.CLOUD_REGISTRY.items():
remote_identity_config = skypilot_config.get_nested(
(cloud_str.lower(), 'remote_identity'), None)
if remote_identity_config:
if remote_identity_config == schemas.RemoteIdentityOptions.SKIP.value:
excluded_clouds.append(cloud_obj)

credentials = sky_check.get_cloud_credential_file_mounts(excluded_clouds)

auth_config = {'ssh_private_key': auth.PRIVATE_SSH_KEY_PATH}
Expand Down
1 change: 1 addition & 0 deletions sky/utils/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ class RemoteIdentityOptions(enum.Enum):
"""
LOCAL_CREDENTIALS = 'LOCAL_CREDENTIALS'
SERVICE_ACCOUNT = 'SERVICE_ACCOUNT'
SKIP = 'SKIP'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to better names, if any

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about remote_identity: null?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being explicit makes it more clear to me, how about 'NO_UPLOAD'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, renamed to NO_UPLOAD



def get_default_remote_identity(cloud: str) -> str:
Expand Down
Loading