Skip to content

Commit

Permalink
feat(experiment_status): Add trial name (#986)
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <gaoce@caicloud.io>
  • Loading branch information
gaocegege authored and k8s-ci-robot committed Dec 23, 2019
1 parent c426a76 commit 133845a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/apis/controller/experiments/v1alpha3/experiment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ type ExperimentStatus struct {
TrialsRunning int32 `json:"trialsRunning,omitempty"`
}

// OptimalTrial is the metrics and assignments of the best trial.
type OptimalTrial struct {
// BestTrialName is the name of the best trial.
BestTrialName string `json:"bestTrialName"`
// Key-value pairs for hyperparameters and assignment values.
ParameterAssignments []common.ParameterAssignment `json:"parameterAssignments"`

Expand Down
1 change: 1 addition & 0 deletions pkg/controller.v1alpha3/experiment/util/status_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func updateTrialsSummary(instance *experimentsv1alpha3.Experiment, trials *trial
if bestTrialIndex != -1 {
bestTrial := trials.Items[bestTrialIndex]

instance.Status.CurrentOptimalTrial.BestTrialName = bestTrial.Name
instance.Status.CurrentOptimalTrial.ParameterAssignments = []commonv1alpha3.ParameterAssignment{}
for _, parameterAssigment := range bestTrial.Spec.ParameterAssignments {
instance.Status.CurrentOptimalTrial.ParameterAssignments = append(instance.Status.CurrentOptimalTrial.ParameterAssignments, parameterAssigment)
Expand Down

0 comments on commit 133845a

Please sign in to comment.