You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/plugins/python/index.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,11 @@
3
3
The `dstack` plugin system allows extending `dstack` server functionality using external Python packages.
4
4
5
5
!!! info "Experimental"
6
-
Plugins are currently an _experimental_ feature.
7
-
Backward compatibility is not guaranteed across releases.
6
+
Plugins are currently an experimental feature. Backward compatibility is not guaranteed across releases.
8
7
9
8
## Enable plugins
10
9
11
-
To enable a plugin, list it under `plugins` in [`server/config.yml`](../reference/server/config.yml.md):
10
+
To enable a plugin, list it under `plugins` in [`server/config.yml`](../../server/config.yml.md):
12
11
13
12
<diveditor-title="server/config.yml">
14
13
@@ -24,7 +23,7 @@ projects:
24
23
25
24
On the next server restart, you should see a log message indicating that the plugin is loaded.
26
25
27
-
## Create plugins
26
+
## Create a plugin
28
27
29
28
To create a plugin, create a Python package that implements a subclass of
30
29
`dstack.plugins.Plugin` and exports this subclass as a "dstack.plugins" entry point.
@@ -61,7 +60,7 @@ To create a plugin, create a Python package that implements a subclass of
61
60
62
61
</div>
63
62
64
-
3. Specify a "dstack.plugins" entry point in `pyproject.toml`:
63
+
3. Specify a `"dstack.plugins"` entry point in `pyproject.toml`:
65
64
66
65
<div editor-title="pyproject.toml">
67
66
@@ -74,10 +73,9 @@ To create a plugin, create a Python package that implements a subclass of
74
73
75
74
Then you can install the plugin package into your Python environment and enable it via `server/config.yml`.
76
75
77
-
??? info "Plugins in Docker"
76
+
??? info "Docker"
78
77
If you deploy `dstack` using a Docker image you can add plugins either
79
-
by including them in your custom image built upon the `dstack` server image,
80
-
or by mounting installed plugins as volumes.
78
+
by including them in your custom image built upon the `dstack` [server image :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/tree/master/docker/server){:target="_blank"}, or by mounting installed plugins as volumes.
81
79
82
80
## Apply policies
83
81
@@ -113,9 +111,9 @@ class ExamplePolicy(ApplyPolicy):
113
111
114
112
</div>
115
113
116
-
## Built-in Plugins
114
+
## Built-in plugins
117
115
118
-
### REST Plugin
116
+
### REST plugin
119
117
120
118
`rest_plugin`is a builtin `dstack` plugin that allows writing your custom plugins as API servers, so you don't need to install plugins as Python packages.
121
119
@@ -125,4 +123,4 @@ Plugins implemented as API servers have advantages over plugins implemented as P
125
123
* You can use any programming language.
126
124
* If you run the `dstack` server via Docker, you don't need to extend the `dstack` server image with plugins or map them via volumes.
127
125
128
-
To get started, check out the [plugin server example](https://github.com/dstackai/dstack/tree/master/examples/plugins/example_plugin_server). The `rest_plugin` server API is documented [here](../reference/plugins/rest_plugin/index.md).
126
+
To get started, check out the [plugin server example :material-arrow-top-right-thin:{ .external }](https://github.com/dstackai/dstack/tree/master/examples/plugins/example_plugin_server){:target="_blank"}. The `rest_plugin` server API is documented [here](../../plugins/rest/index.md).
0 commit comments