Skip to content

Commit

Permalink
Write entries to extra settings table during create (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnugeorge authored and k8s-ci-robot committed Jun 5, 2019
1 parent b0e0dd5 commit 77ae12d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/common/v1alpha2/katib_manager_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ func UpdateExperimentStatus(request *api_pb.UpdateExperimentStatusRequest) (*api
return kc.UpdateExperimentStatus(ctx, request)
}

func UpdateAlgorithmExtraSettings(request *api_pb.UpdateAlgorithmExtraSettingsRequest) (*api_pb.UpdateAlgorithmExtraSettingsReply, error) {
ctx := context.Background()
kcc, err := getKatibManagerClientAndConn()
if err != nil {
return nil, err
}
defer closeKatibManagerConnection(kcc)
kc := kcc.KatibManagerClient
return kc.UpdateAlgorithmExtraSettings(ctx, request)
}

func RegisterTrial(request *api_pb.RegisterTrialRequest) (*api_pb.RegisterTrialReply, error) {
ctx := context.Background()
kcc, err := getKatibManagerClientAndConn()
Expand Down
11 changes: 11 additions & 0 deletions pkg/controller/v1alpha2/experiment/managerclient/managerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ func (d *DefaultClient) CreateExperimentInDB(instance *experimentsv1alpha2.Exper
if _, err := commonv1alpha2.RegisterExperiment(request); err != nil {
return err
}
if len(experiment.Spec.Algorithm.AlgorithmSetting) > 0 {
req := &api_pb.UpdateAlgorithmExtraSettingsRequest{
ExperimentName: experiment.Name,
ExtraAlgorithmSettings: experiment.Spec.Algorithm.AlgorithmSetting,
}

if _, err := commonv1alpha2.UpdateAlgorithmExtraSettings(req); err != nil {
return err
}

}
return nil
}

Expand Down

0 comments on commit 77ae12d

Please sign in to comment.