文末提供程序和源码下载
dstack 是 Kubernetes 和 Slurm 的开源替代方案,旨在简化顶级云和本地集群中 ML 团队的 GPU 分配和 AI 工作负载编排。
dstack 支持 NVIDIA 开箱即用的 、 AMD 、 Google TPU 和 Intel Gaudi 加速器。
在通过 CLI 或 API 使用 dstack 之前,请设置一个 dstack 服务器。如果您已经有一个正在运行的 dstack 服务器,则只需设置 CLI。
Set up the server 设置服务器
(可选)配置后端
要与云提供商一起使用 dstack ,请通过该文件 ~/.dstack/server/config.yml 配置后端。
Start the server 启动服务器
You can install the server on Linux, macOS, and Windows (via WSL 2). It requires Git and OpenSSH.
您可以在 Linux、macOS 和 Windows 上安装服务器(通过 WSL 2)。它需要 Git 和 OpenSSH。
pip 果仁
$ pip install "dstack[all]" -U
uv
$ uv tool install "dstack[all]" -U
Once it's installed, go ahead and start the server.
安装后,继续启动服务器。
$ 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/
For more details on server configuration options, see the Server deployment guide.
有关 Server 配置选项的更多详细信息,请参阅 Server 部署指南。
Set up the CLI 设置 CLI
Once the server is up, you can access it via the dstack CLI.
服务器启动后,您可以通过 dstack CLI 访问它。
The CLI can be installed on Linux, macOS, and Windows. It requires Git and OpenSSH.
CLI 可以安装在 Linux、macOS 和 Windows 上。它需要 Git 和 OpenSSH。
pip 果仁
$ pip install dstack -U
uv
$ uv tool install dstack -U
To point the CLI to the dstack server, configure it with the server address, user token, and project name:
要将 CLI 指向服务器, dstack 请使用服务器地址、用户令牌和项目名称对其进行配置:
$ dstack config \
--url http://127.0.0.1:3000 \
--project main \
--token bbae0f28-d3dd-4820-bf61-8f4bb40815da
Configuration is updated at ~/.dstack/config.yml
1. Define configurations 1. 定义配置
dstack 支持以下配置:
配置可以定义为存储库中的 YAML 文件。
2. Apply configurations 2. 应用配置
通过 dstack apply CLI 命令或编程 API 应用配置。
dstack 跨云和本地集群自动管理预置、作业队列、自动扩展、联网、卷、运行故障、容量不足错误、端口转发等。
夸克网盘分享
本文信息来源于GitHub作者地址:https://github.com/dstackai/dstack