Skip to content

Commit

Permalink
[FSTORE-985] Update GitHub Actions with TF tutorials (#199)
Browse files Browse the repository at this point in the history
* TF Tutorials

* All jobs into one workflow

* Update API Keys
  • Loading branch information
Maxxx-zh authored Aug 21, 2023
1 parent 7d37bc4 commit c958670
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 96 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/test-python-310.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/test-python-38.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/test-python-39.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/test_tutorials.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: test-tutorials-python

on:
workflow_dispatch:
push:
branches:
- 'master'

jobs:
test_tutorials38:
runs-on: ubuntu-latest
steps:
- name: Checkout repo content
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Execute Python workflows from bash script
env:
HOPSWORKS_API_KEY: ${{ secrets.HOPSWORKS_API_KEY_38 }}
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
run: ./scripts/test-notebooks.sh

test_tutorials39:
needs: test_tutorials38
runs-on: ubuntu-latest
steps:
- name: Checkout repo content
uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Execute Python workflows from bash script
env:
HOPSWORKS_API_KEY: ${{ secrets.HOPSWORKS_API_KEY_39 }}
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
run: ./scripts/test-notebooks.sh

test_tutorials310:
needs: test_tutorials39
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v3

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

- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: execute python workflows from bash script
env:
HOPSWORKS_API_KEY: ${{ secrets.HOPSWORKS_API_KEY_310 }}
WEATHER_API_KEY: ${{ secrets.WEATHER_API_KEY }}
run: ./scripts/test-notebooks.sh
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ jupyter
ipykernel
nbconvert
scikit-learn
gradio
plotly
Pillow
seaborn
xgboost
joblib==1.1.0
textblob
vaderSentiment
tweepy
tensorflow
torch
geopy
48 changes: 48 additions & 0 deletions scripts/cleanup-tutorials.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,54 @@
" except:\n",
" print(f\"Couldn't delete {fg} FG\")"
]
},
{
"cell_type": "markdown",
"id": "7fa8f537",
"metadata": {},
"source": [
"## Cleanup TF Tutorials"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0d9b676d",
"metadata": {},
"outputs": [],
"source": [
" \n",
"# Delete a model\n",
"models=[\"xgb_model\", \"keras_model\", \"torch_model\"]\n",
"for model in models:\n",
" try:\n",
" model = mr.get_model(f\"{model}\", version=1)\n",
" model.delete()\n",
" except:\n",
" print(f\"Couldn't delete {model} model\")\n",
"\n",
"# Delete the feature_views before the feature groups\n",
"\n",
"fvs=[\"serving_fv\"]\n",
"\n",
"for fv in fvs:\n",
" try:\n",
" feature_view = fs.get_feature_view(name=f\"{fv}\", version=1)\n",
" feature_view.delete()\n",
" except:\n",
" print(f\"Couldn't delete {fv} feature view\")\n",
"\n",
"fgs = [\n",
" \"feature_group_online\",\n",
" ]\n",
"\n",
"for fg in fgs:\n",
" try:\n",
" fg = fs.get_feature_group(name=f\"{fg}\", version=1)\n",
" fg.delete()\n",
" except:\n",
" print(f\"Couldn't delete {fg} FG\")"
]
}
],
"metadata": {
Expand Down
30 changes: 29 additions & 1 deletion scripts/test-notebooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,32 @@ jupyter nbconvert --to notebook --execute nyc_taxi_fares/3_nyc_taxi_fares_traini
jupyter nbconvert --to notebook --execute nyc_taxi_fares/4_nyc_taxi_fares_batch_inference.ipynb

# Remove any FGs, FVs, Models, Deployments
jupyter nbconvert --to notebook --execute ../scripts/cleanup-tutorials.ipynb
jupyter nbconvert --to notebook --execute ../scripts/cleanup-tutorials.ipynb

# Go to transformation_functions folder
cd transformation_functions

# Keras TF
jupyter nbconvert --to notebook --execute keras/keras_transformation_functions.ipynb

# Remove any FGs, FVs, Models, Deployments
jupyter nbconvert --to notebook --execute ../../scripts/cleanup-tutorials.ipynb

# PyTorch TF
jupyter nbconvert --to notebook --execute pytorch/pytorch_transformation_functions.ipynb

# Remove any FGs, FVs, Models, Deployments
jupyter nbconvert --to notebook --execute ../../scripts/cleanup-tutorials.ipynb

# Sklearn TF
jupyter nbconvert --to notebook --execute sklearn/sklearn_transformation_functions.ipynb

# Remove any FGs, FVs, Models, Deployments
jupyter nbconvert --to notebook --execute ../../scripts/cleanup-tutorials.ipynb

# Custom TF
python custom/transformations.py
jupyter nbconvert --to notebook --execute custom/custom_transformation_functions.ipynb

# Remove any FGs, FVs, Models, Deployments
jupyter nbconvert --to notebook --execute ../../scripts/cleanup-tutorials.ipynb

0 comments on commit c958670

Please sign in to comment.