Skip to content

Commit

Permalink
GRPC: Rename Manager to DBManager service (#1279)
Browse files Browse the repository at this point in the history
* Rename Manager to DBManager in gRPC

* Update git ignore
  • Loading branch information
andreyvelich authored Jul 25, 2020
1 parent 9320b4e commit 27658a7
Show file tree
Hide file tree
Showing 22 changed files with 259 additions and 498 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ ehthumbs_vista.db
$RECYCLE.BIN/

/katib-controller
/katib-manager
/katib-db-manager
/katib-ui
2 changes: 1 addition & 1 deletion cmd/db-manager/v1beta1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func main() {
size := 1<<31 - 1
klog.Infof("Start Katib manager: %s", port)
s := grpc.NewServer(grpc.MaxRecvMsgSize(size), grpc.MaxSendMsgSize(size))
api_pb.RegisterManagerServer(s, &server{})
api_pb.RegisterDBManagerServer(s, &server{})
health_pb.RegisterHealthServer(s, &server{})
reflection.Register(s)
if err = s.Serve(listener); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/metricscollector/v1beta1/file-metricscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func main() {
klog.Fatalf("could not connect: %v", err)
}
defer conn.Close()
c := api.NewManagerClient(conn)
c := api.NewDBManagerClient(conn)
ctx := context.Background()
var metricList []string
if len(*metricNames) != 0 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import grpc
import argparse
import api_pb2
import api_pb2_grpc
from pns import WaitOtherMainProcesses
from tfevent_loader import MetricsCollector
from logging import getLogger, StreamHandler, INFO
Expand Down Expand Up @@ -45,7 +44,7 @@ def parse_options():
channel = grpc.beta.implementations.insecure_channel(
manager_server[0], int(manager_server[1]))

with api_pb2.beta_create_Manager_stub(channel) as client:
with api_pb2.beta_create_DBManager_stub(channel) as client:
logger.info("In " + opt.trial_name + " " +
str(len(observation_log.metric_logs)) + " metrics will be reported.")
client.ReportObservationLog(api_pb2.ReportObservationLogRequest(
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/manager/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Katib API
# Katib GRPC API

Katib offers the following APIs:

- Manager service is an API for core component.
- DBManager service is an API for DB services (in v1alpha3 named Manager service).
- Suggestion service is an API for Suggestion services.
- EarlyStopping service is an API for EarlyStopping services.

Expand Down
274 changes: 137 additions & 137 deletions pkg/apis/manager/v1beta1/api.pb.go

Large diffs are not rendered by default.

218 changes: 0 additions & 218 deletions pkg/apis/manager/v1beta1/api.pb.gw.go

This file was deleted.

12 changes: 6 additions & 6 deletions pkg/apis/manager/v1beta1/api.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Katib API v1beta1
* Katib GRPC API v1beta1
*/
syntax = "proto3";

Expand All @@ -8,12 +8,9 @@ package api.v1.beta1;
import "google/api/annotations.proto";

/**
* Service for Main API for Katib
* For each RPC service, we define mapping to HTTP REST API method.
* The mapping includes the URL path, query parameters and request body.
* https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.api#http
* DBManager service defines APIs to manage Katib database.
*/
service Manager {
service DBManager {
/**
* Report a log of Observations for a Trial.
* The log consists of timestamp and value of metric.
Expand All @@ -33,6 +30,9 @@ service Manager {
rpc DeleteObservationLog(DeleteObservationLogRequest) returns (DeleteObservationLogReply);
}

/**
* Suggestion service defines APIs to manage Katib Suggestion objects.
*/
service Suggestion {
rpc GetSuggestions(GetSuggestionsRequest) returns (GetSuggestionsReply);
rpc ValidateAlgorithmSettings(ValidateAlgorithmSettingsRequest) returns (ValidateAlgorithmSettingsReply);
Expand Down
27 changes: 12 additions & 15 deletions pkg/apis/manager/v1beta1/gen-doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
- [ParameterType](#api.v1.beta1.ParameterType)
- [TrialStatus.TrialConditionType](#api.v1.beta1.TrialStatus.TrialConditionType)

- [DBManager](#api.v1.beta1.DBManager)
- [EarlyStopping](#api.v1.beta1.EarlyStopping)
- [Manager](#api.v1.beta1.Manager)
- [Suggestion](#api.v1.beta1.Suggestion)

- [Scalar Value Types](#scalar-value-types)
Expand All @@ -55,7 +55,7 @@
<p align="right"><a href="#top">Top</a></p>

## api.proto
Katib API v1beta1
Katib GRPC API v1beta1


<a name="api.v1.beta1.AlgorithmSetting"></a>
Expand Down Expand Up @@ -645,34 +645,31 @@ Types of value for HyperParameter.



<a name="api.v1.beta1.EarlyStopping"></a>
<a name="api.v1.beta1.DBManager"></a>

### EarlyStopping
TODO: This feature is not yet fully implemented.
### DBManager
DBManager service defines APIs to manage Katib database.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ReportObservationLog | [ReportObservationLogRequest](#api.v1.beta1.ReportObservationLogRequest) | [ReportObservationLogReply](#api.v1.beta1.ReportObservationLogReply) | Report a log of Observations for a Trial. The log consists of timestamp and value of metric. Katib store every log of metrics. You can see accuracy curve or other metric logs on UI. |
| GetObservationLog | [GetObservationLogRequest](#api.v1.beta1.GetObservationLogRequest) | [GetObservationLogReply](#api.v1.beta1.GetObservationLogReply) | Get all log of Observations for a Trial. |
| DeleteObservationLog | [DeleteObservationLogRequest](#api.v1.beta1.DeleteObservationLogRequest) | [DeleteObservationLogReply](#api.v1.beta1.DeleteObservationLogReply) | Delete all log of Observations for a Trial. |


<a name="api.v1.beta1.Manager"></a>
<a name="api.v1.beta1.EarlyStopping"></a>

### Manager
Service for Main API for Katib
For each RPC service, we define mapping to HTTP REST API method.
The mapping includes the URL path, query parameters and request body.
https://cloud.google.com/service-infrastructure/docs/service-management/reference/rpc/google.api#http
### EarlyStopping
TODO: This feature is not yet fully implemented.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ReportObservationLog | [ReportObservationLogRequest](#api.v1.beta1.ReportObservationLogRequest) | [ReportObservationLogReply](#api.v1.beta1.ReportObservationLogReply) | Report a log of Observations for a Trial. The log consists of timestamp and value of metric. Katib store every log of metrics. You can see accuracy curve or other metric logs on UI. |
| GetObservationLog | [GetObservationLogRequest](#api.v1.beta1.GetObservationLogRequest) | [GetObservationLogReply](#api.v1.beta1.GetObservationLogReply) | Get all log of Observations for a Trial. |
| DeleteObservationLog | [DeleteObservationLogRequest](#api.v1.beta1.DeleteObservationLogRequest) | [DeleteObservationLogReply](#api.v1.beta1.DeleteObservationLogReply) | Delete all log of Observations for a Trial. |


<a name="api.v1.beta1.Suggestion"></a>

### Suggestion

Suggestion service defines APIs to manage Katib Suggestion objects.

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
Expand Down
Loading

0 comments on commit 27658a7

Please sign in to comment.