dstack

dstackarrow-up-right is an open-source, streamlined alternative to Kubernetes and Slurm, specifically designed for AI workloads. It simplifies container orchestration to accelerate the development, training, and deployment of AI models.

Installation

To use dstack with Verda Cloud, you first need to configure dstack integration by providing access credentials.

  1. Log inarrow-up-right to your Verda Cloud account.

  2. Navigate to the Keys page in the sidebar.

  3. Find Cloud API credentials area and then click the + Create button

Then, configure the backend via ~/.dstack/server/config.yml:

projects:
  - name: main
    backends:
      - type: datacrunch
        creds:
          type: api_key
          client_id: xfaHBqYEsArqhKWX-e52x3HH7w8T
          client_secret: B5ZU5Qx9Nt8oGMlmMhNI3iglK8bjMhagTbylZy4WzncZe39995f7Vxh8

See the dstack documentationarrow-up-right for more configuration options.

Once the backend is configured, install the dstack server. Follow their official guide at https://dstack.ai/docs/installation/arrow-up-right to install dstack locally.

$ pip install "dstack[datacrunch]" -U
$ dstack server


Applying ~/.dstack/server/config.yml...

The admin token is "bbae0f28-d3dd-4820-bf61-8f4bb40815da"
The server is running at http://127.0.0.1:3000/

Create a fleet

Before you can submit your first run, you have to create a fleetarrow-up-right.

Pass the fleet configuration to dstack apply:

Once the fleet is created, you can run dstack’s dev environments, tasks, and services.

Dev environments

A dev environmentarrow-up-right lets you provision an instance and access it using your desktop IDE (VS Code, Cursor, PyCharm, etc) or via SSH.

Example configuration:

To run a dev environment, apply the configuration:

Open the link to access the dev environment from your desktop IDE.

Tasks

A taskarrow-up-right allows you to schedule a job or run a web app. Tasks can be distributed and support port forwarding.

Example training task configuration:

To run the task, apply the configuration:

Services

A servicearrow-up-right allows you to deploy a model or any web app as a scalable and secure endpoint.

Example configuration:

To deploy the model, apply the configuration:

dstack can handle auto-scaling and authentication if the corresponding properties are set.

If deploying a model, once the service is up, you can access it via dstack’s UI in addition to the API endpoint.

Clusters

Managed support for Verda’s instant clusters is coming to dstack. Meanwhile, in case you’ve created clusters with Verda, you can access them via dstack by creating an SSH fleetarrow-up-right and listing the IP addresses of each node in the cluster, along with SSH user and SSH private key for each host.

Example configuration:

To create the fleet, apply the configuration:

Once the fleet is created, you can use it for running dev environments, tasks, and services.

With clusters, it’s possible to run distributed tasksarrow-up-right.

Example distributed training task configuration:

To run the task, apply the configuration:

dstack automatically runs the container on each node while passing system environment variablesarrow-up-right, which you can use with torchrun, accelerate, or other distributed frameworks.

dstack’s Documentation

dstack supports a wide range of configurations, not only simplifying the development, training, and deployment of AI models but also optimizing cloud resource usage and reducing costs. Explore dstack’s official documentation for more details and configuration options.

Last updated

Was this helpful?