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

Remove used katib-manager code #836

Merged
merged 1 commit into from
Sep 29, 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
93 changes: 0 additions & 93 deletions cmd/manager/v1alpha3/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,99 +26,6 @@ var dbIf common.KatibDBInterface
type server struct {
}

// Register a Experiment to DB.
func (s *server) RegisterExperiment(ctx context.Context, in *api_pb.RegisterExperimentRequest) (*api_pb.RegisterExperimentReply, error) {
err := dbIf.RegisterExperiment(in.Experiment)
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)
return &api_pb.DeleteExperimentReply{}, err
}

// Get a Experiment from DB by name.
func (s *server) GetExperiment(ctx context.Context, in *api_pb.GetExperimentRequest) (*api_pb.GetExperimentReply, error) {
exp, err := dbIf.GetExperiment(in.ExperimentName)
return &api_pb.GetExperimentReply{
Experiment: exp,
}, err
}

// Get a summary list of Experiment from DB.
// The summary includes name and condition.
func (s *server) GetExperimentList(ctx context.Context, in *api_pb.GetExperimentListRequest) (*api_pb.GetExperimentListReply, error) {
expList, err := dbIf.GetExperimentList()
return &api_pb.GetExperimentListReply{
ExperimentSummaries: expList,
}, err
}

// Update Status of a experiment.
func (s *server) UpdateExperimentStatus(ctx context.Context, in *api_pb.UpdateExperimentStatusRequest) (*api_pb.UpdateExperimentStatusReply, error) {
err := dbIf.UpdateExperimentStatus(in.ExperimentName, in.NewStatus)
return &api_pb.UpdateExperimentStatusReply{}, err
}

// Update AlgorithmExtraSettings.
// The ExtraSetting is created if it does not exist, otherwise it is overwrited.
func (s *server) UpdateAlgorithmExtraSettings(ctx context.Context, in *api_pb.UpdateAlgorithmExtraSettingsRequest) (*api_pb.UpdateAlgorithmExtraSettingsReply, error) {
err := dbIf.UpdateAlgorithmExtraSettings(in.ExperimentName, in.ExtraAlgorithmSettings)
return &api_pb.UpdateAlgorithmExtraSettingsReply{}, err
}

// Get all AlgorithmExtraSettings.
func (s *server) GetAlgorithmExtraSettings(ctx context.Context, in *api_pb.GetAlgorithmExtraSettingsRequest) (*api_pb.GetAlgorithmExtraSettingsReply, error) {
eas, err := dbIf.GetAlgorithmExtraSettings(in.ExperimentName)
return &api_pb.GetAlgorithmExtraSettingsReply{
ExtraAlgorithmSettings: eas,
}, err
}

// Register a Trial to DB.
// ID will be filled by manager automatically.
func (s *server) RegisterTrial(ctx context.Context, in *api_pb.RegisterTrialRequest) (*api_pb.RegisterTrialReply, error) {
err := dbIf.RegisterTrial(in.Trial)
return &api_pb.RegisterTrialReply{}, err
}

// Delete a Trial from DB by ID.
func (s *server) DeleteTrial(ctx context.Context, in *api_pb.DeleteTrialRequest) (*api_pb.DeleteTrialReply, error) {
err := dbIf.DeleteTrial(in.TrialName)
return &api_pb.DeleteTrialReply{}, err
}

// Get a list of Trial from DB by name of a Experiment.
func (s *server) GetTrialList(ctx context.Context, in *api_pb.GetTrialListRequest) (*api_pb.GetTrialListReply, error) {
trList, err := dbIf.GetTrialList(in.ExperimentName, in.Filter)
return &api_pb.GetTrialListReply{
Trials: trList,
}, err
}

// Get a Trial from DB by ID of Trial.
func (s *server) GetTrial(ctx context.Context, in *api_pb.GetTrialRequest) (*api_pb.GetTrialReply, error) {
tr, err := dbIf.GetTrial(in.TrialName)
return &api_pb.GetTrialReply{
Trial: tr,
}, err
}

// Update Status of a trial.
func (s *server) UpdateTrialStatus(ctx context.Context, in *api_pb.UpdateTrialStatusRequest) (*api_pb.UpdateTrialStatusReply, error) {
err := dbIf.UpdateTrialStatus(in.TrialName, in.NewStatus)
return &api_pb.UpdateTrialStatusReply{}, err
}

// Report a log of Observations for a Trial.
// The log consists of timestamp and value of metric.
// Katib store every log of metrics.
Expand Down
Loading