diff --git a/sky/clouds/do.py b/sky/clouds/do.py index 9961d8fbfa6..5536cb296ef 100644 --- a/sky/clouds/do.py +++ b/sky/clouds/do.py @@ -2,7 +2,7 @@ import json import typing -from typing import Dict, Iterator, List, Optional, Tuple +from typing import Dict, Iterator, List, Optional, Tuple, Union from sky import clouds from sky.adaptors import do @@ -158,7 +158,7 @@ def get_default_instance_type( @classmethod def get_accelerators_from_instance_type( - cls, instance_type: str) -> Optional[Dict[str, int]]: + cls, instance_type: str) -> Optional[Dict[str, Union[int, float]]]: return service_catalog.get_accelerators_from_instance_type( instance_type, clouds='DO') @@ -172,6 +172,7 @@ def make_deploy_resources_variables( cluster_name: resources_utils.ClusterName, region: 'clouds.Region', zones: Optional[List['clouds.Zone']], + num_nodes: int, dryrun: bool = False) -> Dict[str, Optional[str]]: del zones, dryrun, cluster_name diff --git a/sky/clouds/service_catalog/do_catalog.py b/sky/clouds/service_catalog/do_catalog.py index bd4c1253b0d..40a53aa6bc4 100644 --- a/sky/clouds/service_catalog/do_catalog.py +++ b/sky/clouds/service_catalog/do_catalog.py @@ -5,7 +5,7 @@ """ import typing -from typing import Dict, List, Optional, Tuple +from typing import Dict, List, Optional, Tuple, Union from sky.clouds.service_catalog import common from sky.utils import ux_utils @@ -60,7 +60,7 @@ def get_default_instance_type( def get_accelerators_from_instance_type( - instance_type: str) -> Optional[Dict[str, int]]: + instance_type: str) -> Optional[Dict[str, Union[int, float]]]: return common.get_accelerators_from_instance_type_impl(_df, instance_type) diff --git a/tests/smoke_tests/test_basic.py b/tests/smoke_tests/test_basic.py index b03251f313d..aead10fa733 100644 --- a/tests/smoke_tests/test_basic.py +++ b/tests/smoke_tests/test_basic.py @@ -422,7 +422,7 @@ def test_load_dump_yaml_config_equivalent(self): # ---------- Testing Multiple Accelerators ---------- @pytest.mark.no_fluidstack # Fluidstack does not support K80 gpus for now @pytest.mark.no_paperspace # Paperspace does not support K80 gpus -@pytest.mark.no_do # DO does not support K80s +@pytest.mark.no_do # DO does not support K80s def test_multiple_accelerators_ordered(): name = smoke_tests_utils.get_cluster_name() test = smoke_tests_utils.Test( @@ -439,7 +439,7 @@ def test_multiple_accelerators_ordered(): @pytest.mark.no_fluidstack # Fluidstack has low availability for T4 GPUs @pytest.mark.no_paperspace # Paperspace does not support T4 GPUs -@pytest.mark.no_do # DO does not have multiple accelerators +@pytest.mark.no_do # DO does not have multiple accelerators def test_multiple_accelerators_ordered_with_default(): name = smoke_tests_utils.get_cluster_name() test = smoke_tests_utils.Test( @@ -456,7 +456,7 @@ def test_multiple_accelerators_ordered_with_default(): @pytest.mark.no_fluidstack # Fluidstack has low availability for T4 GPUs @pytest.mark.no_paperspace # Paperspace does not support T4 GPUs -@pytest.mark.no_do # DO does not have multiple accelerators +@pytest.mark.no_do # DO does not have multiple accelerators def test_multiple_accelerators_unordered(): name = smoke_tests_utils.get_cluster_name() test = smoke_tests_utils.Test( @@ -472,7 +472,7 @@ def test_multiple_accelerators_unordered(): @pytest.mark.no_fluidstack # Fluidstack has low availability for T4 GPUs @pytest.mark.no_paperspace # Paperspace does not support T4 GPUs -@pytest.mark.no_do # DO does not support multiple accelerators +@pytest.mark.no_do # DO does not support multiple accelerators def test_multiple_accelerators_unordered_with_default(): name = smoke_tests_utils.get_cluster_name() test = smoke_tests_utils.Test( @@ -506,7 +506,7 @@ def test_multiple_resources(): @pytest.mark.no_paperspace # Requires other clouds to be enabled @pytest.mark.no_kubernetes @pytest.mark.aws # SkyBenchmark requires S3 access -@pytest.mark.no_do # requires other clouds to be enabled +@pytest.mark.no_do # requires other clouds to be enabled def test_sky_bench(generic_cloud: str): name = smoke_tests_utils.get_cluster_name() test = smoke_tests_utils.Test( diff --git a/tests/smoke_tests/test_cluster_job.py b/tests/smoke_tests/test_cluster_job.py index 773166f5e63..5ad90dbdcea 100644 --- a/tests/smoke_tests/test_cluster_job.py +++ b/tests/smoke_tests/test_cluster_job.py @@ -43,7 +43,7 @@ @pytest.mark.no_scp # SCP does not have T4 gpus. Run test_scp_job_queue instead @pytest.mark.no_paperspace # Paperspace does not have T4 gpus. @pytest.mark.no_oci # OCI does not have T4 gpus -@pytest.mark.parametrize('accelerator', [{'do' : 'H100'}]) +@pytest.mark.parametrize('accelerator', [{'do': 'H100'}]) def test_job_queue(generic_cloud: str, accelerator: Dict[str, str]): accelerator = accelerator.get(generic_cloud, 'T4') name = smoke_tests_utils.get_cluster_name() @@ -79,7 +79,7 @@ def test_job_queue(generic_cloud: str, accelerator: Dict[str, str]): @pytest.mark.no_scp # Doesn't support SCP for now @pytest.mark.no_oci # Doesn't support OCI for now @pytest.mark.no_kubernetes # Doesn't support Kubernetes for now -@pytest.mark.parametrize('accelerator', [{'do' : 'H100'}]) +@pytest.mark.parametrize('accelerator', [{'do': 'H100'}]) @pytest.mark.parametrize( 'image_id', [ @@ -96,7 +96,8 @@ def test_job_queue(generic_cloud: str, accelerator: Dict[str, str]): # 2. python>=3.12 works with SkyPilot runtime. 'docker:winglian/axolotl:main-latest' ]) -def test_job_queue_with_docker(generic_cloud: str, image_id: str, accelerator: Dict[str, str]): +def test_job_queue_with_docker(generic_cloud: str, image_id: str, + accelerator: Dict[str, str]): accelerator = accelerator.get(generic_cloud, 'T4') name = smoke_tests_utils.get_cluster_name() + image_id[len('docker:'):][:4] total_timeout_minutes = 40 if generic_cloud == 'azure' else 15 @@ -389,7 +390,7 @@ def test_docker_preinstalled_package(generic_cloud: str): @pytest.mark.no_ibm # IBM Cloud does not have T4 gpus @pytest.mark.no_scp # SCP does not support num_nodes > 1 yet @pytest.mark.no_oci # OCI Cloud does not have T4 gpus -@pytest.mark.no_do # DO does not have T4 gpus +@pytest.mark.no_do # DO does not have T4 gpus def test_multi_echo(generic_cloud: str): name = smoke_tests_utils.get_cluster_name() test = smoke_tests_utils.Test( diff --git a/tests/smoke_tests/test_managed_job.py b/tests/smoke_tests/test_managed_job.py index 729b6dd7f79..bbe1509e770 100644 --- a/tests/smoke_tests/test_managed_job.py +++ b/tests/smoke_tests/test_managed_job.py @@ -94,7 +94,7 @@ def test_managed_jobs(generic_cloud: str): @pytest.mark.no_scp # SCP does not support spot instances @pytest.mark.no_paperspace # Paperspace does not support spot instances @pytest.mark.no_kubernetes # Kubernetes does not have a notion of spot instances -@pytest.mark.no_do # DO does not support spot instances +@pytest.mark.no_do # DO does not support spot instances @pytest.mark.managed_jobs def test_job_pipeline(generic_cloud: str): """Test a job pipeline.""" @@ -136,7 +136,7 @@ def test_job_pipeline(generic_cloud: str): @pytest.mark.no_scp # SCP does not support spot instances @pytest.mark.no_paperspace # Paperspace does not support spot instances @pytest.mark.no_kubernetes # Kubernetes does not have a notion of spot instances -@pytest.mark.no_do # DO does not support spot instances +@pytest.mark.no_do # DO does not support spot instances @pytest.mark.managed_jobs def test_managed_jobs_failed_setup(generic_cloud: str): """Test managed job with failed setup.""" @@ -388,7 +388,7 @@ def test_managed_jobs_pipeline_recovery_gcp(): @pytest.mark.no_scp # SCP does not support spot instances @pytest.mark.no_paperspace # Paperspace does not support spot instances @pytest.mark.no_kubernetes # Kubernetes does not have a notion of spot instances -@pytest.mark.no_do # DO does not have spot instances +@pytest.mark.no_do # DO does not have spot instances @pytest.mark.managed_jobs def test_managed_jobs_recovery_default_resources(generic_cloud: str): """Test managed job recovery for default resources.""" diff --git a/tests/smoke_tests/test_sky_serve.py b/tests/smoke_tests/test_sky_serve.py index 33cccf43a32..2be23630ce7 100644 --- a/tests/smoke_tests/test_sky_serve.py +++ b/tests/smoke_tests/test_sky_serve.py @@ -197,7 +197,7 @@ def test_skyserve_oci_http(): @pytest.mark.no_fluidstack # Fluidstack does not support T4 gpus for now -@pytest.mark.parametrize('accelerator', [{'do' : 'H100'}]) +@pytest.mark.parametrize('accelerator', [{'do': 'H100'}]) @pytest.mark.serve def test_skyserve_llm(generic_cloud: str, accelerator: Dict[str, str]): """Test skyserve with real LLM usecase"""