Skip to content

Commit

Permalink
use uv pip for awscli
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Dec 19, 2024
1 parent 494c885 commit 83997be
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions sky/cloud_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ class S3CloudStorage(CloudStorage):

# List of commands to install AWS CLI
_GET_AWSCLI = [
'aws --version >/dev/null 2>&1 || pip3 install awscli',
'aws --version >/dev/null 2>&1 || '
# We use SKY_UV_PIP_CMD to install awscli, instead of raw pip command,
# as on some clouds, pip may not be available, e.g., on Kubernetes, our
# conda pacakge is installing in the background, and may not be ready
# to use yet when we reach here.
f'{constants.SKY_UV_PIP_CMD} install awscli',
]

def is_directory(self, url: str) -> bool:
Expand Down Expand Up @@ -82,7 +87,8 @@ def make_sync_dir_command(self, source: str, destination: str) -> str:
# AWS Sync by default uses 10 threads to upload files to the bucket.
# To increase parallelism, modify max_concurrent_requests in your
# aws config file (Default path: ~/.aws/config).
download_via_awscli = ('aws s3 sync --no-follow-symlinks '
download_via_awscli = (f'{constants.SKY_REMOTE_PYTHON_ENV}/bin/aws s3 '
'sync --no-follow-symlinks '
f'{source} {destination}')

all_commands = list(self._GET_AWSCLI)
Expand All @@ -91,7 +97,8 @@ def make_sync_dir_command(self, source: str, destination: str) -> str:

def make_sync_file_command(self, source: str, destination: str) -> str:
"""Downloads a file using AWS CLI."""
download_via_awscli = f'aws s3 cp {source} {destination}'
download_via_awscli = (f'{constants.SKY_REMOTE_PYTHON_ENV}/bin/aws '
f's3 cp {source} {destination}')

all_commands = list(self._GET_AWSCLI)
all_commands.append(download_via_awscli)
Expand Down

0 comments on commit 83997be

Please sign in to comment.