Skip to content

Add action to test docs build and automate tutorials #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/mkdocs-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: mkdocs-release

on:
push:
branches: [ branch-* ]

jobs:
publish-release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Checkout hopsworks-tutorials
uses: actions/checkout@v3
with:
repository: logicalclocks/hopsworks-tutorials
path: docs/hopsworks-tutorials
fetch-depth: 0

- uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: install deps
run: pip3 install pip==22.0.3 && pip3 install 'git+https://github.com/logicalclocks/feature-store-api@master#egg=hsfs[docs]&subdirectory=python'

- name: copy tutorial images
run: python prepare_images.py

- name: setup git
run: |
git config --global user.name Mike
git config --global user.email [email protected]

# Put this back and increment version when cutting a new release branch
# - name: mike deploy docs
# run: mike deploy 3.0 latest -u --push
38 changes: 38 additions & 0 deletions .github/workflows/mkdocs-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: mkdocs-test

on: pull_request

jobs:
test-docs-build:
runs-on: ubuntu-latest

steps:
- name: Checkout main repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Checkout hopsworks-tutorials
uses: actions/checkout@v3
with:
repository: logicalclocks/hopsworks-tutorials
path: docs/hopsworks-tutorials
fetch-depth: 0

- uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: install deps
run: pip3 install pip==22.0.3 && pip3 install 'git+https://github.com/logicalclocks/feature-store-api@master#egg=hsfs[docs]&subdirectory=python'

- name: copy tutorial images
run: python prepare_images.py

- name: setup git
run: |
git config --global user.name Mike
git config --global user.email [email protected]

- name: mike deploy docs
run: mike deploy 3.1-SNAPSHOT dev -u
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ venv.bak/

# mkdocs documentation
site/
docs/hopsworks-tutorials/

# mypy
.mypy_cache/
Expand Down
Binary file removed docs/getting_started/images/01_featuregroups.png
Binary file not shown.
Binary file removed docs/getting_started/images/02_training-dataset.png
Binary file not shown.
Binary file removed docs/getting_started/images/03_model.png
Binary file not shown.
Binary file removed docs/getting_started/images/fg_overview.gif
Binary file not shown.
Binary file removed docs/getting_started/images/fg_statistics.gif
Binary file not shown.
Binary file removed docs/getting_started/images/fv_overview.gif
Binary file not shown.
Binary file removed docs/getting_started/images/icon102.png
Binary file not shown.
Binary file removed docs/getting_started/images/provenance.gif
Binary file not shown.
Binary file removed docs/getting_started/images/serving_endpoints.gif
Binary file not shown.
1,587 changes: 0 additions & 1,587 deletions docs/getting_started/quickstart.ipynb

This file was deleted.

935 changes: 0 additions & 935 deletions docs/tutorials/fraud_batch/1_feature_groups.ipynb

This file was deleted.

879 changes: 0 additions & 879 deletions docs/tutorials/fraud_batch/2_feature_view_creation.ipynb

This file was deleted.

631 changes: 0 additions & 631 deletions docs/tutorials/fraud_batch/3_model_training.ipynb

This file was deleted.

403 changes: 0 additions & 403 deletions docs/tutorials/fraud_online/1_feature_groups.ipynb

This file was deleted.

302 changes: 0 additions & 302 deletions docs/tutorials/fraud_online/2_feature_view_creation.ipynb

This file was deleted.

555 changes: 0 additions & 555 deletions docs/tutorials/fraud_online/3_model_training.ipynb

This file was deleted.

14 changes: 7 additions & 7 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ edit_uri: ""

nav:
- Home: index.md
- Getting Started: getting_started/quickstart.ipynb
- Getting Started: hopsworks-tutorials/quickstart.ipynb
- Tutorials:
- Fraud Batch:
- 1. Feature Groups: tutorials/fraud_batch/1_feature_groups.ipynb
- 2. Feature View: tutorials/fraud_batch/2_feature_view_creation.ipynb
- 3. Model Training: tutorials/fraud_batch/3_model_training.ipynb
- 1. Feature Groups: hopsworks-tutorials/fraud_batch/1_feature_groups.ipynb
- 2. Feature View: hopsworks-tutorials/fraud_batch/2_feature_view_creation.ipynb
- 3. Model Training: hopsworks-tutorials/fraud_batch/3_model_training.ipynb
- Fraud Online:
- 1. Feature Groups: tutorials/fraud_online/1_feature_groups.ipynb
- 2. Feature View: tutorials/fraud_online/2_feature_view_creation.ipynb
- 3. Model Training: tutorials/fraud_online/3_model_training.ipynb
- 1. Feature Groups: hopsworks-tutorials/fraud_online/1_feature_groups.ipynb
- 2. Feature View: hopsworks-tutorials/fraud_online/2_feature_view_creation.ipynb
- 3. Model Training: hopsworks-tutorials/fraud_online/3_model_training.ipynb
- Concepts:
- Hopsworks Platform: concepts/hopsworks.md
- Feature Store:
Expand Down
20 changes: 20 additions & 0 deletions prepare_images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import argparse
import shutil
import os

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--path', '-p', help="path to the hopsworks tutorials dir", type=str, default="docs/hopsworks-tutorials")
parser.add_argument('--src', '-s', help="name of directory with images to copy", type=str, default="images")

args = parser.parse_args()

except_dirs = [".git", args.src]

sub_dirs = [
element for element in os.listdir(args.path)
if os.path.isdir(os.path.join(args.path, element)) and element not in except_dirs
]

for dst in sub_dirs:
shutil.copytree(os.path.join(args.path, args.src), os.path.join(args.path, dst, args.src), dirs_exist_ok=True)