dstack Configuration and Dev Environment Deployment on centron Servers

dstack is an open-source substitute for Kubernetes and Slurm, built to make AI development and rollout across cloud providers easier. It reduces the burden of infrastructure management by offering a friendly interface and declarative YAML files, allowing developers to concentrate on creating and expanding their apps instead of dealing with operational friction. Suitable for machine learning pipelines, distributed workloads, and scalable hosting, dstack fits smoothly into cloud setups and offers elastic resource scaling, persistent storage, and secure service exposure.

In this guide, you will get to know the configuration options available in dstack. After that, you will install and start the dstack server, and finally launch a dev environment using centron servers together with dstack.

dstack Configurations

Dev environment

dstack lets you create interactive development environments that are optimized for desktop IDEs. These environments give developers room to code, debug, and test effectively while tapping into cloud power. Using dev environments, teams keep setups consistent and accelerate development by avoiding local dependency mismatches.

Tasks

Tasks in dstack are meant for automating and scheduling jobs, making them highly flexible for many scenarios. Whether you want to handle data pipelines, execute batch processing, or run recurring jobs, tasks cover it. They also support distributed processing and can host web apps, so they are a key piece for simplifying automation and workflows.

Services

With dstack, deploying and operating long-running services is simple and efficient. Services are well suited for running APIs, web servers, or machine learning models so they remain available and performant.

Fleets

Fleets allow developers to operate and scale clusters of resources smoothly across cloud or on-prem environments. They are made for elastic scaling and automatically change resource allocation based on demand to keep efficiency high.

Create a Virtual Environment

In this part, you will create a virtual environment on your system and set things up for deploying a dstack dev environment.

Install the venv package.

$ apt install python3-venv -y

Create a virtual environment.

$ python3 -m venv dstack-env

Activate the virtual environment.

$ source dstack-env/bin/activate

Install dstack

Here, you will install all required dependencies for dstack and start the dstack server so you can deploy the dev environment later.

Create a directory and move into it to hold the backend file.

$ mkdir -p ~/.dstack/server

Create a backend yml file that declares centron as the provider.

$ nano ~/.dstack/server/config.yml

Copy and paste the configuration below.

projects:

* name: main
  backends:

  * type: centron
    creds:
    type: api_key
    api_key:

Retrieve your centron API Key.

Save and close the file.

Install dstack.

$ pip install "dstack[all]" -U

Start the dstack server.

Write down the URL where the dstack server is running and the token shown in the output.

Point the CLI to the dstack server.

$ dstack config --url  
--project main 
--token

Deploy Dev Environment

In this section, you will run the dstack dev environment configuration and deploy it on a centron server.

Stay in the dstack-env virtual environment, then create a folder and switch into it.

$ mkdir quickstart && cd quickstart

Initialize the folder.

Create a YAML file that defines the dstack dev environment setup.

Copy and paste the config shown below.

type: dev-environment
name: vscode

python: '3.11'
ide: vscode
spot_policy: auto

This configuration creates a dev environment called vscode with Python 3.11, intended for interactive development through Visual Studio Code. It automatically provisions resources using spot or on-demand instances depending on availability and price.

You can expand the configuration to install extra tools, libraries, or dependencies in advance so the environment is more fully prepared.

Save and close the file.

Apply the configuration.

$ dstack apply -f .dstack.yaml

The setup may take up to 10 minutes. You can track progress in the centron Customer Portal by viewing the status of server provisioning, which begins automatically once you apply the configuration.

Open the environment in the VS Code desktop app.

vscode://vscode-remote/ssh-remote+vscode/workflow

Conclusion

With dstack and centron, creating and launching development environments becomes smooth, letting developers focus on building and scaling applications instead of wrestling with infrastructure. By working through this guide, you learned how to configure dstack, start its server, and deploy a dev environment matched to your workflow. Whether you are targeting machine learning pipelines, distributed computing, or scalable app hosting, dstack delivers a solid way to simplify development. Visit the dstack documentation

Source: vultr.com

Create a Free Account

Register now and get access to our Cloud Services.

Posts you might be interested in: