Skip to content

Commit ebed655

Browse files
committed
Initial commit
0 parents  commit ebed655

15 files changed

Lines changed: 709 additions & 0 deletions

.github/ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Motivation
2+
3+
write the motivation
4+
5+
## Goal
6+
- write the goal
7+
8+
write the description
9+
10+
## Implementation
11+
- feature
12+
- feature
13+
- resource
14+
- testing

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## What is this PR for?
2+
3+
write a reason
4+
5+
## This PR includes
6+
7+
- item
8+
- item
9+
- item
10+
11+
## What type of PR is it?
12+
13+
Feature/Bugfix/....
14+
15+
## What is the issue?
16+
17+
N/A
18+
19+
## How should this be tested?
20+
21+
write a method and a sample of command

.gitignore

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
49+
# Translations
50+
*.mo
51+
*.pot
52+
53+
# Django stuff:
54+
*.log
55+
local_settings.py
56+
57+
# Flask stuff:
58+
instance/
59+
.webassets-cache
60+
61+
# Scrapy stuff:
62+
.scrapy
63+
64+
# Sphinx documentation
65+
docs/_build/
66+
67+
# PyBuilder
68+
target/
69+
70+
# Jupyter Notebook
71+
.ipynb_checkpoints
72+
73+
# pyenv
74+
.python-version
75+
76+
# celery beat schedule file
77+
celerybeat-schedule
78+
79+
# SageMath parsed files
80+
*.sage.py
81+
82+
# dotenv
83+
.env
84+
85+
# virtualenv
86+
.venv
87+
venv/
88+
ENV/
89+
90+
# Spyder project settings
91+
.spyderproject
92+
.spyproject
93+
94+
# Rope project settings
95+
.ropeproject
96+
97+
# mkdocs documentation
98+
/site
99+
100+
# mypy
101+
.mypy_cache/
102+
103+
# PyCharm
104+
.idea/
105+
106+
# grpc file
107+
drucker_pb2.py
108+
drucker_pb2_grpc.py
109+
110+
# Mac OS temporary file
111+
.DS_Store

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "drucker-grpc-proto"]
2+
path = drucker-grpc-proto
3+
url = https://github.com/drucker/drucker-grpc-proto.git
4+
branch = master

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# drucker-client
2+
Drucker is a framework of serving machine learning module. Drucker makes it easy to serve, manage and integrate your ML models into your existing services. Moreover, Drucker can be used on Kubernetes. This project is a SDK for accessing Drucker service of your ML module. All you need is initializing ```DruckerWorkerClient``` class.
3+
4+
## Parent Project
5+
https://github.com/drucker/drucker-parent
6+
7+
## Components
8+
- [Drucker](https://github.com/drucker/drucker): Serving framework for a machine learning module.
9+
- [Drucker-dashboard](https://github.com/drucker/drucker-dashboard): Management web service for the machine learning models to the drucker service.
10+
- [Drucker-client](https://github.com/drucker/drucker-client) (here): SDK for accessing a drucker service.
11+
- [Drucker-example](https://github.com/drucker/drucker-example): Example of how to use drucker.
12+
13+
### Available methods of ```DruckerWorkerClient```
14+
You need to use an appropriate method for your Drucker service. The methods are generated according to the input and output formats. *V* is the length of feature vector. *M* is the number of classes. If your algorithm is a binary classifier, you set *M* to 1. If your algorithm is a multi-class classifier, you set *M* to the number of classes.
15+
16+
|method |input: data<BR>(required) |input: option |output: label<BR>(required) |output: score<BR>(required) |output: option |
17+
|:---|:---|:---|:---|:---|:---|
18+
|run_predict_string_string |string |string (json) |string |double |string (json) |
19+
|run_predict_string_bytes |string |string (json) |bytes |double |string (json) |
20+
|run_predict_string_arrint |string |string (json) |int[*M*] |double[*M*] |string (json) |
21+
|run_predict_string_arrfloat |string |string (json) |double[*M*] |double[*M*] |string (json) |
22+
|run_predict_string_arrstring |string |string (json) |string[*M*] |double[*M*] |string (json) |
23+
|run_predict_bytes_string |bytes |string (json) |string |double |string (json) |
24+
|run_predict_bytes_bytes |bytes |string (json) |bytes |double |string (json) |
25+
|run_predict_bytes_arrint |bytes |string (json) |int[*M*] |double[*M*] |string (json) |
26+
|run_predict_bytes_arrfloat |bytes |string (json) |double[*M*] |double[*M*] |string (json) |
27+
|run_predict_bytes_arrstring |bytes |string (json) |string[*M*] |double[*M*] |string (json) |
28+
|run_predict_arrint_string |int[*V*] |string (json) |string |double |string (json) |
29+
|run_predict_arrint_bytes |int[*V*] |string (json) |bytes |double |string (json) |
30+
|run_predict_arrint_arrint |int[*V*] |string (json) |int[*M*] |double[*M*] |string (json) |
31+
|run_predict_arrint_arrfloat |int[*V*] |string (json) |double[*M*] |double[*M*] |string (json) |
32+
|run_predict_arrint_arrstring |int[*V*] |string (json) |string[*M*] |double[*M*] |string (json) |
33+
|run_predict_arrfloat_string |double[*V*] |string (json) |string |double |string (json) |
34+
|run_predict_arrfloat_bytes |double[*V*] |string (json) |bytes |double |string (json) |
35+
|run_predict_arrfloat_arrint |double[*V*] |string (json) |int[*M*] |double[*M*] |string (json) |
36+
|run_predict_arrfloat_arrfloat |double[*V*] |string (json) |double[*M*] |double[*M*] |string (json) |
37+
|run_predict_arrfloat_arrstring |double[*V*] |string (json) |string[*M*] |double[*M*] |string (json) |
38+
|run_predict_arrstring_string |string[*V*] |string (json) |string |double |string (json) |
39+
|run_predict_arrstring_bytes |string[*V*] |string (json) |bytes |double |string (json) |
40+
|run_predict_arrstring_arrint |string[*V*] |string (json) |int[*M*] |double[*M*] |string (json) |
41+
|run_predict_arrstring_arrfloat |string[*V*] |string (json) |double[*M*] |double[*M*] |string (json) |
42+
|run_predict_arrstring_arrstring |string[*V*] |string (json) |string[*M*] |double[*M*] |string (json) |
43+
44+
The input "option" field needs to be a json format. Any style is Ok but we have some reserved fields below.
45+
46+
|Field |Type |Description |
47+
|:---|:---|:---|
48+
|suppress_log_input |bool |True: NOT print the input and output to the log message. <BR>False (default): Print the input and output to the log message.
49+
50+
### Run it
51+
```
52+
$ sh start.sh
53+
```
54+
55+
## Drucker on Kubernetes
56+
https://github.com/drucker/drucker-parent/tree/master/docs/UsageDruckerOnKubernetes.md

__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import sys
6+
7+
sd = os.path.abspath(os.path.dirname(__file__))
8+
sys.path.append(sd)

core/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
import sys
6+
7+
sd = os.path.abspath(os.path.dirname(__file__))
8+
sys.path.append(sd)

0 commit comments

Comments
 (0)