Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the serving client and server module #76

Merged
merged 3 commits into from
Apr 13, 2021

Conversation

leonwanghui
Copy link
Contributor

@leonwanghui leonwanghui commented Apr 12, 2021

What type of PR is this?

/kind enhancement

What does this PR do / why do we need it:

Currently the serving module (both client and server) is still in early stage, and causing some common problems (such as Issue #62). This PR is proposed to refactor the serving framework to make it easier to specify the dynamic ip address and port, and more importantly provide a more clear framework for developers to learn and enhance it.

The change of this PR contains:

  • Design a unified entrance interface for both client and server module with Client and Server class
  • Now the system can automatically detect if the server started or shutdown even without manually specified
  • Users can specify the host ip and port when initializing Server and Client class
  • Update the Flask listen path from http://127.0.0.1:5000/predict to http://127.0.0.1:5000/servables/<name> for predict request

How to use:

Before After
from tinyms.serving import start_server, server_started, list_servables, predict, shutdown

start_server()
if server_started():
    list_servables()
    predict('example.jpg', 'servable_name', dataset_name='mnist')
shutdown()
from tinyms.serving import Client, Server

server = Server()
server.start_server()
client = Client()
client.list_servables()
client.predict('example.jpg', 'servable_name', dataset_name='mnist')
server.shutdown()

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewers:

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@leonwanghui leonwanghui changed the title Refactor the serving client module Refactor the serving client and server module Apr 13, 2021
@leonwanghui leonwanghui marked this pull request as ready for review April 13, 2021 02:47
@leonwanghui leonwanghui merged commit 6c15bc0 into tinyms-ai:main Apr 13, 2021
@leonwanghui leonwanghui deleted the serving-refactor branch April 13, 2021 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants