Skip to content

Commit 1b1de36

Browse files
authored
Revert merge of library (#234)
* Revert "[FSTORE-1453] Move client, decorators, variable_api and constants to hopsworks_common (#229)" This reverts commit 85deafd. * Revert "[FSTORE-1439][APPEND] Apply ruff formatting and fixes to the merged repo (#232)" This reverts commit a612df1. * Revert "[FSTORE-1439] Merge hopsworks-api, feature-store-api and machine-learning-api" This reverts commit 67484a9. * Revert "[FSTORE-1454] Unify variable_api and project_api (#219)" This reverts commit dd4470a. * Revert "Merge machine-learning-api into hsml subdirectory" This reverts commit c599739.
1 parent 85deafd commit 1b1de36

File tree

670 files changed

+5808
-24721
lines changed

Some content is hidden

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

670 files changed

+5808
-24721
lines changed

.github/workflows/mkdocs-main.yml

+1-18
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,7 @@ jobs:
2424
run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev]
2525

2626
- name: generate autodoc
27-
run: python3 ./python/auto_doc.py
28-
29-
- name: Cache local Maven repository
30-
uses: actions/cache@v2
31-
with:
32-
path: ~/.m2/repository
33-
key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }}
34-
restore-keys: |
35-
${{ runner.os }}-maven-
36-
- name: Set up JDK 8
37-
uses: actions/setup-java@v3
38-
with:
39-
java-version: "8"
40-
distribution: "adopt"
41-
42-
- name: Build java doc documentation
43-
working-directory: ./java
44-
run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc
27+
run: python3 auto_doc.py
4528

4629
- name: setup git
4730
run: |

.github/workflows/mkdocs-release.yml

+2-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: mkdocs-release
22

33
on:
44
push:
5-
branches: [branch-*]
5+
branches: [branch-*\.*]
66

77
jobs:
88
publish-release:
@@ -29,25 +29,7 @@ jobs:
2929
run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev]
3030

3131
- name: generate autodoc
32-
run: python3 ./python/auto_doc.py
33-
34-
- name: Cache local Maven repository
35-
uses: actions/cache@v2
36-
with:
37-
path: ~/.m2/repository
38-
key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }}
39-
restore-keys: |
40-
${{ runner.os }}-maven-
41-
- name: Set up JDK 8
42-
uses: actions/setup-java@v3
43-
with:
44-
java-version: "8"
45-
distribution: "adopt"
46-
47-
- name: Build java doc documentation
48-
working-directory: ./java
49-
run:
50-
mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc
32+
run: python3 auto_doc.py
5133

5234
- name: setup git
5335
run: |

.github/workflows/python-lint.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: python
2+
3+
on: pull_request
4+
5+
env:
6+
APP_API_KEY: ${{ secrets.APP_API_KEY }}
7+
8+
jobs:
9+
lint_stylecheck:
10+
name: Lint and Stylecheck
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.11"
19+
20+
- name: Get all changed files
21+
id: get-changed-files
22+
uses: tj-actions/changed-files@v44
23+
with:
24+
files_yaml: |
25+
src:
26+
- 'python/**/*.py'
27+
- '!python/tests/**/*.py'
28+
test:
29+
- 'python/tests/**/*.py'
30+
31+
- name: install deps
32+
run: pip install ruff==0.4.2
33+
34+
- name: ruff on python files
35+
if: steps.get-changed-files.outputs.src_any_changed == 'true'
36+
env:
37+
SRC_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.src_all_changed_files }}
38+
run: ruff check --output-format=github $SRC_ALL_CHANGED_FILES
39+
40+
- name: ruff on test files
41+
if: steps.get-changed-files.outputs.test_any_changed == 'true'
42+
env:
43+
TEST_ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.test_all_changed_files }}
44+
run: ruff check --output-format=github $TEST_ALL_CHANGED_FILES
45+
46+
- name: ruff format --check $ALL_CHANGED_FILES
47+
env:
48+
ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }}
49+
run: ruff format $ALL_CHANGED_FILES

.gitignore

-11
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ coverage.xml
5151
.hypothesis/
5252
.pytest_cache/
5353
.ruff_cache/
54-
bigquery.json
55-
metastore_db/
5654

5755
# Translations
5856
*.mo
@@ -73,9 +71,6 @@ instance/
7371
# Sphinx documentation
7472
docs/_build/
7573

