Skip to content

.dstack/profiles.yml

Sometimes, you may want to reuse the same parameters across runs or set your own defaults so you don’t have to repeat them in every run configuration. You can do this by defining a profile, either globally in ~/.dstack/profiles.yml or locally in .dstack/profiles.yml.

A profile can be set as default to apply automatically to any run, or specified with --profile NAME in dstack apply.

Example:

profiles:
  - name: my-profile
    # If set to true, this profile will be applied automatically
    default: true

    # The spot pololicy can be "spot", "on-demand", or "auto"
    spot_policy: auto
    # Limit the maximum price of the instance per hour
    max_price: 1.5
    # Stop any run if it runs longer that this duration
    max_duration: 1d
    # Use only these backends
    backends: [azure, lambda]

The profile configuration supports most properties that a run configuration supports — see below.

Root reference

backends - (Optional) The backends to consider for provisioning (e.g., [aws, gcp]).
regions - (Optional) The regions to consider for provisioning (e.g., [eu-west-1, us-west4, westeurope]).
availability_zones - (Optional) The availability zones to consider for provisioning (e.g., [eu-west-1a, us-west4-a]).
instance_types - (Optional) The cloud-specific instance types to consider for provisioning (e.g., [p3.8xlarge, n1-standard-4]).
reservation - (Optional) The existing reservation to use for instance provisioning. Supports AWS Capacity Reservations, AWS Capacity Blocks, and GCP reservations.
spot_policy - (Optional) The policy for provisioning spot or on-demand instances: spot, on-demand, auto. Defaults to on-demand.
retry - (Optional) The policy for resubmitting the run. Defaults to false.
max_duration - (Optional) The maximum duration of a run (e.g., 2h, 1d, etc). After it elapses, the run is automatically stopped. Use off for unlimited duration. Defaults to off.
stop_duration - (Optional) The maximum duration of a run graceful stopping. After it elapses, the run is automatically forced stopped. This includes force detaching volumes used by the run. Use off for unlimited duration. Defaults to 5m.
max_price - (Optional) The maximum instance price per hour, in dollars.
creation_policy - (Optional) The policy for using instances from fleets: reuse, reuse-or-create. Defaults to reuse-or-create.
idle_duration - (Optional) Time to wait before terminating idle instances. Defaults to 5m for runs and 3d for fleets. Use off for unlimited duration.
utilization_policy - (Optional) Run termination policy based on utilization.
startup_order - (Optional) The order in which master and workers jobs are started: any, master-first, workers-first. Defaults to any.
stop_criteria - (Optional) The criteria determining when a multi-node run should be considered finished: all-done, master-done. Defaults to all-done.
schedule - (Optional) The schedule for starting the run at specified time.
fleets - (Optional) The fleets considered for reuse.
tags - (Optional) The custom tags to associate with the resource. The tags are also propagated to the underlying backend resources. If there is a conflict with backend-level tags, does not override them.
name - (Optional) The name of the profile that can be passed as --profile to dstack apply.
default - (Optional) If set to true, dstack apply will use this profile by default..

retry

on_events - (Optional) The list of events that should be handled with retry. Supported events are no-capacity, interruption, error. Omit to retry on all events.
duration - (Optional) The maximum period of retrying the run, e.g., 4h or 1d.

utilization_policy

min_gpu_utilization - Minimum required GPU utilization, percent. If any GPU has utilization below specified value during the whole time window, the run is terminated.
time_window - The time window of metric samples taking into account to measure utilization (e.g., 30m, 1h). Minimum is 5m.