Skip to content

Commit

Permalink
Add automation test for featurestore cli notebooks (#2668)
Browse files Browse the repository at this point in the history
* Add automation test for featurestore cli notebooks

* Sample updates for AML Spark managed VNet GA. (#2656)

* Sample updates for AML Spark managed VNet GA.

* Updated notebook title. Triggering build to test.

* Updated workspace name to include timestamp. Triggering build to test.

* Shortened VNet workspace name to meet validation.

* README.md clean-up and fixes for AML Spark samples.

* README.md clean-up and fixes for AML Spark samples.

* chore: Remove 'Send IcM on Failure' step from tutorial workflows (#2670)

* chore: Remove 'Send IcM on Failure' step that hasn't been in use for a while

* chore: Run tutorials/readme.py

* chore: Remove unused local 'generate-icm' action

* update cron schedules to avoid endpoint deletion from automated resource cleanup (#2672)

* change starting hour for workflow

* update cron for text mc mlflow

* use python 3.8.* (#2678)

* use python 3.8.18

* Update cleanup.yml

* update usepython v4

* Update workstation_env.yml (#2680)

* Examples for online inference for LLaVA (#2671)

* Rough version of ITT notebook.

* Working version of the notebook.

* Minor improvements.

* Rough version of the CLI demo.

* Reformat with black.

* Remove mode parameter in call to prepare_data.py.

* Make code cells easier to read.

* Minor readability improvement.

* Format with black.

* Minor fixes and reformatting.

* Reformat with black.

* Update workstation_env.yml (#2681)

delete extraneous space

* update vision FT examples corresponding to recent component update (#2650)

* updating changes with ME component

* updating MMOD as well

* update MMOD cli

* separate section for model evaluation component

* remove ds ort true for classification

* black check

* Remove v1 references (#2675)

* Remove v1 samples from v2 repo

* Remove v1 from table of contents

* Remove v1 test files

* Remove v1 test files

* Remove v1 folder from README

* Remove v1 folder

* Remove v1 tests

* Delete v1 files

* Restore custom-container directory

* Restore custom-container/triton directory

---------

Co-authored-by: Yogi Pandey <20666257+ynpandey@users.noreply.github.com>
Co-authored-by: kdestin <101366538+kdestin@users.noreply.github.com>
Co-authored-by: Rehaan Bhimani <rbhimani@microsoft.com>
Co-authored-by: Ada <61294872+adrosa@users.noreply.github.com>
Co-authored-by: Sheri Gilley <sgilley@microsoft.com>
Co-authored-by: rdondera-microsoft <98922913+rdondera-microsoft@users.noreply.github.com>
Co-authored-by: shubhamiit <41925087+shubhamiit@users.noreply.github.com>
Co-authored-by: Diondra <16376603+diondrapeck@users.noreply.github.com>
  • Loading branch information
9 people committed Sep 27, 2023
1 parent 868c8d8 commit 55dffe9
Show file tree
Hide file tree
Showing 9 changed files with 412 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This code is autogenerated.
# Code is generated by running custom script: python3 readme.py
# Any manual changes to this file may cause incorrect behavior.
# Any manual changes will be overwritten if the code is regenerated.

name: sdk-featurestore_sample-test_featurestore_cli_samples
# This file is created by sdk/python/readme.py.
# Please do not edit directly.
on:
workflow_dispatch:
schedule:
- cron: "56 10/12 * * *"
pull_request:
branches:
- main
paths:
- sdk/python/featurestore_sample/**
- .github/workflows/sdk-featurestore_sample-test_featurestore_cli_samples.yml
- sdk/python/dev-requirements.txt
- infra/bootstrapping/**
- sdk/python/setup.sh
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: check out repo
uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: pip install notebook reqs
run: pip install -r sdk/python/dev-requirements.txt
- name: azure login
uses: azure/login@v1
with:
creds: ${{secrets.AZUREML_CREDENTIALS}}
- name: bootstrap resources
run: |
echo '${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}';
bash bootstrap.sh
working-directory: infra/bootstrapping
continue-on-error: false
- name: setup SDK
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash setup.sh
working-directory: sdk/python
continue-on-error: true
- name: setup-cli
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash setup.sh
working-directory: cli
continue-on-error: true
- name: setup feature-store resources
run: |
bash -x setup-resources-cli.sh test_featurestore_cli_samples.ipynb
working-directory: sdk/python/featurestore_sample
continue-on-error: true
- name: run featurestore_sample/test_featurestore_cli_samples.ipynb
run: |
source "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh";
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh" generate_workspace_config "../../.azureml/config.json";
bash "${{ github.workspace }}/infra/bootstrapping/sdk_helpers.sh" replace_template_values "test_featurestore_cli_samples.ipynb";
[ -f "../../.azureml/config" ] && cat "../../.azureml/config";
papermill -k python test_featurestore_cli_samples.ipynb test_featurestore_cli_samples.output.ipynb
working-directory: sdk/python/featurestore_sample
- name: upload notebook's working folder as an artifact
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test_featurestore_cli_samples
path: sdk/python/featurestore_sample
33 changes: 33 additions & 0 deletions sdk/python/featurestore_sample/featurestore_cli_job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from pyspark.sql import SparkSession

spark = SparkSession.builder.appName("AccessData").getOrCreate()

import os

for path, subdirs, files in os.walk("./"):
for name in files:
print(os.path.join(path, name))

print("=======Test CLI Notebook 1============")
with open(
"notebooks/sdk_and_cli/1. Develop a feature set and register with managed feature store.py"
) as f:
exec(f.read())

print("=======Test CLI Notebook 2============")
with open(
"notebooks/sdk_and_cli/2. Enable materialization and backfill feature data.py"
) as f:
exec(f.read())

print("=======Test CLI Notebook 3============")
with open(
"notebooks/sdk_and_cli/3. Experiment and train models using features.py"
) as f:
exec(f.read())

print("=======Test CLI Notebook 4============")
with open(
"notebooks/sdk_and_cli/4. Enable recurrent materialization and run batch inference.py"
) as f:
exec(f.read())
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
"\n",
"# Please update your alias belpw (or any custom directory you uploaded the samples to).\n",
"# You can find the name from the directory structure in the left nav\n",
"root_dir = \"./Users/<your user alias>/featurestore_sample\"\n",
"root_dir = \"./Users/<your_user_alias>/featurestore_sample\"\n",
"\n",
"if os.path.isdir(root_dir):\n",
" print(\"The folder exists.\")\n",
Expand Down Expand Up @@ -258,7 +258,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand All @@ -282,7 +285,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -399,7 +405,7 @@
"# You can optionally replace them to create the resources in a different subsciprtion/resourceGroup, or use existing resources\n",
"import os\n",
"\n",
"featurestore_name = \"my-featurestore\"\n",
"featurestore_name = \"<FEATURESTORE_NAME>\"\n",
"featurestore_location = \"eastus\"\n",
"featurestore_subscription_id = os.environ[\"AZUREML_ARM_SUBSCRIPTION\"]\n",
"featurestore_resource_group_name = os.environ[\"AZUREML_ARM_RESOURCEGROUP\"]"
Expand Down Expand Up @@ -435,7 +441,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -726,7 +735,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -767,7 +779,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"\n",
"# please update the dir to ./Users/{your-alias} (or any custom directory you uploaded the samples to).\n",
"# You can find the name from the directory structure inm the left nav\n",
"root_dir = \"./Users/<your user alias>/featurestore_sample\"\n",
"root_dir = \"./Users/<your_user_alias>/featurestore_sample\"\n",
"\n",
"if os.path.isdir(root_dir):\n",
" print(\"The folder exists.\")\n",
Expand Down Expand Up @@ -199,7 +199,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand All @@ -223,7 +226,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand All @@ -247,7 +253,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -334,7 +343,7 @@
"outputs": [],
"source": [
"# use the same name from part #1 of the tutorial\n",
"featurestore_name = \"my-featurestore\"\n",
"featurestore_name = \"<FEATURESTORE_NAME>\"\n",
"# use the same location from part #1 of the tutorial\n",
"featurestore_location = \"eastus\"\n",
"# use the subscription of the project workspace by default\n",
Expand Down Expand Up @@ -461,10 +470,10 @@
"\n",
"storage_subscription_id = os.environ[\"AZUREML_ARM_SUBSCRIPTION\"]\n",
"storage_resource_group_name = os.environ[\"AZUREML_ARM_RESOURCEGROUP\"]\n",
"storage_account_name = \"fstorestorage\"\n",
"storage_account_name = \"<STORAGE_ACCOUNT_NAME>\"\n",
"# feature store location is used by default. You can change it.\n",
"storage_location = featurestore_location\n",
"storage_file_system_name = \"offlinestore\""
"storage_file_system_name = \"<STORAGE_FILE_SYSTEM_NAME>\""
]
},
{
Expand Down Expand Up @@ -496,7 +505,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand All @@ -520,7 +532,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -653,7 +668,7 @@
"# User assigned managed identity values. Optionally you may change the values.\n",
"uai_subscription_id = os.environ[\"AZUREML_ARM_SUBSCRIPTION\"]\n",
"uai_resource_group_name = os.environ[\"AZUREML_ARM_RESOURCEGROUP\"]\n",
"uai_name = \"fstoreuai\"\n",
"uai_name = \"<FEATURE_STORE_UAI_NAME>\"\n",
"# feature store location is used by default. You can change it.\n",
"uai_location = featurestore_location"
]
Expand Down Expand Up @@ -687,7 +702,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -724,7 +742,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -815,7 +836,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand All @@ -835,7 +859,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -876,7 +903,10 @@
"transient": {
"deleting": false
}
}
},
"tags": [
"active-ipynb"
]
},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit 55dffe9

Please sign in to comment.