Skip to content

Commit

Permalink
Merge pull request #210 from cliveseldon/cleanup
Browse files Browse the repository at this point in the history
Remove non-seldon runtimes
  • Loading branch information
axsaucedo authored Nov 5, 2021
2 parents 09079af + 19c9161 commit 5f5612f
Show file tree
Hide file tree
Showing 62 changed files with 380 additions and 2,552 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ Tempo provides a unified interface to multiple MLOps projects that enable data s
* Deploy locally to Docker to test with Docker runtimes.
* Deploy to production on Kubernetes
* Extract declarative Kubernetes yaml to follow GitOps workflows.
* Supporting a wide range of production runtimes
* Supporting Seldon production runtimes
* Seldon Core open source
* KFServing open source
* Seldon Deploy enterprise
* Create stateful services. Examples:
* Multi-Armed Bandits.
Expand Down
109 changes: 18 additions & 91 deletions docs/examples/asyncio/README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,12 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "alert-surge",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[01;34m.\u001b[00m\r\n",
"├── \u001b[01;34martifacts\u001b[00m\r\n",
"│   ├── \u001b[01;34mclassifier\u001b[00m\r\n",
"│   ├── \u001b[01;34msklearn\u001b[00m\r\n",
"│   └── \u001b[01;34mxgboost\u001b[00m\r\n",
"└── \u001b[01;34msrc\u001b[00m\r\n",
" ├── constants.py\r\n",
" ├── data.py\r\n",
" ├── tempo.py\r\n",
" └── train.py\r\n",
"\r\n",
"5 directories, 4 files\r\n"
]
}
],
"outputs": [],
"source": [
"!tree -P \"*.py\" -I \"__init__.py|__pycache__\" -L 2"
]
Expand All @@ -84,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "equipped-silence",
"metadata": {},
"outputs": [],
Expand All @@ -98,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "reported-hurricane",
"metadata": {
"code_folding": []
Expand Down Expand Up @@ -134,26 +115,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "lesser-reply",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[18:05:52] WARNING: ../src/learner.cc:1095: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/clive/anaconda3/envs/tempo-examples/lib/python3.7/site-packages/xgboost/sklearn.py:1146: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].\n",
" warnings.warn(label_encoder_deprecation_msg, UserWarning)\n"
]
}
],
"outputs": [],
"source": [
"from src.data import IrisData\n",
"from src.train import train_sklearn, train_xgboost\n",
Expand All @@ -177,7 +142,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "smoking-tribe",
"metadata": {},
"outputs": [],
Expand All @@ -187,7 +152,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "regular-balance",
"metadata": {
"code_folding": []
Expand Down Expand Up @@ -243,38 +208,20 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"id": "considered-terminology",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"artifacts/classifier/conda.yaml\r\n"
]
}
],
"outputs": [],
"source": [
"!ls artifacts/classifier/conda.yaml"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "rural-mathematics",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting packages...\n",
"Packing environment at '/home/clive/anaconda3/envs/tempo-330c15d8-a189-45a6-abc3-a27f39b6a7c5' to '/home/clive/work/mlops/fork-tempo/docs/examples/asyncio/artifacts/classifier/environment.tar.gz'\n",
"[########################################] | 100% Completed | 11.2s\n"
]
}
],
"outputs": [],
"source": [
"import tempo\n",
"\n",
Expand All @@ -293,7 +240,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "56037cc4",
"metadata": {},
"outputs": [],
Expand All @@ -304,49 +251,29 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "cb489575",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([2.], dtype=float32)"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"await remote_model.predict(np.array([[1, 2, 3, 4]]))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"id": "dc6c0829",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1.]\n",
"[[0.97329617 0.02412145 0.00258233]]\n"
]
}
],
"outputs": [],
"source": [
"print(await remote_model.predict(np.array([[0, 0, 0,0]])))\n",
"print(await remote_model.predict(np.array([[5.964,4.006,2.081,1.031]])))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"id": "6fa56a63",
"metadata": {},
"outputs": [],
Expand Down
40 changes: 0 additions & 40 deletions docs/examples/asyncio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ conda env create --name tempo-examples --file conda/tempo-examples.yaml
!tree -P "*.py" -I "__init__.py|__pycache__" -L 2
```

.
├── artifacts
│   ├── classifier
│   ├── sklearn
│   └── xgboost
└── src
├── constants.py
├── data.py
├── tempo.py
└── train.py

5 directories, 4 files


## Train Models

This section is where as a data scientist you do your work of training models and creating artfacts.
Expand Down Expand Up @@ -94,13 +80,6 @@ train_sklearn(data)
train_xgboost(data)
```

[18:05:52] WARNING: ../src/learner.cc:1095: Starting in XGBoost 1.3.0, the default evaluation metric used with the objective 'multi:softprob' was changed from 'merror' to 'mlogloss'. Explicitly set eval_metric if you'd like to restore the old behavior.


/home/clive/anaconda3/envs/tempo-examples/lib/python3.7/site-packages/xgboost/sklearn.py:1146: UserWarning: The use of label encoder in XGBClassifier is deprecated and will be removed in a future release. To remove this warning, do the following: 1) Pass option use_label_encoder=False when constructing XGBClassifier object; and 2) Encode your labels (y) as integers starting with 0, i.e. 0, 1, 2, ..., [num_class - 1].
warnings.warn(label_encoder_deprecation_msg, UserWarning)


## Create Tempo Artifacts

Here we create the Tempo models and orchestration Pipeline for our final service using our models.
Expand Down Expand Up @@ -160,21 +139,13 @@ In preparation for running our models we save the Python environment needed for
!ls artifacts/classifier/conda.yaml
```

artifacts/classifier/conda.yaml



```python
import tempo

tempo.save(classifier)
```

Collecting packages...
Packing environment at '/home/clive/anaconda3/envs/tempo-330c15d8-a189-45a6-abc3-a27f39b6a7c5' to '/home/clive/work/mlops/fork-tempo/docs/examples/asyncio/artifacts/classifier/environment.tar.gz'
[########################################] | 100% Completed | 11.2s


## Test Locally on Docker

Here we test our models using production images but running locally on Docker. This allows us to ensure the final production deployed model will behave as expected when deployed.
Expand All @@ -192,22 +163,11 @@ await remote_model.predict(np.array([[1, 2, 3, 4]]))
```




array([2.], dtype=float32)




```python
print(await remote_model.predict(np.array([[0, 0, 0,0]])))
print(await remote_model.predict(np.array([[5.964,4.006,2.081,1.031]])))
```

[1.]
[[0.97329617 0.02412145 0.00258233]]



```python
remote_model.undeploy()
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/control-environments/pipeline-as-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dependencies:
```python
from tempo.serve.metadata import ModelFramework, KubernetesOptions

from tempo.kfserving.protocol import KFServingV2Protocol
from tempo.protocols.v2 import V2Protocol

from tempo.seldon.k8s import SeldonKubernetesRuntime
from tempo.seldon.docker import SeldonDockerRuntime
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/control-environments/pipeline-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ dependencies:
```python
from tempo.serve.metadata import ModelFramework, KubernetesOptions

from tempo.kfserving.protocol import KFServingV2Protocol
from tempo.protocols.v2 import V2Protocol

from tempo.seldon.k8s import SeldonKubernetesRuntime
from tempo.seldon.docker import SeldonDockerRuntime
Expand Down
Loading

0 comments on commit 5f5612f

Please sign in to comment.