From d92d572e33cd15a6f293346621b41b30c7903530 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 02:27:27 +0200 Subject: [PATCH 1/9] Merge workflows --- .github/workflows/mkdocs-main.yml | 17 +++++++++++++++++ .github/workflows/mkdocs-release.yml | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/.github/workflows/mkdocs-main.yml b/.github/workflows/mkdocs-main.yml index e8e14b4ea..3c797097e 100644 --- a/.github/workflows/mkdocs-main.yml +++ b/.github/workflows/mkdocs-main.yml @@ -43,6 +43,23 @@ jobs: working-directory: ./java run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: "8" + distribution: "adopt" + + - name: Build java doc documentation + working-directory: ./java + run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc + - name: setup git run: | git config --global user.name Mike diff --git a/.github/workflows/mkdocs-release.yml b/.github/workflows/mkdocs-release.yml index f1c6bb814..f931cd5bc 100644 --- a/.github/workflows/mkdocs-release.yml +++ b/.github/workflows/mkdocs-release.yml @@ -49,6 +49,24 @@ jobs: run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: "8" + distribution: "adopt" + + - name: Build java doc documentation + working-directory: ./java + run: + mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc + - name: setup git run: | git config --global user.name Mike From c3456e63c2eb7906e1b7e26aef2608d6d129f61b Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 09:14:18 +0200 Subject: [PATCH 2/9] Fix import problem in docgen --- .github/workflows/mkdocs-main.yml | 19 +------------------ .github/workflows/mkdocs-release.yml | 20 +------------------- python/pyproject.toml | 15 ++++++++++++++- requirements-docs.txt | 11 ----------- 4 files changed, 16 insertions(+), 49 deletions(-) delete mode 100644 requirements-docs.txt diff --git a/.github/workflows/mkdocs-main.yml b/.github/workflows/mkdocs-main.yml index 3c797097e..9294fef53 100644 --- a/.github/workflows/mkdocs-main.yml +++ b/.github/workflows/mkdocs-main.yml @@ -21,7 +21,7 @@ jobs: - name: install deps working-directory: ./python - run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev] + run: cp ../README.md . && pip3 install -e .[dev] - name: generate autodoc run: python3 ./python/auto_doc.py @@ -43,23 +43,6 @@ jobs: working-directory: ./java run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - java-version: "8" - distribution: "adopt" - - - name: Build java doc documentation - working-directory: ./java - run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc - - name: setup git run: | git config --global user.name Mike diff --git a/.github/workflows/mkdocs-release.yml b/.github/workflows/mkdocs-release.yml index f931cd5bc..80a325760 100644 --- a/.github/workflows/mkdocs-release.yml +++ b/.github/workflows/mkdocs-release.yml @@ -26,7 +26,7 @@ jobs: - name: install deps working-directory: ./python - run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev] + run: cp ../README.md . && pip3 install -e .[dev] - name: generate autodoc run: python3 ./python/auto_doc.py @@ -49,24 +49,6 @@ jobs: run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - java-version: "8" - distribution: "adopt" - - - name: Build java doc documentation - working-directory: ./java - run: - mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../docs/javadoc - - name: setup git run: | git config --global user.name Mike diff --git a/python/pyproject.toml b/python/pyproject.toml index 9452f5061..bfe782997 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -86,7 +86,20 @@ dev-pandas1 = [ "pandas<=1.5.3", "sqlalchemy<=1.4.48", ] -dev = ["hopsworks[dev-no-opt,great-expectations]"] +dev-docs = [ + "mkdocs==1.5.3", + "mkdocs-material==9.5.17", + "mike==2.0.0", + "sphinx==7.3.7", + "keras_autodoc @ git+https://git@github.com/logicalclocks/keras-autodoc", + "markdown-include==0.8.1", + "mkdocs-jupyter==0.24.3", + "markdown==3.6", + "pymdown-extensions==10.7.1", + "mkdocs-macros-plugin==1.0.4", + "mkdocs-minify-plugin>=0.2.0", +] +dev = ["hopsworks[dev-no-opt,great-expectations,dev-docs]"] [build-system] requires = ["setuptools", "wheel"] diff --git a/requirements-docs.txt b/requirements-docs.txt deleted file mode 100644 index 8bc8d6230..000000000 --- a/requirements-docs.txt +++ /dev/null @@ -1,11 +0,0 @@ -mkdocs==1.5.3 -mkdocs-material==9.5.17 -mike==2.0.0 -sphinx==7.3.7 -keras_autodoc @ git+https://git@github.com/logicalclocks/keras-autodoc -markdown-include==0.8.1 -mkdocs-jupyter==0.24.3 -markdown==3.6 -pymdown-extensions==10.7.1 -mkdocs-macros-plugin==1.0.4 -mkdocs-minify-plugin>=0.2.0 From 9c573da7f00701f022c82833225ee6c2a3fbf856 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 09:29:48 +0200 Subject: [PATCH 3/9] Merge and remove the rest of python files --- hsfs/python/.pre-commit-config.yaml | 8 -------- hsfs/python/setup.py | 4 ---- hsml/python/.pre-commit-config.yaml | 10 ---------- hsml/python/setup.py | 19 ------------------- python/.pre-commit-config.yaml | 2 +- 5 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 hsfs/python/.pre-commit-config.yaml delete mode 100644 hsfs/python/setup.py delete mode 100644 hsml/python/.pre-commit-config.yaml delete mode 100644 hsml/python/setup.py diff --git a/hsfs/python/.pre-commit-config.yaml b/hsfs/python/.pre-commit-config.yaml deleted file mode 100644 index 98e886d9d..000000000 --- a/hsfs/python/.pre-commit-config.yaml +++ /dev/null @@ -1,8 +0,0 @@ -exclude: setup.py -repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 - hooks: - - id: ruff - args: [--fix] - - id: ruff-format \ No newline at end of file diff --git a/hsfs/python/setup.py b/hsfs/python/setup.py deleted file mode 100644 index b024da80e..000000000 --- a/hsfs/python/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -from setuptools import setup - - -setup() diff --git a/hsml/python/.pre-commit-config.yaml b/hsml/python/.pre-commit-config.yaml deleted file mode 100644 index 645dcf677..000000000 --- a/hsml/python/.pre-commit-config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -exclude: setup.py -repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.2 - hooks: - # Run the linter - - id: ruff - args: [--fix] - # Run the formatter - - id: ruff-format diff --git a/hsml/python/setup.py b/hsml/python/setup.py deleted file mode 100644 index cb916d7e6..000000000 --- a/hsml/python/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2021 Logical Clocks AB -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from setuptools import setup - - -setup() diff --git a/python/.pre-commit-config.yaml b/python/.pre-commit-config.yaml index 8c774780d..50ff0bd9f 100644 --- a/python/.pre-commit-config.yaml +++ b/python/.pre-commit-config.yaml @@ -1,7 +1,7 @@ exclude: setup.py repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.2 + rev: v0.5.0 hooks: - id: ruff args: [--fix] From aec69be0f1fc7c236cb061b31cea4b9c2cb0ada0 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 09:32:21 +0200 Subject: [PATCH 4/9] Merge gitignore --- .gitignore | 8 +++ hsfs/.gitignore | 145 ------------------------------------------------ hsml/.gitignore | 130 ------------------------------------------- 3 files changed, 8 insertions(+), 275 deletions(-) delete mode 100644 hsfs/.gitignore delete mode 100644 hsml/.gitignore diff --git a/.gitignore b/.gitignore index 79f7be6ad..1581db87d 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,8 @@ coverage.xml .hypothesis/ .pytest_cache/ .ruff_cache/ +bigquery.json +metastore_db/ # Translations *.mo @@ -71,6 +73,9 @@ instance/ # Sphinx documentation docs/_build/ +# Mike Javadoc +docs/javadoc + # PyBuilder target/ @@ -131,3 +136,6 @@ docs/generated docs/CONTRIBUTING.md docs/index.md + +# Test artifacts +keyFile.json diff --git a/hsfs/.gitignore b/hsfs/.gitignore deleted file mode 100644 index a8b4c5683..000000000 --- a/hsfs/.gitignore +++ /dev/null @@ -1,145 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST -python/README.md -python/LICENSE - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ -.ruff_cache/ -bigquery.json -metastore_db/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# Mike Javadoc -docs/javadoc - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# Java -.idea -.vscode -*.iml -target/ - -# Mac -.DS_Store - -# mkdocs intemediate files -docs/generated - -# Test artifacts -keyFile.json - -# delombok dir -delombok - -# dev scripts dir -dev_scripts/ -dev_tools/ diff --git a/hsml/.gitignore b/hsml/.gitignore deleted file mode 100644 index 6e96d8144..000000000 --- a/hsml/.gitignore +++ /dev/null @@ -1,130 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST -python/README.md -python/LICENSE - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ -.ruff_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# Java -.idea -.vscode -*.iml -target/ - -# Mac -.DS_Store - -# mkdocs intemediate files -docs/generated From 349fed6c699882fe7fd8743c4fa5ff98c773cd3f Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 09:34:05 +0200 Subject: [PATCH 5/9] Move docker and jenkins files --- hsfs/Dockerfile => Dockerfile | 0 hsfs/Jenkinsfile | 23 ----------------------- hsml/Dockerfile | 9 --------- hsml/Jenkinsfile | 23 ----------------------- 4 files changed, 55 deletions(-) rename hsfs/Dockerfile => Dockerfile (100%) delete mode 100644 hsfs/Jenkinsfile delete mode 100644 hsml/Dockerfile delete mode 100644 hsml/Jenkinsfile diff --git a/hsfs/Dockerfile b/Dockerfile similarity index 100% rename from hsfs/Dockerfile rename to Dockerfile diff --git a/hsfs/Jenkinsfile b/hsfs/Jenkinsfile deleted file mode 100644 index d2014d5cb..000000000 --- a/hsfs/Jenkinsfile +++ /dev/null @@ -1,23 +0,0 @@ -pipeline { - agent { - docker { - label "local" - image "docker.hops.works/hopsworks_twine:0.0.1" - } - } - stages { - stage("publish") { - environment { - PYPI = credentials('977daeb0-e1c8-43a0-b35a-fc37bb9eee9b') - } - steps { - dir("python") { - sh "rm -f LICENSE README.md" - sh "cp -f ../LICENSE ../README.md ./" - sh "python3 -m build" - sh "twine upload -u $PYPI_USR -p $PYPI_PSW --skip-existing dist/*" - } - } - } - } -} diff --git a/hsml/Dockerfile b/hsml/Dockerfile deleted file mode 100644 index 7f87ca293..000000000 --- a/hsml/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM ubuntu:20.04 - -RUN apt-get update && \ - apt-get install -y python3-pip git && apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -RUN pip3 install twine - -RUN mkdir -p /.local && chmod -R 777 /.local diff --git a/hsml/Jenkinsfile b/hsml/Jenkinsfile deleted file mode 100644 index d2014d5cb..000000000 --- a/hsml/Jenkinsfile +++ /dev/null @@ -1,23 +0,0 @@ -pipeline { - agent { - docker { - label "local" - image "docker.hops.works/hopsworks_twine:0.0.1" - } - } - stages { - stage("publish") { - environment { - PYPI = credentials('977daeb0-e1c8-43a0-b35a-fc37bb9eee9b') - } - steps { - dir("python") { - sh "rm -f LICENSE README.md" - sh "cp -f ../LICENSE ../README.md ./" - sh "python3 -m build" - sh "twine upload -u $PYPI_USR -p $PYPI_PSW --skip-existing dist/*" - } - } - } - } -} From 86965708f49d4fa6121f8a1a4b0ace1a18899a64 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 09:44:36 +0200 Subject: [PATCH 6/9] Merge CONTRIBUTING --- CONTRIBUTING.md | 116 +++++++++++------------ hsfs/CONTRIBUTING.md | 220 ------------------------------------------- hsml/CONTRIBUTING.md | 215 ------------------------------------------ 3 files changed, 57 insertions(+), 494 deletions(-) delete mode 100644 hsfs/CONTRIBUTING.md delete mode 100644 hsml/CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 564734d53..e2801b11b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,16 +1,17 @@ ## Python development setup + --- - Fork and clone the repository -- Create a new Python environment with your favourite environment manager, e.g. virtualenv or conda +- 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`) - Install repository in editable mode with development dependencies: - ```bash - cd python - pip install -e ".[dev]" - ``` + ```bash + cd python + pip install -e ".[dev]" + ``` - 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: @@ -37,75 +38,67 @@ We follow a few best practices for writing the Python documentation: 1. Use the google docstring style: - ```python - """[One Line Summary] + ```python + """[One Line Summary] - [Extended Summary] + [Extended Summary] - [!!! example - import xyz - ] + [!!! example + import xyz + ] - # Arguments - arg1: Type[, optional]. Description[, defaults to `default`] - arg2: Type[, optional]. Description[, defaults to `default`] + # Arguments + arg1: Type[, optional]. Description[, defaults to `default`] + arg2: Type[, optional]. Description[, defaults to `default`] - # Returns - Type. Description. + # Returns + Type. Description. - # Raises - Exception. Description. - """ - ``` - - If Python 3 type annotations are used, they are inserted automatically. + # Raises + Exception. Description. + """ + ``` + If Python 3 type annotations are used, they are inserted automatically. 2. Hopsworks entity engine methods (e.g. ExecutionEngine etc.) only require a single line docstring. -3. Private REST Api implementations (e.g. GitRemoteApi etc.) should be fully documented with docstrings without defaults. -4. Public Api such as metadata objects and public REST Api implementations should be fully documented with defaults. +3. Private REST API implementations (e.g. FeatureGroupApi etc.) should be fully documented with docstrings without defaults. +4. Public API such as metadata objects and public REST API implementations should be fully documented with defaults. #### Setup and Build Documentation 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. **Background about `mike`:** - `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. +`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. -1. Currently we are using our own version of `keras-autodoc` +1. Install Hopsworks with `dev-docs` extras: - ```bash - pip install git+https://github.com/logicalclocks/keras-autodoc - ``` + ```bash + pip install -e ".[dev-docs]" + ``` -2. Install HOPSWORKS with `docs` extras: - - ```bash - pip install -e .[dev,docs] - ``` +2. To build the docs, first run the auto doc script: -3. To build the docs, first run the auto doc script: - - ```bash - cd .. - python auto_doc.py - ``` + ```bash + python auto_doc.py + ``` ##### Option 1: Build only current version of docs -4. Either build the docs, or serve them dynamically: +3. Either build the docs, or serve them dynamically: - Note: Links and pictures might not resolve properly later on when checking with this build. - The reason for that is that the docs are deployed with versioning on docs.hopsworks.ai and - therefore another level is added to all paths, e.g. `docs.hopsworks.ai/[version-or-alias]`. - Using relative links should not be affected by this, however, building the docs with version - (Option 2) is recommended. + Note: Links and pictures might not resolve properly later on when checking with this build. + The reason for that is that the docs are deployed with versioning on docs.hopsworks.ai and + therefore another level is added to all paths, e.g. `docs.hopsworks.ai/[version-or-alias]`. + Using relative links should not be affected by this, however, building the docs with version + (Option 2) is recommended. - ```bash - mkdocs build - # or - mkdocs serve - ``` + ```bash + mkdocs build + # or + mkdocs serve + ``` ##### Option 2 (Preferred): Build multi-version doc with `mike` @@ -113,34 +106,36 @@ We use `mkdocs` together with `mike` ([for versioning](https://github.com/jimpor On docs.hopsworks.ai we implement the following versioning scheme: -- 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. -- 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. -- previous stable releases: rendered without alias, e.g. **3.0.0**. +- 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. +- 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. +- previous stable releases: rendered without alias, e.g. **3.4.4**. ###### Build Instructions -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: +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: Building *one* branch: Checkout your dev branch with modified docs: + ```bash git checkout [dev-branch] ``` Generate API docs if necessary: + ```bash python auto_doc.py ``` Build docs with a version and alias + ```bash mike deploy [version] [alias] --update-alias # for example, if you are updating documentation to be merged to master, # which will become the new SNAPSHOT version: - mike deploy 3.1.0-SNAPSHOT dev --update-alias + mike deploy 4.0.0-SNAPSHOT dev --update-alias # if you are updating docs of the latest stable release branch mike deploy [version] latest --update-alias @@ -158,17 +153,20 @@ On docs.hopsworks.ai we implement the following versioning scheme: ``` You can now checkout the gh-pages branch and serve: + ```bash git checkout gh-pages mike serve ``` You can also list all available versions/aliases: + ```bash mike list ``` Delete and reset your local gh-pages branch: + ```bash mike delete --all @@ -194,7 +192,7 @@ PAGES = { 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: -``` +```` ## The XYZ package {{module}} @@ -207,7 +205,7 @@ Some extra content here. ``` {{xyz.asd}} -``` +```` Finally, run the `auto_doc.py` script, as decribed above, to update the documentation. diff --git a/hsfs/CONTRIBUTING.md b/hsfs/CONTRIBUTING.md deleted file mode 100644 index 0df3de08e..000000000 --- a/hsfs/CONTRIBUTING.md +++ /dev/null @@ -1,220 +0,0 @@ -## Python development setup - ---- - -- Fork and clone the repository - -- 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`) - -- Install repository in editable mode with development dependencies: - - ```bash - cd python - pip install -e ".[python,dev]" - ``` - -- 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 Feature Store 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: - - ```bash - cd python - pip install --user pre-commit - pre-commit install - ``` - - Afterwards, pre-commit will run whenever you commit. - -- To run formatting and code-style separately, you can configure your IDE, such as VSCode, to use `ruff`, or run it via the command line: - - ```bash - # linting - ruff check python --fix - # formatting - ruff format python - ``` - -### Python documentation - -We follow a few best practices for writing the Python documentation: - -1. Use the google docstring style: - - ```python - """[One Line Summary] - - [Extended Summary] - - [!!! example - import xyz - ] - - # Arguments - arg1: Type[, optional]. Description[, defaults to `default`] - arg2: Type[, optional]. Description[, defaults to `default`] - - # Returns - Type. Description. - - # Raises - Exception. Description. - """ - ``` - - If Python 3 type annotations are used, they are inserted automatically. - -2. Feature store entity engine methods (e.g. FeatureGroupEngine etc.) only require a single line docstring. -3. REST Api implementations (e.g. FeatureGroupApi etc.) should be fully documented with docstrings without defaults. -4. Public Api such as metadata objects should be fully documented with defaults. - -#### Setup and Build Documentation - -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. - -**Background about `mike`:** -`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. - -1. Currently we are using our own version of `keras-autodoc` - - ```bash - pip install git+https://github.com/logicalclocks/keras-autodoc - ``` - -2. Install HSFS with `docs` extras: - - ```bash - pip install -e ".[python,dev]" && pip install -r ../requirements-docs.txt - ``` - -3. To build the docs, first run the auto doc script: - - ```bash - cd .. - python auto_doc.py - ``` - -##### Option 1: Build only current version of docs - -4. Either build the docs, or serve them dynamically: - - Note: Links and pictures might not resolve properly later on when checking with this build. - The reason for that is that the docs are deployed with versioning on docs.hopsworks.ai and - therefore another level is added to all paths, e.g. `docs.hopsworks.ai/[version-or-alias]`. - Using relative links should not be affected by this, however, building the docs with version - (Option 2) is recommended. - - ```bash - mkdocs build - # or - mkdocs serve - ``` - -##### Option 2 (Preferred): Build multi-version doc with `mike` - -###### Versioning on docs.hopsworks.ai - -On docs.hopsworks.ai we implement the following versioning scheme: - -- current master branches (e.g. of hsfs corresponding to master of Hopsworks): rendered as current Hopsworks snapshot version, e.g. **2.2.0-SNAPSHOT [dev]**, where `dev` is an alias to indicate that this is an unstable version. -- the latest release: rendered with full current version, e.g. **2.1.5 [latest]** with `latest` alias to indicate that this is the latest stable release. -- previous stable releases: rendered without alias, e.g. **2.1.4**. - -###### Build Instructions - -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: - - Building _one_ branch: - - Checkout your dev branch with modified docs: - - ```bash - git checkout [dev-branch] - ``` - - Generate API docs if necessary: - - ```bash - python auto_doc.py - ``` - - Build docs with a version and alias - - ```bash - mike deploy [version] [alias] --update-alias - - # for example, if you are updating documentation to be merged to master, - # which will become the new SNAPSHOT version: - mike deploy 2.2.0-SNAPSHOT dev --update-alias - - # if you are updating docs of the latest stable release branch - mike deploy [version] latest --update-alias - - # if you are updating docs of a previous stable release branch - mike deploy [version] - ``` - - If no gh-pages branch existed in your local repository, this will have created it. - - **Important**: If no previous docs were built, you will have to choose a version as default to be loaded as index, as follows - - ```bash - mike set-default [version-or-alias] - ``` - - You can now checkout the gh-pages branch and serve: - - ```bash - git checkout gh-pages - mike serve - ``` - - You can also list all available versions/aliases: - - ```bash - mike list - ``` - - Delete and reset your local gh-pages branch: - - ```bash - mike delete --all - - # or delete single version - mike delete [version-or-alias] - ``` - -#### Adding new API documentation - -To add new documentation for APIs, you need to add information about the method/class to document to the `auto_doc.py` script: - -```python -PAGES = { - "connection.md": [ - "hsfs.connection.Connection.connection" - ] - "new_template.md": [ - "module", - "xyz.asd" - ] -} -``` - -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: - -```` -## The XYZ package - -{{module}} - -Some extra content here. - -!!! example - ```python - import xyz - ``` - -{{xyz.asd}} -```` - -Finally, run the `auto_doc.py` script, as decribed above, to update the documentation. - -For information about Markdown syntax and possible Admonitions/Highlighting etc. see -the [Material for Mkdocs themes reference documentation](https://squidfunk.github.io/mkdocs-material/reference/abbreviations/). diff --git a/hsml/CONTRIBUTING.md b/hsml/CONTRIBUTING.md deleted file mode 100644 index b287467c6..000000000 --- a/hsml/CONTRIBUTING.md +++ /dev/null @@ -1,215 +0,0 @@ -## Python development setup ---- - -- Fork and clone the repository - -- Create a new Python environment with your favourite environment manager, e.g. virtualenv or conda - -- Install repository in editable mode with development dependencies: - - ```bash - cd python - pip install -e ".[dev]" - ``` - -- 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 Model Registry 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: - - ```bash - cd python - pip install --user pre-commit - pre-commit install - ``` - - Afterwards, pre-commit will run whenever you commit. - -- To run formatting and code-style separately, you can configure your IDE, such as VSCode, to use [ruff](https://docs.astral.sh/ruff/tutorial/#getting-started): - - ```bash - cd python - ruff check --fix - ruff format - ``` - -### Python documentation - -We follow a few best practices for writing the Python documentation: - -1. Use the google docstring style: - - ```python - """[One Line Summary] - - [Extended Summary] - - [!!! example - import xyz - ] - - # Arguments - arg1: Type[, optional]. Description[, defaults to `default`] - arg2: Type[, optional]. Description[, defaults to `default`] - - # Returns - Type. Description. - - # Raises - Exception. Description. - """ - ``` - - If Python 3 type annotations are used, they are inserted automatically. - - -2. Model registry entity engine methods (e.g. ModelEngine etc.) only require a single line docstring. -3. REST Api implementations (e.g. ModelApi etc.) should be fully documented with docstrings without defaults. -4. Public Api such as metadata objects should be fully documented with defaults. - -#### Setup and Build Documentation - -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. - -**Background about `mike`:** - `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. - -1. Currently we are using our own version of `keras-autodoc` - - ```bash - pip install git+https://github.com/logicalclocks/keras-autodoc - ``` - -2. Install HSML with `docs` extras: - - ```bash - pip install -e .[dev,docs] - ``` - -3. To build the docs, first run the auto doc script: - - ```bash - cd .. - python auto_doc.py - ``` - -##### Option 1: Build only current version of docs - -4. Either build the docs, or serve them dynamically: - - Note: Links and pictures might not resolve properly later on when checking with this build. - The reason for that is that the docs are deployed with versioning on docs.hopsworks.ai and - therefore another level is added to all paths, e.g. `docs.hopsworks.ai/[version-or-alias]`. - Using relative links should not be affected by this, however, building the docs with version - (Option 2) is recommended. - - ```bash - mkdocs build - # or - mkdocs serve - ``` - -##### Option 2 (Preferred): Build multi-version doc with `mike` - -###### Versioning on docs.hopsworks.ai - -On docs.hopsworks.ai we implement the following versioning scheme: - -- current master branches (e.g. of hsml corresponding to master of Hopsworks): rendered as current Hopsworks snapshot version, e.g. **2.2.0-SNAPSHOT [dev]**, where `dev` is an alias to indicate that this is an unstable version. -- the latest release: rendered with full current version, e.g. **2.1.5 [latest]** with `latest` alias to indicate that this is the latest stable release. -- previous stable releases: rendered without alias, e.g. **2.1.4**. - -###### Build Instructions - -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: - - Building *one* branch: - - Checkout your dev branch with modified docs: - ```bash - git checkout [dev-branch] - ``` - - Generate API docs if necessary: - ```bash - python auto_doc.py - ``` - - Build docs with a version and alias - ```bash - mike deploy [version] [alias] --update-alias - - # for example, if you are updating documentation to be merged to master, - # which will become the new SNAPSHOT version: - mike deploy 2.2.0-SNAPSHOT dev --update-alias - - # if you are updating docs of the latest stable release branch - mike deploy [version] latest --update-alias - - # if you are updating docs of a previous stable release branch - mike deploy [version] - ``` - - If no gh-pages branch existed in your local repository, this will have created it. - - **Important**: If no previous docs were built, you will have to choose a version as default to be loaded as index, as follows - - ```bash - mike set-default [version-or-alias] - ``` - - You can now checkout the gh-pages branch and serve: - ```bash - git checkout gh-pages - mike serve - ``` - - You can also list all available versions/aliases: - ```bash - mike list - ``` - - Delete and reset your local gh-pages branch: - ```bash - mike delete --all - - # or delete single version - mike delete [version-or-alias] - ``` - -#### Adding new API documentation - -To add new documentation for APIs, you need to add information about the method/class to document to the `auto_doc.py` script: - -```python -PAGES = { - "connection.md": [ - "hsml.connection.Connection.connection", - "hsml.connection.Connection.setup_databricks", - ] - "new_template.md": [ - "module", - "xyz.asd" - ] -} -``` - -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: - -``` -## The XYZ package - -{{module}} - -Some extra content here. - -!!! example - ```python - import xyz - ``` - -{{xyz.asd}} -``` - -Finally, run the `auto_doc.py` script, as decribed above, to update the documentation. - -For information about Markdown syntax and possible Admonitions/Highlighting etc. see -the [Material for Mkdocs themes reference documentation](https://squidfunk.github.io/mkdocs-material/reference/abbreviations/). From 49afc8553d6920075d0d3bc789c42a2935f657cc Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Mon, 15 Jul 2024 10:03:31 +0200 Subject: [PATCH 7/9] Merge README and remove hsfs and hsml subdirectories --- README.md | 94 +++++++++++++++++++---- hsfs/LICENSE | 201 ------------------------------------------------- hsfs/README.md | 201 ------------------------------------------------- hsml/LICENSE | 201 ------------------------------------------------- hsml/README.md | 141 ---------------------------------- 5 files changed, 79 insertions(+), 759 deletions(-) delete mode 100644 hsfs/LICENSE delete mode 100644 hsfs/README.md delete mode 100644 hsml/LICENSE delete mode 100644 hsml/README.md diff --git a/README.md b/README.md index 162c95f97..e523c059d 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ src="https://img.shields.io/pypi/v/hopsworks?color=blue" alt="PyPiStatus" /> + Scala/Java Artifacts Downloads *hopsworks* is the python API for interacting with a Hopsworks cluster. Don't have a Hopsworks cluster just yet? Register an account on [Hopsworks Serverless](https://app.hopsworks.ai/) and get started for free. Once connected to your project, you can: - - Insert dataframes into the online or offline Store, create training datasets or *serve real-time* feature vectors in the Feature Store via the [Feature Store API](https://github.com/logicalclocks/feature-store-api). Already have data somewhere you want to import, checkout our [Storage Connectors](https://docs.hopsworks.ai/latest/user_guides/fs/storage_connector/) documentation. - - register ML models in the model registry and *deploy* them via model serving via the [Machine Learning API](https://gitub.com/logicalclocks/machine-learning-api). - - manage environments, executions, kafka topics and more once you deploy your own Hopsworks cluster, either on-prem or in the cloud. Hopsworks is open-source and has its own [Community Edition](https://github.com/logicalclocks/hopsworks). + +- Insert dataframes into the online or offline Store, create training datasets or *serve real-time* feature vectors in the Feature Store via the Feature Store API. Already have data somewhere you want to import, checkout our [Storage Connectors](https://docs.hopsworks.ai/latest/user_guides/fs/storage_connector/) documentation. +- register ML models in the model registry and *deploy* them via model serving via the Machine Learning API. +- manage environments, executions, kafka topics and more once you deploy your own Hopsworks cluster, either on-prem or in the cloud. Hopsworks is open-source and has its own [Community Edition](https://github.com/logicalclocks/hopsworks). Our [tutorials](https://github.com/logicalclocks/hopsworks-tutorials) cover a wide range of use cases and example of what *you* can build using Hopsworks. @@ -43,16 +48,19 @@ Our [tutorials](https://github.com/logicalclocks/hopsworks-tutorials) cover a wi Once you created a project on [Hopsworks Serverless](https://app.hopsworks.ai) and created a new [Api Key](https://docs.hopsworks.ai/latest/user_guides/projects/api_key/create_api_key/), just use your favourite virtualenv and package manager to install the library: ```bash -pip install hopsworks +pip install "hopsworks[python]" ``` Fire up a notebook and connect to your project, you will be prompted to enter your newly created API key: + ```python import hopsworks project = hopsworks.login() ``` +### Feature Store API + Access the Feature Store of your project to use as a central repository for your feature data. Use *your* favourite data engineering library (pandas, polars, Spark, etc...) to insert data into the Feature Store, create training datasets or serve real-time feature vectors. Want to predict likelyhood of e-scooter accidents in real-time? Here's how you can do it: ```python @@ -60,9 +68,9 @@ fs = project.get_feature_store() # Write to Feature Groups bike_ride_fg = fs.get_or_create_feature_group( - name="bike_rides", - version=1, - primary_key=["ride_id"], + name="bike_rides", + version=1, + primary_key=["ride_id"], event_time="activation_time", online_enabled=True, ) @@ -73,13 +81,13 @@ fg.insert(bike_rides_df) profile_fg = fs.get_feature_group("user_profile", version=1) bike_ride_fv = fs.get_or_create_feature_view( - name="bike_rides_view", - version=1, + name="bike_rides_view", + version=1, query=bike_ride_fg.select_except(["ride_id"]).join(profile_fg.select(["age", "has_license"]), on="user_id") ) bike_rides_Q1_2021_df = bike_ride_fv.get_batch_data( - start_date="2021-01-01", + start_date="2021-01-01", end_date="2021-01-31" ) @@ -97,22 +105,68 @@ bike_ride_fv.init_serving() while True: new_ride_vector = poll_ride_queue() feature_vector = bike_ride_fv.get_online_feature_vector( - {"user_id": new_ride_vector["user_id"]}, + {"user_id": new_ride_vector["user_id"]}, passed_features=new_ride_vector ) accident_probability = model.predict(feature_vector) ``` -Or you can use the Machine Learning API to register models and deploy them for serving: +The API enables interaction with the Hopsworks Feature Store. It makes creating new features, feature groups and training datasets easy. + +The API is environment independent and can be used in two modes: + +- Spark mode: For data engineering jobs that create and write features into the feature store or generate training datasets. It requires a Spark environment such as the one provided in the Hopsworks platform or Databricks. In Spark mode, HSFS provides bindings both for Python and JVM languages. + +- Python mode: For data science jobs to explore the features available in the feature store, generate training datasets and feed them in a training pipeline. Python mode requires just a Python interpreter and can be used both in Hopsworks from Python Jobs/Jupyter Kernels, Amazon SageMaker or KubeFlow. + +Scala API is also available, here is a short sample of it: + +```scala +import com.logicalclocks.hsfs._ +val connection = HopsworksConnection.builder().build() +val fs = connection.getFeatureStore(); +val attendances_features_fg = fs.getFeatureGroup("games_features", 1); +attendances_features_fg.show(1) +``` + +### Machine Learning API + +Or you can use the Machine Learning API to interact with the Hopsworks Model Registry and Model Serving. The API makes it easy to export, manage and deploy models. For example, to register models and deploy them for serving you can do: + ```python mr = project.get_model_registry() # or -ms = project.get_model_serving() +ms = connection.get_model_serving() + +# Create a new model: +model = mr.tensorflow.create_model(name="mnist", + version=1, + metrics={"accuracy": 0.94}, + description="mnist model description") +model.save("/tmp/model_directory") # or /tmp/model_file + +# Download a model: +model = mr.get_model("mnist", version=1) +model_path = model.download() + +# Delete the model: +model.delete() + +# Get the best-performing model +best_model = mr.get_best_model('mnist', 'accuracy', 'max') + +# Deploy the model: +deployment = model.deploy() +deployment.start() + +# Make predictions with a deployed model +data = { "instances": [ model.input_example ] } +predictions = deployment.predict(data) ``` ## Tutorials -Need more inspiration or want to learn more about the Hopsworks platform? Check out our [tutorials](https://github.com/logicalclocks/hopsworks-tutorials). +Need more inspiration or want to learn more about the Hopsworks platform? Check out our [tutorials](https://github.com/logicalclocks/hopsworks-tutorials). ## Documentation @@ -124,7 +178,17 @@ For general questions about the usage of Hopsworks and the Feature Store please Please report any issue using [Github issue tracking](https://github.com/logicalclocks/hopsworks-api/issues). +### Related to Feautre Store API + +Please attach the client environment from the output below to your issue, if it is related to Feature Store API: + +```python +import hopsworks +import hsfs +hopsworks.login().get_feature_store() +print(hsfs.get_env()) +``` + ## Contributing If you would like to contribute to this library, please see the [Contribution Guidelines](CONTRIBUTING.md). - diff --git a/hsfs/LICENSE b/hsfs/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/hsfs/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/hsfs/README.md b/hsfs/README.md deleted file mode 100644 index a13ea2ce5..000000000 --- a/hsfs/README.md +++ /dev/null @@ -1,201 +0,0 @@ -# Hopsworks Feature Store - -

