Skip to content
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

AzureML Tests Cleanup #1733

Merged
merged 10 commits into from
Jun 9, 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
22 changes: 12 additions & 10 deletions .github/workflows/azureml-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ on:
default: 'Anything to describe this manual run'

env:
CLUSTER_NAME: "nightly-cluster"
CPU_CLUSTER_NAME: "cpu-cluster"
GPU_CLUSTER_NAME: "gpu-cluster"
EXP_NAME: "nightly_tests"
RG: "pradjoshi-aml-rg"
WS: "pradjoshi-aml-ws"
RG: "recommenders_project_resources"
WS: "azureml-test-workspace"
TEST_LOGS_PATH: '"test_logs.log"'
PYTEST_EXIT_CODE: "pytest_exit_code.log"

jobs:
nightly-tests:
name: ${{ join(matrix.*, ', ') }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -56,7 +58,7 @@ jobs:
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{secrets.AML_TEST_CREDENTIALS}}
creds: ${{secrets.AZUREML_TEST_CREDENTIALS}}
- name: Install wheel package
run: pip install wheel
- name: Create wheel from setup.py
Expand All @@ -68,24 +70,24 @@ jobs:
- name: Submit CPU tests to AzureML
if: contains(matrix.test-group, 'cpu')
run: >-
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CLUSTER_NAME}}
--subid ${{secrets.AML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CPU_CLUSTER_NAME}}
--subid ${{secrets.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
--rg ${{env.RG}} --wsname ${{env.WS}} --expname ${{env.EXP_NAME}}_${{matrix.test-group}}
--testlogs ${{env.TEST_LOGS_PATH}} --testkind "nightly"
--conda_pkg_python ${{matrix.python-version}} --testgroup ${{matrix.test-group}}
- name: Submit GPU tests to AzureML
if: contains(matrix.test-group, 'gpu')
run: >-
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CLUSTER_NAME}}
--subid ${{secrets.AML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.GPU_CLUSTER_NAME}}
--subid ${{secrets.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
--rg ${{env.RG}} --wsname ${{env.WS}} --expname ${{env.EXP_NAME}}_${{matrix.test-group}}
--testlogs ${{env.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind "nightly"
--conda_pkg_python ${{matrix.python-version}} --testgroup ${{matrix.test-group}}
- name: Submit PySpark tests to AzureML
if: contains(matrix.test-group, 'spark')
run: >-
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CLUSTER_NAME}}
--subid ${{secrets.AML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CPU_CLUSTER_NAME}}
--subid ${{secrets.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
--rg ${{env.RG}} --wsname ${{env.WS}} --expname ${{env.EXP_NAME}}_${{matrix.test-group}}
--testlogs ${{env.TEST_LOGS_PATH}} --add_spark_dependencies --testkind "nightly"
--conda_pkg_python ${{matrix.python-version}} --testgroup ${{matrix.test-group}}
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/azureml-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
pull_request:
branches: [ staging, main ]

# push:
# # because we can't schedule runs for non-main branches,
# # to ensure we are running the build on the staging branch, we can add push policy for it
# branches: [pradjoshi/update_azureml_cluster]

# enable manual trigger
workflow_dispatch:
input:
Expand All @@ -17,15 +22,17 @@ on:
default: 'Anything to describe this manual run'

env:
CLUSTER_NAME: "nightly-cluster"
CPU_CLUSTER_NAME: "cpu-cluster"
GPU_CLUSTER_NAME: "gpu-cluster"
EXP_NAME: "unit_tests"
RG: "pradjoshi-aml-rg"
WS: "pradjoshi-aml-ws"
RG: "recommenders_project_resources"
WS: "azureml-test-workspace"
TEST_LOGS_PATH: '"test_logs.log"'
PYTEST_EXIT_CODE: "pytest_exit_code.log"

jobs:
unit-tests:
name: ${{ join(matrix.*, ', ') }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -43,7 +50,7 @@ jobs:
- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{secrets.AML_TEST_CREDENTIALS}}
creds: ${{secrets.AZUREML_TEST_CREDENTIALS}}
- name: Install wheel package
run: pip install wheel
- name: Create wheel from setup.py
Expand All @@ -55,24 +62,24 @@ jobs:
- name: Submit CPU tests to AzureML
if: contains(matrix.test-group, 'cpu')
run: >-
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CLUSTER_NAME}}
--subid ${{secrets.AML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CPU_CLUSTER_NAME}}
--subid ${{secrets.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
--rg ${{env.RG}} --wsname ${{env.WS}} --expname ${{env.EXP_NAME}}_${{matrix.test-group}}
--testlogs ${{env.TEST_LOGS_PATH}} --testkind "unit"
--conda_pkg_python ${{matrix.python-version}} --testgroup ${{matrix.test-group}}
- name: Submit GPU tests to AzureML
if: contains(matrix.test-group, 'gpu')
run: >-
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CLUSTER_NAME}}
--subid ${{secrets.AML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.GPU_CLUSTER_NAME}}
--subid ${{secrets.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
--rg ${{env.RG}} --wsname ${{env.WS}} --expname ${{env.EXP_NAME}}_${{matrix.test-group}}
--testlogs ${{env.TEST_LOGS_PATH}} --add_gpu_dependencies --testkind "unit"
--conda_pkg_python ${{matrix.python-version}} --testgroup ${{matrix.test-group}}
- name: Submit PySpark tests to AzureML
if: contains(matrix.test-group, 'spark')
run: >-
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CLUSTER_NAME}}
--subid ${{secrets.AML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
python tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py --clustername ${{env.CPU_CLUSTER_NAME}}
--subid ${{secrets.AZUREML_TEST_SUBID}} --reponame "recommenders" --branch ${{ steps.extract_branch.outputs.branch }}
--rg ${{env.RG}} --wsname ${{env.WS}} --expname ${{env.EXP_NAME}}_${{matrix.test-group}}
--testlogs ${{env.TEST_LOGS_PATH}} --add_spark_dependencies --testkind "unit"
--conda_pkg_python ${{matrix.python-version}} --testgroup ${{matrix.test-group}}
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ The following tests run on a Linux DSVM daily.
| **Windows Spark** | main | [![Build Status](https://dev.azure.com/best-practices/recommenders/_apis/build/status/windows-tests/dsvm_nightly_win_pyspark?branchName=main)](https://dev.azure.com/best-practices/recommenders/_build/latest?definitionId=103&branchName=main) | | staging | [![Build Status](https://dev.azure.com/best-practices/recommenders/_apis/build/status/windows-tests/dsvm_nightly_win_pyspark?branchName=staging)](https://dev.azure.com/best-practices/recommenders/_build/latest?definitionId=103&branchName=staging) |
-->

### AzureML Nightly Build Status

Smoke and integration tests are run daily on AzureML.

| Build Type | Branch | Status | | Branch | Status |
| --- | --- | --- | --- | --- | --- |
| **Nightly** | main | [![azureml-nightly](https://github.com/microsoft/recommenders/actions/workflows/azureml-nightly.yml/badge.svg?branch=main)](https://github.com/microsoft/recommenders/actions/workflows/azureml-nightly.yml?query=branch%3Amain) | | staging | [![azureml-nightly](https://github.com/microsoft/recommenders/actions/workflows/azureml-nightly.yml/badge.svg?branch=staging)](https://github.com/microsoft/recommenders/actions/workflows/azureml-nightly.yml?query=branch%3Astaging) |
miguelgfierro marked this conversation as resolved.
Show resolved Hide resolved

## Related projects

- [Microsoft AI Github](https://github.com/microsoft/ai): Find other Best Practice projects, and Azure AI design patterns in our central repository.
Expand Down
2 changes: 1 addition & 1 deletion tests/ci/azureml_tests/run_groupwise_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@
# logger.info("os.listdir files {}".format(os.listdir(".")))

# upload pytest stdout file
logs_path = glob.glob('**/70_driver_log.txt', recursive=True)[0]
logs_path = (glob.glob('**/70_driver_log.txt', recursive=True) + glob.glob('**/std_log.txt', recursive=True))[0]
run.upload_file(name='test_logs', path_or_stream=logs_path)
8 changes: 0 additions & 8 deletions tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,6 @@ def create_arg_parser():
parser.add_argument(
"--subid", action="store", default="123456", help="Azure Subscription ID"
)
# reco wheel is created in the GitHub action workflow.
# Not recommended to change this.
parser.add_argument(
"--wheelfile",
action="store",
default="./dist/recommenders-1.0.0-py3-none-any.whl",
help="recommenders whl file path",
)
# AzureML experiment name
parser.add_argument(
"--expname",
Expand Down