76-
# Mike Javadoc
77-
docs/javadoc
78-
7974
# PyBuilder
8075
target/
8176

@@ -133,9 +128,3 @@ target/
133128

134129
# mkdocs intemediate files
135130
docs/generated
136-
137-
docs/CONTRIBUTING.md
138-
docs/index.md
139-
140-
# Test artifacts
141-
keyFile.json

CONTRIBUTING.md

+59-57
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
## Python development setup
2-
32
---
43

54
- Fork and clone the repository
65

7-
- Create a new Python environment with your favourite environment manager (e.g. virtualenv or conda) and Python 3.9 (newer versions will return a library conflict in `auto_doc.py`)
6+
- Create a new Python environment with your favourite environment manager, e.g. virtualenv or conda
87

98
- Install repository in editable mode with development dependencies:
109

11-
```bash
12-
cd python
13-
pip install -e ".[dev]"
14-
```
10+
```bash
11+
cd python
12+
pip install -e ".[dev]"
13+
```
1514

1615
- Install [pre-commit](https://pre-commit.com/) and then activate its hooks. pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. The library uses pre-commit to ensure code-style and code formatting through [ruff](https://docs.astral.sh/ruff/). Run the following commands from the `python` directory:
1716

@@ -38,104 +37,110 @@ We follow a few best practices for writing the Python documentation:
3837

3938
1. Use the google docstring style:
4039

41-
```python
42-
"""[One Line Summary]
40+
```python
41+
"""[One Line Summary]
4342
44-
[Extended Summary]
43+
[Extended Summary]
4544
46-
[!!! example
47-
import xyz
48-
]
45+
[!!! example
46+
import xyz
47+
]
4948
50-
# Arguments
51-
arg1: Type[, optional]. Description[, defaults to `default`]
52-
arg2: Type[, optional]. Description[, defaults to `default`]
49+
# Arguments
50+
arg1: Type[, optional]. Description[, defaults to `default`]
51+
arg2: Type[, optional]. Description[, defaults to `default`]
5352
54-
# Returns
55-
Type. Description.
53+
# Returns
54+
Type. Description.
5655
57-
# Raises
58-
Exception. Description.
59-
"""
60-
```
56+
# Raises
57+
Exception. Description.
58+
"""
59+
```
60+
61+
If Python 3 type annotations are used, they are inserted automatically.
6162

62-
If Python 3 type annotations are used, they are inserted automatically.
6363

6464
2. Hopsworks entity engine methods (e.g. ExecutionEngine etc.) only require a single line docstring.
65-
3. Private REST API implementations (e.g. FeatureGroupApi etc.) should be fully documented with docstrings without defaults.
66-
4. Public API such as metadata objects and public REST API implementations should be fully documented with defaults.
65+
3. Private REST Api implementations (e.g. GitRemoteApi etc.) should be fully documented with docstrings without defaults.
66+
4. Public Api such as metadata objects and public REST Api implementations should be fully documented with defaults.
6767

6868
#### Setup and Build Documentation
6969

7070
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.
7171

7272
**Background about `mike`:**
73-
`mike` builds the documentation and commits it as a new directory to the gh-pages branch. Each directory corresponds to one version of the documentation. Additionally, `mike` maintains a json in the root of gh-pages with the mappings of versions/aliases for each of the directories available. With aliases you can define extra names like `dev` or `latest`, to indicate stable and unstable releases.
73+
`mike` builds the documentation and commits it as a new directory to the gh-pages branch. Each directory corresponds to one version of the documentation. Additionally, `mike` maintains a json in the root of gh-pages with the mappings of versions/aliases for each of the directories available. With aliases you can define extra names like `dev` or `latest`, to indicate stable and unstable releases.
7474

75-
1. Install Hopsworks with `dev-docs` extras:
75+
1. Currently we are using our own version of `keras-autodoc`
7676

77-
```bash
78-
pip install -e ".[dev-docs]"
79-
```
77+
```bash
78+
pip install git+https://github.com/logicalclocks/keras-autodoc
79+
```
8080

81-
2. To build the docs, first run the auto doc script:
81+
2. Install HOPSWORKS with `docs` extras:
82+
83+
```bash
84+
pip install -e .[dev,docs]
85+
```
8286

83-
```bash
84-
python auto_doc.py
85-
```
87+
3. To build the docs, first run the auto doc script:
88+
89+
```bash
90+
cd ..
91+
python auto_doc.py
92+
```
8693

8794
##### Option 1: Build only current version of docs
8895

89-
3. Either build the docs, or serve them dynamically:
96+
4. Either build the docs, or serve them dynamically:
9097

91-
Note: Links and pictures might not resolve properly later on when checking with this build.
92-
The reason for that is that the docs are deployed with versioning on docs.hopsworks.ai and
93-
therefore another level is added to all paths, e.g. `docs.hopsworks.ai/[version-or-alias]`.
94-
Using relative links should not be affected by this, however, building the docs with version
95-
(Option 2) is recommended.
98+
Note: Links and pictures might not resolve properly later on when checking with this build.
99+
The reason for that is that the docs are deployed with versioning on docs.hopsworks.ai and
100+
therefore another level is added to all paths, e.g. `docs.hopsworks.ai/[version-or-alias]`.
101+
Using relative links should not be affected by this, however, building the docs with version
102+
(Option 2) is recommended.
96103

97-
```bash
98-
mkdocs build
99-
# or
100-
mkdocs serve
101-
```
104+
```bash
105+
mkdocs build
106+
# or
107+
mkdocs serve
108+
```
102109

103110
##### Option 2 (Preferred): Build multi-version doc with `mike`
104111

105112
###### Versioning on docs.hopsworks.ai
106113

107114
On docs.hopsworks.ai we implement the following versioning scheme:
108115

109-
- 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.
110-
- 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.
111-
- previous stable releases: rendered without alias, e.g. **3.4.4**.
116+
- current master branches (e.g. of hopsworks corresponding to master of Hopsworks): rendered as current Hopsworks snapshot version, e.g. **3.1.0-SNAPSHOT [dev]**, where `dev` is an alias to indicate that this is an unstable version.
117+
- the latest release: rendered with full current version, e.g. **3.0.1 [latest]** with `latest` alias to indicate that this is the latest stable release.
118+
- previous stable releases: rendered without alias, e.g. **3.0.0**.
112119

113120
###### Build Instructions
114121

115-
4. 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:
122+
4. For this you can either checkout and make a local copy of the `upstream/gh-pages` branch, where
123+
`mike` maintains the current state of docs.hopsworks.ai, or just build documentation for the branch you are updating:
116124

117125
Building *one* branch:
118126

119127
Checkout your dev branch with modified docs:
120-
121128
```bash
122129
git checkout [dev-branch]
123130
```
124131

125132
Generate API docs if necessary:
126-
127133
```bash
128134
python auto_doc.py
129135
```
130136

131137
Build docs with a version and alias
132-
133138
```bash
134139
mike deploy [version] [alias] --update-alias
135140
136141
# for example, if you are updating documentation to be merged to master,
137142
# which will become the new SNAPSHOT version:
138-
mike deploy 4.0.0-SNAPSHOT dev --update-alias
143+
mike deploy 3.1.0-SNAPSHOT dev --update-alias
139144
140145
# if you are updating docs of the latest stable release branch
141146
mike deploy [version] latest --update-alias
@@ -153,20 +158,17 @@ On docs.hopsworks.ai we implement the following versioning scheme:
153158
```
154159

155160
You can now checkout the gh-pages branch and serve:
156-
157161
```bash
158162
git checkout gh-pages
159163
mike serve
160164
```
161165

162166
You can also list all available versions/aliases:
163-
164167
```bash
165168
mike list
166169
```
167170

168171
Delete and reset your local gh-pages branch:
169-
170172
```bash
171173
mike delete --all
172174
@@ -192,7 +194,7 @@ PAGES = {
192194

193195
Now you can add a template markdown file to the `docs/templates` directory with the name you specified in the auto-doc script. The `new_template.md` file should contain a tag to identify the place at which the API documentation should be inserted:
194196

195-
````
197+
```
196198
## The XYZ package
197199
198200
{{module}}
@@ -205,7 +207,7 @@ Some extra content here.
205207
```
206208
207209
{{xyz.asd}}
208-
````
210+
```
209211

210212
Finally, run the `auto_doc.py` script, as decribed above, to update the documentation.
211213

0 commit comments

Comments
 (0)