Skip to content

Commit

Permalink
split out azure-cli dep
Browse files Browse the repository at this point in the history
  • Loading branch information
cg505 committed Nov 27, 2024
1 parent 2a1b494 commit 9ef8d22
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
8 changes: 5 additions & 3 deletions sky/setup_files/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
'colorama < 0.4.5',
]

# azure-cli cannot be installed normally by uv, so we need to work around it in
# a few places.
AZURE_CLI = 'azure-cli>=2.65.0'

extras_require: Dict[str, List[str]] = {
'aws': aws_dependencies,
# TODO(zongheng): azure-cli is huge and takes a long time to install.
Expand All @@ -93,9 +97,7 @@
# We need azure-identity>=1.13.0 to enable the customization of the
# timeout of AzureCliCredential.
'azure': [
# If you update the azure-cli dependency, update in sky/skylet/constants.py
# SKYPILOT_WHEEL_INSTALLATION_COMMANDS as well.
'azure-cli>=2.65.0',
AZURE_CLI,
'azure-core>=1.31.0',
'azure-identity>=1.19.0',
'azure-mgmt-network>=27.0.0',
Expand Down
4 changes: 3 additions & 1 deletion sky/skylet/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from packaging import version

import sky
from sky.setup_files import dependencies

SKY_LOGS_DIRECTORY = '~/sky_logs'
SKY_REMOTE_WORKDIR = '~/sky_workdir'
Expand Down Expand Up @@ -226,7 +227,8 @@
# cause uv to use pre-releases for some other packages that have sufficient
# stable releases.
'if [ "{cloud}" = "azure" ]; then '
f'{SKY_UV_PIP_CMD} install --prerelease=allow "azure-cli>=2.65.0"; fi;'
f'{SKY_UV_PIP_CMD} install --prerelease=allow "{dependencies.AZURE_CLI}";'
'fi;'
# Install skypilot from wheel
f'{SKY_UV_PIP_CMD} install "$(echo ~/.sky/wheels/{{sky_wheel_hash}}/'
f'skypilot-{_sky_version}*.whl)[{{cloud}}, remote]" && '
Expand Down
10 changes: 2 additions & 8 deletions sky/utils/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,12 @@ def _get_cloud_dependencies_installation_commands(
if isinstance(cloud, clouds.Azure):
# azure-cli cannot be normally installed by uv.
# See comments in sky/skylet/constants.py.
azure_cli_dep = [
dep for dep in cloud_python_dependencies
if dep.startswith('azure-cli')
]
assert len(azure_cli_dep) == 1, cloud_python_dependencies
azure_cli_dep = azure_cli_dep[0]
cloud_python_dependencies.remove(azure_cli_dep)
cloud_python_dependencies.remove(dependencies.AZURE_CLI)

step_prefix = prefix_str.replace('<step>', str(len(commands) + 1))
commands.append(
f'echo -en "\\r{step_prefix}azure-cli{empty_str}" &&'
f'uv pip install --prerelease=allow "{azure_cli_dep}" '
f'uv pip install --prerelease=allow "{dependencies.AZURE_CLI}" '
'> /dev/null 2>&1')
elif isinstance(cloud, clouds.Kubernetes):
step_prefix = prefix_str.replace('<step>', str(len(commands) + 1))
Expand Down

0 comments on commit 9ef8d22

Please sign in to comment.