From 13f54ebc52094902f4c84e8250deab0c8ab8c4b6 Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Wed, 28 Aug 2024 10:00:53 -0700 Subject: [PATCH] [AWS] Fix catalog folder not exists issue (#3883) fix catalog folder --- sky/clouds/service_catalog/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sky/clouds/service_catalog/common.py b/sky/clouds/service_catalog/common.py index fbbe0fdcef1..1b5fec9e8e8 100644 --- a/sky/clouds/service_catalog/common.py +++ b/sky/clouds/service_catalog/common.py @@ -58,7 +58,9 @@ class InstanceTypeInfo(NamedTuple): def get_catalog_path(filename: str) -> str: - return os.path.join(_ABSOLUTE_VERSIONED_CATALOG_DIR, filename) + catalog_path = os.path.join(_ABSOLUTE_VERSIONED_CATALOG_DIR, filename) + os.makedirs(os.path.dirname(catalog_path), exist_ok=True) + return catalog_path def is_catalog_modified(filename: str) -> bool: @@ -225,7 +227,7 @@ def _update_catalog(): with open(meta_path + '.md5', 'w', encoding='utf-8') as f: f.write(hashlib.md5(r.text.encode()).hexdigest()) - logger.info(f'Updated {cloud} catalog.') + logger.debug(f'Updated {cloud} catalog {filename}.') return LazyDataFrame(catalog_path, update_func=_update_catalog)