Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Build Docs

on:
workflow_call:
inputs:
release-tag:
type: string
required: false

jobs:
build-docs:
Expand All @@ -17,18 +13,10 @@ jobs:
python-version: 3.11
- name: Install dstack
run: |
uv pip install examples/plugins/example_plugin_server
if [ -n "${{ inputs.release-tag }}" ]; then
uv pip install "dstack[server]==${{ inputs.release-tag }}"
else
uv pip install -e '.[server]'
fi
uv sync --extra server
- name: Build
run: |
uv pip install pillow cairosvg
sudo apt-get update && sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
uv pip install mkdocs-material "mkdocs-material[imaging]" mkdocs-material-extensions mkdocs-redirects mkdocs-gen-files "mkdocstrings[python]" mkdocs-render-swagger-plugin --upgrade
uv pip install git+https://${{ secrets.GH_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
uv run mkdocs build -s
- uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ name: Build & Deploy Docs

on:
workflow_dispatch:
inputs:
release-tag:
description: "dstack version"

jobs:
build-docs:
uses: ./.github/workflows/build-docs.yml
with:
release-tag: ${{ inputs.release-tag }}
secrets: inherit

deploy-docs:
Expand Down
4 changes: 4 additions & 0 deletions contributing/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ pyright -p .
## 6. Frontend

See [FRONTEND.md](FRONTEND.md) for the details on how to build and develop the frontend.

## 7. Documentation

See [DOCS.md](DOCS.md) for the details on how to preview or build the documentation.
49 changes: 49 additions & 0 deletions contributing/DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Documentation setup

## 1. Clone the repo:

```shell
git clone https://github.com/dstackai/dstack
cd dstack
```

## 2. Install uv:

https://docs.astral.sh/uv/getting-started/installation

```shell
curl -LsSf https://astral.sh/uv/install.sh | sh
```

## 3. Install `dstack` with all extras and dev dependencies:

> [!WARNING]
> Building documentation requires `python_version >= 3.11`.

```shell
uv sync --all-extras
```

`dstack` will be installed into the project's `.venv` in editable mode.

## 4. (Recommended) Install pre-commit hooks:

Code formatting and linting can be done automatically on each commit with `pre-commit` hooks:

```shell
uv run pre-commit install
```

## 5. Preview documentation

To preview the documentation, run the follow command:

```shell
uv run mkdocs serve -w examples -s
```

If you want to build static files, you can use the following command:

```shell
uv run mkdocs build -s
```
5 changes: 3 additions & 2 deletions examples/plugins/example_plugin_server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name = "dstack-plugin-server"
version = "0.1.0"
description = "Example plugin server"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.9"
dependencies = [
"fastapi[standard]>=0.115.12",
"fastapi",
"uvicorn",
"dstack",
]

Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ pattern = '<picture>\s*|<source[^>]*>\s*|\s*</picture>|<video[^>]*>\s*|</video>\
replacement = ''
ignore-case = true

[tool.uv.sources]
dstack-plugin-server = { path = "examples/plugins/example_plugin_server", editable = true }

[tool.pyright]
include = [
"src/dstack/plugins",
Expand Down Expand Up @@ -109,6 +112,18 @@ dev = [
"pytest-xdist>=3.6.1",
"pyinstrument>=5.0.0",
"kubernetes-stubs-elephant-fork",
# docs
"dstack[server]; python_version >= '3.11'",
"dstack-plugin-server; python_version >= '3.11'",
"pillow; python_version >= '3.11'",
"cairosvg; python_version >= '3.11'",
"mkdocs-material>=9.7.0; python_version >= '3.11'",
"mkdocs-material[imaging]; python_version >= '3.11'",
"mkdocs-material-extensions; python_version >= '3.11'",
"mkdocs-redirects; python_version >= '3.11'",
"mkdocs-gen-files; python_version >= '3.11'",
"mkdocstrings[python]; python_version >= '3.11'",
"mkdocs-render-swagger-plugin; python_version >= '3.11'",
]

[project.optional-dependencies]
Expand Down