Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Execute setup when --detach-setup and no run section #4430

Merged
merged 7 commits into from
Dec 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ def add_prologue(self, job_id: int) -> None:
)
def get_or_fail(futures, pg) -> List[int]:
\"\"\"Wait for tasks, if any fails, cancel all unready.\"\"\"
if not futures:
return []
returncodes = [1] * len(futures)
# Wait for 1 task to be ready.
ready = []
Expand Down Expand Up @@ -3460,15 +3462,23 @@ def _execute(
Returns:
Job id if the task is submitted to the cluster, None otherwise.
"""
if task.run is None:
if task.run is None and self._setup_cmd is None:
logger.info('Run commands not specified or empty.')
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved
return None
# Check the task resources vs the cluster resources. Since `sky exec`
# will not run the provision and _check_existing_cluster
# We need to check ports here since sky.exec shouldn't change resources
valid_resource = self.check_resources_fit_cluster(handle,
task,
check_ports=True)
if task.run is None:
# If the task has no run command, we still need to execute the
# generated ray driver program to run the setup command in detached
# mode.
# In this case, we don't need to check the resources.
valid_resource = sky.Resources()
Michaelvll marked this conversation as resolved.
Show resolved Hide resolved
else:
# Check the task resources vs the cluster resources. Since
# `sky exec` will not run the provision and _check_existing_cluster
# We need to check ports here since sky.exec shouldn't change
# resources.
valid_resource = self.check_resources_fit_cluster(handle,
task,
check_ports=True)
task_copy = copy.copy(task)
# Handle multiple resources exec case.
task_copy.set_resources(valid_resource)
Expand Down
Loading