Skip to content

Commit 3ec63b9

Browse files
Backward compatibility for SkyPilot 0.10.3+ (#339)
Signed-off-by: Romil Bhardwaj <[email protected]>
1 parent afcd979 commit 3ec63b9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

nemo_run/core/execution/skypilot.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,17 @@ def launch(
419419
dryrun: bool = False,
420420
) -> tuple[Optional[int], Optional["backends.ResourceHandle"]]:
421421
from sky import backends, launch, stream_and_get
422-
from sky.utils import common_utils
422+
423+
# Backward compatibility for SkyPilot 0.10.3+
424+
# dump_yaml_str moved from sky.utils.common_utils to yaml_utils
425+
try:
426+
from sky.utils import yaml_utils
427+
except ImportError:
428+
from sky.utils import common_utils as yaml_utils
423429

424430
task_yml = os.path.join(self.job_dir, "skypilot_task.yml")
425431
with open(task_yml, "w+") as f:
426-
f.write(common_utils.dump_yaml_str(task.to_yaml_config()))
432+
f.write(yaml_utils.dump_yaml_str(task.to_yaml_config()))
427433

428434
backend = backends.CloudVmRayBackend()
429435
if num_nodes:

0 commit comments

Comments
 (0)