8000 Run regression tests on nightlies (PyPI CPU, GPU. & Conda CPU, GPU) by agunapal · Pull Request #2562 · pytorch/serve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Run regression tests on nightlies (PyPI CPU, GPU. & Conda CPU, GPU) #2562

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 51 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1bdc47a
added workflow for pypi
ankithagunapal Aug 31, 2023
5fb2bf0
added workflow for pypi
ankithagunapal Aug 31, 2023
5b7cee0
testing changes
ankithagunapal Aug 31, 2023
4308285
testing changes
ankithagunapal Aug 31, 2023
cab11ab
added workflow for pypi gpu
ankithagunapal Aug 31, 2023
a60a7f7
added workflow for pypi gpu
ankithagunapal Aug 31, 2023
9062b51
added workflow for conda cpuw!
ankithagunapal Aug 31, 2023
900dcfe
added workflow for conda cpu
ankithagunapal Aug 31, 2023
a0fbfeb
added workflow for conda cpu
ankithagunapal Aug 31, 2023
152f33f
Run workflow
ankithagunapal Aug 31, 2023
3ecb90e
uncomment tests
ankithagunapal Aug 31, 2023
461e8bc
testing workflow
ankithagunapal Aug 31, 2023
bca84a7
testing workflow
ankithagunapal Aug 31, 2023
737b7e6
testing gpu conda
ankithagunapal Sep 1, 2023
874310b
testing gpu conda
ankithagunapal Sep 1, 2023
0e4edf5
testing gpu conda
ankithagunapal Sep 1, 2023
ef2ec55
testing gpu conda
ankithagunapal Sep 1, 2023
2f2856b
testing gpu conda
ankithagunapal Sep 1, 2023
697c674
testing gpu conda
ankithagunapal Sep 1, 2023
9cc8d28
testing gpu conda
ankithagunapal Sep 1, 2023
6676eb5
testing gpu conda
ankithagunapal Sep 1, 2023
07d50bc
testing gpu conda
ankithagunapal Sep 1, 2023
1862968
testing gpu conda
ankithagunapal Sep 1, 2023
e2efe58
testing gpu conda
ankithagunapal Sep 1, 2023
0fb4e07
testing gpu conda
ankithagunapal Sep 1, 2023
76529ff
testing gpu conda
ankithagunapal Sep 1, 2023
30dfb9d
testing gpu conda
ankithagunapal Sep 1, 2023
1d7c273
testing gpu conda
ankithagunapal Sep 1, 2023
0550470
testing gpu conda
ankithagunapal Sep 1, 2023
a1cfc06
testing gpu conda
ankithagunapal Sep 1, 2023
9c9c3ff
testing gpu conda
ankithagunapal Sep 1, 2023
4dd64ae
testing gpu conda
ankithagunapal Sep 1, 2023
2efbc65
removing conda gpu workflow
ankithagunapal Sep 1, 2023
b64d45c
Merge branch 'master' into ci_regression_binaries
agunapal Sep 1, 2023
a420c7c
removing conda gpu workflow
ankithagunapal Sep 1, 2023
5a2eda9
Merge branch 'ci_regression_binaries' of https://github.com/agunapal/…
ankithagunapal Sep 1, 2023
01f5582
removing conda gpu workflow
agunapal Sep 1, 2023
11b8da5
removing conda gpu workflow
agunapal Sep 1, 2023
df5fb2b
Test cpu & gpu binaries
agunapal Sep 9, 2023
a08959b
Test cpu & gpu binaries
agunapal Sep 9, 2023
321c675
Test cpu & gpu binaries
agunapal Sep 9, 2023
ab88bd0
CPU works. testing GPU
agunapal Sep 9, 2023
5ec1765
CPU works. testing GPU
agunapal Sep 9, 2023
e393d86
testing gpu
agunapal Sep 9, 2023
bbdea10
testing gpu
agunapal Sep 9, 2023
e7e6b67
testing gpu
agunapal Sep 9, 2023
231a751
testing gpu
agunapal Sep 9, 2023
7bf0d57
testing gpu
agunapal Sep 9, 2023
f7811b7
Verified CPU and GPU runs
agunapal Sep 9, 2023
b0a9dbb
Merge branch 'master' into ci_regression_binaries
agunapal Sep 9, 2023
20ce65e
Merge branch 'master' into ci_regression_binaries
agunapal Sep 11, 2023
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
45 changes: 45 additions & 0 deletions .github/workflows/regression_tests_cpu_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Run Regression Tests for CPU nightly binaries

on:
# run every day at 6:15am
schedule:
- cron: '15 6 * * *'
merge_group:

concurrency:
group: ci-cpu-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true

