Skip to content

Commit

Permalink
build: remove extra.bento-server dependency, add extra.tracing (#2036)
Browse files Browse the repository at this point in the history
* add extra[tracing], make prometheus required dependency

* remove legacy framework code

* move io test dir

* try fix ci pyright

* perf: enable running in Docker + maybe fix ONNXMLir problem

Signed-off-by: Aaron Pham <[email protected]>

* fix: attrs deps, remove cattrs

Signed-off-by: Aaron Pham <[email protected]>

Co-authored-by: Aaron Pham <[email protected]>
  • Loading branch information
parano and aarnphm authored Nov 21, 2021
1 parent 809632b commit ae32bf7
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 282 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Format check
run: make ci-format
run: USE_DOCKER=true make ci-format
- name: Lint check
# TODO: after fix all pylint errors under bentoml uses `make ci-lint` instead
run: make ci-flake8
# TODO: add `make ci-lint` after fixing all pylint errors.
run: USE_DOCKER=true make ci-flake8
- name: Type check
run: make ci-pyright
run: USE_DOCKER=true make ci-pyright

documentation_spelling_check:
defaults:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/docs-requirements.txt
- name: Install libenchant
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run unit tests
Expand All @@ -178,15 +178,14 @@ jobs:
- name: Run unit tests (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
pip install -U pydantic
pytest tests/unit --cov=bentoml --cov-config=setup.cfg --cov-report=xml:"unit.xml"
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v2
with:
name: codecov-${{ matrix.os }}-python${{ matrix.python-version }}
fail_ci_if_error: true
flags: bento-server
flags: unit-tests
directory: ./
files: ./unit.xml
verbose: true
Expand Down Expand Up @@ -246,7 +245,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand All @@ -255,7 +254,7 @@ jobs:
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v2
with:
flags: bento-server
flags: e2e-tests
directory: ./
files: ./tests/e2e/bento_server_general_features/general_features.xml
verbose: true
Expand Down
56 changes: 26 additions & 30 deletions .github/workflows/frameworks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -254,7 +254,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -359,7 +359,7 @@ jobs:
# - name: Install dependencies
# if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
# run: |
# pip install ".[bento-server]"
# pip install .
# pip install -r requirements/tests-requirements.txt
#
# - name: Run tests and generate coverage report
Expand Down Expand Up @@ -414,7 +414,7 @@ jobs:
# - name: Install dependencies
# if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
# run: |
# pip install ".[bento-server]"
# pip install .
# pip install -r requirements/tests-requirements.txt
#
# - name: Run tests and generate coverage report
Expand Down Expand Up @@ -469,7 +469,7 @@ jobs:
# - name: Install dependencies
# if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
# run: |
# pip install ".[bento-server]"
# pip install .
# pip install -r requirements/tests-requirements.txt
#
# - name: Run tests and generate coverage report
Expand Down Expand Up @@ -521,7 +521,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -571,7 +571,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -621,7 +621,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -671,7 +671,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -721,7 +721,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -771,7 +771,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -821,7 +821,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -851,14 +851,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all tags and branches
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Run tests and generate coverage report
run: |
python setup.py install
python setup.py develop
pip install -r requirements/tests-requirements.txt tensorflow==2.2.0 pandas tf2onnx
export PATH="/workdir/onnx-mlir/build/Debug/lib/:/workdir/onnx-mlir/build/Debug/bin/:${PATH}"
export PYTHONPATH="${PYTHONPATH}:/workdir/onnx-mlir/build/Debug/lib/"
Expand Down Expand Up @@ -907,7 +903,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -957,7 +953,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1012,7 +1008,7 @@ jobs:
# - name: Install dependencies
# if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
# run: |
# pip install ".[bento-server]"
# pip install .
# pip install -r requirements/tests-requirements.txt
#
# - name: Run tests and generate coverage report
Expand Down Expand Up @@ -1062,7 +1058,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1112,7 +1108,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Set up QEMU
Expand Down Expand Up @@ -1166,7 +1162,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1216,7 +1212,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1266,7 +1262,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1316,7 +1312,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1366,7 +1362,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1416,7 +1412,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down Expand Up @@ -1466,7 +1462,7 @@ jobs:
- name: Install dependencies
if: steps.cache-pip.outputs.cache-hit != 'true' || needs.diff.outputs.dependencies == 'true' || needs.diff.outputs.related == 'true'
run: |
pip install ".[bento-server]"
pip install .
pip install -r requirements/tests-requirements.txt
- name: Run tests and generate coverage report
Expand Down
12 changes: 2 additions & 10 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@ pip --version

Clone the source code from BentoML's GitHub repository:
```bash
git clone --recurse-submodules https://github.com/bentoml/BentoML.git && cd BentoML
git clone https://github.com/bentoml/BentoML.git && cd BentoML
```

Install BentoML with pip in `editable` mode:
```bash
pip install -e .
```

Additionally install `bento-server` dependencies with:
```bash
pip install -e ".[bento-server]"
```

This will make `bentoml` available on your system which links to the sources of
your local clone and pick up changes you made locally.

Expand Down Expand Up @@ -109,7 +104,7 @@ By default, each of our frameworks tests file with have the format: `test_<frame
|`root_test_dir`| `<str>`| root directory to run a given tests |
|`is_dir`| `<bool>`| whether `target` is a directory instead of a file |
|`override_name_or_path`| `<str>`| optional way to override a tests file name if doesn't match our convention |
|`dependencies`| `<List[str]>`| define required dependencies to run the tests, accepts `requirements.txt` format |
|`dependencies`| `<List[str]>`| define additional dependencies required to run the tests, accepts `requirements.txt` format |
|`external_scripts`| `<str>`| optional shell scripts that can be run on top of `./scripts/ci/run_tests.sh` for given testsuite |
|`type_tests`| `<Literal["e2e","unit","integration"]>`| define type of tests for given `target` |

Expand All @@ -126,9 +121,6 @@ general_features:
is_dir: true
type_tests: "e2e"
dependencies:
- "pandas"
- "pydantic"
- "scikit-learn"
- "Pillow"
# framework
Expand Down
Loading

0 comments on commit ae32bf7

Please sign in to comment.