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

Implement GetExperimentInDB #558

Merged
merged 6 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/manager/v1alpha2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ func (s *server) RegisterExperiment(ctx context.Context, in *api_pb.RegisterExpe
return &api_pb.RegisterExperimentReply{}, err
}

// Register a Experiment to DB.
func (s *server) PreCheckRegisterExperiment(ctx context.Context, in *api_pb.RegisterExperimentRequest) (*api_pb.PreCheckRegisterExperimentReply, error) {
can_register, err := dbIf.PreCheckRegisterExperiment(in.Experiment)
return &api_pb.PreCheckRegisterExperimentReply{
CanRegister: can_register,
}, err
}

// Delete a Experiment from DB by name.
func (s *server) DeleteExperiment(ctx context.Context, in *api_pb.DeleteExperimentRequest) (*api_pb.DeleteExperimentReply, error) {
err := dbIf.DeleteExperiment(in.ExperimentName)
Expand Down
431 changes: 246 additions & 185 deletions pkg/api/v1alpha2/api.pb.go

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions pkg/api/v1alpha2/api.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions pkg/api/v1alpha2/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ service Manager {
};
};

/**
* PreCheck to register a Experiment to DB.
*/
rpc PreCheckRegisterExperiment(RegisterExperimentRequest) returns (PreCheckRegisterExperimentReply){
option (google.api.http) = {
post: "/api/Manager/PreCheckRegisterExperiment"
body: "experiment"
};
};


/**
* Delete a Experiment from DB by name.
*/
Expand Down Expand Up @@ -392,6 +403,9 @@ message RegisterExperimentRequest {
message RegisterExperimentReply {
}

message PreCheckRegisterExperimentReply {
bool can_register = 1;
}
message DeleteExperimentRequest {
string experiment_name = 1;
}
Expand Down
36 changes: 36 additions & 0 deletions pkg/api/v1alpha2/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,33 @@
]
}
},
"/api/Manager/PreCheckRegisterExperiment": {
"post": {
"summary": "*\nPreCheck to register a Experiment to DB.",
"operationId": "PreCheckRegisterExperiment",
"responses": {
"200": {
"description": "",
"schema": {
"$ref": "#/definitions/alpha2PreCheckRegisterExperimentReply"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/alpha2Experiment"
}
}
],
"tags": [
"Manager"
]
}
},
"/api/Manager/RegisterExperiment": {
"post": {
"summary": "*\nRegister a Experiment to DB.",
Expand Down Expand Up @@ -906,6 +933,15 @@
"default": "UNKNOWN_TYPE",
"description": "*\nTypes of value for HyperParameter."
},
"alpha2PreCheckRegisterExperimentReply": {
"type": "object",
"properties": {
"can_register": {
"type": "boolean",
"format": "boolean"
}
}
},
"alpha2RegisterExperimentReply": {
"type": "object"
},
Expand Down
Loading