- Hopsworks Community - Hopsworks Feature Store Documentation - python - PyPiStatus - Scala/Java Artifacts - Downloads - Ruff - License -

- -HSFS is the library to interact with the Hopsworks Feature Store. The library makes creating new features, feature groups and training datasets easy. - -The library is environment independent and can be used in two modes: - -- Spark mode: For data engineering jobs that create and write features into the feature store or generate training datasets. It requires a Spark environment such as the one provided in the Hopsworks platform or Databricks. In Spark mode, HSFS provides bindings both for Python and JVM languages. - -- Python mode: For data science jobs to explore the features available in the feature store, generate training datasets and feed them in a training pipeline. Python mode requires just a Python interpreter and can be used both in Hopsworks from Python Jobs/Jupyter Kernels, Amazon SageMaker or KubeFlow. - -The library automatically configures itself based on the environment it is run. -However, to connect from an external environment such as Databricks or AWS Sagemaker, -additional connection information, such as host and port, is required. For more information checkout the [Hopsworks documentation](https://docs.hopsworks.ai/latest/). - -## Getting Started On Hopsworks - -Get started easily by registering an account on [Hopsworks Serverless](https://app.hopsworks.ai/). Create your project and a [new Api key](https://docs.hopsworks.ai/latest/user_guides/projects/api_key/create_api_key/). In a new python environment with Python 3.8 or higher, install the [client library](https://docs.hopsworks.ai/latest/user_guides/client_installation/) using pip: - -```bash -# Get all Hopsworks SDKs: Feature Store, Model Serving and Platform SDK -pip install hopsworks -# or minimum install with the Feature Store SDK -pip install hsfs[python] -# if using zsh don't forget the quotes -pip install 'hsfs[python]' -``` - -You can start a notebook and instantiate a connection and get the project feature store handler. - -```python -import hopsworks - -project = hopsworks.login() # you will be prompted for your api key -fs = project.get_feature_store() -``` - -or using `hsfs` directly: - -```python -import hsfs - -connection = hsfs.connection( - host="c.app.hopsworks.ai", # - project="your-project", - api_key_value="your-api-key", -) -fs = connection.get_feature_store() -``` - -Create a new feature group to start inserting feature values. -```python -fg = fs.create_feature_group("rain", - version=1, - description="Rain features", - primary_key=['date', 'location_id'], - online_enabled=True) - -fg.save(dataframe) -``` - -Upsert new data in to the feature group with `time_travel_format="HUDI"`". -```python -fg.insert(upsert_df) -``` - -Retrieve commit timeline metdata of the feature group with `time_travel_format="HUDI"`". -```python -fg.commit_details() -``` - -"Reading feature group as of specific point in time". -```python -fg = fs.get_feature_group("rain", 1) -fg.read("2020-10-20 07:34:11").show() -``` - -Read updates that occurred between specified points in time. -```python -fg = fs.get_feature_group("rain", 1) -fg.read_changes("2020-10-20 07:31:38", "2020-10-20 07:34:11").show() -``` - -Join features together -```python -feature_join = rain_fg.select_all() - .join(temperature_fg.select_all(), on=["date", "location_id"]) - .join(location_fg.select_all()) -feature_join.show(5) -``` - -join feature groups that correspond to specific point in time -```python -feature_join = rain_fg.select_all() - .join(temperature_fg.select_all(), on=["date", "location_id"]) - .join(location_fg.select_all()) - .as_of("2020-10-31") -feature_join.show(5) -``` - -join feature groups that correspond to different time -```python -rain_fg_q = rain_fg.select_all().as_of("2020-10-20 07:41:43") -temperature_fg_q = temperature_fg.select_all().as_of("2020-10-20 07:32:33") -location_fg_q = location_fg.select_all().as_of("2020-10-20 07:33:08") -joined_features_q = rain_fg_q.join(temperature_fg_q).join(location_fg_q) -``` - -Use the query object to create a training dataset: -```python -td = fs.create_training_dataset("rain_dataset", - version=1, - data_format="tfrecords", - description="A test training dataset saved in TfRecords format", - splits={'train': 0.7, 'test': 0.2, 'validate': 0.1}) - -td.save(feature_join) -``` - -A short introduction to the Scala API: -```scala -import com.logicalclocks.hsfs._ -val connection = HopsworksConnection.builder().build() -val fs = connection.getFeatureStore(); -val attendances_features_fg = fs.getFeatureGroup("games_features", 1); -attendances_features_fg.show(1) -``` - -You can find more examples on how to use the library in our [hops-examples](https://github.com/logicalclocks/hops-examples) repository. - -## Usage - -Usage data is collected for improving quality of the library. It is turned on by default if the backend -is "c.app.hopsworks.ai". To turn it off, use one of the following way: -```python -# use environment variable -import os -os.environ["ENABLE_HOPSWORKS_USAGE"] = "false" - -# use `disable_usage_logging` -import hsfs -hsfs.disable_usage_logging() -``` - -The source code can be found in python/hsfs/usage.py. - -## Documentation - -Documentation is available at [Hopsworks Feature Store Documentation](https://docs.hopsworks.ai/). - -## Issues - -For general questions about the usage of Hopsworks and the Feature Store please open a topic on [Hopsworks Community](https://community.hopsworks.ai/). - -Please report any issue using [Github issue tracking](https://github.com/logicalclocks/feature-store-api/issues). - -Please attach the client environment from the output below in the issue: -```python -import hopsworks -import hsfs -hopsworks.login().get_feature_store() -print(hsfs.get_env()) -``` - -## Contributing - -If you would like to contribute to this library, please see the [Contribution Guidelines](CONTRIBUTING.md). diff --git a/hsml/LICENSE b/hsml/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/hsml/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/hsml/README.md b/hsml/README.md deleted file mode 100644 index ee835ddc7..000000000 --- a/hsml/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Hopsworks Model Management - -

- Hopsworks Community - Hopsworks Model Management Documentation - python - PyPiStatus - Scala/Java Artifacts - Downloads - Ruff - License -

- -HSML is the library to interact with the Hopsworks Model Registry and Model Serving. The library makes it easy to export, manage and deploy models. - -However, to connect from an external Python environment additional connection information, such as host and port, is required. - -## Getting Started On Hopsworks - -Get started easily by registering an account on [Hopsworks Serverless](https://app.hopsworks.ai/). Create your project and a [new Api key](https://docs.hopsworks.ai/latest/user_guides/projects/api_key/create_api_key/). In a new python environment with Python 3.8 or higher, install the [client library](https://docs.hopsworks.ai/latest/user_guides/client_installation/) using pip: - -```bash -# Get all Hopsworks SDKs: Feature Store, Model Serving and Platform SDK -pip install hopsworks -# or just the Model Registry and Model Serving SDK -pip install hsml -``` - -You can start a notebook and instantiate a connection and get the project feature store handler. - -```python -import hopsworks - -project = hopsworks.login() # you will be prompted for your api key - -mr = project.get_model_registry() -# or -ms = project.get_model_serving() -``` - -or using `hsml` directly: - -```python -import hsml - -connection = hsml.connection( - host="c.app.hopsworks.ai", # - project="your-project", - api_key_value="your-api-key", -) - -mr = connection.get_model_registry() -# or -ms = connection.get_model_serving() -``` - -Create a new model -```python -model = mr.tensorflow.create_model(name="mnist", - version=1, - metrics={"accuracy": 0.94}, - description="mnist model description") -model.save("/tmp/model_directory") # or /tmp/model_file -``` - -Download a model -```python -model = mr.get_model("mnist", version=1) - -model_path = model.download() -``` - -Delete a model -```python -model.delete() -``` - -Get best performing model -```python -best_model = mr.get_best_model('mnist', 'accuracy', 'max') - -``` - -Deploy a model -```python -deployment = model.deploy() -``` - -Start a deployment -```python -deployment.start() -``` - -Make predictions with a deployed model -```python -data = { "instances": [ model.input_example ] } - -predictions = deployment.predict(data) -``` - -# Tutorials - -You can find more examples on how to use the library in our [tutorials](https://github.com/logicalclocks/hopsworks-tutorials). - -## Documentation - -Documentation is available at [Hopsworks Model Management Documentation](https://docs.hopsworks.ai/). - -## Issues - -For general questions about the usage of Hopsworks Machine Learning please open a topic on [Hopsworks Community](https://community.hopsworks.ai/). -Please report any issue using [Github issue tracking](https://github.com/logicalclocks/machine-learning-api/issues). - - -## Contributing - -If you would like to contribute to this library, please see the [Contribution Guidelines](CONTRIBUTING.md). From 6ffa4c03416dda6c620ae3be732a38f495f9e4d7 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 16 Jul 2024 11:11:26 +0200 Subject: [PATCH 8/9] Revert the move of requirements-docs to an extra See PR #209 --- .github/workflows/mkdocs-main.yml | 2 +- .github/workflows/mkdocs-release.yml | 2 +- python/pyproject.toml | 15 +-------------- requirements-docs.txt | 11 +++++++++++ 4 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 requirements-docs.txt diff --git a/.github/workflows/mkdocs-main.yml b/.github/workflows/mkdocs-main.yml index 9294fef53..e8e14b4ea 100644 --- a/.github/workflows/mkdocs-main.yml +++ b/.github/workflows/mkdocs-main.yml @@ -21,7 +21,7 @@ jobs: - name: install deps working-directory: ./python - run: cp ../README.md . && pip3 install -e .[dev] + run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev] - name: generate autodoc run: python3 ./python/auto_doc.py diff --git a/.github/workflows/mkdocs-release.yml b/.github/workflows/mkdocs-release.yml index 80a325760..f1c6bb814 100644 --- a/.github/workflows/mkdocs-release.yml +++ b/.github/workflows/mkdocs-release.yml @@ -26,7 +26,7 @@ jobs: - name: install deps working-directory: ./python - run: cp ../README.md . && pip3 install -e .[dev] + run: cp ../README.md . && pip3 install -r ../requirements-docs.txt && pip3 install -e .[dev] - name: generate autodoc run: python3 ./python/auto_doc.py diff --git a/python/pyproject.toml b/python/pyproject.toml index bfe782997..9452f5061 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -86,20 +86,7 @@ dev-pandas1 = [ "pandas<=1.5.3", "sqlalchemy<=1.4.48", ] -dev-docs = [ - "mkdocs==1.5.3", - "mkdocs-material==9.5.17", - "mike==2.0.0", - "sphinx==7.3.7", - "keras_autodoc @ git+https://git@github.com/logicalclocks/keras-autodoc", - "markdown-include==0.8.1", - "mkdocs-jupyter==0.24.3", - "markdown==3.6", - "pymdown-extensions==10.7.1", - "mkdocs-macros-plugin==1.0.4", - "mkdocs-minify-plugin>=0.2.0", -] -dev = ["hopsworks[dev-no-opt,great-expectations,dev-docs]"] +dev = ["hopsworks[dev-no-opt,great-expectations]"] [build-system] requires = ["setuptools", "wheel"] diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 000000000..8bc8d6230 --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1,11 @@ +mkdocs==1.5.3 +mkdocs-material==9.5.17 +mike==2.0.0 +sphinx==7.3.7 +keras_autodoc @ git+https://git@github.com/logicalclocks/keras-autodoc +markdown-include==0.8.1 +mkdocs-jupyter==0.24.3 +markdown==3.6 +pymdown-extensions==10.7.1 +mkdocs-macros-plugin==1.0.4 +mkdocs-minify-plugin>=0.2.0 From 6c8e8f4ed61fa880fd48ca26be5612d5c28e7920 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Tue, 16 Jul 2024 15:53:49 +0200 Subject: [PATCH 9/9] Add hopsworks_common --- python/hopsworks_common/__init__.py | 15 +++++++++++++++ python/pyproject.toml | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 python/hopsworks_common/__init__.py diff --git a/python/hopsworks_common/__init__.py b/python/hopsworks_common/__init__.py new file mode 100644 index 000000000..ff8055b9b --- /dev/null +++ b/python/hopsworks_common/__init__.py @@ -0,0 +1,15 @@ +# +# Copyright 2024 Hopsworks AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/python/pyproject.toml b/python/pyproject.toml index 9452f5061..e3970c466 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -94,7 +94,7 @@ build-backend = "setuptools.build_meta" [tool.setuptools.packages.find] exclude = ["tests*"] -include = ["../README.md", "../LICENSE", "hopsworks*", "hsfs*", "hsml*"] +include = ["../README.md", "../LICENSE", "hopsworks*", "hsfs*", "hsml*", "hopsworks_common*"] [tool.setuptools.dynamic] version = { attr = "hopsworks.version.__version__" } @@ -166,7 +166,7 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" [tool.ruff.lint.isort] lines-after-imports = 2 -known-third-party = ["hopsworks", "hsfs", "hsml"] +known-third-party = ["hopsworks", "hsfs", "hsml", "hopsworks_common"] [tool.ruff.format]