dstack icon indicating copy to clipboard operation
dstack copied to clipboard

[Feature]: Debug mode for tasks

Open spott opened this issue 10 months ago • 7 comments

Problem

When I'm trying to develop a task, it is typically a bunch of, 'write yaml', run dstack apply, figure out where it failed. It would be great if instead of failing and killing the run I could have it fail and pause so I could ssh into the box and figure out how to fix things before I edit the task and rerun.

Solution

There are a few options I think:

  • A "debug" flag for tasks (maybe as a command line option?) that:
    • instead of killing the job after commands fail, it stops the job. The user can then ssh into the node and figure out how to fix things before they rerun in a non-debug session.
    • or: automatically drops to a shell if the commands fail.
  • A consolidation between "dev-env" and "tasks". Something like the above debug flag isn't actually all that different from a dev environment, so a way to convert between a task and a dev environment with a minimum of changes could also solve this. Right now, dev environments and tasks have slightly different syntax, so I have to change a bunch in order to start with a dev environment and then take what I learn and turn it into a task.

Workaround

I use "sleep 1000" sometimes.

Would you like to help us implement this feature by sending a PR?

Yes

spott avatar Feb 15 '25 04:02 spott