Support running run configurations with `dstack apply`
#1223 allowed creating/updating gateways via dstack apply. Similarly, dstack apply should work for runs. It will accept a run configuration as
dstack apply -f service.dstack.yml
If the run configuration doesn't specify a run name, dstack apply will work just like dstack run – create a new run with a random name. If the run name is specified, then dstack apply will create/re-create the run with the specified name. dstack apply can have configuration-specific arguments and accept the same arguments as dstack run.
Required changes:
- Add
namefield to run configuration so that users can specify run names in yaml. dstack runrequiresworking_dirpositional argument that serves two purposes: 1) it's used as the working dir of the container and 2) run configuration is searched relative two it.dstack applydoesn't have requiredworking_dir. Theworking_dirof the container should be specified via a new run configuration parameter. The run configuration search doesn't need to be done with respect to some specificworking_dir– only with respect to cwd – so this can be dropped.
Currently, resource specification via dstack run CLI arguments is very limited. cpu and memory are not supported. This can be fixed if the CLI arguments unified with dstack pool add. This could probably be done together with #1327
This issue is stale because it has been open for 30 days with no activity.