Skip to content

Commit 1ba14ff

Browse files
Andrey Cheptsovclaude
andcommitted
Add Exports concept page and CLI reference
- Create docs/docs/concepts/exports.md concept page - Create docs/docs/reference/cli/dstack/export.md CLI reference - Add cross-links from Fleets and Projects concept pages - Add Exports to nav in mkdocs.yml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 130b22b commit 1ba14ff

5 files changed

Lines changed: 220 additions & 2 deletions

File tree

docs/docs/concepts/exports.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: Exports
3+
description: Exporting resources across projects
4+
---
5+
6+
# Exports
7+
8+
Exports allow making resources from one project available to other projects. When a project exports a resource,
9+
the specified importer projects can see and use it as if it were their own.
10+
11+
!!! warning "Experimental"
12+
Exports are an experimental feature.
13+
Currently, only [SSH fleets](fleets.md#ssh-fleets) can be exported.
14+
Exports do not yet support configuration files and `dstack apply`.
15+
Use the CLI commands below to manage exports.
16+
17+
An export is created in the exporter project and specifies the resources to export and the
18+
importer projects that will gain access to them.
19+
20+
Once an export is created, the importer projects can see the exported resources in their resource lists and use them
21+
for running tasks, dev environments, and services. Imported resources appear with a project prefix
22+
(e.g., `team-a/my-fleet`) to distinguish them from the project's own resources.
23+
24+
!!! info "Required project role"
25+
The user creating or updating an export must have the project admin role on both the exporter project and
26+
each importer project. Alternatively, a global admin can add any project as an importer.
27+
28+
## Manage exports
29+
30+
### Create exports
31+
32+
Use the `dstack export create` command to create a new export. Specify the fleets to export
33+
with `--fleet` and the importer projects with `--importer`:
34+
35+
<div class="termy">
36+
37+
```shell
38+
$ dstack export create my-export --fleet my-fleet --importer team-b
39+
NAME FLEETS IMPORTERS
40+
my-export my-fleet team-b
41+
42+
```
43+
44+
</div>
45+
46+
Both `--fleet` and `--importer` can be specified multiple times:
47+
48+
<div class="termy">
49+
50+
```shell
51+
$ dstack export create shared-gpus --fleet gpu-fleet-1 --fleet gpu-fleet-2 --importer team-b --importer team-c
52+
NAME FLEETS IMPORTERS
53+
shared-gpus gpu-fleet-1, gpu-fleet-2 team-b, team-c
54+
55+
```
56+
57+
</div>
58+
59+
### List exports
60+
61+
Use `dstack export list` (or simply `dstack export`) to list all exports in the project:
62+
63+
<div class="termy">
64+
65+
```shell
66+
$ dstack export list
67+
NAME FLEETS IMPORTERS
68+
my-export my-fleet team-b
69+
shared-gpus gpu-fleet-1, gpu-fleet-2 team-b, team-c
70+
71+
```
72+
73+
</div>
74+
75+
### Update exports
76+
77+
Use the `dstack export update` command to add or remove fleets and importers from an existing export:
78+
79+
<div class="termy">
80+
81+
```shell
82+
$ dstack export update my-export --add-fleet another-fleet --add-importer team-c
83+
NAME FLEETS IMPORTERS
84+
my-export my-fleet, another-fleet team-b, team-c
85+
86+
```
87+
88+
</div>
89+
90+
To remove a fleet or importer:
91+
92+
<div class="termy">
93+
94+
```shell
95+
$ dstack export update my-export --remove-importer team-b
96+
NAME FLEETS IMPORTERS
97+
my-export my-fleet, another-fleet team-c
98+
99+
```
100+
101+
</div>
102+
103+
### Delete exports
104+
105+
Use the `dstack export delete` command to delete an export. This revokes access for all importer projects:
106+
107+
<div class="termy">
108+
109+
```shell
110+
$ dstack export delete my-export
111+
Delete the export my-export? [y/n]: y
112+
Export my-export deleted
113+
```
114+
115+
</div>
116+
117+
Use `-y` to skip the confirmation prompt.
118+
119+
## Access imported fleets
120+
121+
From the importer project's perspective, exported fleets appear automatically in `dstack fleet list`
122+
with a `<project>/<fleet>` prefix:
123+
124+
<div class="termy">
125+
126+
```shell
127+
$ dstack fleet list
128+
NAME NODES GPU SPOT BACKEND PRICE STATUS CREATED
129+
my-local-fleet 1 - - ssh - active 3 days ago
130+
team-a/my-fleet 2 A100:80GB:8 - ssh - active 1 week ago
131+
team-a/another-fleet 1 H100:80GB:4 - ssh - active 2 days ago
132+
133+
```
134+
135+
</div>
136+
137+
Imported fleets can be used for runs just like the project's own fleets.
138+
139+
!!! info "What's next?"
140+
1. Check the [`dstack export` CLI reference](../reference/cli/dstack/export.md)
141+
2. Learn how to manage [fleets](fleets.md)
142+
3. Read about [projects](projects.md) and project roles

docs/docs/concepts/fleets.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,11 @@ ssh_config:
468468
!!! info "Reference"
469469
The fleet configuration file supports additional options, including [`instance_types`](../reference/dstack.yml/fleet.md#instance_types), [`max_price`](../reference/dstack.yml/fleet.md#max_price), [`regions`](../reference/dstack.yml/fleet.md#max_price), among others. For the complete list, see the [reference](../reference/dstack.yml/fleet.md).
470470

471+
## Export fleets
472+
473+
Fleets can be exported to other projects, allowing those projects to use the exported fleets
474+
for running dev environments, tasks, and services. See [Exports](exports.md) for more details.
475+
471476
## Manage fleets
472477

473478
### List fleets
@@ -507,5 +512,6 @@ To terminate and delete specific instances from a fleet, pass `-i INSTANCE_NUM`.
507512
1. Check [dev environments](dev-environments.md), [tasks](tasks.md), and
508513
[services](services.md)
509514
2. Read about [Backends](backends.md) guide
510-
3. Explore the [`.dstack.yml` reference](../reference/dstack.yml/fleet.md)
511-
4. See the [Clusters](../../examples.md#clusters) example
515+
3. Learn how to [export fleets](exports.md) to other projects
516+
4. Explore the [`.dstack.yml` reference](../reference/dstack.yml/fleet.md)
517+
5. See the [Clusters](../../examples.md#clusters) example

docs/docs/concepts/projects.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ A user can be added to a project and assigned or unassigned as a project role on
4141
Unlike admins, managers cannot configure backends and gateways.
4242
* **User** – A user can manage project resources including runs, fleets, and volumes.
4343

44+
## Project exports
45+
46+
Projects can export resources such as fleets to other projects, allowing them to be used across team
47+
boundaries. See [Exports](exports.md) for more details.
48+
4449
## Authorization
4550

4651
### User token
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# dstack export
2+
3+
The `dstack export` commands manage [exports](../../../concepts/exports.md) of resources to other projects.
4+
5+
## dstack export list
6+
7+
The `dstack export list` command lists all exports in the project.
8+
9+
##### Usage
10+
11+
<div class="termy">
12+
13+
```shell
14+
$ dstack export list --help
15+
#GENERATE#
16+
```
17+
18+
</div>
19+
20+
## dstack export create
21+
22+
The `dstack export create` command creates a new export.
23+
24+
##### Usage
25+
26+
<div class="termy">
27+
28+
```shell
29+
$ dstack export create --help
30+
#GENERATE#
31+
```
32+
33+
</div>
34+
35+
## dstack export update
36+
37+
The `dstack export update` command updates an existing export.
38+
39+
##### Usage
40+
41+
<div class="termy">
42+
43+
```shell
44+
$ dstack export update --help
45+
#GENERATE#
46+
```
47+
48+
</div>
49+
50+
## dstack export delete
51+
52+
The `dstack export delete` command deletes the specified export.
53+
54+
##### Usage
55+
56+
<div class="termy">
57+
58+
```shell
59+
$ dstack export delete --help
60+
#GENERATE#
61+
```
62+
63+
</div>

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ nav:
237237
- Projects: docs/concepts/projects.md
238238
- Metrics: docs/concepts/metrics.md
239239
- Events: docs/concepts/events.md
240+
- Exports: docs/concepts/exports.md
240241
- Guides:
241242
- Server deployment: docs/guides/server-deployment.md
242243
- Troubleshooting: docs/guides/troubleshooting.md
@@ -271,6 +272,7 @@ nav:
271272
- dstack volume: docs/reference/cli/dstack/volume.md
272273
- dstack gateway: docs/reference/cli/dstack/gateway.md
273274
- dstack secret: docs/reference/cli/dstack/secret.md
275+
- dstack export: docs/reference/cli/dstack/export.md
274276
- API:
275277
- Python API: docs/reference/api/python/index.md
276278
- REST API: docs/reference/api/rest/index.md

0 commit comments

Comments
 (0)