Skip to content

Commit

Permalink
Merge branch 'azure-provisioner' of github.com:skypilot-org/skypilot …
Browse files Browse the repository at this point in the history
…into azure-provisioner
  • Loading branch information
Michaelvll committed Jul 7, 2024
2 parents 7962912 + 4798ad2 commit 37da89c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
11 changes: 11 additions & 0 deletions sky/provision/azure/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import logging
from multiprocessing import pool
import os
import pathlib
import time
import typing
Expand All @@ -16,6 +17,7 @@
from sky.adaptors import azure
from sky.provision import common
from sky.provision import constants
from sky.skylet import constants as skylet_constants
from sky.utils import common_utils
from sky.utils import ux_utils

Expand Down Expand Up @@ -503,6 +505,15 @@ def get_cluster_info(
provider_config: Optional[Dict[str, Any]] = None) -> common.ClusterInfo:
"""See sky/provision/__init__.py"""
del region
# Add the executable path to the PATH environment variable to make sure, az
# command is available in the subprocess. Thisis useful for a controller to
# query statuses of old Azure instances that was provisioned with ray
# autoscaler.
os.environ['PATH'] = os.pathsep.join([
os.environ.get('PATH', ''),
os.path.expanduser(
os.path.join(skylet_constants.SKY_REMOTE_PYTHON_ENV, 'bin'))
])
filters = {constants.TAG_RAY_CLUSTER_NAME: cluster_name_on_cloud}
assert provider_config is not None, (cluster_name_on_cloud, provider_config)
resource_group = provider_config['resource_group']
Expand Down
5 changes: 3 additions & 2 deletions sky/utils/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ def _get_cloud_dependencies_installation_commands(
'! command -v curl &> /dev/null || '
'! command -v socat &> /dev/null || '
'! command -v netcat &> /dev/null; '
'then apt update && apt install curl socat netcat -y; '
'then apt update && apt install curl socat netcat -y '
'&> /dev/null; '
'fi" && '
# Install kubectl
'(command -v kubectl &>/dev/null || '
Expand All @@ -253,7 +254,7 @@ def _get_cloud_dependencies_installation_commands(
'pip list | grep cudo-compute > /dev/null 2>&1 || '
'pip install "cudo-compute>=0.1.10" > /dev/null 2>&1 && '
'wget https://download.cudo.org/compute/cudoctl-0.3.2-amd64.deb -O ~/cudoctl.deb > /dev/null 2>&1 && ' # pylint: disable=line-too-long
'sudo dpkg -i ~/cudoctl.deb > /dev/null 2>&1')
'sudo dpkg -i ~/cudoctl.deb 2>&1 > /dev/null')
if controller == Controllers.JOBS_CONTROLLER:
if isinstance(cloud, clouds.IBM):
commands.append(
Expand Down
4 changes: 2 additions & 2 deletions tests/backward_compatibility_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if [ "$start_from" -le 7 ]; then
conda activate sky-back-compat-master
rm -r ~/.sky/wheels || true
sky spot launch -d --cloud ${CLOUD} -y --cpus 2 --num-nodes 2 -n ${MANAGED_JOB_JOB_NAME}-7-0 "echo hi; sleep 1000"
sky spot launch -d --cloud ${CLOUD} -y --cpus 2 --num-nodes 2 -n ${MANAGED_JOB_JOB_NAME}-7-1 "echo hi; sleep 300"
sky spot launch -d --cloud ${CLOUD} -y --cpus 2 --num-nodes 2 -n ${MANAGED_JOB_JOB_NAME}-7-1 "echo hi; sleep 400"
conda activate sky-back-compat-current
rm -r ~/.sky/wheels || true
s=$(sky jobs queue | grep ${MANAGED_JOB_JOB_NAME}-7 | grep "RUNNING" | wc -l)
Expand All @@ -183,7 +183,7 @@ s=$(sky jobs queue | grep ${MANAGED_JOB_JOB_NAME}-7)
echo "$s"
echo "$s" | grep "RUNNING" | wc -l | grep 3 || exit 1
sky jobs cancel -y -n ${MANAGED_JOB_JOB_NAME}-7-0
sky jobs logs -n "${MANAGED_JOB_JOB_NAME}-7-1"
sky jobs logs -n "${MANAGED_JOB_JOB_NAME}-7-1" || exit 1
s=$(sky jobs queue | grep ${MANAGED_JOB_JOB_NAME}-7)
echo "$s"
echo "$s" | grep "SUCCEEDED" | wc -l | grep 2 || exit 1
Expand Down

0 comments on commit 37da89c

Please sign in to comment.