Skip to content

Commit

Permalink
bayesian optimization draft (#38)
Browse files Browse the repository at this point in the history
* bayesian optimization draft

* add matern kernel and two other acquisition functions

* modify the code structure and add Dockerfile and k8s manifest

* fix typos in manifest files

* add build and deploy test

* fix errors in run-tests
  • Loading branch information
libbyandhelen authored and k8s-ci-robot committed Apr 16, 2018
1 parent c045619 commit b5900f0
Show file tree
Hide file tree
Showing 25 changed files with 3,336 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# python ignore files
__pycache__/
.idea/

# Project specific ignore files
*.swp
bin
Expand Down
2,065 changes: 2,065 additions & 0 deletions api/python/api_pb2.py

Large diffs are not rendered by default.

283 changes: 283 additions & 0 deletions api/python/api_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

import api.python.api_pb2 as api__pb2


class ManagerStub(object):
# missing associated documentation comment in .proto file
pass

def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.CreateStudy = channel.unary_unary(
'/api.Manager/CreateStudy',
request_serializer=api__pb2.CreateStudyRequest.SerializeToString,
response_deserializer=api__pb2.CreateStudyReply.FromString,
)
self.StopStudy = channel.unary_unary(
'/api.Manager/StopStudy',
request_serializer=api__pb2.StopStudyRequest.SerializeToString,
response_deserializer=api__pb2.StopStudyReply.FromString,
)
self.GetStudies = channel.unary_unary(
'/api.Manager/GetStudies',
request_serializer=api__pb2.GetStudiesRequest.SerializeToString,
response_deserializer=api__pb2.GetStudiesReply.FromString,
)
self.SuggestTrials = channel.unary_unary(
'/api.Manager/SuggestTrials',
request_serializer=api__pb2.SuggestTrialsRequest.SerializeToString,
response_deserializer=api__pb2.SuggestTrialsReply.FromString,
)
self.CompleteTrial = channel.unary_unary(
'/api.Manager/CompleteTrial',
request_serializer=api__pb2.CompleteTrialRequest.SerializeToString,
response_deserializer=api__pb2.CompleteTrialReply.FromString,
)
self.ShouldTrialStop = channel.unary_unary(
'/api.Manager/ShouldTrialStop',
request_serializer=api__pb2.ShouldTrialStopRequest.SerializeToString,
response_deserializer=api__pb2.ShouldTrialStopReply.FromString,
)
self.GetObjectValue = channel.unary_unary(
'/api.Manager/GetObjectValue',
request_serializer=api__pb2.GetObjectValueRequest.SerializeToString,
response_deserializer=api__pb2.GetObjectValueReply.FromString,
)
self.AddMeasurementToTrials = channel.unary_unary(
'/api.Manager/AddMeasurementToTrials',
request_serializer=api__pb2.AddMeasurementToTrialsRequest.SerializeToString,
response_deserializer=api__pb2.AddMeasurementToTrialsReply.FromString,
)
self.InitializeSuggestService = channel.unary_unary(
'/api.Manager/InitializeSuggestService',
request_serializer=api__pb2.InitializeSuggestServiceRequest.SerializeToString,
response_deserializer=api__pb2.InitializeSuggestServiceReply.FromString,
)


class ManagerServicer(object):
# missing associated documentation comment in .proto file
pass

def CreateStudy(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def StopStudy(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def GetStudies(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def SuggestTrials(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def CompleteTrial(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def ShouldTrialStop(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def GetObjectValue(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def AddMeasurementToTrials(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def InitializeSuggestService(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_ManagerServicer_to_server(servicer, server):
rpc_method_handlers = {
'CreateStudy': grpc.unary_unary_rpc_method_handler(
servicer.CreateStudy,
request_deserializer=api__pb2.CreateStudyRequest.FromString,
response_serializer=api__pb2.CreateStudyReply.SerializeToString,
),
'StopStudy': grpc.unary_unary_rpc_method_handler(
servicer.StopStudy,
request_deserializer=api__pb2.StopStudyRequest.FromString,
response_serializer=api__pb2.StopStudyReply.SerializeToString,
),
'GetStudies': grpc.unary_unary_rpc_method_handler(
servicer.GetStudies,
request_deserializer=api__pb2.GetStudiesRequest.FromString,
response_serializer=api__pb2.GetStudiesReply.SerializeToString,
),
'SuggestTrials': grpc.unary_unary_rpc_method_handler(
servicer.SuggestTrials,
request_deserializer=api__pb2.SuggestTrialsRequest.FromString,
response_serializer=api__pb2.SuggestTrialsReply.SerializeToString,
),
'CompleteTrial': grpc.unary_unary_rpc_method_handler(
servicer.CompleteTrial,
request_deserializer=api__pb2.CompleteTrialRequest.FromString,
response_serializer=api__pb2.CompleteTrialReply.SerializeToString,
),
'ShouldTrialStop': grpc.unary_unary_rpc_method_handler(
servicer.ShouldTrialStop,
request_deserializer=api__pb2.ShouldTrialStopRequest.FromString,
response_serializer=api__pb2.ShouldTrialStopReply.SerializeToString,
),
'GetObjectValue': grpc.unary_unary_rpc_method_handler(
servicer.GetObjectValue,
request_deserializer=api__pb2.GetObjectValueRequest.FromString,
response_serializer=api__pb2.GetObjectValueReply.SerializeToString,
),
'AddMeasurementToTrials': grpc.unary_unary_rpc_method_handler(
servicer.AddMeasurementToTrials,
request_deserializer=api__pb2.AddMeasurementToTrialsRequest.FromString,
response_serializer=api__pb2.AddMeasurementToTrialsReply.SerializeToString,
),
'InitializeSuggestService': grpc.unary_unary_rpc_method_handler(
servicer.InitializeSuggestService,
request_deserializer=api__pb2.InitializeSuggestServiceRequest.FromString,
response_serializer=api__pb2.InitializeSuggestServiceReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'api.Manager', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))


class SuggestionStub(object):
# missing associated documentation comment in .proto file
pass

def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GenerateTrials = channel.unary_unary(
'/api.Suggestion/GenerateTrials',
request_serializer=api__pb2.GenerateTrialsRequest.SerializeToString,
response_deserializer=api__pb2.GenerateTrialsReply.FromString,
)
self.SetSuggestionParameters = channel.unary_unary(
'/api.Suggestion/SetSuggestionParameters',
request_serializer=api__pb2.SetSuggestionParametersRequest.SerializeToString,
response_deserializer=api__pb2.SetSuggestionParametersReply.FromString,
)
self.StopSuggestion = channel.unary_unary(
'/api.Suggestion/StopSuggestion',
request_serializer=api__pb2.StopSuggestionRequest.SerializeToString,
response_deserializer=api__pb2.StopSuggestionReply.FromString,
)


class SuggestionServicer(object):
# missing associated documentation comment in .proto file
pass

def GenerateTrials(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def SetSuggestionParameters(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def StopSuggestion(self, request, context):
# missing associated documentation comment in .proto file
pass
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')


def add_SuggestionServicer_to_server(servicer, server):
rpc_method_handlers = {
'GenerateTrials': grpc.unary_unary_rpc_method_handler(
servicer.GenerateTrials,
request_deserializer=api__pb2.GenerateTrialsRequest.FromString,
response_serializer=api__pb2.GenerateTrialsReply.SerializeToString,
),
'SetSuggestionParameters': grpc.unary_unary_rpc_method_handler(
servicer.SetSuggestionParameters,
request_deserializer=api__pb2.SetSuggestionParametersRequest.FromString,
response_serializer=api__pb2.SetSuggestionParametersReply.SerializeToString,
),
'StopSuggestion': grpc.unary_unary_rpc_method_handler(
servicer.StopSuggestion,
request_deserializer=api__pb2.StopSuggestionRequest.FromString,
response_serializer=api__pb2.StopSuggestionReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'api.Suggestion', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))


class AutoStoppingStub(object):
# missing associated documentation comment in .proto file
pass

def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""


class AutoStoppingServicer(object):
# missing associated documentation comment in .proto file
pass


def add_AutoStoppingServicer_to_server(servicer, server):
rpc_method_handlers = {
}
generic_handler = grpc.method_handlers_generic_handler(
'api.AutoStopping', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
23 changes: 23 additions & 0 deletions manifests/vizier/suggestion/bayesianoptimization/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: vizier-suggestion-bayesianoptimization
namespace: katib
labels:
app: vizier
component: suggestion-bayesianoptimization
spec:
replicas: 1
template:
metadata:
name: vizier-suggestion-bayesianoptimization
labels:
app: vizier
component: suggestion-bayesianoptimization
spec:
containers:
- name: vizier-suggestion-bayesianoptimization
image: katib/suggestion-bayesianoptimization
ports:
- name: api
containerPort: 6789
17 changes: 17 additions & 0 deletions manifests/vizier/suggestion/bayesianoptimization/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: vizier-suggestion-bayesianoptimization
namespace: katib
labels:
app: vizier
component: suggestion-bayesianoptimization
spec:
type: ClusterIP
ports:
- port: 6789
protocol: TCP
name: api
selector:
app: vizier
component: suggestion-bayesianoptimization
Loading

0 comments on commit b5900f0

Please sign in to comment.