Skip to content

Commit

Permalink
feat(suggestion): Support advisor algorithms (kubeflow#4)
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <gaoce@caicloud.io>
  • Loading branch information
gaocegege authored and caicloud-bot committed May 7, 2019
1 parent cd6d1e8 commit 725c9bd
Show file tree
Hide file tree
Showing 60 changed files with 6,676 additions and 0 deletions.
Empty file.
28 changes: 28 additions & 0 deletions cmd/suggestion/v1alpha3/advisor/unified.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import grpc
from concurrent import futures

import time

from pkg.api.suggestion.v1alpha3.python import advisor_pb2_grpc
from pkg.suggestion.v1alpha3.advisor.advisor import AdvisorUnifiedService
from pkg.suggestion.v1alpha1.types import DEFAULT_PORT

_ONE_DAY_IN_SECONDS = 60 * 60 * 24


def serve():
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
advisor_pb2_grpc.add_AdvisorSuggestionServicer_to_server(
AdvisorUnifiedService(), server)
server.add_insecure_port(DEFAULT_PORT)
print("Listening...")
server.start()
try:
while True:
time.sleep(_ONE_DAY_IN_SECONDS)
except KeyboardInterrupt:
server.stop(0)


if __name__ == "__main__":
serve()
Loading

0 comments on commit 725c9bd

Please sign in to comment.