Skip to content

Commit

Permalink
Do not delete runner file on stop
Browse files Browse the repository at this point in the history
  • Loading branch information
r4victor committed Jul 5, 2023
1 parent ad35589 commit 69421b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli/dstack/_internal/backend/base/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def stop_job(
if new_status:
if runner and runner.job.status.is_unfinished() and runner.job.status != new_status:
if new_status.is_finished():
runners.stop_runner(storage, compute, runner)
runners.stop_runner(compute, runner)
else:
runner.job.status = new_status
runners.update_runner(storage, runner)
Expand Down
3 changes: 1 addition & 2 deletions cli/dstack/_internal/backend/base/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ def delete_runner(storage: Storage, runner: Runner):
storage.delete_object(_get_runner_filename(runner.runner_id))


def stop_runner(storage: Storage, compute: Compute, runner: Runner):
def stop_runner(compute: Compute, runner: Runner):
if runner.request_id:
if runner.resources.spot:
compute.cancel_spot_request(runner)
else:
compute.terminate_instance(runner)
delete_runner(storage, runner)


def serialize_runner_yaml(
Expand Down

0 comments on commit 69421b5

Please sign in to comment.