Skip to content

Commit

Permalink
[Docs] Added the init example to Dev environments
Browse files Browse the repository at this point in the history
  • Loading branch information
peterschmidt85 committed Jan 18, 2025
1 parent 106242d commit 0fe2849
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions docs/docs/concepts/dev-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ resources:
</div>
### Initialization
If you want to pre-configure the dev environment, specify the [`init`](../reference/dstack.yml/dev-environment.md#init)
property with a list of commands to run at startup:

<div editor-title="examples/.dstack.yml">

```yaml
type: dev-environment
# The name is optional, if not specified, generated randomly
name: vscode
python: "3.11"
ide: vscode
# Commands to run on startup
init:
- pip install wandb
```

</div>


### Resources

When you specify a resource value like `cpu` or `memory`,
Expand Down
2 changes: 1 addition & 1 deletion src/dstack/_internal/core/models/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def check_image_or_commands_present(cls, values):
class DevEnvironmentConfigurationParams(CoreModel):
ide: Annotated[Literal["vscode"], Field(description="The IDE to run")]
version: Annotated[Optional[str], Field(description="The version of the IDE")]
init: Annotated[CommandsList, Field(description="The bash commands to run")] = []
init: Annotated[CommandsList, Field(description="The bash commands to run on startup")] = []


class DevEnvironmentConfiguration(
Expand Down

0 comments on commit 0fe2849

Please sign in to comment.