```yaml
type: fleet
diff --git a/docs/docs/concepts/services.md b/docs/docs/concepts/services.md
index 716ab211ed..24a0187de8 100644
--- a/docs/docs/concepts/services.md
+++ b/docs/docs/concepts/services.md
@@ -2,6 +2,9 @@
Services allow you to deploy models or web apps as secure and scalable endpoints.
+??? info "Prerequisites"
+ Before running a service, make sure you’ve [installed](../installation/index.md) the server and CLI, and created a [fleet](fleets.md).
+
## Apply a configuration
First, define a service configuration as a YAML file in your project folder.
diff --git a/docs/docs/concepts/tasks.md b/docs/docs/concepts/tasks.md
index ea0d775fb1..d6e2fb5591 100644
--- a/docs/docs/concepts/tasks.md
+++ b/docs/docs/concepts/tasks.md
@@ -1,11 +1,13 @@
# Tasks
-A task allows you to run arbitrary commands on one or more nodes.
-They are best suited for jobs like training or batch processing.
+A task allows you to run arbitrary commands on one or more nodes. They are best suited for jobs like training or batch processing.
+
+??? info "Prerequisites"
+ Before running a task, make sure you’ve [installed](../installation/index.md) the server and CLI, and created a [fleet](fleets.md).
## Apply a configuration
-First, define a task configuration as a YAML file in your project folder.
+First, define a task configuration as a YAML file.
The filename must end with `.dstack.yml` (e.g. `.dstack.yml` or `dev.dstack.yml` are both acceptable).
[//]: # (TODO: Make tabs - single machine & distributed tasks & web app)
diff --git a/docs/docs/installation/index.md b/docs/docs/installation/index.md
index 5d24373fd9..aad8741b66 100644
--- a/docs/docs/installation/index.md
+++ b/docs/docs/installation/index.md
@@ -8,11 +8,7 @@
### Configure backends
-To orchestrate compute across cloud providers or existing Kubernetes clusters, you need to configure backends.
-
-Backends can be set up in `~/.dstack/server/config.yml` or through the [project settings page](../concepts/projects.md#backends) in the UI.
-
-For more details, see [Backends](../concepts/backends.md).
+To orchestrate compute across cloud providers or Kubernetes clusters, you need to configure [backends](../concepts/backends.md).
??? info "SSH fleets"
When using `dstack` with on-prem servers, backend configuration isn’t required. Simply create [SSH fleets](../concepts/fleets.md#ssh-fleets) once the server is up.
@@ -79,8 +75,7 @@ The server can run on your laptop or any environment with access to the cloud an
To verify that backends are properly configured, use the [`dstack offer`](../reference/cli/dstack/offer.md#list-gpu-offers) command to list available GPU offers.
!!! info "Server deployment"
- For more details on server deployment options, see the
- [Server deployment](../guides/server-deployment.md) guide.
+ For more details on server deployment options, see the [Server deployment](../guides/server-deployment.md) guide.
## Set up the CLI
@@ -206,5 +201,5 @@ This configuration is stored in `~/.dstack/config.yml`.
1. Follow [Quickstart](../quickstart.md)
2. See [Backends](../concepts/backends.md)
3. Check the [server deployment](../guides/server-deployment.md) guide
- 4. Browse [examples](/examples)
+ 4. Browse [examples](../../examples.md)
5. Join the community via [Discord](https://discord.gg/u8SmfwPpMd)
diff --git a/docs/docs/quickstart.md b/docs/docs/quickstart.md
index 7b71519dbe..759ec1b573 100644
--- a/docs/docs/quickstart.md
+++ b/docs/docs/quickstart.md
@@ -1,81 +1,108 @@
# Quickstart
-> Before using `dstack`, ensure you've [installed](installation/index.md) the server.
+??? info "Prerequsites"
+ Before using `dstack`, ensure you've [installed](installation/index.md) the server and the CLI.
-## Set up a directory
-
-Set up a directory where you'll store you project files and `dstack` configurations.
+## Create a fleet
-
+Before you can submit your first run, you have to create a [fleet](concepts/fleets.md).
-```shell
-$ mkdir quickstart && cd quickstart
-```
+=== "Backend fleet"
+ If you're using cloud providers or Kubernetes clusters and have configured the corresponding [backends](concepts/backends.md), create a fleet as follows:
-
+
-## Create a fleet
+ ```yaml
+ type: fleet
+ name: default
-If [backends](concepts/backends.md) are configured, `dstack` can create a new [backend fleet](concepts/fleets.md#backend-fleets) on the fly. However, it’s recommended to create them explicitly.
+ # Allow to provision of up to 2 instances
+ nodes: 0..2
-
Define a configuration
+ # Deprovision instances above the minimum if they remain idle
+ idle_duration: 1h
-Create the following fleet configuration inside your project folder:
+ resources:
+ # Allow to provision up to 8 GPUs
+ gpu: 0..8
+ ```
-
+
-```yaml
-type: fleet
-name: default
+ Pass the fleet configuration to `dstack apply`:
-# Allow to provision of up to 2 instances
-nodes: 0..2
+
-# Deprovision instances above the minimum if they remain idle
-idle_duration: 1h
+ ```shell
+ $ dstack apply -f fleet.dstack.yml
+
+ # BACKEND REGION RESOURCES SPOT PRICE
+ 1 gcp us-west4 2xCPU, 8GB, 100GB (disk) yes $0.010052
+ 2 azure westeurope 2xCPU, 8GB, 100GB (disk) yes $0.0132
+ 3 gcp europe-central2 2xCPU, 8GB, 100GB (disk) yes $0.013248
-resources:
- # Allow to provision up to 8 GPUs
- gpu: 0..8
-```
+ Create the fleet? [y/n]: y
-
+ FLEET INSTANCE BACKEND RESOURCES PRICE STATUS CREATED
+ defalut - - - - - 10:36
+ ```
-
Apply the configuration
+
-Apply the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
+ If `nodes` is a range that starts above `0`, `dstack` pre-creates the initial number of instances up front, while any additional ones are created on demand.
+
+ > Setting the `nodes` range to start above `0` is supported only for [VM-based backends](concepts/backends.md#vm-based).
-
+ If the fleet needs to be a cluster, the [placement](concepts/fleets.md#backend-placement) property must be set to `cluster`.
+
+=== "SSH fleet"
+ If you have a group of on-prem servers accessible via SSH, you can create an SSH fleet as follows:
-```shell
-$ dstack apply -f fleet.dstack.yml
+
- # BACKEND REGION RESOURCES SPOT PRICE
- 1 gcp us-west4 2xCPU, 8GB, 100GB (disk) yes $0.010052
- 2 azure westeurope 2xCPU, 8GB, 100GB (disk) yes $0.0132
- 3 gcp europe-central2 2xCPU, 8GB, 100GB (disk) yes $0.013248
+ ```yaml
+ type: fleet
+ name: my-fleet
+
+ ssh_config:
+ user: ubuntu
+ identity_file: ~/.ssh/id_rsa
+ hosts:
+ - 3.255.177.51
+ - 3.255.177.52
+ ```
+
+
-Fleet cloud-fleet does not exist yet.
-Create the fleet? [y/n]: y
- FLEET INSTANCE BACKEND RESOURCES PRICE STATUS CREATED
- defalut-fleet - - - - - 10:36
-```
+ Pass the fleet configuration to `dstack apply`:
-
+
+
+ ```shell
+ $ dstack apply -f fleet.dstack.yml
+
+ Provisioning...
+ ---> 100%
+
+ FLEET INSTANCE GPU PRICE STATUS CREATED
+ my-fleet 0 L4:24GB (spot) $0 idle 3 mins ago
+ 1 L4:24GB (spot) $0 idle 3 mins ago
+ ```
+
+
-Alternatively, you can create an [SSH fleet](concepts/fleets#ssh-fleets).
+ > Hosts must have Docker and GPU drivers installed and meet the other [requirements](concepts/fleets.md#ssh-fleets).
+
+ If the fleet needs to be a cluster, the [placement](concepts/fleets.md#ssh-placement) property must be set to `cluster`.
## Submit your first run
`dstack` supports three types of run configurations.
=== "Dev environment"
-
A [dev environment](concepts/dev-environments.md) lets you provision an instance and access it with your desktop IDE.
-
Define a configuration
-
- Create the following run configuration inside your project folder:
+ Create the following run configuration:
@@ -96,9 +123,7 @@ Alternatively, you can create an [SSH fleet](concepts/fleets#ssh-fleets).
-
Apply the configuration
-
- Apply the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
+ Apply the configuration via `dstack apply`:
@@ -121,17 +146,12 @@ Alternatively, you can create an [SSH fleet](concepts/fleets#ssh-fleets).
- Open the link to access the dev environment using your desktop IDE.
-
- Alternatively, you can access it via `ssh
`.
+ Open the link to access the dev environment using your desktop IDE. Alternatively, you can access it via `ssh `.
=== "Task"
-
A [task](concepts/tasks.md) allows you to schedule a job or run a web app. Tasks can be distributed and can forward ports.
- Define a configuration
-
- Create the following run configuration inside your project folder:
+ Create the following run configuration:
@@ -161,9 +181,7 @@ Alternatively, you can create an [SSH fleet](concepts/fleets#ssh-fleets).
By default, tasks run on a single instance. To run a distributed task, specify
[`nodes`](concepts/tasks.md#distributed-tasks), and `dstack` will run it on a cluster.
-
Apply the configuration
-
- Run the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
+ Run the configuration via `dstack apply`:
@@ -190,12 +208,9 @@ Alternatively, you can create an [SSH fleet](concepts/fleets#ssh-fleets).
If you specified `ports`, they will be automatically forwarded to `localhost` for convenient access.
=== "Service"
-
A [service](concepts/services.md) allows you to deploy a model or any web app as an endpoint.
-
Define a configuration
-
- Create the following run configuration inside your project folder:
+ Create the following run configuration:
@@ -226,9 +241,7 @@ Alternatively, you can create an [SSH fleet](concepts/fleets#ssh-fleets).
-
Apply the configuration
-
- Run the configuration via [`dstack apply`](reference/cli/dstack/apply.md):
+ Run the configuration via `dstack apply`:
@@ -254,15 +267,9 @@ Alternatively, you can create an [SSH fleet](concepts/fleets#ssh-fleets).
- !!! info "Gateway"
- To enable [auto-scaling](concepts/services.md#replicas-and-scaling),
- [rate limits](concepts/services.md#rate-limits),
- or use a custom domain with HTTPS,
- set up a [gateway](concepts/gateways.md) before running the service.
- If you're using [dstack Sky](https://sky.dstack.ai),
- a gateway is pre-configured for you.
+ > To enable auto-scaling rate limits, or use a custom domain with HTTPS, set up a [gateway](concepts/gateways.md) before running the service.
-`dstack apply` automatically provisions instances and runs the workload according to the configuration.
+`dstack apply` automatically provisions instances with created fleets and runs the workload according to the configuration.
## Troubleshooting