Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
asaiacai committed Sep 28, 2023
1 parent 3b07c48 commit beb2a75
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3034,11 +3034,13 @@ def _setup(self, handle: CloudVmRayResourceHandle, task: task_lib.Task,

if task.setup is None:
return

stable_cluster_internal_ips = handle.internal_ips()
sky_env_vars_dict = {}
sky_env_vars_dict["SKYPILOT_NODE_IPS"] = "\\n".join(stable_cluster_internal_ips)
sky_env_vars_dict["SKYPILOT_NODE_RANK"] = """$(expr $(printf ${SKYPILOT_NODE_IPS} | grep -n "$(hostname -i)" | awk -F: '{print $1}') - 1)"""
sky_env_vars_dict["SKYPILOT_NODE_IPS"] = "\\n".join(
stable_cluster_internal_ips)
sky_env_vars_dict[
"SKYPILOT_NODE_RANK"] = """$(expr $(printf ${SKYPILOT_NODE_IPS} | grep -n "$(hostname -i)" | awk -F: '{print $1}') - 1)"""
env_vars = {**task.envs, **sky_env_vars_dict}
setup_script = log_lib.make_task_bash_script(task.setup,
env_vars=env_vars)
Expand Down

0 comments on commit beb2a75

Please sign in to comment.