diff --git a/pkg/apis/controller/experiments/v1beta1/experiment_types.go b/pkg/apis/controller/experiments/v1beta1/experiment_types.go index 19c5a83f051..2d8e1d6968b 100644 --- a/pkg/apis/controller/experiments/v1beta1/experiment_types.go +++ b/pkg/apis/controller/experiments/v1beta1/experiment_types.go @@ -221,6 +221,7 @@ const ( DistributionLogUniform Distribution = "logUniform" DistributionNormal Distribution = "normal" DistributionLogNormal Distribution = "logNormal" + DistributionUnknown Distribution = "unknown" ) // TrialTemplate describes structure of trial template diff --git a/pkg/apis/manager/v1beta1/api.pb.go b/pkg/apis/manager/v1beta1/api.pb.go index 8ca56b39563..862db115141 100644 --- a/pkg/apis/manager/v1beta1/api.pb.go +++ b/pkg/apis/manager/v1beta1/api.pb.go @@ -85,10 +85,11 @@ func (ParameterType) EnumDescriptor() ([]byte, []int) { type Distribution int32 const ( - Distribution_UNIFORM Distribution = 0 - Distribution_LOG_UNIFORM Distribution = 1 - Distribution_NORMAL Distribution = 2 - Distribution_LOG_NORMAL Distribution = 3 + Distribution_UNIFORM Distribution = 0 + Distribution_LOG_UNIFORM Distribution = 1 + Distribution_NORMAL Distribution = 2 + Distribution_LOG_NORMAL Distribution = 3 + Distribution_DISTRIBUTION_UNKNOWN Distribution = 4 ) // Enum value maps for Distribution. @@ -98,12 +99,14 @@ var ( 1: "LOG_UNIFORM", 2: "NORMAL", 3: "LOG_NORMAL", + 4: "DISTRIBUTION_UNKNOWN", } Distribution_value = map[string]int32{ - "UNIFORM": 0, - "LOG_UNIFORM": 1, - "NORMAL": 2, - "LOG_NORMAL": 3, + "UNIFORM": 0, + "LOG_UNIFORM": 1, + "NORMAL": 2, + "LOG_NORMAL": 3, + "DISTRIBUTION_UNKNOWN": 4, } ) @@ -3034,82 +3037,83 @@ var file_api_proto_rawDesc = []byte{ 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x43, 0x52, 0x45, 0x54, 0x45, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, - 0x49, 0x43, 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x48, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x49, 0x43, 0x41, 0x4c, 0x10, 0x04, 0x2a, 0x62, 0x0a, 0x0c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x49, 0x46, 0x4f, 0x52, 0x4d, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x4f, 0x47, 0x5f, 0x55, 0x4e, 0x49, 0x46, 0x4f, 0x52, 0x4d, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x4f, 0x47, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x03, - 0x2a, 0x38, 0x0a, 0x0d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, - 0x0a, 0x08, 0x4d, 0x49, 0x4e, 0x49, 0x4d, 0x49, 0x5a, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, - 0x4d, 0x41, 0x58, 0x49, 0x4d, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0e, 0x43, 0x6f, - 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, - 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, - 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x52, 0x45, - 0x41, 0x54, 0x45, 0x52, 0x10, 0x03, 0x32, 0xc6, 0x02, 0x0a, 0x09, 0x44, 0x42, 0x4d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x12, 0x6a, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x61, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x12, 0x6a, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, - 0xe1, 0x01, 0x0a, 0x0a, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x18, 0x0a, 0x14, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x04, 0x2a, 0x38, 0x0a, 0x0d, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x49, 0x4e, 0x49, + 0x4d, 0x49, 0x5a, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x41, 0x58, 0x49, 0x4d, 0x49, + 0x5a, 0x45, 0x10, 0x02, 0x2a, 0x4a, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, + 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x52, 0x49, 0x53, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x09, + 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x45, 0x53, + 0x53, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x10, 0x03, + 0x32, 0xc6, 0x02, 0x0a, 0x09, 0x44, 0x42, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x6a, + 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x61, 0x0a, 0x11, 0x47, 0x65, + 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, + 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x6a, 0x0a, + 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xe1, 0x01, 0x0a, 0x0a, 0x53, 0x75, + 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x58, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x67, + 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x79, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, + 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, + 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0xe0, 0x02, + 0x0a, 0x0d, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, + 0x6d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, + 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x58, + 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x79, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x67, - 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x32, 0xe0, 0x02, 0x0a, 0x0d, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x6d, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, 0x6c, - 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x2a, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, - 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x61, 0x72, - 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x58, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x72, - 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x85, - 0x01, 0x0a, 0x1d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, - 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, - 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x61, - 0x74, 0x69, 0x62, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x69, - 0x5f, 0x76, 0x31, 0x5f, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x54, 0x72, 0x69, 0x61, 0x6c, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x85, 0x01, 0x0a, 0x1d, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x45, 0x61, 0x72, 0x6c, 0x79, 0x53, 0x74, 0x6f, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, + 0x75, 0x62, 0x65, 0x66, 0x6c, 0x6f, 0x77, 0x2f, 0x6b, 0x61, 0x74, 0x69, 0x62, 0x2f, 0x70, 0x6b, + 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x31, 0x5f, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/apis/manager/v1beta1/api.proto b/pkg/apis/manager/v1beta1/api.proto index 553531918cc..f3fabf977dc 100644 --- a/pkg/apis/manager/v1beta1/api.proto +++ b/pkg/apis/manager/v1beta1/api.proto @@ -105,6 +105,7 @@ enum Distribution { LOG_UNIFORM = 1; NORMAL = 2; LOG_NORMAL = 3; + DISTRIBUTION_UNKNOWN = 4; } /** diff --git a/pkg/apis/manager/v1beta1/python/api_pb2.py b/pkg/apis/manager/v1beta1/python/api_pb2.py index 5ad1e167b6c..3a95a64b82b 100644 --- a/pkg/apis/manager/v1beta1/python/api_pb2.py +++ b/pkg/apis/manager/v1beta1/python/api_pb2.py @@ -14,7 +14,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tapi.proto\x12\x0c\x61pi.v1.beta1\"R\n\nExperiment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x04spec\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ExperimentSpecR\x04spec\"\x85\x04\n\x0e\x45xperimentSpec\x12T\n\x0fparameter_specs\x18\x01 \x01(\x0b\x32+.api.v1.beta1.ExperimentSpec.ParameterSpecsR\x0eparameterSpecs\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x39\n\talgorithm\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12\x46\n\x0e\x65\x61rly_stopping\x18\x04 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\x12\x30\n\x14parallel_trial_count\x18\x05 \x01(\x05R\x12parallelTrialCount\x12&\n\x0fmax_trial_count\x18\x06 \x01(\x05R\rmaxTrialCount\x12\x36\n\nnas_config\x18\x07 \x01(\x0b\x32\x17.api.v1.beta1.NasConfigR\tnasConfig\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"\xab\x01\n\rParameterSpec\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x42\n\x0eparameter_type\x18\x02 \x01(\x0e\x32\x1b.api.v1.beta1.ParameterTypeR\rparameterType\x12\x42\n\x0e\x66\x65\x61sible_space\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.FeasibleSpaceR\rfeasibleSpace\"\x9b\x01\n\rFeasibleSpace\x12\x10\n\x03max\x18\x01 \x01(\tR\x03max\x12\x10\n\x03min\x18\x02 \x01(\tR\x03min\x12\x12\n\x04list\x18\x03 \x03(\tR\x04list\x12\x12\n\x04step\x18\x04 \x01(\tR\x04step\x12>\n\x0c\x64istribution\x18\x05 \x01(\x0e\x32\x1a.api.v1.beta1.DistributionR\x0c\x64istribution\"\xc0\x01\n\rObjectiveSpec\x12/\n\x04type\x18\x01 \x01(\x0e\x32\x1b.api.v1.beta1.ObjectiveTypeR\x04type\x12\x12\n\x04goal\x18\x02 \x01(\x01R\x04goal\x12\x32\n\x15objective_metric_name\x18\x03 \x01(\tR\x13objectiveMetricName\x12\x36\n\x17\x61\x64\x64itional_metric_names\x18\x04 \x03(\tR\x15\x61\x64\x64itionalMetricNames\"\x85\x01\n\rAlgorithmSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12M\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\x1e.api.v1.beta1.AlgorithmSettingR\x11\x61lgorithmSettings\"<\n\x10\x41lgorithmSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x8d\x01\n\x11\x45\x61rlyStoppingSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12Q\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\".api.v1.beta1.EarlyStoppingSettingR\x11\x61lgorithmSettings\"@\n\x14\x45\x61rlyStoppingSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xd2\x01\n\tNasConfig\x12<\n\x0cgraph_config\x18\x01 \x01(\x0b\x32\x19.api.v1.beta1.GraphConfigR\x0bgraphConfig\x12\x42\n\noperations\x18\x02 \x01(\x0b\x32\".api.v1.beta1.NasConfig.OperationsR\noperations\x1a\x43\n\nOperations\x12\x35\n\toperation\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.OperationR\toperation\"p\n\x0bGraphConfig\x12\x1d\n\nnum_layers\x18\x01 \x01(\x05R\tnumLayers\x12\x1f\n\x0binput_sizes\x18\x02 \x03(\x05R\ninputSizes\x12!\n\x0coutput_sizes\x18\x03 \x03(\x05R\x0boutputSizes\"\xd2\x01\n\tOperation\x12%\n\x0eoperation_type\x18\x01 \x01(\tR\roperationType\x12O\n\x0fparameter_specs\x18\x02 \x01(\x0b\x32&.api.v1.beta1.Operation.ParameterSpecsR\x0eparameterSpecs\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"{\n\x05Trial\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12+\n\x04spec\x18\x02 \x01(\x0b\x32\x17.api.v1.beta1.TrialSpecR\x04spec\x12\x31\n\x06status\x18\x03 \x01(\x0b\x32\x19.api.v1.beta1.TrialStatusR\x06status\"\xfe\x02\n\tTrialSpec\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x61\n\x15parameter_assignments\x18\x03 \x01(\x0b\x32,.api.v1.beta1.TrialSpec.ParameterAssignmentsR\x14parameterAssignments\x12;\n\x06labels\x18\x04 \x03(\x0b\x32#.api.v1.beta1.TrialSpec.LabelsEntryR\x06labels\x1a[\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"?\n\x13ParameterAssignment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xed\x02\n\x0bTrialStatus\x12\x1d\n\nstart_time\x18\x01 \x01(\tR\tstartTime\x12\'\n\x0f\x63ompletion_time\x18\x02 \x01(\tR\x0e\x63ompletionTime\x12J\n\tcondition\x18\x03 \x01(\x0e\x32,.api.v1.beta1.TrialStatus.TrialConditionTypeR\tcondition\x12;\n\x0bobservation\x18\x04 \x01(\x0b\x32\x19.api.v1.beta1.ObservationR\x0bobservation\"\x8c\x01\n\x12TrialConditionType\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06KILLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x16\n\x12METRICSUNAVAILABLE\x10\x05\x12\x10\n\x0c\x45\x41RLYSTOPPED\x10\x06\x12\x0b\n\x07UNKNOWN\x10\x07\"=\n\x0bObservation\x12.\n\x07metrics\x18\x01 \x03(\x0b\x32\x14.api.v1.beta1.MetricR\x07metrics\"2\n\x06Metric\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x83\x01\n\x1bReportObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x45\n\x0fobservation_log\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"\x1b\n\x19ReportObservationLogReply\"J\n\x0eObservationLog\x12\x38\n\x0bmetric_logs\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.MetricLogR\nmetricLogs\"X\n\tMetricLog\x12\x1d\n\ntime_stamp\x18\x01 \x01(\tR\ttimeStamp\x12,\n\x06metric\x18\x02 \x01(\x0b\x32\x14.api.v1.beta1.MetricR\x06metric\"\x94\x01\n\x18GetObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x1f\n\x0bmetric_name\x18\x02 \x01(\tR\nmetricName\x12\x1d\n\nstart_time\x18\x03 \x01(\tR\tstartTime\x12\x19\n\x08\x65nd_time\x18\x04 \x01(\tR\x07\x65ndTime\"_\n\x16GetObservationLogReply\x12\x45\n\x0fobservation_log\x18\x01 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"<\n\x1b\x44\x65leteObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x1b\n\x19\x44\x65leteObservationLogReply\"\xe6\x01\n\x15GetSuggestionsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12\x34\n\x16\x63urrent_request_number\x18\x04 \x01(\x05R\x14\x63urrentRequestNumber\x12\x30\n\x14total_request_number\x18\x05 \x01(\x05R\x12totalRequestNumber\"\xa4\x04\n\x13GetSuggestionsReply\x12k\n\x15parameter_assignments\x18\x01 \x03(\x0b\x32\x36.api.v1.beta1.GetSuggestionsReply.ParameterAssignmentsR\x14parameterAssignments\x12\x39\n\talgorithm\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x03 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\x1a\x91\x02\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x12\x1d\n\ntrial_name\x18\x02 \x01(\tR\ttrialName\x12Z\n\x06labels\x18\x03 \x03(\x0b\x32\x42.api.v1.beta1.GetSuggestionsReply.ParameterAssignments.LabelsEntryR\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\\\n ValidateAlgorithmSettingsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\" \n\x1eValidateAlgorithmSettingsReply\"\xb3\x01\n\x1cGetEarlyStoppingRulesRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12,\n\x12\x64\x62_manager_address\x18\x03 \x01(\tR\x10\x64\x62ManagerAddress\"o\n\x1aGetEarlyStoppingRulesReply\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x01 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\"\x9a\x01\n\x11\x45\x61rlyStoppingRule\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x12<\n\ncomparison\x18\x03 \x01(\x0e\x32\x1c.api.v1.beta1.ComparisonTypeR\ncomparison\x12\x1d\n\nstart_step\x18\x04 \x01(\x05R\tstartStep\"n\n$ValidateEarlyStoppingSettingsRequest\x12\x46\n\x0e\x65\x61rly_stopping\x18\x01 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\"$\n\"ValidateEarlyStoppingSettingsReply\"6\n\x15SetTrialStatusRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x15\n\x13SetTrialStatusReply*U\n\rParameterType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\x07\n\x03INT\x10\x02\x12\x0c\n\x08\x44ISCRETE\x10\x03\x12\x0f\n\x0b\x43\x41TEGORICAL\x10\x04*H\n\x0c\x44istribution\x12\x0b\n\x07UNIFORM\x10\x00\x12\x0f\n\x0bLOG_UNIFORM\x10\x01\x12\n\n\x06NORMAL\x10\x02\x12\x0e\n\nLOG_NORMAL\x10\x03*8\n\rObjectiveType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08MINIMIZE\x10\x01\x12\x0c\n\x08MAXIMIZE\x10\x02*J\n\x0e\x43omparisonType\x12\x16\n\x12UNKNOWN_COMPARISON\x10\x00\x12\t\n\x05\x45QUAL\x10\x01\x12\x08\n\x04LESS\x10\x02\x12\x0b\n\x07GREATER\x10\x03\x32\xc6\x02\n\tDBManager\x12j\n\x14ReportObservationLog\x12).api.v1.beta1.ReportObservationLogRequest\x1a\'.api.v1.beta1.ReportObservationLogReply\x12\x61\n\x11GetObservationLog\x12&.api.v1.beta1.GetObservationLogRequest\x1a$.api.v1.beta1.GetObservationLogReply\x12j\n\x14\x44\x65leteObservationLog\x12).api.v1.beta1.DeleteObservationLogRequest\x1a\'.api.v1.beta1.DeleteObservationLogReply2\xe1\x01\n\nSuggestion\x12X\n\x0eGetSuggestions\x12#.api.v1.beta1.GetSuggestionsRequest\x1a!.api.v1.beta1.GetSuggestionsReply\x12y\n\x19ValidateAlgorithmSettings\x12..api.v1.beta1.ValidateAlgorithmSettingsRequest\x1a,.api.v1.beta1.ValidateAlgorithmSettingsReply2\xe0\x02\n\rEarlyStopping\x12m\n\x15GetEarlyStoppingRules\x12*.api.v1.beta1.GetEarlyStoppingRulesRequest\x1a(.api.v1.beta1.GetEarlyStoppingRulesReply\x12X\n\x0eSetTrialStatus\x12#.api.v1.beta1.SetTrialStatusRequest\x1a!.api.v1.beta1.SetTrialStatusReply\x12\x85\x01\n\x1dValidateEarlyStoppingSettings\x12\x32.api.v1.beta1.ValidateEarlyStoppingSettingsRequest\x1a\x30.api.v1.beta1.ValidateEarlyStoppingSettingsReplyBAZ?github.com/kubeflow/katib/pkg/apis/manager/v1beta1;api_v1_beta1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tapi.proto\x12\x0c\x61pi.v1.beta1\"R\n\nExperiment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x30\n\x04spec\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ExperimentSpecR\x04spec\"\x85\x04\n\x0e\x45xperimentSpec\x12T\n\x0fparameter_specs\x18\x01 \x01(\x0b\x32+.api.v1.beta1.ExperimentSpec.ParameterSpecsR\x0eparameterSpecs\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x39\n\talgorithm\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12\x46\n\x0e\x65\x61rly_stopping\x18\x04 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\x12\x30\n\x14parallel_trial_count\x18\x05 \x01(\x05R\x12parallelTrialCount\x12&\n\x0fmax_trial_count\x18\x06 \x01(\x05R\rmaxTrialCount\x12\x36\n\nnas_config\x18\x07 \x01(\x0b\x32\x17.api.v1.beta1.NasConfigR\tnasConfig\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"\xab\x01\n\rParameterSpec\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x42\n\x0eparameter_type\x18\x02 \x01(\x0e\x32\x1b.api.v1.beta1.ParameterTypeR\rparameterType\x12\x42\n\x0e\x66\x65\x61sible_space\x18\x03 \x01(\x0b\x32\x1b.api.v1.beta1.FeasibleSpaceR\rfeasibleSpace\"\x9b\x01\n\rFeasibleSpace\x12\x10\n\x03max\x18\x01 \x01(\tR\x03max\x12\x10\n\x03min\x18\x02 \x01(\tR\x03min\x12\x12\n\x04list\x18\x03 \x03(\tR\x04list\x12\x12\n\x04step\x18\x04 \x01(\tR\x04step\x12>\n\x0c\x64istribution\x18\x05 \x01(\x0e\x32\x1a.api.v1.beta1.DistributionR\x0c\x64istribution\"\xc0\x01\n\rObjectiveSpec\x12/\n\x04type\x18\x01 \x01(\x0e\x32\x1b.api.v1.beta1.ObjectiveTypeR\x04type\x12\x12\n\x04goal\x18\x02 \x01(\x01R\x04goal\x12\x32\n\x15objective_metric_name\x18\x03 \x01(\tR\x13objectiveMetricName\x12\x36\n\x17\x61\x64\x64itional_metric_names\x18\x04 \x03(\tR\x15\x61\x64\x64itionalMetricNames\"\x85\x01\n\rAlgorithmSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12M\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\x1e.api.v1.beta1.AlgorithmSettingR\x11\x61lgorithmSettings\"<\n\x10\x41lgorithmSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x8d\x01\n\x11\x45\x61rlyStoppingSpec\x12%\n\x0e\x61lgorithm_name\x18\x01 \x01(\tR\ralgorithmName\x12Q\n\x12\x61lgorithm_settings\x18\x02 \x03(\x0b\x32\".api.v1.beta1.EarlyStoppingSettingR\x11\x61lgorithmSettings\"@\n\x14\x45\x61rlyStoppingSetting\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xd2\x01\n\tNasConfig\x12<\n\x0cgraph_config\x18\x01 \x01(\x0b\x32\x19.api.v1.beta1.GraphConfigR\x0bgraphConfig\x12\x42\n\noperations\x18\x02 \x01(\x0b\x32\".api.v1.beta1.NasConfig.OperationsR\noperations\x1a\x43\n\nOperations\x12\x35\n\toperation\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.OperationR\toperation\"p\n\x0bGraphConfig\x12\x1d\n\nnum_layers\x18\x01 \x01(\x05R\tnumLayers\x12\x1f\n\x0binput_sizes\x18\x02 \x03(\x05R\ninputSizes\x12!\n\x0coutput_sizes\x18\x03 \x03(\x05R\x0boutputSizes\"\xd2\x01\n\tOperation\x12%\n\x0eoperation_type\x18\x01 \x01(\tR\roperationType\x12O\n\x0fparameter_specs\x18\x02 \x01(\x0b\x32&.api.v1.beta1.Operation.ParameterSpecsR\x0eparameterSpecs\x1aM\n\x0eParameterSpecs\x12;\n\nparameters\x18\x01 \x03(\x0b\x32\x1b.api.v1.beta1.ParameterSpecR\nparameters\"{\n\x05Trial\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12+\n\x04spec\x18\x02 \x01(\x0b\x32\x17.api.v1.beta1.TrialSpecR\x04spec\x12\x31\n\x06status\x18\x03 \x01(\x0b\x32\x19.api.v1.beta1.TrialStatusR\x06status\"\xfe\x02\n\tTrialSpec\x12\x39\n\tobjective\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.ObjectiveSpecR\tobjective\x12\x61\n\x15parameter_assignments\x18\x03 \x01(\x0b\x32,.api.v1.beta1.TrialSpec.ParameterAssignmentsR\x14parameterAssignments\x12;\n\x06labels\x18\x04 \x03(\x0b\x32#.api.v1.beta1.TrialSpec.LabelsEntryR\x06labels\x1a[\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"?\n\x13ParameterAssignment\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\xed\x02\n\x0bTrialStatus\x12\x1d\n\nstart_time\x18\x01 \x01(\tR\tstartTime\x12\'\n\x0f\x63ompletion_time\x18\x02 \x01(\tR\x0e\x63ompletionTime\x12J\n\tcondition\x18\x03 \x01(\x0e\x32,.api.v1.beta1.TrialStatus.TrialConditionTypeR\tcondition\x12;\n\x0bobservation\x18\x04 \x01(\x0b\x32\x19.api.v1.beta1.ObservationR\x0bobservation\"\x8c\x01\n\x12TrialConditionType\x12\x0b\n\x07\x43REATED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06KILLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x16\n\x12METRICSUNAVAILABLE\x10\x05\x12\x10\n\x0c\x45\x41RLYSTOPPED\x10\x06\x12\x0b\n\x07UNKNOWN\x10\x07\"=\n\x0bObservation\x12.\n\x07metrics\x18\x01 \x03(\x0b\x32\x14.api.v1.beta1.MetricR\x07metrics\"2\n\x06Metric\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"\x83\x01\n\x1bReportObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x45\n\x0fobservation_log\x18\x02 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"\x1b\n\x19ReportObservationLogReply\"J\n\x0eObservationLog\x12\x38\n\x0bmetric_logs\x18\x01 \x03(\x0b\x32\x17.api.v1.beta1.MetricLogR\nmetricLogs\"X\n\tMetricLog\x12\x1d\n\ntime_stamp\x18\x01 \x01(\tR\ttimeStamp\x12,\n\x06metric\x18\x02 \x01(\x0b\x32\x14.api.v1.beta1.MetricR\x06metric\"\x94\x01\n\x18GetObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\x12\x1f\n\x0bmetric_name\x18\x02 \x01(\tR\nmetricName\x12\x1d\n\nstart_time\x18\x03 \x01(\tR\tstartTime\x12\x19\n\x08\x65nd_time\x18\x04 \x01(\tR\x07\x65ndTime\"_\n\x16GetObservationLogReply\x12\x45\n\x0fobservation_log\x18\x01 \x01(\x0b\x32\x1c.api.v1.beta1.ObservationLogR\x0eobservationLog\"<\n\x1b\x44\x65leteObservationLogRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x1b\n\x19\x44\x65leteObservationLogReply\"\xe6\x01\n\x15GetSuggestionsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12\x34\n\x16\x63urrent_request_number\x18\x04 \x01(\x05R\x14\x63urrentRequestNumber\x12\x30\n\x14total_request_number\x18\x05 \x01(\x05R\x12totalRequestNumber\"\xa4\x04\n\x13GetSuggestionsReply\x12k\n\x15parameter_assignments\x18\x01 \x03(\x0b\x32\x36.api.v1.beta1.GetSuggestionsReply.ParameterAssignmentsR\x14parameterAssignments\x12\x39\n\talgorithm\x18\x02 \x01(\x0b\x32\x1b.api.v1.beta1.AlgorithmSpecR\talgorithm\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x03 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\x1a\x91\x02\n\x14ParameterAssignments\x12\x43\n\x0b\x61ssignments\x18\x01 \x03(\x0b\x32!.api.v1.beta1.ParameterAssignmentR\x0b\x61ssignments\x12\x1d\n\ntrial_name\x18\x02 \x01(\tR\ttrialName\x12Z\n\x06labels\x18\x03 \x03(\x0b\x32\x42.api.v1.beta1.GetSuggestionsReply.ParameterAssignments.LabelsEntryR\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\\\n ValidateAlgorithmSettingsRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\" \n\x1eValidateAlgorithmSettingsReply\"\xb3\x01\n\x1cGetEarlyStoppingRulesRequest\x12\x38\n\nexperiment\x18\x01 \x01(\x0b\x32\x18.api.v1.beta1.ExperimentR\nexperiment\x12+\n\x06trials\x18\x02 \x03(\x0b\x32\x13.api.v1.beta1.TrialR\x06trials\x12,\n\x12\x64\x62_manager_address\x18\x03 \x01(\tR\x10\x64\x62ManagerAddress\"o\n\x1aGetEarlyStoppingRulesReply\x12Q\n\x14\x65\x61rly_stopping_rules\x18\x01 \x03(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingRuleR\x12\x65\x61rlyStoppingRules\"\x9a\x01\n\x11\x45\x61rlyStoppingRule\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\x12<\n\ncomparison\x18\x03 \x01(\x0e\x32\x1c.api.v1.beta1.ComparisonTypeR\ncomparison\x12\x1d\n\nstart_step\x18\x04 \x01(\x05R\tstartStep\"n\n$ValidateEarlyStoppingSettingsRequest\x12\x46\n\x0e\x65\x61rly_stopping\x18\x01 \x01(\x0b\x32\x1f.api.v1.beta1.EarlyStoppingSpecR\rearlyStopping\"$\n\"ValidateEarlyStoppingSettingsReply\"6\n\x15SetTrialStatusRequest\x12\x1d\n\ntrial_name\x18\x01 \x01(\tR\ttrialName\"\x15\n\x13SetTrialStatusReply*U\n\rParameterType\x12\x10\n\x0cUNKNOWN_TYPE\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\x07\n\x03INT\x10\x02\x12\x0c\n\x08\x44ISCRETE\x10\x03\x12\x0f\n\x0b\x43\x41TEGORICAL\x10\x04*b\n\x0c\x44istribution\x12\x0b\n\x07UNIFORM\x10\x00\x12\x0f\n\x0bLOG_UNIFORM\x10\x01\x12\n\n\x06NORMAL\x10\x02\x12\x0e\n\nLOG_NORMAL\x10\x03\x12\x18\n\x14\x44ISTRIBUTION_UNKNOWN\x10\x04*8\n\rObjectiveType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0c\n\x08MINIMIZE\x10\x01\x12\x0c\n\x08MAXIMIZE\x10\x02*J\n\x0e\x43omparisonType\x12\x16\n\x12UNKNOWN_COMPARISON\x10\x00\x12\t\n\x05\x45QUAL\x10\x01\x12\x08\n\x04LESS\x10\x02\x12\x0b\n\x07GREATER\x10\x03\x32\xc6\x02\n\tDBManager\x12j\n\x14ReportObservationLog\x12).api.v1.beta1.ReportObservationLogRequest\x1a\'.api.v1.beta1.ReportObservationLogReply\x12\x61\n\x11GetObservationLog\x12&.api.v1.beta1.GetObservationLogRequest\x1a$.api.v1.beta1.GetObservationLogReply\x12j\n\x14\x44\x65leteObservationLog\x12).api.v1.beta1.DeleteObservationLogRequest\x1a\'.api.v1.beta1.DeleteObservationLogReply2\xe1\x01\n\nSuggestion\x12X\n\x0eGetSuggestions\x12#.api.v1.beta1.GetSuggestionsRequest\x1a!.api.v1.beta1.GetSuggestionsReply\x12y\n\x19ValidateAlgorithmSettings\x12..api.v1.beta1.ValidateAlgorithmSettingsRequest\x1a,.api.v1.beta1.ValidateAlgorithmSettingsReply2\xe0\x02\n\rEarlyStopping\x12m\n\x15GetEarlyStoppingRules\x12*.api.v1.beta1.GetEarlyStoppingRulesRequest\x1a(.api.v1.beta1.GetEarlyStoppingRulesReply\x12X\n\x0eSetTrialStatus\x12#.api.v1.beta1.SetTrialStatusRequest\x1a!.api.v1.beta1.SetTrialStatusReply\x12\x85\x01\n\x1dValidateEarlyStoppingSettings\x12\x32.api.v1.beta1.ValidateEarlyStoppingSettingsRequest\x1a\x30.api.v1.beta1.ValidateEarlyStoppingSettingsReplyBAZ?github.com/kubeflow/katib/pkg/apis/manager/v1beta1;api_v1_beta1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -29,11 +29,11 @@ _globals['_PARAMETERTYPE']._serialized_start=5425 _globals['_PARAMETERTYPE']._serialized_end=5510 _globals['_DISTRIBUTION']._serialized_start=5512 - _globals['_DISTRIBUTION']._serialized_end=5584 - _globals['_OBJECTIVETYPE']._serialized_start=5586 - _globals['_OBJECTIVETYPE']._serialized_end=5642 - _globals['_COMPARISONTYPE']._serialized_start=5644 - _globals['_COMPARISONTYPE']._serialized_end=5718 + _globals['_DISTRIBUTION']._serialized_end=5610 + _globals['_OBJECTIVETYPE']._serialized_start=5612 + _globals['_OBJECTIVETYPE']._serialized_end=5668 + _globals['_COMPARISONTYPE']._serialized_start=5670 + _globals['_COMPARISONTYPE']._serialized_end=5744 _globals['_EXPERIMENT']._serialized_start=27 _globals['_EXPERIMENT']._serialized_end=109 _globals['_EXPERIMENTSPEC']._serialized_start=112 @@ -124,10 +124,10 @@ _globals['_SETTRIALSTATUSREQUEST']._serialized_end=5400 _globals['_SETTRIALSTATUSREPLY']._serialized_start=5402 _globals['_SETTRIALSTATUSREPLY']._serialized_end=5423 - _globals['_DBMANAGER']._serialized_start=5721 - _globals['_DBMANAGER']._serialized_end=6047 - _globals['_SUGGESTION']._serialized_start=6050 - _globals['_SUGGESTION']._serialized_end=6275 - _globals['_EARLYSTOPPING']._serialized_start=6278 - _globals['_EARLYSTOPPING']._serialized_end=6630 + _globals['_DBMANAGER']._serialized_start=5747 + _globals['_DBMANAGER']._serialized_end=6073 + _globals['_SUGGESTION']._serialized_start=6076 + _globals['_SUGGESTION']._serialized_end=6301 + _globals['_EARLYSTOPPING']._serialized_start=6304 + _globals['_EARLYSTOPPING']._serialized_end=6656 # @@protoc_insertion_point(module_scope) diff --git a/pkg/apis/manager/v1beta1/python/api_pb2.pyi b/pkg/apis/manager/v1beta1/python/api_pb2.pyi index 47976f7059a..21cbb161d77 100644 --- a/pkg/apis/manager/v1beta1/python/api_pb2.pyi +++ b/pkg/apis/manager/v1beta1/python/api_pb2.pyi @@ -20,6 +20,7 @@ class Distribution(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): LOG_UNIFORM: _ClassVar[Distribution] NORMAL: _ClassVar[Distribution] LOG_NORMAL: _ClassVar[Distribution] + DISTRIBUTION_UNKNOWN: _ClassVar[Distribution] class ObjectiveType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -42,6 +43,7 @@ UNIFORM: Distribution LOG_UNIFORM: Distribution NORMAL: Distribution LOG_NORMAL: Distribution +DISTRIBUTION_UNKNOWN: Distribution UNKNOWN: ObjectiveType MINIMIZE: ObjectiveType MAXIMIZE: ObjectiveType diff --git a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go index 8db6f3b82f3..b77949ac9e5 100644 --- a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go +++ b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient.go @@ -532,13 +532,38 @@ func convertParameterType(typ experimentsv1beta1.ParameterType) suggestionapi.Pa } func convertFeasibleSpace(fs experimentsv1beta1.FeasibleSpace) *suggestionapi.FeasibleSpace { - res := &suggestionapi.FeasibleSpace{ - Max: fs.Max, - Min: fs.Min, - List: fs.List, - Step: fs.Step, + distribution := convertDistribution(fs.Distribution) + if distribution == suggestionapi.Distribution_DISTRIBUTION_UNKNOWN { + return &suggestionapi.FeasibleSpace{ + Max: fs.Max, + Min: fs.Min, + List: fs.List, + Step: fs.Step, + } + } + + return &suggestionapi.FeasibleSpace{ + Max: fs.Max, + Min: fs.Min, + List: fs.List, + Step: fs.Step, + Distribution: distribution, + } +} + +func convertDistribution(typ experimentsv1beta1.Distribution) suggestionapi.Distribution { + switch typ { + case experimentsv1beta1.DistributionUniform: + return suggestionapi.Distribution_UNIFORM + case experimentsv1beta1.DistributionLogUniform: + return suggestionapi.Distribution_LOG_UNIFORM + case experimentsv1beta1.DistributionNormal: + return suggestionapi.Distribution_NORMAL + case experimentsv1beta1.DistributionLogNormal: + return suggestionapi.Distribution_LOG_NORMAL + default: + return suggestionapi.Distribution_DISTRIBUTION_UNKNOWN } - return res } func convertComparison(comparison suggestionapi.ComparisonType) commonapiv1beta1.ComparisonType { diff --git a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go index b51e9f6cb29..c4df08bbfaa 100644 --- a/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go +++ b/pkg/controller.v1beta1/suggestion/suggestionclient/suggestionclient_test.go @@ -23,6 +23,8 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/onsi/gomega" "go.uber.org/mock/gomock" "google.golang.org/grpc" @@ -539,6 +541,96 @@ func TestConvertParameterType(t *testing.T) { } } +func TestConvertFeasibleSpace(t *testing.T) { + + tcs := []struct { + inFeasibleSpace experimentsv1beta1.FeasibleSpace + expectedFeasibleSpace *suggestionapi.FeasibleSpace + testDescription string + }{ + { + inFeasibleSpace: experimentsv1beta1.FeasibleSpace{ + Max: "10", + Min: "1", + List: []string{"1", "2", "3"}, + Step: "1", + Distribution: experimentsv1beta1.DistributionUnknown, + }, + expectedFeasibleSpace: &suggestionapi.FeasibleSpace{ + Max: "10", + Min: "1", + List: []string{"1", "2", "3"}, + Step: "1", + }, + testDescription: "Convert feasible space with unknown distribution", + }, + { + inFeasibleSpace: experimentsv1beta1.FeasibleSpace{ + Max: "100", + Min: "10", + Step: "10", + Distribution: experimentsv1beta1.DistributionUniform, + }, + expectedFeasibleSpace: &suggestionapi.FeasibleSpace{ + Max: "100", + Min: "10", + Step: "10", + Distribution: suggestionapi.Distribution_UNIFORM, + }, + testDescription: "Convert feasible space with uniform distribution", + }, + } + + for _, tc := range tcs { + actualFeasibleSpace := convertFeasibleSpace(tc.inFeasibleSpace) + if diff := cmp.Diff(tc.expectedFeasibleSpace, actualFeasibleSpace, cmpopts.IgnoreUnexported(suggestionapi.FeasibleSpace{})); diff != "" { + t.Errorf("Case: %v failed. Unexpected difference (-want +got):\n%s", tc.testDescription, diff) + } + } +} + +func TestConvertDistribution(t *testing.T) { + + tcs := []struct { + inDistribution experimentsv1beta1.Distribution + expectedDistribution suggestionapi.Distribution + testDescription string + }{ + { + inDistribution: experimentsv1beta1.DistributionUniform, + expectedDistribution: suggestionapi.Distribution_UNIFORM, + testDescription: "Convert uniform distribution", + }, + { + inDistribution: experimentsv1beta1.DistributionLogUniform, + expectedDistribution: suggestionapi.Distribution_LOG_UNIFORM, + testDescription: "Convert log-uniform distribution", + }, + { + inDistribution: experimentsv1beta1.DistributionNormal, + expectedDistribution: suggestionapi.Distribution_NORMAL, + testDescription: "Convert normal distribution", + }, + { + inDistribution: experimentsv1beta1.DistributionLogNormal, + expectedDistribution: suggestionapi.Distribution_LOG_NORMAL, + testDescription: "Convert log-normal distribution", + }, + { + inDistribution: experimentsv1beta1.DistributionUnknown, + expectedDistribution: suggestionapi.Distribution_DISTRIBUTION_UNKNOWN, + testDescription: "Convert unknown distribution", + }, + } + + for _, tc := range tcs { + actualDistribution := convertDistribution(tc.inDistribution) + if actualDistribution != tc.expectedDistribution { + t.Errorf("Case: %v failed. Expected distribution %v, got %v", tc.testDescription, tc.expectedDistribution, actualDistribution) + } + } +} + func TestConvertTrialObservation(t *testing.T) { tcs := []struct {