Skip to content

Commit

Permalink
Sherif akoush/quickfix/improve docs (#180)
Browse files Browse the repository at this point in the history
Co-authored-by: Sherif Akoush <[email protected]>
  • Loading branch information
sakoush and sakoush authored Aug 5, 2021
1 parent 9e3028c commit 656a06d
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 40 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9' ]

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7.10
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make install-dev
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,12 @@ You can do so as:
$ pytest
```

### Additional system requirements for running the tests:

- `docker`
- `conda`: for example `Miniconda`, follow the steps described in this [link](https://docs.conda.io/projects/conda/en/latest/user-guide/).
- Models artifacts:
For first time, install `gsutil` and download the models from Seldon's Google Storage bucket:
```bash
$ make tests/testdata
```
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LABEL name="Seldon MLOPs Utils" \
vendor="Seldon Technologies" \
version="0.1" \
release="1" \
summary="Seldon MLOPs untils" \
summary="Seldon MLOPs Utils" \
description="Artifact handling utilities"

RUN pip install pip -U
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mypy==0.800

# Testing
pytest==6.2.0
pytest-cov==2.12.1
pytest-asyncio==0.14.0
pytest-cases==3.4.6
tox==3.22.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _load_description() -> str:
url="https://github.com/SeldonIO/tempo",
packages=find_packages(),
include_package_data=True,
python_requires=">=3.6",
python_requires=">=3.7",
setup_requires=["pytest-runner"],
install_requires=[
"grpcio>=1.32.0",
Expand Down
20 changes: 1 addition & 19 deletions tests/artifacts/pipeline/conda.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
channels:
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- ca-certificates=2021.1.19=h06a4308_1
- certifi=2020.12.5=py37h06a4308_0
- ld_impl_linux-64=2.33.1=h53a641e_7
- libffi=3.3=he6710b0_2
- libgcc-ng=9.1.0=hdf63c60_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- ncurses=6.2=he6710b0_1
- openssl=1.1.1k=h27cfd23_0
- pip=21.0.1=py37h06a4308_0
- python=3.7.10=hdb3f193_0
- readline=8.1=h27cfd23_0
- setuptools=52.0.0=py37h06a4308_0
- sqlite=3.35.3=hdfb4753_0
- tk=8.6.10=hbc83047_0
- wheel=0.36.2=pyhd3eb1b0_0
- xz=5.2.5=h7b6447c_0
- zlib=1.2.11=h7b6447c_3
- pip
name: mlops-test
prefix: /home/clive/anaconda3/envs/mlops-test
32 changes: 18 additions & 14 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
from pathlib import Path

import numpy as np
Expand Down Expand Up @@ -26,20 +27,23 @@ def pytest_collection_modifyitems(items):

@pytest.fixture
def pipeline_conda_yaml() -> str:
condaPath = PIPELINE_LOCAL_DIR + "/conda.yaml"
if not os.path.isfile(condaPath):
with open(PIPELINE_LOCAL_DIR + "/conda.yaml.tmpl") as f:
env = yaml.safe_load(f)
path = Path(TESTS_PATH)
parent = path.parent.absolute()
pip_deps = {"pip": []}
env["dependencies"].append(pip_deps)
for dep in MLServerEnvDeps:
pip_deps["pip"].append(dep)
pip_deps["pip"].append("mlops-tempo @ file://" + str(parent))
with open(condaPath, "w") as f2:
yaml.safe_dump(env, f2)
return condaPath
vi = sys.version_info
python_version = f"{vi.major}.{vi.minor}.{vi.micro}"
conda_path = PIPELINE_LOCAL_DIR + "/conda.yaml"
with open(PIPELINE_LOCAL_DIR + "/conda.yaml.tmpl") as f:
env = yaml.safe_load(f)
path = Path(TESTS_PATH)
parent = path.parent.absolute()
env["dependencies"].append(f"python={python_version}")
pip_deps = {"pip": []}
env["dependencies"].append(pip_deps)
for dep in MLServerEnvDeps:
pip_deps["pip"].append(dep)
pip_deps["pip"].append("mlops-tempo @ file://" + str(parent))
# pin the python version
with open(conda_path, "w") as f2:
yaml.safe_dump(env, f2)
return conda_path


@pytest.fixture
Expand Down
6 changes: 3 additions & 3 deletions tests/seldon/docker/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@


def test_conda_yaml(pipeline_conda_yaml):
print(pipeline_conda_yaml)
with open(pipeline_conda_yaml) as f:
env = yaml.safe_load(f)
for dep in env["dependencies"]:
if dep == "pip":
assert dep[0] == MLServerEnvDeps[0]
# we want to fetch the pip dependencies
if isinstance(dep, dict):
assert dep["pip"][0] == MLServerEnvDeps[0]


def test_deploy_pipeline_docker(
Expand Down

0 comments on commit 656a06d

Please sign in to comment.