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: README.md
+38-96Lines changed: 38 additions & 96 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,62 @@ This is the source of the Hopsworks Documentation published at <https://docs.hop
4
4
5
5
## Build instructions
6
6
7
-
### Step 1: Setup python environment
7
+
We use `mkdocs` together with [`mike`]((https://github.com/jimporter/mike/) for versioning to build the documentation.
8
+
We also use this two main mkdocs plugins: [`mkdocstrings`](https://mkdocstrings.github.io/) and [its Python handler](https://mkdocstrings.github.io/python/), and [`mkdocs-material`](https://squidfunk.github.io/mkdocs-material/) as the theme.
8
9
9
-
Create a python 3.10 environment, using a python environment manager of your own choosing. For example `virtualenv` or `anaconda`.
10
+
**Background about `mike`:**
11
+
`mike` builds the documentation and commits it as a new directory to the `gh-pages` branch.
12
+
Each directory corresponds to one version of the documentation.
13
+
Additionally, `mike` maintains a json in the root of `gh-pages` with the mappings of versions/aliases for each of the directories available.
14
+
With aliases, you can define extra names like `dev` or `latest`, to indicate stable and unstable releases.
10
15
11
-
### Step 2
16
+
### Versioning on docs.hopsworks.ai
17
+
18
+
On docs.hopsworks.ai we implement the following versioning scheme:
19
+
20
+
- the latest release: rendered with full current version, e.g. **4.4 [latest]** with `latest` alias to indicate that this is the latest stable release.
21
+
- previous stable releases: rendered without alias, e.g. **4.3**.
Alternatively, you can just activate the virtual environment you use for development of `hopsworks-api` (obtained via `uv sync`), this is the way it is done in the actions.
43
+
Namely, in `.github/workflows/mkdocs-release.yml` and `.github/workflows/mkdocs-test.yml`, the `hopsworks-api` repo is cloned, and its uv virtual environment is used with `dev` extra and all development groups.
44
+
45
+
A callback is set in `hopsworks-api` GitHub Actions, which triggers `.github/workflows/mkdocs-release.yml` on any pushes to release branches (that is, `branch-x.x`).
31
46
32
-
Use mkdocs to build the documentation and serve it locally
47
+
### Step 3
48
+
49
+
Build and serve the docs using mike.
33
50
34
51
```bash
35
-
{PY_ENV}/bin/mkdocs serve
52
+
# Use the current version instead of 4.4:
53
+
mike deploy 4.4 latest --update-alias
54
+
# Next, serve the docs to access them locally:
55
+
mike serve
36
56
```
37
57
38
-
The documentation should now be available locally on the following URL: <http://127.0.0.1:8000/>
58
+
**Important**: The first time you serve the docs, you have to choose a default version, as follows:
We use `mkdocs` together with `mike` ([for versioning](https://github.com/jimporter/mike/)) to build the documentation and a plugin called `keras-autodoc` to auto generate Python API documentation from docstrings.
64
-
65
-
**Background about `mike`:**
66
-
`mike` builds the documentation and commits it as a new directory to the gh-pages branch.
67
-
Each directory corresponds to one version of the documentation.
68
-
Additionally, `mike` maintains a json in the root of gh-pages with the mappings of versions/aliases for each of the directories available.
69
-
With aliases you can define extra names like `dev` or `latest`, to indicate stable and unstable releases.
70
-
71
-
### Versioning on docs.hopsworks.ai
72
-
73
-
On docs.hopsworks.ai we implement the following versioning scheme:
74
-
75
-
- current master branches (e.g. of hopsworks corresponding to master of Hopsworks): rendered as current Hopsworks snapshot version, e.g. **4.0.0-SNAPSHOT [dev]**, where `dev` is an alias to indicate that this is an unstable version.
76
-
- the latest release: rendered with full current version, e.g. **3.8.0 [latest]** with `latest` alias to indicate that this is the latest stable release.
77
-
- previous stable releases: rendered without alias, e.g. **3.4.4**.
78
-
79
-
### 4. Build Instructions
80
-
81
-
For this you can either checkout and make a local copy of the `upstream/gh-pages` branch, where `mike` maintains the current state of docs.hopsworks.ai, or just build documentation for the branch you are updating:
82
-
83
-
Building *one* branch:
84
-
85
-
Checkout your dev branch with modified docs:
86
-
87
-
```bash
88
-
git checkout [dev-branch]
89
-
```
90
-
91
-
Generate API docs if necessary:
92
-
93
-
```bash
94
-
python auto_doc.py
95
-
```
96
-
97
-
Build docs with a version and alias
98
-
99
-
```bash
100
-
mike deploy [version] [alias] --update-alias
101
-
102
-
# for example, if you are updating documentation to be merged to master,
103
-
# which will become the new SNAPSHOT version:
104
-
mike deploy 4.0.0-SNAPSHOT dev --update-alias
105
-
106
-
# if you are updating docs of the latest stable release branch
107
-
mike deploy [version] latest --update-alias
108
-
109
-
# if you are updating docs of a previous stable release branch
110
-
mike deploy [version]
111
-
```
112
-
113
-
If no gh-pages branch existed in your local repository, this will have created it.
114
-
115
-
**Important**: If no previous docs were built, you will have to choose a version as default to be loaded as index, as follows
116
-
117
-
```bash
118
-
mike set-default [version-or-alias]
119
-
```
120
-
121
-
You can now checkout the gh-pages branch and serve:
0 commit comments