Skip to content

Commit d2fdd17

Browse files
peterschmidt85Andrey Cheptsov
andauthored
Rename docs/ to mkdocs/, move examples under /docs/, inline source (#3859)
* Inline example source code into docs pages Drop the mkdocs hook that materialized examples/<path>/README.md into docs/examples/<path>/index.md stubs at build time. Move the 20 navigated example READMEs directly into docs/examples/<path>.md (flat layout, no per-example subdirectory) and delete the parallel .dstack.yml configs since their content is already inline in the markdown. The two GCP NCCL test yamls that were only referenced via dead "Source code" admonitions are now inlined into their respective tabs. Within the moved pages, convert absolute https://dstack.ai/(docs|examples) links to relative .md paths so mkdocs strict mode validates them. Non-navigated examples (misc/, llms/, server-deployment/, plugins/, single-node-training/{qlora,optimum-tpu}, the AMD subdirs, etc.) are left untouched for a later pass. * Move examples under /docs/, merge single and distributed training - Move docs/examples/ to docs/docs/examples/ so URLs become /docs/examples/... instead of /examples/.... The old /examples/<cat>/<name>/ URLs continue to work via redirects, including the recently-published /docs/examples/ {single-node-training,distributed-training}/ paths. - Merge "Single-node training" and "Distributed training" example sections into a single "Training" section. TRL and Axolotl pages now contain both variants under top-level "Single-node training" and "Distributed training" H2 sections; Ray+RAGEN moves over unchanged. - Convert remaining absolute https://dstack.ai/(docs|examples)/... links to relative .md links throughout the moved example pages and the concept docs that point into them. Drop dead /docs/guides/{clusters,kubernetes} links (target pages were removed earlier) and replace with anchor links to the Kubernetes backend / cluster placement sections where appropriate. - Inline two GCP NCCL test yamls (a3mega-nccl-tests, a3high-nccl-tests) that were previously referenced via dead "Source code" admonitions. * Drop redirect that collides with the real AMD example page The redirect source 'docs/examples/accelerators/amd/index.md' is now the canonical URL of the moved AMD example page, so the redirect plugin was overwriting the real page's index.html with a self-referencing redirect, producing an infinite loop. * Add Accelerators link to footer Examples section * Re-ordered top menu (moved Blog to the end) * Rename docs/ to mkdocs/ and extract just recipes The mkdocs source dir is now mkdocs/, and the previously-confusing docs/docs/ nesting becomes mkdocs/docs/ (read: "in mkdocs sources, the /docs/ URL section"). - mkdocs.yml: explicit docs_dir: mkdocs, plus custom_dir, cards_layout_dir, pymdownx.snippets.base_path, edit_uri all repointed to mkdocs/ - scripts/docs/{gen_openapi_reference,gen_rest_plugin_spec_reference}.py output paths repointed to mkdocs/docs/...; also write a trailing newline so end-of-file-fixer doesn't fight with mkdocs serve - .gitignore: openapi.json patterns repointed to mkdocs/docs/...; untrack the three generated openapi.json files (they're regenerated by the build and shouldn't be in git) - .github/workflows/build.yml path filter updated to mkdocs/** - README.md, AGENTS.md, contributing/{DOCS,BACKENDS}.md prose updated - .justfile: extract docs recipes into mkdocs/.justfile (mkdocs-serve, mkdocs-build) following the same pattern as runner/ and frontend/; drop -w examples (no longer needed) and add --livereload to work around mkdocs live-reload bugs * Apply ruff import-sorting fixes to docs gen scripts --------- Co-authored-by: Andrey Cheptsov <andrey.cheptsov@github.com>
1 parent a9b1db9 commit d2fdd17

303 files changed

Lines changed: 913 additions & 1457 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- "master"
77
paths-ignore:
8-
- "docs/**"
8+
- "mkdocs/**"
99
- "mkdocs.yml"
1010
pull_request:
1111
branches:

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ uv.lock
2626
/src/dstack/_internal/server/statics
2727

2828
profiling_results.html
29-
docs/docs/reference/api/http/openapi.json
30-
docs/docs/reference/api/rest/openapi.json
31-
docs/docs/reference/plugins/rest/rest_plugin_openapi.json
29+
30+
mkdocs/docs/reference/api/http/openapi.json
31+
mkdocs/docs/reference/api/rest/openapi.json
32+
mkdocs/docs/reference/plugins/rest/rest_plugin_openapi.json

.justfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
# Run `just` to see all available commands.
66
#
77
# Components:
8-
# * runner/justfile – Building and uploading dstack runner and shim
8+
# * runner/.justfile – Building and uploading dstack runner and shim
9+
# * frontend/.justfile – Building and running the frontend
10+
# * mkdocs/.justfile – Building and previewing the docs site
911

1012
default:
1113
@just --list
@@ -16,5 +18,4 @@ import "runner/.justfile"
1618

1719
import "frontend/.justfile"
1820

19-
docs-serve:
20-
uv run mkdocs serve --livereload -w examples -s
21+
import "mkdocs/.justfile"

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Core Python package lives in `src/dstack`; internal modules (including server) sit under `_internal`, API surfaces under `api`, and plugin integrations under `plugins`.
55
- Tests reside in `src/tests` and mirror package paths; add new suites alongside the code they cover.
66
- Frontend lives in `frontend` (React/webpack) and is built into `src/dstack/_internal/server/statics`.
7-
- Docs sources are in `docs` with extra contributor notes in `contributing/*.md`; examples for users sit in `examples/`.
7+
- Docs sources are in `mkdocs/docs/` with extra contributor notes in `contributing/*.md`.
88

99
## Build, Test, and Development Commands
1010
- Install deps (editable package with extras): `uv sync --all-extras` (uses `.venv` in repo).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<h2>
33
<a target="_blank" href="https://dstack.ai">
44
<picture>
5-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/dstackai/dstack/master/docs/assets/images/dstack-logo-dark.svg"/>
6-
<img alt="dstack" src="https://raw.githubusercontent.com/dstackai/dstack/master/docs/assets/images/dstack-logo.svg" width="350px"/>
5+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/dstackai/dstack/master/mkdocs/assets/images/dstack-logo-dark.svg"/>
6+
<img alt="dstack" src="https://raw.githubusercontent.com/dstackai/dstack/master/mkdocs/assets/images/dstack-logo.svg" width="350px"/>
77
</picture>
88
</a>
99
</h2>

contributing/BACKENDS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ If instances in the backend take more than 10 minutes to start, override the def
160160

161161
### 2.10. Document the backend
162162

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.
163+
Add the backend to the [Concepts->Backends](https://github.com/dstackai/dstack/blob/master/mkdocs/docs/concepts/backends.md
164+
) page and the [server/comfig.yml](https://github.com/dstackai/dstack/blob/master/mkdocs/docs/reference/server/config.yml.md) reference.
165165

166166
## 3. Appendix
167167

contributing/DOCS.md

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ uv run pre-commit install
3939
To preview the documentation, run the follow command:
4040

4141
```shell
42-
uv run mkdocs serve -w examples -s
42+
uv run mkdocs serve --livereload -s
4343
```
4444

45+
The `--livereload` flag is required to work around live-reload bugs in recent `mkdocs` versions.
46+
4547
If you want to build static files, you can use the following command:
4648

4749
```shell
@@ -57,7 +59,6 @@ The documentation uses a custom build system with MkDocs hooks to generate vario
5759
Use these in `.envrc` to disable expensive docs regeneration, especially during `mkdocs serve` auto-reload. Set any of them to disable the corresponding artifact.
5860

5961
```shell
60-
export DSTACK_DOCS_DISABLE_EXAMPLES=1
6162
export DSTACK_DOCS_DISABLE_LLM_TXT=1
6263
export DSTACK_DOCS_DISABLE_CLI_REFERENCE=1
6364
export DSTACK_DOCS_DISABLE_YAML_SCHEMAS=1
@@ -69,19 +70,11 @@ export DSTACK_DOCS_DISABLE_REST_PLUGIN_SPEC_REFERENCE=1
6970

7071
The build process is customized via hooks in `scripts/docs/hooks.py`:
7172

72-
#### 1. Example materialization
73-
74-
Example pages like `examples/single-node-training/trl/index.md` are stubs that reference `README.md` files in the repository root:
75-
- **Stub location**: `docs/examples/single-node-training/trl/index.md`
76-
- **Content source**: `examples/single-node-training/trl/README.md`
77-
78-
During the build, the hook reads the README content and uses it for rendering the HTML page.
79-
80-
#### 2. Schema reference expansion
73+
#### 1. Schema reference expansion
8174

8275
Files in `docs/reference/**/*.md` can use `#SCHEMA#` placeholders that are expanded with generated schema documentation during the build.
8376

84-
#### 3. llms.txt generation
77+
#### 2. llms.txt generation
8578

8679
Two files are generated for LLM consumption:
8780

@@ -108,9 +101,9 @@ description: Short description of what this page covers
108101
---
109102
```
110103

111-
For examples, add frontmatter to the `README.md` files in the repository root (e.g., `examples/single-node-training/trl/README.md`).
104+
For examples, add frontmatter to the page files (e.g., `mkdocs/docs/examples/training/trl.md`).
112105

113-
#### 4. Skills discovery
106+
#### 3. Skills discovery
114107

115108
The build creates `.well-known/skills/` directory structure for skills discovery:
116109
- Reads `skills/dstack/SKILL.md`
@@ -121,35 +114,32 @@ The build creates `.well-known/skills/` directory structure for skills discovery
121114
### File structure
122115

123116
```
124-
docs/
125-
├── docs/ # Main documentation content
126-
│ ├── index.md # Getting started
117+
mkdocs/ # docs_dir for the mkdocs site
118+
├── index.md # Homepage
119+
├── docs/ # /docs/ URL section
120+
│ ├── index.md # Getting started
127121
│ ├── installation.md
128122
│ ├── quickstart.md
129-
│ ├── concepts/ # Concept pages
130-
│ ├── guides/ # How-to guides
131-
│ └── reference/ # API reference (schema expansion)
132-
├── examples/ # Example stub files (index.md)
133-
│ └── single-node-training/
134-
│ └── trl/
135-
│ └── index.md # Stub referencing root README
136-
└── overrides/ # Theme customization
137-
138-
examples/ # Example content (repository root)
139-
└── single-node-training/
140-
└── trl/
141-
├── README.md # Actual content with frontmatter
142-
└── train.dstack.yml
123+
│ ├── concepts/ # Concept pages
124+
│ ├── guides/ # How-to guides
125+
│ ├── reference/ # API reference (schema expansion)
126+
│ └── examples/ # Example pages (inline source code)
127+
│ └── training/
128+
│ └── trl.md # Page content with frontmatter
129+
├── blog/ # Blog posts
130+
├── overrides/ # Theme customization
131+
├── layouts/ # Social card layouts
132+
└── assets/ # Stylesheets, images, fonts
143133
144134
scripts/docs/
145-
├── hooks.py # MkDocs build hooks
146-
├── gen_llms_files.py # llms.txt generation
147-
├── gen_schema_reference.py # Schema expansion
148-
└── gen_cli_reference.py # CLI reference generation
135+
├── hooks.py # MkDocs build hooks
136+
├── gen_llms_files.py # llms.txt generation
137+
├── gen_schema_reference.py # Schema expansion
138+
└── gen_cli_reference.py # CLI reference generation
149139
150140
skills/
151141
└── dstack/
152-
└── SKILL.md # Skills discovery content
142+
└── SKILL.md # Skills discovery content
153143
```
154144

155145
### Testing changes

docs/examples/clusters/crusoe/index.md

Whitespace-only changes.

docs/examples/clusters/gcp/index.md

Whitespace-only changes.

docs/examples/clusters/lambda/index.md

Whitespace-only changes.

0 commit comments

Comments
 (0)