diff --git a/pkg/apis/controller/experiments/v1alpha3/experiment_types.go b/pkg/apis/controller/experiments/v1alpha3/experiment_types.go index 90beed89322..a82f8dae499 100644 --- a/pkg/apis/controller/experiments/v1alpha3/experiment_types.go +++ b/pkg/apis/controller/experiments/v1alpha3/experiment_types.go @@ -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"` diff --git a/pkg/controller.v1alpha3/experiment/util/status_util.go b/pkg/controller.v1alpha3/experiment/util/status_util.go index 4e4b820d017..09b08736dbf 100644 --- a/pkg/controller.v1alpha3/experiment/util/status_util.go +++ b/pkg/controller.v1alpha3/experiment/util/status_util.go @@ -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)