| Name | airdot JSON |
| Version |
0.6.0b0
JSON |
| download |
| home_page | https://github.com/airdot-io/airdot-Deploy/ |
| Summary | A code base for deploying ml api |
| upload_time | 2024-01-19 09:22:29 |
| maintainer | |
| docs_url | None |
| author | airdot-io |
| requires_python | >=3.7.0 |
| license | MIT License Copyright (c) 2023 Airdot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
black
pytest
PyYAML
google-api-python-client
google-cloud-core
google-cloud-storage
zstd
boto
botocore
boto3
docker
redis
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# 🚀 Airdot Deployer
[](https://www.python.org/downloads/release/python-360/)
[](https://github.com/psf/black)
Deploy your ML models in **minutes**, not **weeks**.
Detailed documentation can be found [here](https://airdot-io.github.io/airdot-deployer/)
Airdot Deployer will automatically:
1. Restructure your Python code (from Jupyter Notebook/local IDEs) into modules.
2. Builds a REST API around your code.
3. Conterize the app.
4. Spins up the required hardware (local or K8s or cloud).
5. Monitors for model/data drift and performance (in development)
## Take your ML model from Local to Production with one-line of code
```python
from airdot.deployer import Deployer
deployer_obj = Deployer().run(<your-ml-predictor>)
```
Once deployed, your model will be up and running on the intra/internet, accessible to your users. No more worrying about complex server setups or manual configuration. Airdot Deployer does all the heavy lifting for you.
```bash
curl -XPOST <url> -H 'Content-Type: application/json' -d '{"args": "some-value"}'
```
Whether you're a data scientist, developer, or tech enthusiast, Airdot Deployer empowers you to showcase your machine learning prowess and share your creations effortlessly.
## What does Airdot Deployer supports ?
* Local Deployment with Docker 
* K8s Deployment with seldon core 
# Want to try Airdot ? follow setup instructions
## 📋 Setup Instructions
Before we get started, you'll need to have Docker, Docker Compose, and s2i installed on your machine. If you don't have these installed yet, no worries! Follow the steps below to get them set up:
### Docker Install
Please visit the appropriate links to install Docker on your machine:
- For macOS, visit [here](https://docs.docker.com/desktop/install/mac-install/)
- For Windows, visit [here](https://docs.docker.com/desktop/install/windows-install/)
- For Linux, visit [here](https://docs.docker.com/desktop/install/linux-install/)
#### S2I install
For Mac
You can either follow the installation instructions for Linux (and use the darwin-amd64 link) or you can just install source-to-image with Homebrew:
```$ brew install source-to-image```
For Linux just run following command
```bash
curl -s https://api.github.com/repos/openshift/source-to-image/releases/latest| grep browser_download_url | grep linux-amd64 | cut -d '"' -f 4 | wget -qi -
```
For Windows please follow instruction [here](https://github.com/openshift/source-to-image#for-windows)
## 💻 Airdot Deployer Installation
Install the Airdot Deployer package using pip:
```bash
pip install "git+https://github.com/airdot-io/airdot-deployer.git@main#egg=airdot"
```
## or
```bash
pip install airdot
```
## 🎯 Let's try out
### Local Deployments
#### Run following in terminal to setup minio and redis on your machine
```bash
docker network create minio-network && wget https://raw.githubusercontent.com/airdot-io/airdot-deployer/main/docker-compose.yaml && docker-compose -p airdot up
```
### Train your model
```python
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from airdot.deployer import Deployer
from sklearn import datasets
import pandas as pd
import numpy as np
iris = datasets.load_iris()
iris = pd.DataFrame(
data= np.c_[iris['data'], iris['target']],
columns= iris['feature_names'] + ['target']
)
X = iris.drop(['target'], axis=1)
X = X.to_numpy()[:, (2,3)]
y = iris['target']
X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.5, random_state=42)
log_reg = LogisticRegression()
log_reg.fit(X_train,y_train)
```
### Test your model
```python
def predict(value):
return log_reg.predict(value)
```
### Deploy in one step 🤯
```python
deployer_obj = Deployer().run(predict)
```
### Use your deployed Model
```bash
curl -XPOST http://127.0.0.1:8000 -H 'Content-Type: application/json' -d '{"value": [[4.7, 1.2]]}'
```
### Want to stop your deployment
```python
deployer.stop('predict') # to stop container
```
## Deployment on k8s using seldon-core deployment
**Note - This method will use your current cluster and uses seldon-core to deploy**
```python
from airdot import Deployer
import pandas as pd
# this is using default seldon-deployment configuration.
config = {
'deployment_type':'seldon',
'bucket_type':'minio',
'image_uri':'<registry>/get_value_data:latest'
}
deployer = Deployer(deployment_configuration=config)
df2 = pd.DataFrame(data=[[10,20],[10,40]], columns=['1', '2'])
def get_value_data(cl_idx='1'):
return df2[cl_idx].values.tolist()
deployer.run(get_value_data)
```
#### you can also deploy using seldon custom configuration
```python
from airdot import Deployer
import pandas as pd
# this is using default seldon-deployment configuration.
config = {
'deployment_type':'seldon',
'bucket_type':'minio',
'image_uri':'<registry>/get_value_data:latest',
'seldon_configuration': '' # your custom seldon configuration
}
deployer = Deployer(deployment_configuration=config)
df2 = pd.DataFrame(data=[[10,20],[10,40]], columns=['1', '2'])
def get_value_data(cl_idx='1'):
return df2[cl_idx].values.tolist()
deployer.run(get_value_data)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/airdot-io/airdot-Deploy/",
"name": "airdot",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": "",
"keywords": "",
"author": "airdot-io",
"author_email": "airdot-io <abhinav199530singh@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/79/a6/5a8fde932e4e4f7b8e885be3fd468bf6e5474d018f9d4fcd75141323984d/airdot-0.6.0b0.tar.gz",
"platform": null,
"description": "# \ud83d\ude80 Airdot Deployer\n\n\n[](https://www.python.org/downloads/release/python-360/)\n[](https://github.com/psf/black)\n\nDeploy your ML models in **minutes**, not **weeks**.\n\nDetailed documentation can be found [here](https://airdot-io.github.io/airdot-deployer/)\n\nAirdot Deployer will automatically:\n\n1. Restructure your Python code (from Jupyter Notebook/local IDEs) into modules.\n2. Builds a REST API around your code.\n3. Conterize the app.\n4. Spins up the required hardware (local or K8s or cloud).\n5. Monitors for model/data drift and performance (in development)\n\n## Take your ML model from Local to Production with one-line of code\n\n```python\nfrom airdot.deployer import Deployer\ndeployer_obj = Deployer().run(<your-ml-predictor>)\n```\n\nOnce deployed, your model will be up and running on the intra/internet, accessible to your users. No more worrying about complex server setups or manual configuration. Airdot Deployer does all the heavy lifting for you.\n\n```bash\ncurl -XPOST <url> -H 'Content-Type: application/json' -d '{\"args\": \"some-value\"}'\n```\n\nWhether you're a data scientist, developer, or tech enthusiast, Airdot Deployer empowers you to showcase your machine learning prowess and share your creations effortlessly.\n\n\n\n## What does Airdot Deployer supports ?\n\n* Local Deployment with Docker \n* K8s Deployment with seldon core \n\n# Want to try Airdot ? follow setup instructions\n\n## \ud83d\udccb Setup Instructions\n\nBefore we get started, you'll need to have Docker, Docker Compose, and s2i installed on your machine. If you don't have these installed yet, no worries! Follow the steps below to get them set up:\n\n\n### Docker Install\nPlease visit the appropriate links to install Docker on your machine:\n- For macOS, visit [here](https://docs.docker.com/desktop/install/mac-install/)\n- For Windows, visit [here](https://docs.docker.com/desktop/install/windows-install/)\n- For Linux, visit [here](https://docs.docker.com/desktop/install/linux-install/)\n\n#### S2I install\nFor Mac\nYou can either follow the installation instructions for Linux (and use the darwin-amd64 link) or you can just install source-to-image with Homebrew:\n\n```$ brew install source-to-image```\n\nFor Linux just run following command\n\n```bash\ncurl -s https://api.github.com/repos/openshift/source-to-image/releases/latest| grep browser_download_url | grep linux-amd64 | cut -d '\"' -f 4 | wget -qi -\n```\nFor Windows please follow instruction [here](https://github.com/openshift/source-to-image#for-windows)\n\n\n## \ud83d\udcbb Airdot Deployer Installation\nInstall the Airdot Deployer package using pip:\n\n```bash\npip install \"git+https://github.com/airdot-io/airdot-deployer.git@main#egg=airdot\"\n```\n\n## or\n\n```bash\npip install airdot\n```\n\n## \ud83c\udfaf Let's try out\n\n### Local Deployments\n\n#### Run following in terminal to setup minio and redis on your machine\n\n```bash\ndocker network create minio-network && wget https://raw.githubusercontent.com/airdot-io/airdot-deployer/main/docker-compose.yaml && docker-compose -p airdot up\n```\n\n### Train your model\n\n```python\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nfrom airdot.deployer import Deployer\nfrom sklearn import datasets\nimport pandas as pd\nimport numpy as np\n\niris = datasets.load_iris()\niris = pd.DataFrame(\n data= np.c_[iris['data'], iris['target']],\n columns= iris['feature_names'] + ['target']\n)\nX = iris.drop(['target'], axis=1)\nX = X.to_numpy()[:, (2,3)]\ny = iris['target']\nX_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.5, random_state=42)\nlog_reg = LogisticRegression()\nlog_reg.fit(X_train,y_train)\n```\n\n### Test your model\n\n```python\ndef predict(value):\n return log_reg.predict(value)\n```\n\n### Deploy in one step \ud83e\udd2f\n\n```python\ndeployer_obj = Deployer().run(predict)\n```\n\n### Use your deployed Model\n\n```bash\ncurl -XPOST http://127.0.0.1:8000 -H 'Content-Type: application/json' -d '{\"value\": [[4.7, 1.2]]}'\n```\n\n### Want to stop your deployment\n\n```python\ndeployer.stop('predict') # to stop container\n```\n\n## Deployment on k8s using seldon-core deployment\n\n**Note - This method will use your current cluster and uses seldon-core to deploy**\n\n```python\nfrom airdot import Deployer\nimport pandas as pd\n\n# this is using default seldon-deployment configuration.\nconfig = {\n 'deployment_type':'seldon',\n 'bucket_type':'minio',\n 'image_uri':'<registry>/get_value_data:latest'\n }\ndeployer = Deployer(deployment_configuration=config) \n\n\ndf2 = pd.DataFrame(data=[[10,20],[10,40]], columns=['1', '2'])\ndef get_value_data(cl_idx='1'):\n return df2[cl_idx].values.tolist()\n\ndeployer.run(get_value_data) \n```\n\n#### you can also deploy using seldon custom configuration \n\n```python\nfrom airdot import Deployer\nimport pandas as pd\n\n# this is using default seldon-deployment configuration.\nconfig = {\n 'deployment_type':'seldon',\n 'bucket_type':'minio',\n 'image_uri':'<registry>/get_value_data:latest',\n 'seldon_configuration': '' # your custom seldon configuration\n }\ndeployer = Deployer(deployment_configuration=config) \n\n\ndf2 = pd.DataFrame(data=[[10,20],[10,40]], columns=['1', '2'])\ndef get_value_data(cl_idx='1'):\n return df2[cl_idx].values.tolist()\n\ndeployer.run(get_value_data) \n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2023 Airdot Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "A code base for deploying ml api",
"version": "0.6.0b0",
"project_urls": {
"Homepage": "https://github.com/airdot-io/airdot-Deploy"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f6fe50be1ac6a50a9308c7b2b381c4b60b486ff8359056ccee4129a32f53a7df",
"md5": "c90c292b4fd36641c40b0499597eaf01",
"sha256": "948035140799944c3b7ff46da7b0f51b6f359a127d782ea856953ea965b7347a"
},
"downloads": -1,
"filename": "airdot-0.6.0b0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c90c292b4fd36641c40b0499597eaf01",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.0",
"size": 31495,
"upload_time": "2024-01-19T09:22:00",
"upload_time_iso_8601": "2024-01-19T09:22:00.855732Z",
"url": "https://files.pythonhosted.org/packages/f6/fe/50be1ac6a50a9308c7b2b381c4b60b486ff8359056ccee4129a32f53a7df/airdot-0.6.0b0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "79a65a8fde932e4e4f7b8e885be3fd468bf6e5474d018f9d4fcd75141323984d",
"md5": "1face4aa2ab8b87040eeef0c620a831a",
"sha256": "5d6f0e4b4c2865b000928b9a656efd4241338f24e40665395a195da1544b8ced"
},
"downloads": -1,
"filename": "airdot-0.6.0b0.tar.gz",
"has_sig": false,
"md5_digest": "1face4aa2ab8b87040eeef0c620a831a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 27030,
"upload_time": "2024-01-19T09:22:29",
"upload_time_iso_8601": "2024-01-19T09:22:29.931684Z",
"url": "https://files.pythonhosted.org/packages/79/a6/5a8fde932e4e4f7b8e885be3fd468bf6e5474d018f9d4fcd75141323984d/airdot-0.6.0b0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 09:22:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "airdot-io",
"github_project": "airdot-Deploy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "black",
"specs": [
[
"==",
"22.6.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"7.1.2"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"==",
"5.4.1"
]
]
},
{
"name": "google-api-python-client",
"specs": [
[
"==",
"2.78.0"
]
]
},
{
"name": "google-cloud-core",
"specs": [
[
"==",
"2.3.2"
]
]
},
{
"name": "google-cloud-storage",
"specs": [
[
"==",
"2.7.0"
]
]
},
{
"name": "zstd",
"specs": [
[
"==",
"1.5.2.6"
]
]
},
{
"name": "boto",
"specs": [
[
"==",
"2.49.0"
]
]
},
{
"name": "botocore",
"specs": [
[
"==",
"1.29.127"
]
]
},
{
"name": "boto3",
"specs": [
[
"==",
"1.26"
]
]
},
{
"name": "docker",
"specs": [
[
"==",
"6.1.2"
]
]
},
{
"name": "redis",
"specs": [
[
"==",
"4.5.5"
]
]
}
],
"lcname": "airdot"
}