Skip to content

Commit 67d9ea5

Browse files
committed
Final fixes
1 parent 1d5d94b commit 67d9ea5

File tree

3 files changed

+41
-98
lines changed

3 files changed

+41
-98
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,4 @@ target/
128128
# Mac
129129
.DS_Store
130130

131+
/temp_dir

README.md

Lines changed: 38 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,62 @@ This is the source of the Hopsworks Documentation published at <https://docs.hop
44

55
## Build instructions
66

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.
89

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.
1015

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**.
22+
23+
### Step 1
1224

13-
Clone this repository
25+
Clone this repository:
1426

1527
```bash
1628
git clone https://github.com/logicalclocks/logicalclocks.github.io.git
1729
```
1830

19-
### Step 3
20-
21-
Install the required dependencies to build the documentation in the python environment created in the previous step.
31+
### Step 2
2232

23-
**Note that {PY_ENV} is the path to your python environment.**
33+
Create a python virtual environment to build the documentation:
2434

2535
```bash
26-
cd logicalclocks.github.io
27-
{PY_ENV}/bin/pip3 install -r requirements-docs.txt
36+
uv venv
37+
uv pip install -r requirements-docs.txt
38+
# Install hopsworks-api for gathering docstrings for the API reference
39+
uv pip install git+https://github.com/logicalclocks/hopsworks-api.git@main#subdirectory=python
2840
```
2941

30-
### Step 4
42+
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`).
3146

32-
Use mkdocs to build the documentation and serve it locally
47+
### Step 3
48+
49+
Build and serve the docs using mike.
3350

3451
```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
3656
```
3757

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:
59+
60+
```bash
61+
mike set-default latest
62+
```
3963

4064
## Adding new pages
4165

@@ -57,85 +81,3 @@ linkchecker http://127.0.0.1:8000/
5781
# If ok just kill the server
5882
kill -9 $SERVER_PID
5983
```
60-
61-
## Setup and Build Documentation
62-
63-
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:
122-
123-
```bash
124-
git checkout gh-pages
125-
mike serve
126-
```
127-
128-
You can also list all available versions/aliases:
129-
130-
```bash
131-
mike list
132-
```
133-
134-
Delete and reset your local gh-pages branch:
135-
136-
```bash
137-
mike delete --all
138-
139-
# or delete single version
140-
mike delete [version-or-alias]
141-
```

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,5 +379,5 @@ markdown_extensions:
379379
- pymdownx.tasklist:
380380
custom_checkbox: true
381381
- pymdownx.emoji:
382-
emoji_index: "!!python/name:material.extensions.emoji.twemoji"
383-
emoji_generator: "!!python/name:material.extensions.emoji.to_svg"
382+
emoji_index: !!python/name:material.extensions.emoji.twemoji
383+
emoji_generator: !!python/name:material.extensions.emoji.to_svg

0 commit comments

Comments
 (0)