From 72d807f9900f7247ec7bf668966a4480d06bcc5f Mon Sep 17 00:00:00 2001 From: Xudong Guo Date: Thu, 14 Sep 2023 15:08:42 +0800 Subject: [PATCH] fix --- docs/source/reference/faq.rst | 6 +++--- sky/clouds/service_catalog/data_fetchers/fetch_azure.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/source/reference/faq.rst b/docs/source/reference/faq.rst index 382aed93ed8..9e0d9c1a621 100644 --- a/docs/source/reference/faq.rst +++ b/docs/source/reference/faq.rst @@ -103,19 +103,19 @@ By default, SkyPilot supports most global regions on AWS and only supports the U version=$(python -c 'import sky; print(sky.clouds.service_catalog.constants.CATALOG_SCHEMA_VERSION)') mkdir -p ~/.sky/catalogs/${version} cd ~/.sky/catalogs/${version} - # Fetch the US region for GCP + # Fetch U.S. regions region for GCP python -m sky.clouds.service_catalog.data_fetchers.fetch_gcp # Fetch all regions for GCP pip install lxml python -m sky.clouds.service_catalog.data_fetchers.fetch_gcp --all-regions - # Fetch the US region for Azure + # Fetch U.S. regions region for Azure python -m sky.clouds.service_catalog.data_fetchers.fetch_azure # Fetch all regions for Azure python -m sky.clouds.service_catalog.data_fetchers.fetch_azure --all-regions # Fetch the specified regions for Azure python -m sky.clouds.service_catalog.data_fetchers.fetch_azure --regions japaneast australiaeast uksouth - # Exclude the specified regions for Azure + # Fetch U.S. regions for Azure, excluding the specified regions python -m sky.clouds.service_catalog.data_fetchers.fetch_azure --exclude centralus eastus To make your managed spot jobs potentially use all global regions, please log into the spot controller with ``ssh sky-spot-controller-`` diff --git a/sky/clouds/service_catalog/data_fetchers/fetch_azure.py b/sky/clouds/service_catalog/data_fetchers/fetch_azure.py index d003dda516a..897817f322a 100644 --- a/sky/clouds/service_catalog/data_fetchers/fetch_azure.py +++ b/sky/clouds/service_catalog/data_fetchers/fetch_azure.py @@ -266,9 +266,12 @@ def get_additional_columns(row): region_filter = set(get_regions()) - EXCLUDED_REGIONS else: region_filter = US_REGIONS - region_filter = set(region_filter) - set( + region_filter = region_filter - set( args.exclude) if args.exclude else region_filter + if not region_filter: + raise ValueError('No regions to fetch. Please check your arguments.') + instance_df = get_all_regions_instance_types_df(region_filter) os.makedirs('azure', exist_ok=True) instance_df.to_csv('azure/vms.csv', index=False)