Skip to content

Commit cbb0cd6

Browse files
committed
Mention docs update
1 parent 9ccae54 commit cbb0cd6

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

contributing/BACKENDS.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,23 @@ Once the cloud provider is added, submit a pull request.
7878
Once the provider is added to `gpuhunt`, we can proceed with implementing
7979
the corresponding backend with `dstack`. Follow the steps below.
8080

81-
#### 2.1. Determine if you will implement a VM-based or a container-based backend
81+
### 2.1. Determine if you will implement a VM-based or a container-based backend
8282

8383
See the Appendix at the end of this document and make sure the provider meets the outlined requirements.
8484

85-
#### 2.2. Set up the development environment
85+
### 2.2. Set up the development environment
8686

8787
Follow [DEVELOPMENT.md](DEVELOPMENT.md).
8888

89-
#### 2.3. Add dependencies to setup.py
89+
### 2.3. Add dependencies to setup.py
9090

9191
Add any dependencies required by your cloud provider to `setup.py`. Create a separate section with the provider's name for these dependencies, and ensure that you update the `all` section to include them as well.
9292

93-
#### 2.4. Add a new backend type
93+
### 2.4. Add a new backend type
9494

9595
Add a new enumeration member for your provider to `BackendType` ([`src/dstack/_internal/core/models/backends/base.py`](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/core/models/backends/base.py)).
9696

97-
#### 2.5. Create backend files and classes
97+
### 2.5. Create backend files and classes
9898

9999
`dstack` provides a helper script to generate all the necessary files and classes for a new backend.
100100
To add a new backend named `ExampleXYZ`, you should run:
@@ -110,7 +110,7 @@ It will create an `examplexyz` backend directory under `src/dstack/_internal/cor
110110
* `configurator.py` with the `Configurator` class implementation. It deals with validating and storing backend config. You need to adjust it with custom backend config validation.
111111
* `models.py` with all the backend config models used by `Backend`, `Compute`, `Configurator` and other parts of `dstack`.
112112

113-
##### 2.6. Adjust and register the backend config models
113+
### 2.6. Adjust and register the backend config models
114114

115115
Go to `models.py`. It'll contain two config models required for all backends:
116116

@@ -130,7 +130,7 @@ Refer to examples:
130130
[gcp](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/core/backends/gcp/models.py),
131131
[azure](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/core/backends/models.py), etc.
132132

133-
##### 2.7. Implement the backend compute class
133+
### 2.7. Implement the backend compute class
134134

135135
Go to `compute.py` and implement `Compute` methods.
136136
Optionally, extend and implement `ComputeWith*` classes to support additional features such as fleets, volumes, gateways, placement groups, etc. For example, extend `ComputeWithCreateInstanceSupport` to support fleets.
@@ -141,7 +141,7 @@ Refer to examples:
141141
[gcp](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/core/backends/gcp/compute.py),
142142
[azure](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/core/backends/azure/compute.py), etc.
143143

144-
##### 2.8. Implement and register the configurator class
144+
### 2.8. Implement and register the configurator class
145145

146146
Go to `configurator.py` and implement custom `Configurator` logic. At minimum, you should implement creds validation.
147147
You may also need to validate other config parameters if there are any.
@@ -153,14 +153,19 @@ Refer to examples: [datacrunch](https://github.com/dstackai/dstack/blob/master/s
153153

154154
Register configurator by appending it to `_CONFIGURATOR_CLASSES` in [`src/dstack/_internal/core/backends/configurators.py`](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/core/backends/configurators.py).
155155

156-
##### 2.9. (Optional) Override provisioning timeout
156+
### 2.9. (Optional) Override provisioning timeout
157157

158158
If instances in the backend take more than 10 minutes to start, override the default provisioning timeout in
159159
[`src/dstack/_internal/server/background/tasks/common.py`](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/server/background/tasks/common.py).
160160

161+
### 2.10. Document the backend
162+
163+
Add the backend to the [Concepts->Backends](https://github.com/dstackai/dstack/blob/master/docs/docs/concepts/backends.md
164+
) page and the [server/comfig.yml](https://github.com/dstackai/dstack/blob/master/docs/docs/reference/server/config.yml.md) reference.
165+
161166
## 3. Appendix
162167

163-
#### 3.1. Backend compute type
168+
### 3.1. Backend compute type
164169

165170
`dstack` supports two types of backend compute:
166171

0 commit comments

Comments
 (0)