jobs:
regression-cpu-nightly-binaries:
# creates workflows for OS: ubuntu, macOS
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-latest]
python-version: ["3.8", "3.9", "3.10"]
binaries: ["pypi", "conda"]
steps:
- uses: actions/checkout@v3
- name: Setup conda with Python ${{ matrix.python-version }}
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: anaconda, conda-forge
- run: conda --version
- run: python --version
- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Checkout TorchServe
uses: actions/checkout@v3
- name: Install dependencies
run: |
python ts_scripts/install_dependencies.py --environment=dev
- name: Torchserve Regression Tests
run: |
python test/regression_tests.py --binaries --${{ matrix.binaries }} --nightly
56 changes: 56 additions & 0 deletions .github/workflows/regression_tests_gpu_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run Regression Tests for GPU nightly binaries

on:
# run every day at 6:15am
schedule:
- cron: '15 6 * * *'
merge_group:

concurrency:
group: ci-cpu-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true

jobs:
regression-gpu-nightly-binaries:
# creates workflows for OS: ubuntu, macOS
runs-on: [self-hosted, regression-test-gpu]
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
binaries: ["pypi", "conda"]
steps:
- name: Clean up previous run
run: |
echo "Cleaning up previous run"
ls -la ./
sudo rm -rf ./* || true
sudo rm -rf ./.??* || true
ls -la ./
- name: Setup Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Checkout TorchServe
uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: Setup Conda
uses: s-weigand/setup-conda@v1
with:
python-version: ${{ matrix.python-version }}
- name: Setup Python ${{ matrix.python_version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: conda --version
- run: python --version
- name: Install dependencies
run: |
python ts_scripts/install_dependencies.py --environment=dev --cuda=cu118
- name: Torchserve Regression Tests
run: |
python test/regression_tests.py --binaries --${{ matrix.binaries }} --nightly
84 changes: 68 additions & 16 deletions test/regression_tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import os
import sys

Expand All @@ -11,26 +12,77 @@
from ts_scripts.api_utils import test_api
from ts_scripts.install_from_src import install_from_src
from ts_scripts.regression_utils import test_regression
from ts_scripts.utils import check_python_version
from ts_scripts.utils import check_python_version, try_and_handle

now = datetime.datetime.now()
print("Current date and time : " + now.strftime("%Y-%m-%d %H:%M:%S"))

check_python_version()
def regression_tests(binaries, pypi, conda, nightly):
now = datetime.datetime.now()
print("Current date and time : " + now.strftime("%Y-%m-%d %H:%M:%S"))

# Install from source
install_from_src()
check_python_version()

# Generate mar file
mg.generate_mars()
if binaries:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we not derive thats its binary if pypi or conda argument is given?

if pypi:
if nightly:
cmd = f"pip install torchserve-nightly torch-model-archiver-nightly torch-workflow-archiver-nightly"
else:
cmd = f"pip install torchserve torch-model-archiver torch-workflow-archiver"
elif conda:
if nightly:
cmd = f"conda install -c pytorch-nightly torchserve torch-model-archiver torch-workflow-archiver"
else:
cmd = f"conda install -c pytorch torchserve torch-model-archiver torch-workflow-archiver"
try_and_handle(cmd, False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any value in running the command with try_and_handle here? The only exception it handles, its handling by throwing it again, and we do not use dry_run here, so why not call the command directly?

print(f"## In directory: {os.getcwd()}; Executing command: {cmd}")
else:
# Install from source
install_from_src()

# Run newman api tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you plz elaborate on the needed changes for the newman tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure i follow. There is no change to the tests. I am only changing how we install torchserve

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git diff makes it seem like I have changed the tests

test_api(
"all"
) # "all" > management, inference, increased_timeout_inference, https collections
# Generate mar file
mg.generate_mars()

# Run regression tests
test_regression()
# Run newman api tests
test_api(
"all"
) # "all" > management, inference, increased_timeout_inference, https collections

# delete mar_gen_dir
mg.delete_model_store_gen_dir()
# Run regression tests
test_regression()

# delete mar_gen_dir
mg.delete_model_store_gen_dir()


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Regression tests for TorchServe")
parser.add_argument(
"--nightly",
action="store_true",
required=False,
help="Run regression tests using nightly binaries",
)

parser.add_argument(
"--binaries",
action="store_true",
required=False,
help="Run regression tests using binaries",
)

parser.add_argument(
"--pypi",
action="store_true",
required=False,
help="Run regression tests using pypi",
)

parser.add_argument(
"--conda",
action="store_true",
required=False,
help="Run regression tests using conda",
)

args = parser.parse_args()

regression_tests(args.binaries, args.pypi, args.conda, args.nightly)
0