From 75c309dc7f4835a4f8295057b7a9beb6e9c1a998 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 25 Nov 2019 17:46:46 -0800 Subject: [PATCH 01/57] add namespace to some run APIs --- backend/api/go_client/run.pb.go | 279 ++++++++++-------- backend/api/go_client/run.pb.gw.go | 32 ++ .../create_experiment_parameters.go | 2 +- .../experiment_service_client.go | 8 +- .../get_experiment_parameters.go | 2 +- .../list_experiment_parameters.go | 3 +- .../job_service/job_service_client.go | 12 +- .../job_service/list_jobs_parameters.go | 5 +- .../list_pipelines_parameters.go | 3 +- .../pipeline_service_client.go | 10 +- .../run_service/delete_run_parameters.go | 29 ++ .../run_service/list_runs_parameters.go | 5 +- .../run_service/run_service_client.go | 18 +- backend/api/run.proto | 4 + backend/api/swagger/experiment.swagger.json | 10 +- backend/api/swagger/job.swagger.json | 10 +- .../swagger/kfp_api_single_file.swagger.json | 46 ++- backend/api/swagger/pipeline.swagger.json | 7 +- backend/api/swagger/run.swagger.json | 19 +- 19 files changed, 333 insertions(+), 171 deletions(-) diff --git a/backend/api/go_client/run.pb.go b/backend/api/go_client/run.pb.go index 8aa2c76f4c9..43ae4d765ce 100755 --- a/backend/api/go_client/run.pb.go +++ b/backend/api/go_client/run.pb.go @@ -61,7 +61,7 @@ func (x Run_StorageState) String() string { return proto.EnumName(Run_StorageState_name, int32(x)) } func (Run_StorageState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{9, 0} + return fileDescriptor_run_4d22bae5ddb03094, []int{9, 0} } type RunMetric_Format int32 @@ -87,7 +87,7 @@ func (x RunMetric_Format) String() string { return proto.EnumName(RunMetric_Format_name, int32(x)) } func (RunMetric_Format) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{12, 0} + return fileDescriptor_run_4d22bae5ddb03094, []int{12, 0} } type ReportRunMetricsResponse_ReportRunMetricResult_Status int32 @@ -119,11 +119,12 @@ func (x ReportRunMetricsResponse_ReportRunMetricResult_Status) String() string { return proto.EnumName(ReportRunMetricsResponse_ReportRunMetricResult_Status_name, int32(x)) } func (ReportRunMetricsResponse_ReportRunMetricResult_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{14, 0, 0} + return fileDescriptor_run_4d22bae5ddb03094, []int{14, 0, 0} } type CreateRunRequest struct { Run *Run `protobuf:"bytes,1,opt,name=run,proto3" json:"run,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -133,7 +134,7 @@ func (m *CreateRunRequest) Reset() { *m = CreateRunRequest{} } func (m *CreateRunRequest) String() string { return proto.CompactTextString(m) } func (*CreateRunRequest) ProtoMessage() {} func (*CreateRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{0} + return fileDescriptor_run_4d22bae5ddb03094, []int{0} } func (m *CreateRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateRunRequest.Unmarshal(m, b) @@ -160,6 +161,13 @@ func (m *CreateRunRequest) GetRun() *Run { return nil } +func (m *CreateRunRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + type GetRunRequest struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -171,7 +179,7 @@ func (m *GetRunRequest) Reset() { *m = GetRunRequest{} } func (m *GetRunRequest) String() string { return proto.CompactTextString(m) } func (*GetRunRequest) ProtoMessage() {} func (*GetRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{1} + return fileDescriptor_run_4d22bae5ddb03094, []int{1} } func (m *GetRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetRunRequest.Unmarshal(m, b) @@ -213,7 +221,7 @@ func (m *ListRunsRequest) Reset() { *m = ListRunsRequest{} } func (m *ListRunsRequest) String() string { return proto.CompactTextString(m) } func (*ListRunsRequest) ProtoMessage() {} func (*ListRunsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{2} + return fileDescriptor_run_4d22bae5ddb03094, []int{2} } func (m *ListRunsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRunsRequest.Unmarshal(m, b) @@ -270,6 +278,7 @@ func (m *ListRunsRequest) GetFilter() string { type TerminateRunRequest struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -279,7 +288,7 @@ func (m *TerminateRunRequest) Reset() { *m = TerminateRunRequest{} } func (m *TerminateRunRequest) String() string { return proto.CompactTextString(m) } func (*TerminateRunRequest) ProtoMessage() {} func (*TerminateRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{3} + return fileDescriptor_run_4d22bae5ddb03094, []int{3} } func (m *TerminateRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TerminateRunRequest.Unmarshal(m, b) @@ -306,8 +315,16 @@ func (m *TerminateRunRequest) GetRunId() string { return "" } +func (m *TerminateRunRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + type RetryRunRequest struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -317,7 +334,7 @@ func (m *RetryRunRequest) Reset() { *m = RetryRunRequest{} } func (m *RetryRunRequest) String() string { return proto.CompactTextString(m) } func (*RetryRunRequest) ProtoMessage() {} func (*RetryRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{4} + return fileDescriptor_run_4d22bae5ddb03094, []int{4} } func (m *RetryRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RetryRunRequest.Unmarshal(m, b) @@ -344,6 +361,13 @@ func (m *RetryRunRequest) GetRunId() string { return "" } +func (m *RetryRunRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + type ListRunsResponse struct { Runs []*Run `protobuf:"bytes,1,rep,name=runs,proto3" json:"runs,omitempty"` TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` @@ -357,7 +381,7 @@ func (m *ListRunsResponse) Reset() { *m = ListRunsResponse{} } func (m *ListRunsResponse) String() string { return proto.CompactTextString(m) } func (*ListRunsResponse) ProtoMessage() {} func (*ListRunsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{5} + return fileDescriptor_run_4d22bae5ddb03094, []int{5} } func (m *ListRunsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRunsResponse.Unmarshal(m, b) @@ -409,7 +433,7 @@ func (m *ArchiveRunRequest) Reset() { *m = ArchiveRunRequest{} } func (m *ArchiveRunRequest) String() string { return proto.CompactTextString(m) } func (*ArchiveRunRequest) ProtoMessage() {} func (*ArchiveRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{6} + return fileDescriptor_run_4d22bae5ddb03094, []int{6} } func (m *ArchiveRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ArchiveRunRequest.Unmarshal(m, b) @@ -447,7 +471,7 @@ func (m *UnarchiveRunRequest) Reset() { *m = UnarchiveRunRequest{} } func (m *UnarchiveRunRequest) String() string { return proto.CompactTextString(m) } func (*UnarchiveRunRequest) ProtoMessage() {} func (*UnarchiveRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{7} + return fileDescriptor_run_4d22bae5ddb03094, []int{7} } func (m *UnarchiveRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnarchiveRunRequest.Unmarshal(m, b) @@ -476,6 +500,7 @@ func (m *UnarchiveRunRequest) GetId() string { type DeleteRunRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -485,7 +510,7 @@ func (m *DeleteRunRequest) Reset() { *m = DeleteRunRequest{} } func (m *DeleteRunRequest) String() string { return proto.CompactTextString(m) } func (*DeleteRunRequest) ProtoMessage() {} func (*DeleteRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{8} + return fileDescriptor_run_4d22bae5ddb03094, []int{8} } func (m *DeleteRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteRunRequest.Unmarshal(m, b) @@ -512,6 +537,13 @@ func (m *DeleteRunRequest) GetId() string { return "" } +func (m *DeleteRunRequest) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + type Run struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` @@ -534,7 +566,7 @@ func (m *Run) Reset() { *m = Run{} } func (m *Run) String() string { return proto.CompactTextString(m) } func (*Run) ProtoMessage() {} func (*Run) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{9} + return fileDescriptor_run_4d22bae5ddb03094, []int{9} } func (m *Run) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Run.Unmarshal(m, b) @@ -650,7 +682,7 @@ func (m *PipelineRuntime) Reset() { *m = PipelineRuntime{} } func (m *PipelineRuntime) String() string { return proto.CompactTextString(m) } func (*PipelineRuntime) ProtoMessage() {} func (*PipelineRuntime) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{10} + return fileDescriptor_run_4d22bae5ddb03094, []int{10} } func (m *PipelineRuntime) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PipelineRuntime.Unmarshal(m, b) @@ -696,7 +728,7 @@ func (m *RunDetail) Reset() { *m = RunDetail{} } func (m *RunDetail) String() string { return proto.CompactTextString(m) } func (*RunDetail) ProtoMessage() {} func (*RunDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{11} + return fileDescriptor_run_4d22bae5ddb03094, []int{11} } func (m *RunDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RunDetail.Unmarshal(m, b) @@ -746,7 +778,7 @@ func (m *RunMetric) Reset() { *m = RunMetric{} } func (m *RunMetric) String() string { return proto.CompactTextString(m) } func (*RunMetric) ProtoMessage() {} func (*RunMetric) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{12} + return fileDescriptor_run_4d22bae5ddb03094, []int{12} } func (m *RunMetric) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RunMetric.Unmarshal(m, b) @@ -873,7 +905,7 @@ func (m *ReportRunMetricsRequest) Reset() { *m = ReportRunMetricsRequest func (m *ReportRunMetricsRequest) String() string { return proto.CompactTextString(m) } func (*ReportRunMetricsRequest) ProtoMessage() {} func (*ReportRunMetricsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{13} + return fileDescriptor_run_4d22bae5ddb03094, []int{13} } func (m *ReportRunMetricsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsRequest.Unmarshal(m, b) @@ -918,7 +950,7 @@ func (m *ReportRunMetricsResponse) Reset() { *m = ReportRunMetricsRespon func (m *ReportRunMetricsResponse) String() string { return proto.CompactTextString(m) } func (*ReportRunMetricsResponse) ProtoMessage() {} func (*ReportRunMetricsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{14} + return fileDescriptor_run_4d22bae5ddb03094, []int{14} } func (m *ReportRunMetricsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsResponse.Unmarshal(m, b) @@ -963,7 +995,7 @@ func (m *ReportRunMetricsResponse_ReportRunMetricResult) String() string { } func (*ReportRunMetricsResponse_ReportRunMetricResult) ProtoMessage() {} func (*ReportRunMetricsResponse_ReportRunMetricResult) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{14, 0} + return fileDescriptor_run_4d22bae5ddb03094, []int{14, 0} } func (m *ReportRunMetricsResponse_ReportRunMetricResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsResponse_ReportRunMetricResult.Unmarshal(m, b) @@ -1024,7 +1056,7 @@ func (m *ReadArtifactRequest) Reset() { *m = ReadArtifactRequest{} } func (m *ReadArtifactRequest) String() string { return proto.CompactTextString(m) } func (*ReadArtifactRequest) ProtoMessage() {} func (*ReadArtifactRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{15} + return fileDescriptor_run_4d22bae5ddb03094, []int{15} } func (m *ReadArtifactRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReadArtifactRequest.Unmarshal(m, b) @@ -1076,7 +1108,7 @@ func (m *ReadArtifactResponse) Reset() { *m = ReadArtifactResponse{} } func (m *ReadArtifactResponse) String() string { return proto.CompactTextString(m) } func (*ReadArtifactResponse) ProtoMessage() {} func (*ReadArtifactResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_d3e6e7c711d57876, []int{16} + return fileDescriptor_run_4d22bae5ddb03094, []int{16} } func (m *ReadArtifactResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReadArtifactResponse.Unmarshal(m, b) @@ -1496,106 +1528,107 @@ var _RunService_serviceDesc = grpc.ServiceDesc{ Metadata: "backend/api/run.proto", } -func init() { proto.RegisterFile("backend/api/run.proto", fileDescriptor_run_d3e6e7c711d57876) } - -var fileDescriptor_run_d3e6e7c711d57876 = []byte{ - // 1559 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdd, 0x4e, 0x1b, 0x49, - 0x16, 0xa6, 0x6d, 0xb0, 0xf1, 0xb1, 0x0d, 0x4d, 0xf1, 0xe7, 0x38, 0x20, 0x48, 0x93, 0x1f, 0x92, - 0x0d, 0xb6, 0x42, 0x56, 0x2b, 0x2d, 0xab, 0xd5, 0xaa, 0x01, 0x87, 0x78, 0x03, 0x86, 0x2d, 0x1b, - 0x56, 0xca, 0x5e, 0xb4, 0xda, 0xed, 0xb2, 0xe9, 0xc5, 0xee, 0xee, 0xad, 0xaa, 0x86, 0x25, 0x51, - 0x6e, 0x46, 0xca, 0x0b, 0xcc, 0x5c, 0xcc, 0xdd, 0x3c, 0x44, 0x1e, 0x62, 0xa4, 0xb9, 0x9e, 0xfb, - 0xb9, 0x9a, 0x07, 0x19, 0x75, 0x55, 0xb7, 0xd3, 0xfe, 0xc1, 0x48, 0xb9, 0x82, 0x3a, 0xe7, 0x3b, - 0x3f, 0x3e, 0xe7, 0x7c, 0xc7, 0xc7, 0xb0, 0xdc, 0x34, 0xad, 0x2b, 0xe2, 0xb4, 0xca, 0xa6, 0x67, - 0x97, 0xa9, 0xef, 0x94, 0x3c, 0xea, 0x72, 0x17, 0x25, 0x4d, 0xcf, 0x2e, 0xae, 0xc6, 0x75, 0x84, - 0x52, 0x97, 0x4a, 0x6d, 0xf1, 0x61, 0xc7, 0x75, 0x3b, 0x5d, 0x52, 0x16, 0xaf, 0xa6, 0xdf, 0x2e, - 0x93, 0x9e, 0xc7, 0x6f, 0x43, 0xe5, 0x5a, 0xa8, 0x0c, 0x8c, 0x4c, 0xc7, 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b4, 0x5d, 0x48, 0x49, 0x09, 0x9a, 0x87, 0xec, 0x79, 0xad, - 0x7e, 0x56, 0x39, 0xa8, 0xbe, 0xa9, 0x56, 0x0e, 0xd5, 0x29, 0x94, 0x86, 0x24, 0xd6, 0xff, 0xad, - 0x2a, 0x68, 0x0e, 0xe0, 0xac, 0x82, 0x0f, 0x2a, 0xb5, 0x86, 0x7e, 0x54, 0x51, 0x13, 0xfb, 0x69, - 0x98, 0x11, 0x09, 0x68, 0xef, 0x61, 0x15, 0x13, 0xcf, 0xa5, 0xbc, 0xef, 0x9e, 0x4d, 0x5e, 0x8f, - 0xf1, 0x29, 0x4a, 0x4c, 0x9e, 0xa2, 0x9f, 0x92, 0x50, 0x18, 0x75, 0x1e, 0x6e, 0xd4, 0x13, 0x48, - 0x53, 0xc2, 0xfc, 0x2e, 0x8f, 0x96, 0xea, 0xeb, 0x90, 0xae, 0xe3, 0xf1, 0xc3, 0x0a, 0x2c, 0x6c, - 0x71, 0xe4, 0xa3, 0xf8, 0x25, 0x01, 0xcb, 0x63, 0x21, 0x68, 0x03, 0xb2, 0x32, 0x21, 0x23, 0xd6, - 0x26, 0x90, 0xa2, 0x5a, 0xd0, 0xac, 0xc7, 0x30, 0x17, 0x01, 0x06, 0x7a, 0x96, 0x0b, 0x31, 0xb2, - 0x73, 0xb8, 0x4f, 0xb5, 0xa4, 0x68, 0xca, 0xde, 0x37, 0xa4, 0x5b, 0xaa, 0x0b, 0x0f, 0x7d, 0x9a, - 0x16, 0x82, 0x52, 0x32, 0x66, 0x76, 0x88, 0xe8, 0x74, 0x06, 0x47, 0x4f, 0xad, 0x05, 0x29, 0x89, - 0x1d, 0xed, 0x69, 0x0a, 0x12, 0xa7, 0xef, 0x54, 0x05, 0x2d, 0x81, 0x5a, 0xad, 0x5d, 0xe8, 0xc7, - 0xd5, 0x43, 0x43, 0xc7, 0x47, 0xe7, 0x27, 0x95, 0x5a, 0x43, 0x4d, 0xa0, 0x55, 0x58, 0x3c, 0x3c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, 0x22, 0x0b, 0x66, 0xa3, - 0xdb, 0x3b, 0x24, 0xc6, 0xd0, 0x29, 0xfe, 0x6d, 0x43, 0x15, 0x05, 0xa2, 0x81, 0xb3, 0xfd, 0xcf, - 0xca, 0xf7, 0xfa, 0x09, 0x5e, 0x83, 0x74, 0x8b, 0xb4, 0xcd, 0x60, 0xf1, 0x2f, 0xa0, 0x79, 0xc8, - 0x17, 0xb3, 0x22, 0x9e, 0x5c, 0xa6, 0xef, 0x37, 0x60, 0x1d, 0x52, 0xfb, 0xc4, 0xa4, 0x84, 0xa2, - 0xc5, 0xd9, 0x44, 0x31, 0x6f, 0xfa, 0xfc, 0xd2, 0xa5, 0xf6, 0x07, 0xf1, 0xcb, 0x6b, 0x33, 0xd1, - 0xcc, 0x01, 0xf4, 0x01, 0x53, 0xef, 0x5f, 0x77, 0x6c, 0x7e, 0xe9, 0x37, 0x4b, 0x96, 0xdb, 0x2b, - 0x5f, 0xf9, 0x4d, 0x12, 0xdc, 0x1b, 0xfd, 0xdf, 0x7f, 0xac, 0x1c, 0xff, 0xd1, 0xd7, 0x71, 0x0d, - 0xab, 0x6b, 0x13, 0x87, 0x37, 0x53, 0xe2, 0x23, 0xbc, 0xfe, 0x23, 0x00, 0x00, 0xff, 0xff, 0xd4, - 0xc7, 0xa6, 0xe7, 0xc6, 0x0e, 0x00, 0x00, +func init() { proto.RegisterFile("backend/api/run.proto", fileDescriptor_run_4d22bae5ddb03094) } + +var fileDescriptor_run_4d22bae5ddb03094 = []byte{ + // 1577 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xdd, 0x4e, 0x23, 0xcb, + 0x11, 0x66, 0x6c, 0xb0, 0x71, 0xd9, 0x86, 0xa1, 0xf9, 0xf3, 0x7a, 0x41, 0x70, 0x86, 0x73, 0xce, + 0xb2, 0x9b, 0x60, 0x6b, 0xd9, 0x28, 0x52, 0x88, 0x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x78, 0x56, + 0x5a, 0x0d, 0xd4, 0x23, 0x4a, 0x4c, 0x4e, 0xb0, 0xef, 0x60, 0xf2, 0x67, 0x9f, 0x30, 0x8e, 0x8a, + 0x90, 0xa4, 0xbe, 0x53, 0x50, 0xb6, 0x95, 0xdd, 0xec, 0xfe, 0x7c, 0xc9, 0xf4, 0xec, 0x52, 0xa0, + 0x0d, 0x84, 0x68, 0x03, 0x32, 0x8e, 0xd9, 0x27, 0xcc, 0x33, 0x2d, 0x52, 0x48, 0x6c, 0x2b, 0xbb, + 0x19, 0xfc, 0x20, 0xd0, 0x7e, 0x84, 0xfc, 0x29, 0xe1, 0x31, 0x57, 0xab, 0x90, 0xa2, 0xbe, 0x63, + 0xd8, 0x6d, 0xe1, 0x2d, 0x83, 0xe7, 0xa8, 0xef, 0x54, 0xdb, 0xda, 0xbf, 0x14, 0x58, 0xac, 0xd9, + 0x2c, 0x40, 0xb2, 0x08, 0xba, 0x09, 0xe0, 0x99, 0x5d, 0x62, 0x70, 0xf7, 0x86, 0x38, 0x21, 0x3c, + 0x13, 0x48, 0x9a, 0x81, 0x00, 0x3d, 0x07, 0xf1, 0x30, 0x98, 0xfd, 0x51, 0x06, 0x9e, 0xc3, 0xf3, + 0x81, 0xa0, 0x61, 0x7f, 0x24, 0x68, 0x1d, 0xd2, 0xcc, 0xa5, 0xdc, 0x68, 0xdd, 0x17, 0x92, 0xc2, + 0x30, 0x15, 0x3c, 0x0f, 0xef, 0xd1, 0x09, 0xac, 0x8d, 0x17, 0xca, 0xb8, 0x21, 0xf7, 0x85, 0x59, + 0xf1, 0xe9, 0x54, 0xf9, 0xe9, 0x42, 0xc8, 0x7b, 0x72, 0x8f, 0x57, 0x22, 0x3c, 0x8e, 0xe0, 0xef, + 0xc9, 0x3d, 0x5a, 0x83, 0x54, 0xc7, 0xee, 0x71, 0x42, 0x0b, 0x73, 0xd2, 0xbf, 0x7c, 0x69, 0xef, + 0x60, 0xb9, 0x49, 0x68, 0xdf, 0x76, 0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xd3, 0x7d, 0xd3, 0xb1, 0x3b, 0x84, 0x71, 0x31, 0x4b, 0x19, 0xac, 0x46, 0x8a, + 0xb3, 0x50, 0x1e, 0x80, 0xef, 0x5c, 0x7a, 0xd3, 0xe9, 0xb9, 0x77, 0x0f, 0xe0, 0xac, 0x04, 0x47, + 0x8a, 0x08, 0xac, 0x5d, 0x43, 0x06, 0xfb, 0xce, 0x31, 0xe1, 0xa6, 0xdd, 0x9b, 0xba, 0xa0, 0x7f, + 0x0b, 0x83, 0x48, 0x06, 0x95, 0x69, 0x89, 0x51, 0xcf, 0xee, 0xaf, 0x0c, 0xcd, 0x5b, 0x98, 0x32, + 0x5e, 0xf4, 0x86, 0x05, 0xda, 0xbf, 0x15, 0x11, 0x4a, 0x16, 0x6d, 0xc0, 0x16, 0x25, 0xc6, 0x96, + 0x75, 0x48, 0x3b, 0x6e, 0x9b, 0x04, 0x6b, 0x49, 0x92, 0x28, 0x15, 0x3c, 0xab, 0x6d, 0xb4, 0x03, + 0x39, 0xc7, 0xef, 0xb7, 0x08, 0x35, 0x6e, 0xcd, 0x9e, 0x2f, 0x37, 0x89, 0xf2, 0x76, 0x06, 0x67, + 0xa5, 0xf4, 0x2a, 0x10, 0xa2, 0x3d, 0x48, 0x75, 0x5c, 0xda, 0x37, 0xb9, 0xa0, 0x41, 0x8c, 0x64, + 0x32, 0x62, 0xe9, 0x44, 0x28, 0x71, 0x08, 0xd2, 0xf6, 0x21, 0x25, 0x25, 0x68, 0x11, 0xb2, 0x97, + 0xf5, 0xc6, 0x45, 0xe5, 0xa8, 0x7a, 0x52, 0xad, 0x1c, 0xab, 0x33, 0x28, 0x0d, 0x49, 0xac, 0xff, + 0x41, 0x55, 0xd0, 0x02, 0xc0, 0x45, 0x05, 0x1f, 0x55, 0xea, 0x4d, 0xfd, 0xb4, 0xa2, 0x26, 0x0e, + 0xd3, 0x30, 0x27, 0x12, 0xd0, 0x3e, 0xc0, 0x3a, 0x26, 0x9e, 0x4b, 0xf9, 0xc0, 0x3d, 0x7b, 0x62, + 0xb5, 0xc6, 0xa6, 0x28, 0x31, 0x7d, 0x8a, 0xfe, 0x99, 0x84, 0xc2, 0xb8, 0xf3, 0x70, 0xdf, 0x9e, + 0x41, 0x9a, 0x12, 0xe6, 0xf7, 0x78, 0xb4, 0x72, 0xdf, 0x84, 0x74, 0x9d, 0x8c, 0x1f, 0x55, 0x60, + 0x61, 0x8b, 0x23, 0x1f, 0xc5, 0xaf, 0x09, 0x58, 0x9d, 0x08, 0x41, 0x5b, 0x90, 0x95, 0x09, 0x19, + 0xb1, 0x36, 0x81, 0x14, 0xd5, 0x83, 0x66, 0x7d, 0x0f, 0x0b, 0x11, 0x60, 0xa8, 0x67, 0xb9, 0x10, + 0x23, 0x3b, 0x87, 0x07, 0x54, 0x4b, 0x8a, 0xa6, 0x1c, 0x7c, 0x43, 0xba, 0xa5, 0x86, 0xf0, 0x30, + 0xa0, 0x69, 0x21, 0x28, 0x25, 0x63, 0x66, 0x97, 0x88, 0x4e, 0x67, 0x70, 0xf4, 0xd4, 0xda, 0x90, + 0x92, 0xd8, 0xf1, 0x9e, 0xa6, 0x20, 0x71, 0xfe, 0x5e, 0x55, 0xd0, 0x0a, 0xa8, 0xd5, 0xfa, 0x95, + 0x5e, 0xab, 0x1e, 0x1b, 0x3a, 0x3e, 0xbd, 0x3c, 0xab, 0xd4, 0x9b, 0x6a, 0x02, 0xad, 0xc3, 0xf2, + 0xf1, 0xe5, 0x45, 0xad, 0x7a, 0x14, 0x50, 0x11, 0x57, 0x2e, 0xce, 0x71, 0xb3, 0x5a, 0x3f, 0x55, + 0x93, 0x08, 0xc1, 0x42, 0xb5, 0xde, 0xac, 0xe0, 0xba, 0x5e, 0x33, 0x2a, 0x18, 0x9f, 0x63, 0x75, + 0x56, 0xfb, 0x13, 0x2c, 0x63, 0x62, 0xb6, 0x75, 0xca, 0xed, 0x8e, 0x69, 0xf1, 0x27, 0x1a, 0x3f, + 0x65, 0xa8, 0xf3, 0x66, 0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 0x79, 0x3e, 0x51, 0xcc, 0x9b, 0x3e, 0xbf, 0x76, 0xa9, 0xfd, 0x51, 0xfc, 0xe2, 0xdb, + 0x4e, 0xb4, 0x72, 0x00, 0x03, 0xc0, 0xcc, 0x87, 0x37, 0x5d, 0x9b, 0x5f, 0xfb, 0xad, 0x92, 0xe5, + 0xf6, 0xcb, 0x37, 0x7e, 0x8b, 0x04, 0xf7, 0xc6, 0xe0, 0x77, 0x27, 0x2b, 0xc7, 0x7f, 0x6c, 0x76, + 0x5d, 0xc3, 0xea, 0xd9, 0xc4, 0xe1, 0xad, 0x94, 0xf8, 0x08, 0x6f, 0xfe, 0x1f, 0x00, 0x00, 0xff, + 0xff, 0xfb, 0x29, 0x4b, 0x96, 0x3e, 0x0f, 0x00, 0x00, } diff --git a/backend/api/go_client/run.pb.gw.go b/backend/api/go_client/run.pb.gw.go index df7e25cfb41..7b98a61b674 100755 --- a/backend/api/go_client/run.pb.gw.go +++ b/backend/api/go_client/run.pb.gw.go @@ -42,6 +42,10 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray +var ( + filter_RunService_CreateRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"run": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_RunService_CreateRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreateRunRequest var metadata runtime.ServerMetadata @@ -54,6 +58,10 @@ func request_RunService_CreateRun_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_CreateRun_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.CreateRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -157,6 +165,10 @@ func request_RunService_UnarchiveRun_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_RunService_DeleteRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_RunService_DeleteRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq DeleteRunRequest var metadata runtime.ServerMetadata @@ -179,6 +191,10 @@ func request_RunService_DeleteRun_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_DeleteRun_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.DeleteRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -268,6 +284,10 @@ func request_RunService_ReadArtifact_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_RunService_TerminateRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"run_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_RunService_TerminateRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq TerminateRunRequest var metadata runtime.ServerMetadata @@ -290,11 +310,19 @@ func request_RunService_TerminateRun_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err) } + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_TerminateRun_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.TerminateRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } +var ( + filter_RunService_RetryRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"run_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_RunService_RetryRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq RetryRunRequest var metadata runtime.ServerMetadata @@ -317,6 +345,10 @@ func request_RunService_RetryRun_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err) } + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_RetryRun_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.RetryRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err diff --git a/backend/api/go_http_client/experiment_client/experiment_service/create_experiment_parameters.go b/backend/api/go_http_client/experiment_client/experiment_service/create_experiment_parameters.go index 230a2653770..835ebbadeea 100644 --- a/backend/api/go_http_client/experiment_client/experiment_service/create_experiment_parameters.go +++ b/backend/api/go_http_client/experiment_client/experiment_service/create_experiment_parameters.go @@ -78,7 +78,7 @@ for the create experiment operation typically these are written to a http.Reques type CreateExperimentParams struct { /*Body - The experiment to be created + The experiment to be created. */ Body *experiment_model.APIExperiment diff --git a/backend/api/go_http_client/experiment_client/experiment_service/experiment_service_client.go b/backend/api/go_http_client/experiment_client/experiment_service/experiment_service_client.go index 174ad5415fb..af834f1d060 100644 --- a/backend/api/go_http_client/experiment_client/experiment_service/experiment_service_client.go +++ b/backend/api/go_http_client/experiment_client/experiment_service/experiment_service_client.go @@ -39,7 +39,7 @@ type Client struct { } /* -CreateExperiment create experiment API +CreateExperiment creates a new experiment */ func (a *Client) CreateExperiment(params *CreateExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*CreateExperimentOK, error) { // TODO: Validate the params before sending @@ -68,7 +68,7 @@ func (a *Client) CreateExperiment(params *CreateExperimentParams, authInfo runti } /* -DeleteExperiment delete experiment API +DeleteExperiment deletes an experiment */ func (a *Client) DeleteExperiment(params *DeleteExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteExperimentOK, error) { // TODO: Validate the params before sending @@ -97,7 +97,7 @@ func (a *Client) DeleteExperiment(params *DeleteExperimentParams, authInfo runti } /* -GetExperiment get experiment API +GetExperiment finds a specific experiment by ID */ func (a *Client) GetExperiment(params *GetExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*GetExperimentOK, error) { // TODO: Validate the params before sending @@ -126,7 +126,7 @@ func (a *Client) GetExperiment(params *GetExperimentParams, authInfo runtime.Cli } /* -ListExperiment list experiment API +ListExperiment finds all experiments */ func (a *Client) ListExperiment(params *ListExperimentParams, authInfo runtime.ClientAuthInfoWriter) (*ListExperimentOK, error) { // TODO: Validate the params before sending diff --git a/backend/api/go_http_client/experiment_client/experiment_service/get_experiment_parameters.go b/backend/api/go_http_client/experiment_client/experiment_service/get_experiment_parameters.go index 67f5d5b11ee..d128460fc35 100644 --- a/backend/api/go_http_client/experiment_client/experiment_service/get_experiment_parameters.go +++ b/backend/api/go_http_client/experiment_client/experiment_service/get_experiment_parameters.go @@ -76,7 +76,7 @@ for the get experiment operation typically these are written to a http.Request type GetExperimentParams struct { /*ID - The ID of the experiment to be retrieved + The ID of the experiment to be retrieved. */ ID string diff --git a/backend/api/go_http_client/experiment_client/experiment_service/list_experiment_parameters.go b/backend/api/go_http_client/experiment_client/experiment_service/list_experiment_parameters.go index 18a39e3f3b1..caa4b0b00e4 100644 --- a/backend/api/go_http_client/experiment_client/experiment_service/list_experiment_parameters.go +++ b/backend/api/go_http_client/experiment_client/experiment_service/list_experiment_parameters.go @@ -78,7 +78,8 @@ type ListExperimentParams struct { /*Filter A url-encoded, JSON-serialized Filter protocol buffer (see - filter.proto). + [filter.proto](https://github.com/kubeflow/pipelines/ + blob/master/backend/api/filter.proto)). */ Filter *string diff --git a/backend/api/go_http_client/job_client/job_service/job_service_client.go b/backend/api/go_http_client/job_client/job_service/job_service_client.go index 271b8a6ce59..004cf07ba8a 100644 --- a/backend/api/go_http_client/job_client/job_service/job_service_client.go +++ b/backend/api/go_http_client/job_client/job_service/job_service_client.go @@ -39,7 +39,7 @@ type Client struct { } /* -CreateJob create job API +CreateJob creates a new job */ func (a *Client) CreateJob(params *CreateJobParams, authInfo runtime.ClientAuthInfoWriter) (*CreateJobOK, error) { // TODO: Validate the params before sending @@ -68,7 +68,7 @@ func (a *Client) CreateJob(params *CreateJobParams, authInfo runtime.ClientAuthI } /* -DeleteJob delete job API +DeleteJob deletes a job */ func (a *Client) DeleteJob(params *DeleteJobParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteJobOK, error) { // TODO: Validate the params before sending @@ -97,7 +97,7 @@ func (a *Client) DeleteJob(params *DeleteJobParams, authInfo runtime.ClientAuthI } /* -DisableJob disable job API +DisableJob disables a job */ func (a *Client) DisableJob(params *DisableJobParams, authInfo runtime.ClientAuthInfoWriter) (*DisableJobOK, error) { // TODO: Validate the params before sending @@ -126,7 +126,7 @@ func (a *Client) DisableJob(params *DisableJobParams, authInfo runtime.ClientAut } /* -EnableJob enable job API +EnableJob enables a job */ func (a *Client) EnableJob(params *EnableJobParams, authInfo runtime.ClientAuthInfoWriter) (*EnableJobOK, error) { // TODO: Validate the params before sending @@ -155,7 +155,7 @@ func (a *Client) EnableJob(params *EnableJobParams, authInfo runtime.ClientAuthI } /* -GetJob get job API +GetJob finds a specific job by ID */ func (a *Client) GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWriter) (*GetJobOK, error) { // TODO: Validate the params before sending @@ -184,7 +184,7 @@ func (a *Client) GetJob(params *GetJobParams, authInfo runtime.ClientAuthInfoWri } /* -ListJobs list jobs API +ListJobs finds all jobs */ func (a *Client) ListJobs(params *ListJobsParams, authInfo runtime.ClientAuthInfoWriter) (*ListJobsOK, error) { // TODO: Validate the params before sending diff --git a/backend/api/go_http_client/job_client/job_service/list_jobs_parameters.go b/backend/api/go_http_client/job_client/job_service/list_jobs_parameters.go index 9bde0a8072c..ec3c371226a 100644 --- a/backend/api/go_http_client/job_client/job_service/list_jobs_parameters.go +++ b/backend/api/go_http_client/job_client/job_service/list_jobs_parameters.go @@ -90,7 +90,8 @@ type ListJobsParams struct { /*Filter A url-encoded, JSON-serialized Filter protocol buffer (see - filter.proto). + [filter.proto](https://github.com/kubeflow/pipelines/ + blob/master/backend/api/filter.proto)). */ Filter *string @@ -109,7 +110,7 @@ type ListJobsParams struct { */ ResourceReferenceKeyType *string /*SortBy - Can be format of "field_name", "field_name asc" or "field_name des" + Can be format of "field_name", "field_name asc" or "field_name des". Ascending by default. */ diff --git a/backend/api/go_http_client/pipeline_client/pipeline_service/list_pipelines_parameters.go b/backend/api/go_http_client/pipeline_client/pipeline_service/list_pipelines_parameters.go index 0336da5df20..cbe9cb829bb 100644 --- a/backend/api/go_http_client/pipeline_client/pipeline_service/list_pipelines_parameters.go +++ b/backend/api/go_http_client/pipeline_client/pipeline_service/list_pipelines_parameters.go @@ -78,7 +78,8 @@ type ListPipelinesParams struct { /*Filter A url-encoded, JSON-serialized Filter protocol buffer (see - filter.proto). + [filter.proto](https://github.com/kubeflow/pipelines/ + blob/master/backend/api/filter.proto)). */ Filter *string diff --git a/backend/api/go_http_client/pipeline_client/pipeline_service/pipeline_service_client.go b/backend/api/go_http_client/pipeline_client/pipeline_service/pipeline_service_client.go index d6d589b812f..c6bbfd23d9a 100644 --- a/backend/api/go_http_client/pipeline_client/pipeline_service/pipeline_service_client.go +++ b/backend/api/go_http_client/pipeline_client/pipeline_service/pipeline_service_client.go @@ -39,7 +39,7 @@ type Client struct { } /* -CreatePipeline create pipeline API +CreatePipeline adds a pipeline */ func (a *Client) CreatePipeline(params *CreatePipelineParams, authInfo runtime.ClientAuthInfoWriter) (*CreatePipelineOK, error) { // TODO: Validate the params before sending @@ -68,7 +68,7 @@ func (a *Client) CreatePipeline(params *CreatePipelineParams, authInfo runtime.C } /* -DeletePipeline delete pipeline API +DeletePipeline deletes a pipeline */ func (a *Client) DeletePipeline(params *DeletePipelineParams, authInfo runtime.ClientAuthInfoWriter) (*DeletePipelineOK, error) { // TODO: Validate the params before sending @@ -97,7 +97,7 @@ func (a *Client) DeletePipeline(params *DeletePipelineParams, authInfo runtime.C } /* -GetPipeline get pipeline API +GetPipeline finds a specific pipeline by ID */ func (a *Client) GetPipeline(params *GetPipelineParams, authInfo runtime.ClientAuthInfoWriter) (*GetPipelineOK, error) { // TODO: Validate the params before sending @@ -126,7 +126,7 @@ func (a *Client) GetPipeline(params *GetPipelineParams, authInfo runtime.ClientA } /* -GetTemplate get template API +GetTemplate gets a y a m l template for the selected pipeline */ func (a *Client) GetTemplate(params *GetTemplateParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplateOK, error) { // TODO: Validate the params before sending @@ -155,7 +155,7 @@ func (a *Client) GetTemplate(params *GetTemplateParams, authInfo runtime.ClientA } /* -ListPipelines list pipelines API +ListPipelines finds all pipelines */ func (a *Client) ListPipelines(params *ListPipelinesParams, authInfo runtime.ClientAuthInfoWriter) (*ListPipelinesOK, error) { // TODO: Validate the params before sending diff --git a/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go b/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go index 3aaa0bb2b0a..767924239ce 100644 --- a/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go +++ b/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go @@ -77,6 +77,8 @@ type DeleteRunParams struct { /*ID*/ ID string + /*Namespace*/ + Namespace *string timeout time.Duration Context context.Context @@ -127,6 +129,17 @@ func (o *DeleteRunParams) SetID(id string) { o.ID = id } +// WithNamespace adds the namespace to the delete run params +func (o *DeleteRunParams) WithNamespace(namespace *string) *DeleteRunParams { + o.SetNamespace(namespace) + return o +} + +// SetNamespace adds the namespace to the delete run params +func (o *DeleteRunParams) SetNamespace(namespace *string) { + o.Namespace = namespace +} + // WriteToRequest writes these params to a swagger request func (o *DeleteRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -140,6 +153,22 @@ func (o *DeleteRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg return err } + if o.Namespace != nil { + + // query param namespace + var qrNamespace string + if o.Namespace != nil { + qrNamespace = *o.Namespace + } + qNamespace := qrNamespace + if qNamespace != "" { + if err := r.SetQueryParam("namespace", qNamespace); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/backend/api/go_http_client/run_client/run_service/list_runs_parameters.go b/backend/api/go_http_client/run_client/run_service/list_runs_parameters.go index 213a4215603..13f6c38325d 100644 --- a/backend/api/go_http_client/run_client/run_service/list_runs_parameters.go +++ b/backend/api/go_http_client/run_client/run_service/list_runs_parameters.go @@ -90,7 +90,8 @@ type ListRunsParams struct { /*Filter A url-encoded, JSON-serialized Filter protocol buffer (see - filter.proto). + [filter.proto](https://github.com/kubeflow/pipelines/ + blob/master/backend/api/filter.proto)). */ Filter *string @@ -110,7 +111,7 @@ type ListRunsParams struct { ResourceReferenceKeyType *string /*SortBy Can be format of "field_name", "field_name asc" or "field_name des" - Ascending by default. + (Example, "name asc" or "id des"). Ascending by default. */ SortBy *string diff --git a/backend/api/go_http_client/run_client/run_service/run_service_client.go b/backend/api/go_http_client/run_client/run_service/run_service_client.go index 743377492ee..dd05b55b191 100644 --- a/backend/api/go_http_client/run_client/run_service/run_service_client.go +++ b/backend/api/go_http_client/run_client/run_service/run_service_client.go @@ -39,7 +39,7 @@ type Client struct { } /* -ArchiveRun archive run API +ArchiveRun archives a run */ func (a *Client) ArchiveRun(params *ArchiveRunParams, authInfo runtime.ClientAuthInfoWriter) (*ArchiveRunOK, error) { // TODO: Validate the params before sending @@ -68,7 +68,7 @@ func (a *Client) ArchiveRun(params *ArchiveRunParams, authInfo runtime.ClientAut } /* -CreateRun create run API +CreateRun creates a new run */ func (a *Client) CreateRun(params *CreateRunParams, authInfo runtime.ClientAuthInfoWriter) (*CreateRunOK, error) { // TODO: Validate the params before sending @@ -97,7 +97,7 @@ func (a *Client) CreateRun(params *CreateRunParams, authInfo runtime.ClientAuthI } /* -DeleteRun delete run API +DeleteRun deletes a run */ func (a *Client) DeleteRun(params *DeleteRunParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRunOK, error) { // TODO: Validate the params before sending @@ -126,7 +126,7 @@ func (a *Client) DeleteRun(params *DeleteRunParams, authInfo runtime.ClientAuthI } /* -GetRun get run API +GetRun finds a specific run by ID */ func (a *Client) GetRun(params *GetRunParams, authInfo runtime.ClientAuthInfoWriter) (*GetRunOK, error) { // TODO: Validate the params before sending @@ -155,7 +155,7 @@ func (a *Client) GetRun(params *GetRunParams, authInfo runtime.ClientAuthInfoWri } /* -ListRuns list runs API +ListRuns finds all runs */ func (a *Client) ListRuns(params *ListRunsParams, authInfo runtime.ClientAuthInfoWriter) (*ListRunsOK, error) { // TODO: Validate the params before sending @@ -184,7 +184,7 @@ func (a *Client) ListRuns(params *ListRunsParams, authInfo runtime.ClientAuthInf } /* -ReadArtifact read artifact API +ReadArtifact finds a run s artifact data */ func (a *Client) ReadArtifact(params *ReadArtifactParams, authInfo runtime.ClientAuthInfoWriter) (*ReadArtifactOK, error) { // TODO: Validate the params before sending @@ -242,7 +242,7 @@ func (a *Client) ReportRunMetrics(params *ReportRunMetricsParams, authInfo runti } /* -RetryRun retry run API +RetryRun res initiate a failed or terminated run */ func (a *Client) RetryRun(params *RetryRunParams, authInfo runtime.ClientAuthInfoWriter) (*RetryRunOK, error) { // TODO: Validate the params before sending @@ -271,7 +271,7 @@ func (a *Client) RetryRun(params *RetryRunParams, authInfo runtime.ClientAuthInf } /* -TerminateRun terminate run API +TerminateRun terminates an active run */ func (a *Client) TerminateRun(params *TerminateRunParams, authInfo runtime.ClientAuthInfoWriter) (*TerminateRunOK, error) { // TODO: Validate the params before sending @@ -300,7 +300,7 @@ func (a *Client) TerminateRun(params *TerminateRunParams, authInfo runtime.Clien } /* -UnarchiveRun unarchive run API +UnarchiveRun restores an archived run */ func (a *Client) UnarchiveRun(params *UnarchiveRunParams, authInfo runtime.ClientAuthInfoWriter) (*UnarchiveRunOK, error) { // TODO: Validate the params before sending diff --git a/backend/api/run.proto b/backend/api/run.proto index 986ab7f4176..e1985c27d89 100644 --- a/backend/api/run.proto +++ b/backend/api/run.proto @@ -140,6 +140,7 @@ service RunService { message CreateRunRequest { Run run = 1; + string namespace = 2; } message GetRunRequest { @@ -166,10 +167,12 @@ message ListRunsRequest { message TerminateRunRequest { string run_id = 1; + string namespace = 2; } message RetryRunRequest { string run_id = 1; + string namespace = 2; } message ListRunsResponse { @@ -188,6 +191,7 @@ message UnarchiveRunRequest { message DeleteRunRequest { string id = 1; + string namespace = 2; } message Run { diff --git a/backend/api/swagger/experiment.swagger.json b/backend/api/swagger/experiment.swagger.json index 2c1e31bff01..e688de494ba 100644 --- a/backend/api/swagger/experiment.swagger.json +++ b/backend/api/swagger/experiment.swagger.json @@ -17,6 +17,7 @@ "paths": { "/apis/v1beta1/experiments": { "get": { + "summary": "Find all experiments.", "operationId": "ListExperiment", "responses": { "200": { @@ -55,7 +56,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -66,6 +67,7 @@ ] }, "post": { + "summary": "Create a new experiment.", "operationId": "CreateExperiment", "responses": { "200": { @@ -84,7 +86,7 @@ "parameters": [ { "name": "body", - "description": "The experiment to be created", + "description": "The experiment to be created.", "in": "body", "required": true, "schema": { @@ -99,6 +101,7 @@ }, "/apis/v1beta1/experiments/{id}": { "get": { + "summary": "Find a specific experiment by ID.", "operationId": "GetExperiment", "responses": { "200": { @@ -117,7 +120,7 @@ "parameters": [ { "name": "id", - "description": "The ID of the experiment to be retrieved", + "description": "The ID of the experiment to be retrieved.", "in": "path", "required": true, "type": "string" @@ -128,6 +131,7 @@ ] }, "delete": { + "summary": "Delete an experiment.", "operationId": "DeleteExperiment", "responses": { "200": { diff --git a/backend/api/swagger/job.swagger.json b/backend/api/swagger/job.swagger.json index adfd13f0f2f..2a485f7a4cd 100644 --- a/backend/api/swagger/job.swagger.json +++ b/backend/api/swagger/job.swagger.json @@ -17,6 +17,7 @@ "paths": { "/apis/v1beta1/jobs": { "get": { + "summary": "Find all jobs.", "operationId": "ListJobs", "responses": { "200": { @@ -48,7 +49,7 @@ }, { "name": "sort_by", - "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\"\nAscending by default.", + "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\".\nAscending by default.", "in": "query", "required": false, "type": "string" @@ -77,7 +78,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -88,6 +89,7 @@ ] }, "post": { + "summary": "Create a new job.", "operationId": "CreateJob", "responses": { "200": { @@ -121,6 +123,7 @@ }, "/apis/v1beta1/jobs/{id}": { "get": { + "summary": "Find a specific job by ID.", "operationId": "GetJob", "responses": { "200": { @@ -150,6 +153,7 @@ ] }, "delete": { + "summary": "Delete a job.", "operationId": "DeleteJob", "responses": { "200": { @@ -181,6 +185,7 @@ }, "/apis/v1beta1/jobs/{id}/disable": { "post": { + "summary": "Disable a job.", "operationId": "DisableJob", "responses": { "200": { @@ -212,6 +217,7 @@ }, "/apis/v1beta1/jobs/{id}/enable": { "post": { + "summary": "Enable a job.", "operationId": "EnableJob", "responses": { "200": { diff --git a/backend/api/swagger/kfp_api_single_file.swagger.json b/backend/api/swagger/kfp_api_single_file.swagger.json index 124fee5c6ae..d17b157ed1e 100644 --- a/backend/api/swagger/kfp_api_single_file.swagger.json +++ b/backend/api/swagger/kfp_api_single_file.swagger.json @@ -18,6 +18,7 @@ "paths": { "/apis/v1beta1/runs": { "get": { + "summary": "Find all runs.", "operationId": "ListRuns", "responses": { "200": { @@ -49,7 +50,7 @@ }, { "name": "sort_by", - "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\"\nAscending by default.", + "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\"\n(Example, \"name asc\" or \"id des\"). Ascending by default.", "in": "query", "required": false, "type": "string" @@ -78,7 +79,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -89,6 +90,7 @@ ] }, "post": { + "summary": "Create a new run.", "operationId": "CreateRun", "responses": { "200": { @@ -121,6 +123,7 @@ }, "/apis/v1beta1/runs/{id}": { "delete": { + "summary": "Delete a run.", "operationId": "DeleteRun", "responses": { "200": { @@ -142,6 +145,12 @@ "in": "path", "required": true, "type": "string" + }, + { + "name": "namespace", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -151,6 +160,7 @@ }, "/apis/v1beta1/runs/{id}:archive": { "post": { + "summary": "Archive a run.", "operationId": "ArchiveRun", "responses": { "200": { @@ -181,6 +191,7 @@ }, "/apis/v1beta1/runs/{id}:unarchive": { "post": { + "summary": "Restore an archived run.", "operationId": "UnarchiveRun", "responses": { "200": { @@ -211,6 +222,7 @@ }, "/apis/v1beta1/runs/{run_id}": { "get": { + "summary": "Find a specific run by ID.", "operationId": "GetRun", "responses": { "200": { @@ -241,6 +253,7 @@ }, "/apis/v1beta1/runs/{run_id}/nodes/{node_id}/artifacts/{artifact_name}:read": { "get": { + "summary": "Find a run's artifact data.", "operationId": "ReadArtifact", "responses": { "200": { @@ -286,6 +299,7 @@ }, "/apis/v1beta1/runs/{run_id}/retry": { "post": { + "summary": "Re-initiate a failed or terminated run.", "operationId": "RetryRun", "responses": { "200": { @@ -316,6 +330,7 @@ }, "/apis/v1beta1/runs/{run_id}/terminate": { "post": { + "summary": "Terminate an active run.", "operationId": "TerminateRun", "responses": { "200": { @@ -386,6 +401,7 @@ }, "/apis/v1beta1/jobs": { "get": { + "summary": "Find all jobs.", "operationId": "ListJobs", "responses": { "200": { @@ -417,7 +433,7 @@ }, { "name": "sort_by", - "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\"\nAscending by default.", + "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\".\nAscending by default.", "in": "query", "required": false, "type": "string" @@ -446,7 +462,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -457,6 +473,7 @@ ] }, "post": { + "summary": "Create a new job.", "operationId": "CreateJob", "responses": { "200": { @@ -490,6 +507,7 @@ }, "/apis/v1beta1/jobs/{id}": { "get": { + "summary": "Find a specific job by ID.", "operationId": "GetJob", "responses": { "200": { @@ -519,6 +537,7 @@ ] }, "delete": { + "summary": "Delete a job.", "operationId": "DeleteJob", "responses": { "200": { @@ -550,6 +569,7 @@ }, "/apis/v1beta1/jobs/{id}/disable": { "post": { + "summary": "Disable a job.", "operationId": "DisableJob", "responses": { "200": { @@ -581,6 +601,7 @@ }, "/apis/v1beta1/jobs/{id}/enable": { "post": { + "summary": "Enable a job.", "operationId": "EnableJob", "responses": { "200": { @@ -612,6 +633,7 @@ }, "/apis/v1beta1/pipelines": { "get": { + "summary": "Find all pipelines.", "operationId": "ListPipelines", "responses": { "200": { @@ -650,7 +672,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -661,6 +683,7 @@ ] }, "post": { + "summary": "Add a pipeline.", "operationId": "CreatePipeline", "responses": { "200": { @@ -693,6 +716,7 @@ }, "/apis/v1beta1/pipelines/{id}": { "get": { + "summary": "Find a specific pipeline by ID.", "operationId": "GetPipeline", "responses": { "200": { @@ -721,6 +745,7 @@ ] }, "delete": { + "summary": "Delete a pipeline.", "operationId": "DeletePipeline", "responses": { "200": { @@ -751,6 +776,7 @@ }, "/apis/v1beta1/pipelines/{id}/templates": { "get": { + "summary": "Get a YAML template for the selected pipeline.", "operationId": "GetTemplate", "responses": { "200": { @@ -781,6 +807,7 @@ }, "/apis/v1beta1/experiments": { "get": { + "summary": "Find all experiments.", "operationId": "ListExperiment", "responses": { "200": { @@ -819,7 +846,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -830,6 +857,7 @@ ] }, "post": { + "summary": "Create a new experiment.", "operationId": "CreateExperiment", "responses": { "200": { @@ -848,7 +876,7 @@ "parameters": [ { "name": "body", - "description": "The experiment to be created", + "description": "The experiment to be created.", "in": "body", "required": true, "schema": { @@ -863,6 +891,7 @@ }, "/apis/v1beta1/experiments/{id}": { "get": { + "summary": "Find a specific experiment by ID.", "operationId": "GetExperiment", "responses": { "200": { @@ -881,7 +910,7 @@ "parameters": [ { "name": "id", - "description": "The ID of the experiment to be retrieved", + "description": "The ID of the experiment to be retrieved.", "in": "path", "required": true, "type": "string" @@ -892,6 +921,7 @@ ] }, "delete": { + "summary": "Delete an experiment.", "operationId": "DeleteExperiment", "responses": { "200": { diff --git a/backend/api/swagger/pipeline.swagger.json b/backend/api/swagger/pipeline.swagger.json index 4b075c05602..0cd2aeb1e2c 100644 --- a/backend/api/swagger/pipeline.swagger.json +++ b/backend/api/swagger/pipeline.swagger.json @@ -17,6 +17,7 @@ "paths": { "/apis/v1beta1/pipelines": { "get": { + "summary": "Find all pipelines.", "operationId": "ListPipelines", "responses": { "200": { @@ -55,7 +56,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -66,6 +67,7 @@ ] }, "post": { + "summary": "Add a pipeline.", "operationId": "CreatePipeline", "responses": { "200": { @@ -98,6 +100,7 @@ }, "/apis/v1beta1/pipelines/{id}": { "get": { + "summary": "Find a specific pipeline by ID.", "operationId": "GetPipeline", "responses": { "200": { @@ -126,6 +129,7 @@ ] }, "delete": { + "summary": "Delete a pipeline.", "operationId": "DeletePipeline", "responses": { "200": { @@ -156,6 +160,7 @@ }, "/apis/v1beta1/pipelines/{id}/templates": { "get": { + "summary": "Get a YAML template for the selected pipeline.", "operationId": "GetTemplate", "responses": { "200": { diff --git a/backend/api/swagger/run.swagger.json b/backend/api/swagger/run.swagger.json index 863278a88a8..3e46178cf20 100644 --- a/backend/api/swagger/run.swagger.json +++ b/backend/api/swagger/run.swagger.json @@ -17,6 +17,7 @@ "paths": { "/apis/v1beta1/runs": { "get": { + "summary": "Find all runs.", "operationId": "ListRuns", "responses": { "200": { @@ -48,7 +49,7 @@ }, { "name": "sort_by", - "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\"\nAscending by default.", + "description": "Can be format of \"field_name\", \"field_name asc\" or \"field_name des\"\n(Example, \"name asc\" or \"id des\"). Ascending by default.", "in": "query", "required": false, "type": "string" @@ -77,7 +78,7 @@ }, { "name": "filter", - "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\nfilter.proto).", + "description": "A url-encoded, JSON-serialized Filter protocol buffer (see\n[filter.proto](https://github.com/kubeflow/pipelines/\nblob/master/backend/api/filter.proto)).", "in": "query", "required": false, "type": "string" @@ -88,6 +89,7 @@ ] }, "post": { + "summary": "Create a new run.", "operationId": "CreateRun", "responses": { "200": { @@ -120,6 +122,7 @@ }, "/apis/v1beta1/runs/{id}": { "delete": { + "summary": "Delete a run.", "operationId": "DeleteRun", "responses": { "200": { @@ -141,6 +144,12 @@ "in": "path", "required": true, "type": "string" + }, + { + "name": "namespace", + "in": "query", + "required": false, + "type": "string" } ], "tags": [ @@ -150,6 +159,7 @@ }, "/apis/v1beta1/runs/{id}:archive": { "post": { + "summary": "Archive a run.", "operationId": "ArchiveRun", "responses": { "200": { @@ -180,6 +190,7 @@ }, "/apis/v1beta1/runs/{id}:unarchive": { "post": { + "summary": "Restore an archived run.", "operationId": "UnarchiveRun", "responses": { "200": { @@ -210,6 +221,7 @@ }, "/apis/v1beta1/runs/{run_id}": { "get": { + "summary": "Find a specific run by ID.", "operationId": "GetRun", "responses": { "200": { @@ -240,6 +252,7 @@ }, "/apis/v1beta1/runs/{run_id}/nodes/{node_id}/artifacts/{artifact_name}:read": { "get": { + "summary": "Find a run's artifact data.", "operationId": "ReadArtifact", "responses": { "200": { @@ -285,6 +298,7 @@ }, "/apis/v1beta1/runs/{run_id}/retry": { "post": { + "summary": "Re-initiate a failed or terminated run.", "operationId": "RetryRun", "responses": { "200": { @@ -315,6 +329,7 @@ }, "/apis/v1beta1/runs/{run_id}/terminate": { "post": { + "summary": "Terminate an active run.", "operationId": "TerminateRun", "responses": { "200": { From 566cc10529df520f190310ddcb796bc38fdc2fc7 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 10:25:31 -0800 Subject: [PATCH 02/57] update only the create run api --- backend/api/go_client/run.pb.go | 272 ++++++++---------- backend/api/go_client/run.pb.gw.go | 34 +-- .../run_service/create_run_parameters.go | 6 +- .../run_service/delete_run_parameters.go | 29 -- .../api/go_http_client/run_model/BUILD.bazel | 1 + .../run_model/api_create_run_request.go | 88 ++++++ backend/api/run.proto | 5 +- .../swagger/kfp_api_single_file.swagger.json | 19 +- backend/api/swagger/run.swagger.json | 19 +- 9 files changed, 242 insertions(+), 231 deletions(-) create mode 100644 backend/api/go_http_client/run_model/api_create_run_request.go diff --git a/backend/api/go_client/run.pb.go b/backend/api/go_client/run.pb.go index 43ae4d765ce..47f683253d1 100755 --- a/backend/api/go_client/run.pb.go +++ b/backend/api/go_client/run.pb.go @@ -61,7 +61,7 @@ func (x Run_StorageState) String() string { return proto.EnumName(Run_StorageState_name, int32(x)) } func (Run_StorageState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{9, 0} + return fileDescriptor_run_7139843a7cada1fe, []int{9, 0} } type RunMetric_Format int32 @@ -87,7 +87,7 @@ func (x RunMetric_Format) String() string { return proto.EnumName(RunMetric_Format_name, int32(x)) } func (RunMetric_Format) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{12, 0} + return fileDescriptor_run_7139843a7cada1fe, []int{12, 0} } type ReportRunMetricsResponse_ReportRunMetricResult_Status int32 @@ -119,7 +119,7 @@ func (x ReportRunMetricsResponse_ReportRunMetricResult_Status) String() string { return proto.EnumName(ReportRunMetricsResponse_ReportRunMetricResult_Status_name, int32(x)) } func (ReportRunMetricsResponse_ReportRunMetricResult_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{14, 0, 0} + return fileDescriptor_run_7139843a7cada1fe, []int{14, 0, 0} } type CreateRunRequest struct { @@ -134,7 +134,7 @@ func (m *CreateRunRequest) Reset() { *m = CreateRunRequest{} } func (m *CreateRunRequest) String() string { return proto.CompactTextString(m) } func (*CreateRunRequest) ProtoMessage() {} func (*CreateRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{0} + return fileDescriptor_run_7139843a7cada1fe, []int{0} } func (m *CreateRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateRunRequest.Unmarshal(m, b) @@ -179,7 +179,7 @@ func (m *GetRunRequest) Reset() { *m = GetRunRequest{} } func (m *GetRunRequest) String() string { return proto.CompactTextString(m) } func (*GetRunRequest) ProtoMessage() {} func (*GetRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{1} + return fileDescriptor_run_7139843a7cada1fe, []int{1} } func (m *GetRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetRunRequest.Unmarshal(m, b) @@ -221,7 +221,7 @@ func (m *ListRunsRequest) Reset() { *m = ListRunsRequest{} } func (m *ListRunsRequest) String() string { return proto.CompactTextString(m) } func (*ListRunsRequest) ProtoMessage() {} func (*ListRunsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{2} + return fileDescriptor_run_7139843a7cada1fe, []int{2} } func (m *ListRunsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRunsRequest.Unmarshal(m, b) @@ -278,7 +278,6 @@ func (m *ListRunsRequest) GetFilter() string { type TerminateRunRequest struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -288,7 +287,7 @@ func (m *TerminateRunRequest) Reset() { *m = TerminateRunRequest{} } func (m *TerminateRunRequest) String() string { return proto.CompactTextString(m) } func (*TerminateRunRequest) ProtoMessage() {} func (*TerminateRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{3} + return fileDescriptor_run_7139843a7cada1fe, []int{3} } func (m *TerminateRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TerminateRunRequest.Unmarshal(m, b) @@ -315,16 +314,8 @@ func (m *TerminateRunRequest) GetRunId() string { return "" } -func (m *TerminateRunRequest) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - type RetryRunRequest struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -334,7 +325,7 @@ func (m *RetryRunRequest) Reset() { *m = RetryRunRequest{} } func (m *RetryRunRequest) String() string { return proto.CompactTextString(m) } func (*RetryRunRequest) ProtoMessage() {} func (*RetryRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{4} + return fileDescriptor_run_7139843a7cada1fe, []int{4} } func (m *RetryRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RetryRunRequest.Unmarshal(m, b) @@ -361,13 +352,6 @@ func (m *RetryRunRequest) GetRunId() string { return "" } -func (m *RetryRunRequest) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - type ListRunsResponse struct { Runs []*Run `protobuf:"bytes,1,rep,name=runs,proto3" json:"runs,omitempty"` TotalSize int32 `protobuf:"varint,3,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` @@ -381,7 +365,7 @@ func (m *ListRunsResponse) Reset() { *m = ListRunsResponse{} } func (m *ListRunsResponse) String() string { return proto.CompactTextString(m) } func (*ListRunsResponse) ProtoMessage() {} func (*ListRunsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{5} + return fileDescriptor_run_7139843a7cada1fe, []int{5} } func (m *ListRunsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRunsResponse.Unmarshal(m, b) @@ -433,7 +417,7 @@ func (m *ArchiveRunRequest) Reset() { *m = ArchiveRunRequest{} } func (m *ArchiveRunRequest) String() string { return proto.CompactTextString(m) } func (*ArchiveRunRequest) ProtoMessage() {} func (*ArchiveRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{6} + return fileDescriptor_run_7139843a7cada1fe, []int{6} } func (m *ArchiveRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ArchiveRunRequest.Unmarshal(m, b) @@ -471,7 +455,7 @@ func (m *UnarchiveRunRequest) Reset() { *m = UnarchiveRunRequest{} } func (m *UnarchiveRunRequest) String() string { return proto.CompactTextString(m) } func (*UnarchiveRunRequest) ProtoMessage() {} func (*UnarchiveRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{7} + return fileDescriptor_run_7139843a7cada1fe, []int{7} } func (m *UnarchiveRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnarchiveRunRequest.Unmarshal(m, b) @@ -500,7 +484,6 @@ func (m *UnarchiveRunRequest) GetId() string { type DeleteRunRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -510,7 +493,7 @@ func (m *DeleteRunRequest) Reset() { *m = DeleteRunRequest{} } func (m *DeleteRunRequest) String() string { return proto.CompactTextString(m) } func (*DeleteRunRequest) ProtoMessage() {} func (*DeleteRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{8} + return fileDescriptor_run_7139843a7cada1fe, []int{8} } func (m *DeleteRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteRunRequest.Unmarshal(m, b) @@ -537,13 +520,6 @@ func (m *DeleteRunRequest) GetId() string { return "" } -func (m *DeleteRunRequest) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - type Run struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` @@ -566,7 +542,7 @@ func (m *Run) Reset() { *m = Run{} } func (m *Run) String() string { return proto.CompactTextString(m) } func (*Run) ProtoMessage() {} func (*Run) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{9} + return fileDescriptor_run_7139843a7cada1fe, []int{9} } func (m *Run) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Run.Unmarshal(m, b) @@ -682,7 +658,7 @@ func (m *PipelineRuntime) Reset() { *m = PipelineRuntime{} } func (m *PipelineRuntime) String() string { return proto.CompactTextString(m) } func (*PipelineRuntime) ProtoMessage() {} func (*PipelineRuntime) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{10} + return fileDescriptor_run_7139843a7cada1fe, []int{10} } func (m *PipelineRuntime) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PipelineRuntime.Unmarshal(m, b) @@ -728,7 +704,7 @@ func (m *RunDetail) Reset() { *m = RunDetail{} } func (m *RunDetail) String() string { return proto.CompactTextString(m) } func (*RunDetail) ProtoMessage() {} func (*RunDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{11} + return fileDescriptor_run_7139843a7cada1fe, []int{11} } func (m *RunDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RunDetail.Unmarshal(m, b) @@ -778,7 +754,7 @@ func (m *RunMetric) Reset() { *m = RunMetric{} } func (m *RunMetric) String() string { return proto.CompactTextString(m) } func (*RunMetric) ProtoMessage() {} func (*RunMetric) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{12} + return fileDescriptor_run_7139843a7cada1fe, []int{12} } func (m *RunMetric) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RunMetric.Unmarshal(m, b) @@ -905,7 +881,7 @@ func (m *ReportRunMetricsRequest) Reset() { *m = ReportRunMetricsRequest func (m *ReportRunMetricsRequest) String() string { return proto.CompactTextString(m) } func (*ReportRunMetricsRequest) ProtoMessage() {} func (*ReportRunMetricsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{13} + return fileDescriptor_run_7139843a7cada1fe, []int{13} } func (m *ReportRunMetricsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsRequest.Unmarshal(m, b) @@ -950,7 +926,7 @@ func (m *ReportRunMetricsResponse) Reset() { *m = ReportRunMetricsRespon func (m *ReportRunMetricsResponse) String() string { return proto.CompactTextString(m) } func (*ReportRunMetricsResponse) ProtoMessage() {} func (*ReportRunMetricsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{14} + return fileDescriptor_run_7139843a7cada1fe, []int{14} } func (m *ReportRunMetricsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsResponse.Unmarshal(m, b) @@ -995,7 +971,7 @@ func (m *ReportRunMetricsResponse_ReportRunMetricResult) String() string { } func (*ReportRunMetricsResponse_ReportRunMetricResult) ProtoMessage() {} func (*ReportRunMetricsResponse_ReportRunMetricResult) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{14, 0} + return fileDescriptor_run_7139843a7cada1fe, []int{14, 0} } func (m *ReportRunMetricsResponse_ReportRunMetricResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsResponse_ReportRunMetricResult.Unmarshal(m, b) @@ -1056,7 +1032,7 @@ func (m *ReadArtifactRequest) Reset() { *m = ReadArtifactRequest{} } func (m *ReadArtifactRequest) String() string { return proto.CompactTextString(m) } func (*ReadArtifactRequest) ProtoMessage() {} func (*ReadArtifactRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{15} + return fileDescriptor_run_7139843a7cada1fe, []int{15} } func (m *ReadArtifactRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReadArtifactRequest.Unmarshal(m, b) @@ -1108,7 +1084,7 @@ func (m *ReadArtifactResponse) Reset() { *m = ReadArtifactResponse{} } func (m *ReadArtifactResponse) String() string { return proto.CompactTextString(m) } func (*ReadArtifactResponse) ProtoMessage() {} func (*ReadArtifactResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_4d22bae5ddb03094, []int{16} + return fileDescriptor_run_7139843a7cada1fe, []int{16} } func (m *ReadArtifactResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReadArtifactResponse.Unmarshal(m, b) @@ -1528,107 +1504,107 @@ var _RunService_serviceDesc = grpc.ServiceDesc{ Metadata: "backend/api/run.proto", } -func init() { proto.RegisterFile("backend/api/run.proto", fileDescriptor_run_4d22bae5ddb03094) } - -var fileDescriptor_run_4d22bae5ddb03094 = []byte{ - // 1577 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xdd, 0x4e, 0x23, 0xcb, - 0x11, 0x66, 0x6c, 0xb0, 0x71, 0xd9, 0x86, 0xa1, 0xf9, 0xf3, 0x7a, 0x41, 0x70, 0x86, 0x73, 0xce, - 0xb2, 0x9b, 0x60, 0x6b, 0xd9, 0x28, 0x52, 0x88, 0xa2, 0x64, 0x00, 0xc3, 0x7a, 0xd7, 0x18, 0xd2, - 0x36, 0x44, 0xda, 0x5c, 0x8c, 0xc6, 0xe3, 0xb6, 0x99, 0x60, 0xcf, 0x4c, 0xba, 0x7b, 0x20, 0xec, - 0x6a, 0x6f, 0x22, 0xed, 0x0b, 0x24, 0x17, 0xb9, 0xcb, 0x43, 0xec, 0x43, 0x44, 0xca, 0x75, 0xee, - 0x73, 0x95, 0x07, 0x89, 0xa6, 0x7b, 0xc6, 0x8c, 0x7f, 0x30, 0xd2, 0x9e, 0x2b, 0xe8, 0xaa, 0xaf, - 0x7e, 0x5c, 0x55, 0x5f, 0xb9, 0x0c, 0xab, 0x2d, 0x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be, 0x63, - 0xd8, 0x6d, 0xe1, 0x2d, 0x83, 0xe7, 0xa8, 0xef, 0x54, 0xdb, 0xda, 0xbf, 0x14, 0x58, 0xac, 0xd9, - 0x2c, 0x40, 0xb2, 0x08, 0xba, 0x09, 0xe0, 0x99, 0x5d, 0x62, 0x70, 0xf7, 0x86, 0x38, 0x21, 0x3c, - 0x13, 0x48, 0x9a, 0x81, 0x00, 0x3d, 0x07, 0xf1, 0x30, 0x98, 0xfd, 0x51, 0x06, 0x9e, 0xc3, 0xf3, - 0x81, 0xa0, 0x61, 0x7f, 0x24, 0x68, 0x1d, 0xd2, 0xcc, 0xa5, 0xdc, 0x68, 0xdd, 0x17, 0x92, 0xc2, - 0x30, 0x15, 0x3c, 0x0f, 0xef, 0xd1, 0x09, 0xac, 0x8d, 0x17, 0xca, 0xb8, 0x21, 0xf7, 0x85, 0x59, - 0xf1, 0xe9, 0x54, 0xf9, 0xe9, 0x42, 0xc8, 0x7b, 0x72, 0x8f, 0x57, 0x22, 0x3c, 0x8e, 0xe0, 0xef, - 0xc9, 0x3d, 0x5a, 0x83, 0x54, 0xc7, 0xee, 0x71, 0x42, 0x0b, 0x73, 0xd2, 0xbf, 0x7c, 0x69, 0xef, - 0x60, 0xb9, 0x49, 0x68, 0xdf, 0x76, 0x86, 0x2b, 0x38, 0xf9, 0x63, 0x3f, 0x51, 0xbc, 0x13, 0x58, - 0xc4, 0x84, 0xd3, 0xfb, 0x9f, 0xea, 0xe7, 0x0e, 0xd4, 0x87, 0xda, 0x32, 0xcf, 0x75, 0x18, 0x41, - 0x1b, 0x30, 0x4b, 0x7d, 0x87, 0x15, 0x94, 0xed, 0xe4, 0x50, 0x4f, 0x85, 0x34, 0x28, 0x3d, 0x77, - 0xb9, 0xd9, 0x93, 0xc5, 0x4d, 0x8a, 0xe2, 0x66, 0x84, 0x44, 0x54, 0xf7, 0x47, 0x58, 0x74, 0xc8, - 0x5f, 0xb8, 0x11, 0x6b, 0x8f, 0x0c, 0x9a,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, 0xda, 0xbf, 0x15, 0x11, 0x4a, 0x16, 0x6d, 0xc0, 0x16, 0x25, 0xc6, 0x96, - 0x75, 0x48, 0x3b, 0x6e, 0x9b, 0x04, 0x6b, 0x49, 0x92, 0x28, 0x15, 0x3c, 0xab, 0x6d, 0xb4, 0x03, - 0x39, 0xc7, 0xef, 0xb7, 0x08, 0x35, 0x6e, 0xcd, 0x9e, 0x2f, 0x37, 0x89, 0xf2, 0x76, 0x06, 0x67, - 0xa5, 0xf4, 0x2a, 0x10, 0xa2, 0x3d, 0x48, 0x75, 0x5c, 0xda, 0x37, 0xb9, 0xa0, 0x41, 0x8c, 0x64, - 0x32, 0x62, 0xe9, 0x44, 0x28, 0x71, 0x08, 0xd2, 0xf6, 0x21, 0x25, 0x25, 0x68, 0x11, 0xb2, 0x97, - 0xf5, 0xc6, 0x45, 0xe5, 0xa8, 0x7a, 0x52, 0xad, 0x1c, 0xab, 0x33, 0x28, 0x0d, 0x49, 0xac, 0xff, - 0x41, 0x55, 0xd0, 0x02, 0xc0, 0x45, 0x05, 0x1f, 0x55, 0xea, 0x4d, 0xfd, 0xb4, 0xa2, 0x26, 0x0e, - 0xd3, 0x30, 0x27, 0x12, 0xd0, 0x3e, 0xc0, 0x3a, 0x26, 0x9e, 0x4b, 0xf9, 0xc0, 0x3d, 0x7b, 0x62, - 0xb5, 0xc6, 0xa6, 0x28, 0x31, 0x7d, 0x8a, 0xfe, 0x99, 0x84, 0xc2, 0xb8, 0xf3, 0x70, 0xdf, 0x9e, - 0x41, 0x9a, 0x12, 0xe6, 0xf7, 0x78, 0xb4, 0x72, 0xdf, 0x84, 0x74, 0x9d, 0x8c, 0x1f, 0x55, 0x60, - 0x61, 0x8b, 0x23, 0x1f, 0xc5, 0xaf, 0x09, 0x58, 0x9d, 0x08, 0x41, 0x5b, 0x90, 0x95, 0x09, 0x19, - 0xb1, 0x36, 0x81, 0x14, 0xd5, 0x83, 0x66, 0x7d, 0x0f, 0x0b, 0x11, 0x60, 0xa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0xfb, 0x29, 0x4b, 0x96, 0x3e, 0x0f, 0x00, 0x00, +func init() { proto.RegisterFile("backend/api/run.proto", fileDescriptor_run_7139843a7cada1fe) } + +var fileDescriptor_run_7139843a7cada1fe = []byte{ + // 1575 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdd, 0x4e, 0x23, 0xcb, + 0x11, 0xde, 0xb1, 0xc1, 0xc6, 0x65, 0x1b, 0x66, 0x9b, 0x3f, 0xaf, 0x17, 0x04, 0x67, 0xf6, 0xfc, + 0x70, 0x36, 0x07, 0x5b, 0x87, 0x8d, 0x22, 0x85, 0x28, 0x8a, 0x06, 0xf0, 0x72, 0x9c, 0x35, 0x86, + 0xd3, 0x36, 0x44, 0xda, 0x5c, 0x8c, 0xc6, 0xe3, 0xb6, 0x99, 0x60, 0xcf, 0x4c, 0xba, 0x7b, 0x20, + 0xec, 0x6a, 0x6f, 0x22, 0x9d, 0x17, 0x48, 0x2e, 0x72, 0x97, 0x67, 0x88, 0xf2, 0x10, 0x91, 0x72, + 0x9d, 0xfb, 0x5c, 0xe5, 0x41, 0xa2, 0xee, 0x9e, 0x31, 0xe3, 0x1f, 0x8c, 0xb4, 0x57, 0xd0, 0x55, + 0x5f, 0x57, 0x55, 0x57, 0xd5, 0x57, 0xae, 0x81, 0xf5, 0x8e, 0xed, 0xdc, 0x10, 0xaf, 0x5b, 0xb5, + 0x03, 0xb7, 0x4a, 0x43, 0xaf, 0x12, 0x50, 0x9f, 0xfb, 0x28, 0x6d, 0x07, 0x6e, 0x79, 0x33, 0xa9, + 0x23, 0x94, 0xfa, 0x54, 0x69, 0xcb, 0x2f, 0xfb, 0xbe, 0xdf, 0x1f, 0x90, 0xaa, 0x3c, 0x75, 0xc2, + 0x5e, 0x95, 0x0c, 0x03, 0x7e, 0x1f, 0x29, 0xb7, 0x22, 0xa5, 0xb8, 0x64, 0x7b, 0x9e, 0xcf, 0x6d, + 0xee, 0xfa, 0x1e, 0x8b, 0xb4, 0x3b, 0x93, 0x57, 0xb9, 0x3b, 0x24, 0x8c, 0xdb, 0xc3, 0x20, 0x06, + 0x24, 0x9d, 0x06, 0x6e, 0x40, 0x06, 0xae, 0x47, 0x2c, 0x16, 0x10, 0x27, 0x02, 0x7c, 0x39, 0x16, + 0x31, 0x61, 0x7e, 0x48, 0x1d, 0x62, 0x51, 0xd2, 0x23, 0x94, 0x78, 0x0e, 0x89, 0x50, 0xdf, 0xc9, + 0x3f, 0xce, 0x7e, 0x9f, 0x78, 0xfb, 0xec, 0xce, 0xee, 0xf7, 0x09, 0xad, 0xfa, 0x81, 0x8c, 0x64, + 0x3a, 0x2a, 0xa3, 0x01, 0xfa, 0x31, 0x25, 0x36, 0x27, 0x38, 0xf4, 0x30, 0xf9, 0x63, 0x48, 0x18, + 0x47, 0x65, 0x48, 0xd3, 0xd0, 0x2b, 0x69, 0xbb, 0xda, 0x5e, 0xfe, 0x60, 0xa9, 0x62, 0x07, 0x6e, + 0x45, 0x68, 0x85, 0x10, 0x6d, 0x41, 0xce, 0xb3, 0x87, 0x84, 0x05, 0xb6, 0x43, 0x4a, 0xa9, 0x5d, + 0x6d, 0x2f, 0x87, 0x1f, 0x04, 0xc6, 0xd7, 0x50, 0x3c, 0x25, 0x3c, 0x61, 0x6a, 0x1d, 0x32, 0x34, + 0xf4, 0x2c, 0xb7, 0x2b, 0xad, 0xe5, 0xf0, 0x22, 0x0d, 0xbd, 0x7a, 0xd7, 0xf8, 0x97, 0x06, 0x2b, + 0x0d, 0x97, 0x09, 0x24, 0x8b, 0xa1, 0xdb, 0x00, 0x81, 0xdd, 0x27, 0x16, 0xf7, 0x6f, 0x88, 0x17, + 0xc1, 0x73, 0x42, 0xd2, 0x16, 0x02, 0xf4, 0x12, 0xe4, 0xc1, 0x62, 0xee, 0x07, 0xe5, 0x78, 0x11, + 0x2f, 0x09, 0x41, 0xcb, 0xfd, 0x40, 0xd0, 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d, 0x42, 0x91, 0x71, + 0x9f, 0xca, 0x2e, 0xe0, 0x36, 0x27, 0x25, 0xd8, 0xd5, 0xf6, 0x96, 0x0f, 0xd6, 0xe3, 0x4c, 0x54, + 0x5a, 0x4a, 0xdb, 0x12, 0x4a, 0x5c, 0x60, 0x89, 0x13, 0xda, 0x85, 0x7c, 0x97, 0x30, 0x87, 0xba, + 0x92, 0x09, 0x51, 0x97, 0x24, 0x45, 0xe8, 0x17, 0x50, 0x1c, 0x23, 0x5d, 0xd4, 0x21, 0xcf, 0xa5, + 0xf5, 0x8b, 0x48, 0xd3, 0x0a, 0x88, 0x83, 0x0b, 0x41, 0xe2, 0x84, 0x4e, 0x61, 0x75, 0xba, 0xc5, + 0x58, 0x69, 0x51, 0x56, 0x69, 0x63, 0xac, 0xbf, 0x46, 0x2d, 0x85, 0xd1, 0x54, 0x97, 0x31, 0xf4, + 0x4b, 0x00, 0x47, 0x52, 0xb1, 0x6b, 0xd9, 0xbc, 0x94, 0x91, 0xde, 0xcb, 0x15, 0x35, 0x35, 0x2a, + 0xf1, 0xd4, 0xa8, 0xb4, 0xe3, 0xa9, 0x81, 0x73, 0x11, 0xda, 0xe4, 0xe8, 0xd7, 0x50, 0x60, 0xce, + 0x35, 0xe9, 0x86, 0x03, 0x75, 0x39, 0xfb, 0xe4, 0xe5, 0xfc, 0x08, 0x6f, 0x72, 0xf4, 0x2b, 0xc8, + 0xf7, 0x5c, 0xcf, 0x65, 0xd7, 0xea, 0x76, 0xf1, 0xc9, 0xdb, 0x10, 0xc3, 0x4d, 0x2e, 0xa8, 0x21, + 0xaa, 0x11, 0xb2, 0xd2, 0x52, 0x44, 0x3d, 0x79, 0x42, 0x6b, 0xb0, 0x28, 0x27, 0x67, 0xa9, 0xa0, + 0x1a, 0x5b, 0x1e, 0xd0, 0x1e, 0x64, 0x87, 0x84, 0x53, 0xd7, 0x61, 0xa5, 0x9c, 0xcc, 0xd0, 0x72, + 0x5c, 0xbd, 0x33, 0x29, 0xc6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9b, 0xf4, 0xa3, + 0x45, 0xd8, 0x97, 0x51, 0x7d, 0x63, 0x7c, 0x35, 0x2f, 0x2a, 0x1e, 0x1b, 0x44, 0x0e, 0x2c, 0xc5, + 0x9b, 0x77, 0x44, 0x8c, 0x89, 0x45, 0xfc, 0xf3, 0x9a, 0x2a, 0x76, 0x44, 0x85, 0xb1, 0xa3, 0x9f, + 0xb4, 0xbf, 0x98, 0x67, 0x78, 0x0b, 0xb2, 0x5d, 0xd2, 0xb3, 0xc5, 0xd8, 0x7f, 0x8e, 0x56, 0xa0, + 0x58, 0xce, 0x4b, 0x7f, 0x6a, 0x94, 0xbe, 0xdf, 0x81, 0x6d, 0xc8, 0x1c, 0x11, 0x9b, 0x12, 0x8a, + 0x56, 0x97, 0x52, 0xe5, 0xa2, 0x1d, 0xf2, 0x6b, 0x9f, 0xba, 0x1f, 0xe4, 0x57, 0xd9, 0x6e, 0xaa, + 0x53, 0x00, 0x18, 0x01, 0x9e, 0xbd, 0x7f, 0xd3, 0x77, 0xf9, 0x75, 0xd8, 0xa9, 0x38, 0xfe, 0xb0, + 0x7a, 0x13, 0x76, 0x88, 0xd8, 0x36, 0x46, 0xdf, 0x86, 0xac, 0x9a, 0xfc, 0x20, 0xec, 0xfb, 0x96, + 0x33, 0x70, 0x89, 0xc7, 0x3b, 0x19, 0xf9, 0x84, 0x37, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x71, + 0xe6, 0x76, 0x1a, 0xe2, 0x0e, 0x00, 0x00, } diff --git a/backend/api/go_client/run.pb.gw.go b/backend/api/go_client/run.pb.gw.go index 7b98a61b674..8d5ac128691 100755 --- a/backend/api/go_client/run.pb.gw.go +++ b/backend/api/go_client/run.pb.gw.go @@ -42,10 +42,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var ( - filter_RunService_CreateRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"run": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - func request_RunService_CreateRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreateRunRequest var metadata runtime.ServerMetadata @@ -54,11 +50,7 @@ func request_RunService_CreateRun_0(ctx context.Context, marshaler runtime.Marsh if berr != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Run); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_CreateRun_0); err != nil { + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -165,10 +157,6 @@ func request_RunService_UnarchiveRun_0(ctx context.Context, marshaler runtime.Ma } -var ( - filter_RunService_DeleteRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - func request_RunService_DeleteRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq DeleteRunRequest var metadata runtime.ServerMetadata @@ -191,10 +179,6 @@ func request_RunService_DeleteRun_0(ctx context.Context, marshaler runtime.Marsh return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_DeleteRun_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.DeleteRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -284,10 +268,6 @@ func request_RunService_ReadArtifact_0(ctx context.Context, marshaler runtime.Ma } -var ( - filter_RunService_TerminateRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"run_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - func request_RunService_TerminateRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq TerminateRunRequest var metadata runtime.ServerMetadata @@ -310,19 +290,11 @@ func request_RunService_TerminateRun_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_TerminateRun_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.TerminateRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -var ( - filter_RunService_RetryRun_0 = &utilities.DoubleArray{Encoding: map[string]int{"run_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - func request_RunService_RetryRun_0(ctx context.Context, marshaler runtime.Marshaler, client RunServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq RetryRunRequest var metadata runtime.ServerMetadata @@ -345,10 +317,6 @@ func request_RunService_RetryRun_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "run_id", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_RunService_RetryRun_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - msg, err := client.RetryRun(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err diff --git a/backend/api/go_http_client/run_client/run_service/create_run_parameters.go b/backend/api/go_http_client/run_client/run_service/create_run_parameters.go index 7f671ab5188..db0000de379 100644 --- a/backend/api/go_http_client/run_client/run_service/create_run_parameters.go +++ b/backend/api/go_http_client/run_client/run_service/create_run_parameters.go @@ -78,7 +78,7 @@ for the create run operation typically these are written to a http.Request type CreateRunParams struct { /*Body*/ - Body *run_model.APIRun + Body *run_model.APICreateRunRequest timeout time.Duration Context context.Context @@ -119,13 +119,13 @@ func (o *CreateRunParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the create run params -func (o *CreateRunParams) WithBody(body *run_model.APIRun) *CreateRunParams { +func (o *CreateRunParams) WithBody(body *run_model.APICreateRunRequest) *CreateRunParams { o.SetBody(body) return o } // SetBody adds the body to the create run params -func (o *CreateRunParams) SetBody(body *run_model.APIRun) { +func (o *CreateRunParams) SetBody(body *run_model.APICreateRunRequest) { o.Body = body } diff --git a/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go b/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go index 767924239ce..3aaa0bb2b0a 100644 --- a/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go +++ b/backend/api/go_http_client/run_client/run_service/delete_run_parameters.go @@ -77,8 +77,6 @@ type DeleteRunParams struct { /*ID*/ ID string - /*Namespace*/ - Namespace *string timeout time.Duration Context context.Context @@ -129,17 +127,6 @@ func (o *DeleteRunParams) SetID(id string) { o.ID = id } -// WithNamespace adds the namespace to the delete run params -func (o *DeleteRunParams) WithNamespace(namespace *string) *DeleteRunParams { - o.SetNamespace(namespace) - return o -} - -// SetNamespace adds the namespace to the delete run params -func (o *DeleteRunParams) SetNamespace(namespace *string) { - o.Namespace = namespace -} - // WriteToRequest writes these params to a swagger request func (o *DeleteRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -153,22 +140,6 @@ func (o *DeleteRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Reg return err } - if o.Namespace != nil { - - // query param namespace - var qrNamespace string - if o.Namespace != nil { - qrNamespace = *o.Namespace - } - qNamespace := qrNamespace - if qNamespace != "" { - if err := r.SetQueryParam("namespace", qNamespace); err != nil { - return err - } - } - - } - if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/backend/api/go_http_client/run_model/BUILD.bazel b/backend/api/go_http_client/run_model/BUILD.bazel index 9786a9bc659..ce8cfb453a2 100644 --- a/backend/api/go_http_client/run_model/BUILD.bazel +++ b/backend/api/go_http_client/run_model/BUILD.bazel @@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ + "api_create_run_request.go", "api_list_runs_response.go", "api_parameter.go", "api_pipeline_runtime.go", diff --git a/backend/api/go_http_client/run_model/api_create_run_request.go b/backend/api/go_http_client/run_model/api_create_run_request.go new file mode 100644 index 00000000000..48f6d09ecb8 --- /dev/null +++ b/backend/api/go_http_client/run_model/api_create_run_request.go @@ -0,0 +1,88 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by go-swagger; DO NOT EDIT. + +package run_model + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" +) + +// APICreateRunRequest api create run request +// swagger:model apiCreateRunRequest +type APICreateRunRequest struct { + + // namespace + Namespace string `json:"namespace,omitempty"` + + // run + Run *APIRun `json:"run,omitempty"` +} + +// Validate validates this api create run request +func (m *APICreateRunRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRun(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APICreateRunRequest) validateRun(formats strfmt.Registry) error { + + if swag.IsZero(m.Run) { // not required + return nil + } + + if m.Run != nil { + if err := m.Run.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("run") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *APICreateRunRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APICreateRunRequest) UnmarshalBinary(b []byte) error { + var res APICreateRunRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/backend/api/run.proto b/backend/api/run.proto index e1985c27d89..05a559a2774 100644 --- a/backend/api/run.proto +++ b/backend/api/run.proto @@ -65,7 +65,7 @@ service RunService { rpc CreateRun(CreateRunRequest) returns (RunDetail) { option (google.api.http) = { post: "/apis/v1beta1/runs" - body: "run" + body: "*" }; } @@ -167,12 +167,10 @@ message ListRunsRequest { message TerminateRunRequest { string run_id = 1; - string namespace = 2; } message RetryRunRequest { string run_id = 1; - string namespace = 2; } message ListRunsResponse { @@ -191,7 +189,6 @@ message UnarchiveRunRequest { message DeleteRunRequest { string id = 1; - string namespace = 2; } message Run { diff --git a/backend/api/swagger/kfp_api_single_file.swagger.json b/backend/api/swagger/kfp_api_single_file.swagger.json index d17b157ed1e..bb089db1c5e 100644 --- a/backend/api/swagger/kfp_api_single_file.swagger.json +++ b/backend/api/swagger/kfp_api_single_file.swagger.json @@ -112,7 +112,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/apiRun" + "$ref": "#/definitions/apiCreateRunRequest" } } ], @@ -145,12 +145,6 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "namespace", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -1047,6 +1041,17 @@ ], "default": "STORAGESTATE_AVAILABLE" }, + "apiCreateRunRequest": { + "type": "object", + "properties": { + "run": { + "$ref": "#/definitions/apiRun" + }, + "namespace": { + "type": "string" + } + } + }, "apiListRunsResponse": { "type": "object", "properties": { diff --git a/backend/api/swagger/run.swagger.json b/backend/api/swagger/run.swagger.json index 3e46178cf20..7e286c6e40c 100644 --- a/backend/api/swagger/run.swagger.json +++ b/backend/api/swagger/run.swagger.json @@ -111,7 +111,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/apiRun" + "$ref": "#/definitions/apiCreateRunRequest" } } ], @@ -144,12 +144,6 @@ "in": "path", "required": true, "type": "string" - }, - { - "name": "namespace", - "in": "query", - "required": false, - "type": "string" } ], "tags": [ @@ -451,6 +445,17 @@ ], "default": "STORAGESTATE_AVAILABLE" }, + "apiCreateRunRequest": { + "type": "object", + "properties": { + "run": { + "$ref": "#/definitions/apiRun" + }, + "namespace": { + "type": "string" + } + } + }, "apiListRunsResponse": { "type": "object", "properties": { From 1060cbbe6bf73d83a741e133288de2df04d4c700 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 10:39:15 -0800 Subject: [PATCH 03/57] add resourcereference for namespace runs --- .../api/go_client/resource_reference.pb.go | 70 ++--- backend/api/go_client/run.pb.go | 255 +++++++++--------- backend/api/go_client/run.pb.gw.go | 2 +- .../job_model/api_relationship.go | 5 +- .../job_model/api_resource_type.go | 5 +- .../pipeline_model/api_relationship.go | 5 +- .../pipeline_model/api_resource_type.go | 5 +- .../run_service/create_run_parameters.go | 6 +- .../api/go_http_client/run_model/BUILD.bazel | 1 - .../run_model/api_create_run_request.go | 88 ------ .../run_model/api_relationship.go | 5 +- .../run_model/api_resource_type.go | 5 +- backend/api/resource_reference.proto | 2 + backend/api/run.proto | 3 +- backend/api/swagger/job.swagger.json | 9 +- .../swagger/kfp_api_single_file.swagger.json | 25 +- backend/api/swagger/pipeline.swagger.json | 6 +- backend/api/swagger/run.swagger.json | 22 +- 18 files changed, 219 insertions(+), 300 deletions(-) delete mode 100644 backend/api/go_http_client/run_model/api_create_run_request.go diff --git a/backend/api/go_client/resource_reference.pb.go b/backend/api/go_client/resource_reference.pb.go index 2c3b693a600..f6d9ec922ec 100755 --- a/backend/api/go_client/resource_reference.pb.go +++ b/backend/api/go_client/resource_reference.pb.go @@ -40,6 +40,7 @@ const ( ResourceType_JOB ResourceType = 2 ResourceType_PIPELINE ResourceType = 3 ResourceType_PIPELINE_VERSION ResourceType = 4 + ResourceType_NAMESPACE ResourceType = 5 ) var ResourceType_name = map[int32]string{ @@ -48,6 +49,7 @@ var ResourceType_name = map[int32]string{ 2: "JOB", 3: "PIPELINE", 4: "PIPELINE_VERSION", + 5: "NAMESPACE", } var ResourceType_value = map[string]int32{ "UNKNOWN_RESOURCE_TYPE": 0, @@ -55,13 +57,14 @@ var ResourceType_value = map[string]int32{ "JOB": 2, "PIPELINE": 3, "PIPELINE_VERSION": 4, + "NAMESPACE": 5, } func (x ResourceType) String() string { return proto.EnumName(ResourceType_name, int32(x)) } func (ResourceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_81a9849386131b93, []int{0} + return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{0} } type Relationship int32 @@ -70,24 +73,27 @@ const ( Relationship_UNKNOWN_RELATIONSHIP Relationship = 0 Relationship_OWNER Relationship = 1 Relationship_CREATOR Relationship = 2 + Relationship_BELONGING Relationship = 3 ) var Relationship_name = map[int32]string{ 0: "UNKNOWN_RELATIONSHIP", 1: "OWNER", 2: "CREATOR", + 3: "BELONGING", } var Relationship_value = map[string]int32{ "UNKNOWN_RELATIONSHIP": 0, "OWNER": 1, "CREATOR": 2, + "BELONGING": 3, } func (x Relationship) String() string { return proto.EnumName(Relationship_name, int32(x)) } func (Relationship) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_81a9849386131b93, []int{1} + return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{1} } type ResourceKey struct { @@ -102,7 +108,7 @@ func (m *ResourceKey) Reset() { *m = ResourceKey{} } func (m *ResourceKey) String() string { return proto.CompactTextString(m) } func (*ResourceKey) ProtoMessage() {} func (*ResourceKey) Descriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_81a9849386131b93, []int{0} + return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{0} } func (m *ResourceKey) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResourceKey.Unmarshal(m, b) @@ -149,7 +155,7 @@ func (m *ResourceReference) Reset() { *m = ResourceReference{} } func (m *ResourceReference) String() string { return proto.CompactTextString(m) } func (*ResourceReference) ProtoMessage() {} func (*ResourceReference) Descriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_81a9849386131b93, []int{1} + return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{1} } func (m *ResourceReference) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResourceReference.Unmarshal(m, b) @@ -198,31 +204,33 @@ func init() { } func init() { - proto.RegisterFile("backend/api/resource_reference.proto", fileDescriptor_resource_reference_81a9849386131b93) -} - -var fileDescriptor_resource_reference_81a9849386131b93 = []byte{ - // 351 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0x41, 0xab, 0xda, 0x40, - 0x14, 0x85, 0x5f, 0x12, 0xdb, 0xd7, 0x77, 0x15, 0x99, 0x37, 0x58, 0x48, 0x77, 0x22, 0x2d, 0x88, - 0x8b, 0x04, 0x14, 0xf7, 0x55, 0x3b, 0xd0, 0x54, 0x3b, 0x09, 0x63, 0xac, 0x6d, 0x37, 0x21, 0x89, - 0x57, 0x1d, 0x8c, 0xc9, 0x10, 0x23, 0x25, 0xdb, 0xfe, 0xf2, 0x62, 0x68, 0x88, 0xee, 0x66, 0xf8, - 0x0e, 0xe7, 0xbb, 0x70, 0xe0, 0x63, 0x14, 0xc6, 0x27, 0x4c, 0x77, 0x76, 0xa8, 0xa4, 0x9d, 0xe3, - 0x25, 0xbb, 0xe6, 0x31, 0x06, 0x39, 0xee, 0x31, 0xc7, 0x34, 0x46, 0x4b, 0xe5, 0x59, 0x91, 0x51, - 0x23, 0x54, 0x72, 0xf0, 0x05, 0xda, 0xe2, 0x7f, 0x60, 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, 0xd1, - 0x68, 0x1b, 0x9e, 0x17, 0x82, 0xcd, 0x7c, 0x57, 0x10, 0x7d, 0x3e, 0xfd, 0x3d, 0x39, 0xc8, 0xe2, - 0x78, 0x8d, 0xac, 0x38, 0x3b, 0xdb, 0xa7, 0x6b, 0x84, 0xfb, 0x24, 0xfb, 0x63, 0x2b, 0xa9, 0x30, - 0x91, 0x29, 0x5e, 0xec, 0xfb, 0xfd, 0x0e, 0x59, 0x10, 0x27, 0x12, 0xd3, 0x22, 0x7a, 0x5b, 0xed, - 0x36, 0xf9, 0x17, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x32, 0x3a, 0x06, 0xdf, 0x01, 0x00, 0x00, + proto.RegisterFile("backend/api/resource_reference.proto", fileDescriptor_resource_reference_5073ffe6f985b29e) +} + +var fileDescriptor_resource_reference_5073ffe6f985b29e = []byte{ + // 377 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0x51, 0x6b, 0xdb, 0x30, + 0x14, 0x85, 0x6b, 0x3b, 0x5d, 0x97, 0x9b, 0x2c, 0xa8, 0x97, 0x0e, 0xb2, 0xb7, 0x12, 0x36, 0x28, + 0x7d, 0x88, 0xa1, 0xa5, 0x3f, 0x20, 0xc9, 0x44, 0xe7, 0x25, 0x95, 0x8c, 0xec, 0xae, 0xdb, 0x5e, + 0x8c, 0xed, 0xdc, 0xb6, 0x22, 0xae, 0x2d, 0x1c, 0x9b, 0xe1, 0xd7, 0xfd, 0xf2, 0x11, 0x33, 0xe3, + 0xf6, 0x4d, 0xe2, 0x1c, 0xbe, 0xef, 0xc0, 0x85, 0xcf, 0x49, 0x9c, 0xee, 0x28, 0xdf, 0xba, 0xb1, + 0xd1, 0x6e, 0x49, 0xfb, 0xa2, 0x2e, 0x53, 0x8a, 0x4a, 0x7a, 0xa4, 0x92, 0xf2, 0x94, 0xe6, 0xa6, + 0x2c, 0xaa, 0x02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x06, 0x4e, 0xe1, 0xac, 0xd7, 0x6e, 0x16, 0xa1, + 0x27, 0x45, 0xf0, 0xcd, 0xf3, 0xd9, 0x11, 0x0e, 0xe1, 0x58, 0x3e, 0x08, 0xae, 0x98, 0x85, 0x23, + 0x38, 0x59, 0x29, 0xbe, 0x08, 0xa5, 0x62, 0xf6, 0x01, 0xb8, 0xe4, 0x1b, 0x29, 0x6e, 0x3d, 0x71, + 0xcb, 0x9c, 0xe5, 0xcd, 0xef, 0xeb, 0x27, 0x5d, 0x3d, 0xd7, 0xc9, 0x3c, 0x2d, 0x5e, 0xdc, 0x5d, + 0x9d, 0xd0, 0x63, 0x56, 0xfc, 0x71, 0x8d, 0x36, 0x94, 0xe9, 0x9c, 0xf6, 0xee, 0xeb, 0xeb, 0x3e, + 0x15, 0x51, 0x9a, 0x69, 0xca, 0xab, 0xe4, 0x5d, 0x7b, 0xd5, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xc4, 0x3e, 0x5c, 0xbc, 0xfd, 0x01, 0x00, 0x00, } diff --git a/backend/api/go_client/run.pb.go b/backend/api/go_client/run.pb.go index 47f683253d1..8aa2c76f4c9 100755 --- a/backend/api/go_client/run.pb.go +++ b/backend/api/go_client/run.pb.go @@ -61,7 +61,7 @@ func (x Run_StorageState) String() string { return proto.EnumName(Run_StorageState_name, int32(x)) } func (Run_StorageState) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{9, 0} + return fileDescriptor_run_d3e6e7c711d57876, []int{9, 0} } type RunMetric_Format int32 @@ -87,7 +87,7 @@ func (x RunMetric_Format) String() string { return proto.EnumName(RunMetric_Format_name, int32(x)) } func (RunMetric_Format) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{12, 0} + return fileDescriptor_run_d3e6e7c711d57876, []int{12, 0} } type ReportRunMetricsResponse_ReportRunMetricResult_Status int32 @@ -119,12 +119,11 @@ func (x ReportRunMetricsResponse_ReportRunMetricResult_Status) String() string { return proto.EnumName(ReportRunMetricsResponse_ReportRunMetricResult_Status_name, int32(x)) } func (ReportRunMetricsResponse_ReportRunMetricResult_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{14, 0, 0} + return fileDescriptor_run_d3e6e7c711d57876, []int{14, 0, 0} } type CreateRunRequest struct { Run *Run `protobuf:"bytes,1,opt,name=run,proto3" json:"run,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -134,7 +133,7 @@ func (m *CreateRunRequest) Reset() { *m = CreateRunRequest{} } func (m *CreateRunRequest) String() string { return proto.CompactTextString(m) } func (*CreateRunRequest) ProtoMessage() {} func (*CreateRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{0} + return fileDescriptor_run_d3e6e7c711d57876, []int{0} } func (m *CreateRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateRunRequest.Unmarshal(m, b) @@ -161,13 +160,6 @@ func (m *CreateRunRequest) GetRun() *Run { return nil } -func (m *CreateRunRequest) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - type GetRunRequest struct { RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -179,7 +171,7 @@ func (m *GetRunRequest) Reset() { *m = GetRunRequest{} } func (m *GetRunRequest) String() string { return proto.CompactTextString(m) } func (*GetRunRequest) ProtoMessage() {} func (*GetRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{1} + return fileDescriptor_run_d3e6e7c711d57876, []int{1} } func (m *GetRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetRunRequest.Unmarshal(m, b) @@ -221,7 +213,7 @@ func (m *ListRunsRequest) Reset() { *m = ListRunsRequest{} } func (m *ListRunsRequest) String() string { return proto.CompactTextString(m) } func (*ListRunsRequest) ProtoMessage() {} func (*ListRunsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{2} + return fileDescriptor_run_d3e6e7c711d57876, []int{2} } func (m *ListRunsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRunsRequest.Unmarshal(m, b) @@ -287,7 +279,7 @@ func (m *TerminateRunRequest) Reset() { *m = TerminateRunRequest{} } func (m *TerminateRunRequest) String() string { return proto.CompactTextString(m) } func (*TerminateRunRequest) ProtoMessage() {} func (*TerminateRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{3} + return fileDescriptor_run_d3e6e7c711d57876, []int{3} } func (m *TerminateRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TerminateRunRequest.Unmarshal(m, b) @@ -325,7 +317,7 @@ func (m *RetryRunRequest) Reset() { *m = RetryRunRequest{} } func (m *RetryRunRequest) String() string { return proto.CompactTextString(m) } func (*RetryRunRequest) ProtoMessage() {} func (*RetryRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{4} + return fileDescriptor_run_d3e6e7c711d57876, []int{4} } func (m *RetryRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RetryRunRequest.Unmarshal(m, b) @@ -365,7 +357,7 @@ func (m *ListRunsResponse) Reset() { *m = ListRunsResponse{} } func (m *ListRunsResponse) String() string { return proto.CompactTextString(m) } func (*ListRunsResponse) ProtoMessage() {} func (*ListRunsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{5} + return fileDescriptor_run_d3e6e7c711d57876, []int{5} } func (m *ListRunsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListRunsResponse.Unmarshal(m, b) @@ -417,7 +409,7 @@ func (m *ArchiveRunRequest) Reset() { *m = ArchiveRunRequest{} } func (m *ArchiveRunRequest) String() string { return proto.CompactTextString(m) } func (*ArchiveRunRequest) ProtoMessage() {} func (*ArchiveRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{6} + return fileDescriptor_run_d3e6e7c711d57876, []int{6} } func (m *ArchiveRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ArchiveRunRequest.Unmarshal(m, b) @@ -455,7 +447,7 @@ func (m *UnarchiveRunRequest) Reset() { *m = UnarchiveRunRequest{} } func (m *UnarchiveRunRequest) String() string { return proto.CompactTextString(m) } func (*UnarchiveRunRequest) ProtoMessage() {} func (*UnarchiveRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{7} + return fileDescriptor_run_d3e6e7c711d57876, []int{7} } func (m *UnarchiveRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnarchiveRunRequest.Unmarshal(m, b) @@ -493,7 +485,7 @@ func (m *DeleteRunRequest) Reset() { *m = DeleteRunRequest{} } func (m *DeleteRunRequest) String() string { return proto.CompactTextString(m) } func (*DeleteRunRequest) ProtoMessage() {} func (*DeleteRunRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{8} + return fileDescriptor_run_d3e6e7c711d57876, []int{8} } func (m *DeleteRunRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteRunRequest.Unmarshal(m, b) @@ -542,7 +534,7 @@ func (m *Run) Reset() { *m = Run{} } func (m *Run) String() string { return proto.CompactTextString(m) } func (*Run) ProtoMessage() {} func (*Run) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{9} + return fileDescriptor_run_d3e6e7c711d57876, []int{9} } func (m *Run) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Run.Unmarshal(m, b) @@ -658,7 +650,7 @@ func (m *PipelineRuntime) Reset() { *m = PipelineRuntime{} } func (m *PipelineRuntime) String() string { return proto.CompactTextString(m) } func (*PipelineRuntime) ProtoMessage() {} func (*PipelineRuntime) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{10} + return fileDescriptor_run_d3e6e7c711d57876, []int{10} } func (m *PipelineRuntime) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_PipelineRuntime.Unmarshal(m, b) @@ -704,7 +696,7 @@ func (m *RunDetail) Reset() { *m = RunDetail{} } func (m *RunDetail) String() string { return proto.CompactTextString(m) } func (*RunDetail) ProtoMessage() {} func (*RunDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{11} + return fileDescriptor_run_d3e6e7c711d57876, []int{11} } func (m *RunDetail) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RunDetail.Unmarshal(m, b) @@ -754,7 +746,7 @@ func (m *RunMetric) Reset() { *m = RunMetric{} } func (m *RunMetric) String() string { return proto.CompactTextString(m) } func (*RunMetric) ProtoMessage() {} func (*RunMetric) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{12} + return fileDescriptor_run_d3e6e7c711d57876, []int{12} } func (m *RunMetric) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RunMetric.Unmarshal(m, b) @@ -881,7 +873,7 @@ func (m *ReportRunMetricsRequest) Reset() { *m = ReportRunMetricsRequest func (m *ReportRunMetricsRequest) String() string { return proto.CompactTextString(m) } func (*ReportRunMetricsRequest) ProtoMessage() {} func (*ReportRunMetricsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{13} + return fileDescriptor_run_d3e6e7c711d57876, []int{13} } func (m *ReportRunMetricsRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsRequest.Unmarshal(m, b) @@ -926,7 +918,7 @@ func (m *ReportRunMetricsResponse) Reset() { *m = ReportRunMetricsRespon func (m *ReportRunMetricsResponse) String() string { return proto.CompactTextString(m) } func (*ReportRunMetricsResponse) ProtoMessage() {} func (*ReportRunMetricsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{14} + return fileDescriptor_run_d3e6e7c711d57876, []int{14} } func (m *ReportRunMetricsResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsResponse.Unmarshal(m, b) @@ -971,7 +963,7 @@ func (m *ReportRunMetricsResponse_ReportRunMetricResult) String() string { } func (*ReportRunMetricsResponse_ReportRunMetricResult) ProtoMessage() {} func (*ReportRunMetricsResponse_ReportRunMetricResult) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{14, 0} + return fileDescriptor_run_d3e6e7c711d57876, []int{14, 0} } func (m *ReportRunMetricsResponse_ReportRunMetricResult) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReportRunMetricsResponse_ReportRunMetricResult.Unmarshal(m, b) @@ -1032,7 +1024,7 @@ func (m *ReadArtifactRequest) Reset() { *m = ReadArtifactRequest{} } func (m *ReadArtifactRequest) String() string { return proto.CompactTextString(m) } func (*ReadArtifactRequest) ProtoMessage() {} func (*ReadArtifactRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{15} + return fileDescriptor_run_d3e6e7c711d57876, []int{15} } func (m *ReadArtifactRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReadArtifactRequest.Unmarshal(m, b) @@ -1084,7 +1076,7 @@ func (m *ReadArtifactResponse) Reset() { *m = ReadArtifactResponse{} } func (m *ReadArtifactResponse) String() string { return proto.CompactTextString(m) } func (*ReadArtifactResponse) ProtoMessage() {} func (*ReadArtifactResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_run_7139843a7cada1fe, []int{16} + return fileDescriptor_run_d3e6e7c711d57876, []int{16} } func (m *ReadArtifactResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ReadArtifactResponse.Unmarshal(m, b) @@ -1504,107 +1496,106 @@ var _RunService_serviceDesc = grpc.ServiceDesc{ Metadata: "backend/api/run.proto", } -func init() { proto.RegisterFile("backend/api/run.proto", fileDescriptor_run_7139843a7cada1fe) } - -var fileDescriptor_run_7139843a7cada1fe = []byte{ - // 1575 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdd, 0x4e, 0x23, 0xcb, - 0x11, 0xde, 0xb1, 0xc1, 0xc6, 0x65, 0x1b, 0x66, 0x9b, 0x3f, 0xaf, 0x17, 0x04, 0x67, 0xf6, 0xfc, - 0x70, 0x36, 0x07, 0x5b, 0x87, 0x8d, 0x22, 0x85, 0x28, 0x8a, 0x06, 0xf0, 0x72, 0x9c, 0x35, 0x86, - 0xd3, 0x36, 0x44, 0xda, 0x5c, 0x8c, 0xc6, 0xe3, 0xb6, 0x99, 0x60, 0xcf, 0x4c, 0xba, 0x7b, 0x20, - 0xec, 0x6a, 0x6f, 0x22, 0x9d, 0x17, 0x48, 0x2e, 0x72, 0x97, 0x67, 0x88, 0xf2, 0x10, 0x91, 0x72, - 0x9d, 0xfb, 0x5c, 0xe5, 0x41, 0xa2, 0xee, 0x9e, 0x31, 0xe3, 0x1f, 0x8c, 0xb4, 0x57, 0xd0, 0x55, - 0x5f, 0x57, 0x55, 0x57, 0xd5, 0x57, 0xae, 0x81, 0xf5, 0x8e, 0xed, 0xdc, 0x10, 0xaf, 0x5b, 0xb5, - 0x03, 0xb7, 0x4a, 0x43, 0xaf, 0x12, 0x50, 0x9f, 0xfb, 0x28, 0x6d, 0x07, 0x6e, 0x79, 0x33, 0xa9, - 0x23, 0x94, 0xfa, 0x54, 0x69, 0xcb, 0x2f, 0xfb, 0xbe, 0xdf, 0x1f, 0x90, 0xaa, 0x3c, 0x75, 0xc2, - 0x5e, 0x95, 0x0c, 0x03, 0x7e, 0x1f, 0x29, 0xb7, 0x22, 0xa5, 0xb8, 0x64, 0x7b, 0x9e, 0xcf, 0x6d, - 0xee, 0xfa, 0x1e, 0x8b, 0xb4, 0x3b, 0x93, 0x57, 0xb9, 0x3b, 0x24, 0x8c, 0xdb, 0xc3, 0x20, 0x06, - 0x24, 0x9d, 0x06, 0x6e, 0x40, 0x06, 0xae, 0x47, 0x2c, 0x16, 0x10, 0x27, 0x02, 0x7c, 0x39, 0x16, - 0x31, 0x61, 0x7e, 0x48, 0x1d, 0x62, 0x51, 0xd2, 0x23, 0x94, 0x78, 0x0e, 0x89, 0x50, 0xdf, 0xc9, - 0x3f, 0xce, 0x7e, 0x9f, 0x78, 0xfb, 0xec, 0xce, 0xee, 0xf7, 0x09, 0xad, 0xfa, 0x81, 0x8c, 0x64, - 0x3a, 0x2a, 0xa3, 0x01, 0xfa, 0x31, 0x25, 0x36, 0x27, 0x38, 0xf4, 0x30, 0xf9, 0x63, 0x48, 0x18, - 0x47, 0x65, 0x48, 0xd3, 0xd0, 0x2b, 0x69, 0xbb, 0xda, 0x5e, 0xfe, 0x60, 0xa9, 0x62, 0x07, 0x6e, - 0x45, 0x68, 0x85, 0x10, 0x6d, 0x41, 0xce, 0xb3, 0x87, 0x84, 0x05, 0xb6, 0x43, 0x4a, 0xa9, 0x5d, - 0x6d, 0x2f, 0x87, 0x1f, 0x04, 0xc6, 0xd7, 0x50, 0x3c, 0x25, 0x3c, 0x61, 0x6a, 0x1d, 0x32, 0x34, - 0xf4, 0x2c, 0xb7, 0x2b, 0xad, 0xe5, 0xf0, 0x22, 0x0d, 0xbd, 0x7a, 0xd7, 0xf8, 0x97, 0x06, 0x2b, - 0x0d, 0x97, 0x09, 0x24, 0x8b, 0xa1, 0xdb, 0x00, 0x81, 0xdd, 0x27, 0x16, 0xf7, 0x6f, 0x88, 0x17, - 0xc1, 0x73, 0x42, 0xd2, 0x16, 0x02, 0xf4, 0x12, 0xe4, 0xc1, 0x62, 0xee, 0x07, 0xe5, 0x78, 0x11, - 0x2f, 0x09, 0x41, 0xcb, 0xfd, 0x40, 0xd0, 0x26, 0x64, 0x99, 0x4f, 0xb9, 0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, 0x2e, 0xe0, 0x36, 0x27, 0x25, 0xd8, 0xd5, 0xf6, 0x96, 0x0f, 0xd6, 0xe3, 0x4c, 0x54, - 0x5a, 0x4a, 0xdb, 0x12, 0x4a, 0x5c, 0x60, 0x89, 0x13, 0xda, 0x85, 0x7c, 0x97, 0x30, 0x87, 0xba, - 0x92, 0x09, 0x51, 0x97, 0x24, 0x45, 0xe8, 0x17, 0x50, 0x1c, 0x23, 0x5d, 0xd4, 0x21, 0xcf, 0xa5, - 0xf5, 0x8b, 0x48, 0xd3, 0x0a, 0x88, 0x83, 0x0b, 0x41, 0xe2, 0x84, 0x4e, 0x61, 0x75, 0xba, 0xc5, - 0x58, 0x69, 0x51, 0x56, 0x69, 0x63, 0xac, 0xbf, 0x46, 0x2d, 0x85, 0xd1, 0x54, 0x97, 0x31, 0xf4, - 0x4b, 0x00, 0x47, 0x52, 0xb1, 0x6b, 0xd9, 0xbc, 0x94, 0x91, 0xde, 0xcb, 0x15, 0x35, 0x35, 0x2a, - 0xf1, 0xd4, 0xa8, 0xb4, 0xe3, 0xa9, 0x81, 0x73, 0x11, 0xda, 0xe4, 0xe8, 0xd7, 0x50, 0x60, 0xce, - 0x35, 0xe9, 0x86, 0x03, 0x75, 0x39, 0xfb, 0xe4, 0xe5, 0xfc, 0x08, 0x6f, 0x72, 0xf4, 0x2b, 0xc8, - 0xf7, 0x5c, 0xcf, 0x65, 0xd7, 0xea, 0x76, 0xf1, 0xc9, 0xdb, 0x10, 0xc3, 0x4d, 0x2e, 0xa8, 0x21, - 0xaa, 0x11, 0xb2, 0xd2, 0x52, 0x44, 0x3d, 0x79, 0x42, 0x6b, 0xb0, 0x28, 0x27, 0x67, 0xa9, 0xa0, - 0x1a, 0x5b, 0x1e, 0xd0, 0x1e, 0x64, 0x87, 0x84, 0x53, 0xd7, 0x61, 0xa5, 0x9c, 0xcc, 0xd0, 0x72, - 0x5c, 0xbd, 0x33, 0x29, 0xc6, 0xb1, 0xda, 0xa8, 0x41, 0x21,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0x97, 0x51, 0x7d, 0x63, 0x7c, 0x35, 0x2f, 0x2a, 0x1e, 0x1b, 0x44, 0x0e, 0x2c, 0xc5, - 0x9b, 0x77, 0x44, 0x8c, 0x89, 0x45, 0xfc, 0xf3, 0x9a, 0x2a, 0x76, 0x44, 0x85, 0xb1, 0xa3, 0x9f, - 0xb4, 0xbf, 0x98, 0x67, 0x78, 0x0b, 0xb2, 0x5d, 0xd2, 0xb3, 0xc5, 0xd8, 0x7f, 0x8e, 0x56, 0xa0, - 0x58, 0xce, 0x4b, 0x7f, 0x6a, 0x94, 0xbe, 0xdf, 0x81, 0x6d, 0xc8, 0x1c, 0x11, 0x9b, 0x12, 0x8a, - 0x56, 0x97, 0x52, 0xe5, 0xa2, 0x1d, 0xf2, 0x6b, 0x9f, 0xba, 0x1f, 0xe4, 0x57, 0xd9, 0x6e, 0xaa, - 0x53, 0x00, 0x18, 0x01, 0x9e, 0xbd, 0x7f, 0xd3, 0x77, 0xf9, 0x75, 0xd8, 0xa9, 0x38, 0xfe, 0xb0, - 0x7a, 0x13, 0x76, 0x88, 0xd8, 0x36, 0x46, 0xdf, 0x86, 0xac, 0x9a, 0xfc, 0x20, 0xec, 0xfb, 0x96, - 0x33, 0x70, 0x89, 0xc7, 0x3b, 0x19, 0xf9, 0x84, 0x37, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x71, - 0xe6, 0x76, 0x1a, 0xe2, 0x0e, 0x00, 0x00, +func init() { proto.RegisterFile("backend/api/run.proto", fileDescriptor_run_d3e6e7c711d57876) } + +var fileDescriptor_run_d3e6e7c711d57876 = []byte{ + // 1559 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdd, 0x4e, 0x1b, 0x49, + 0x16, 0xa6, 0x6d, 0xb0, 0xf1, 0xb1, 0x0d, 0x4d, 0xf1, 0xe7, 0x38, 0x20, 0x48, 0x93, 0x1f, 0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0xb0, 0x1b, 0xb3, 0xd3, 0x21, 0xb4, 0xec, 0x7a, 0x22, 0x93, 0xd1, 0xac, + 0xb4, 0x12, 0xa8, 0x07, 0x94, 0x98, 0x9c, 0x60, 0xdf, 0xc1, 0xe4, 0x7f, 0x3e, 0x61, 0x1c, 0x15, + 0x21, 0x49, 0x7d, 0xa7, 0xa0, 0x6c, 0x2a, 0xdb, 0xd9, 0xdd, 0xd9, 0x92, 0xe9, 0xd9, 0xa5, 0x40, + 0x1b, 0x08, 0xb5, 0xa7, 0x90, 0x3f, 0x22, 0x3c, 0x06, 0x5e, 0x86, 0x14, 0xf5, 0x1d, 0xc3, 0x6e, + 0x09, 0x7c, 0x06, 0xcf, 0x50, 0xdf, 0xa9, 0xb6, 0xb4, 0x9f, 0x15, 0x98, 0x3f, 0xb6, 0x59, 0x80, + 0x64, 0x11, 0x74, 0x1d, 0xc0, 0x33, 0x3b, 0xc4, 0xe0, 0xee, 0x15, 0x71, 0x42, 0x78, 0x26, 0x90, + 0x34, 0x02, 0x01, 0x7a, 0x08, 0xe2, 0x61, 0x30, 0xfb, 0x03, 0x29, 0x24, 0x36, 0x95, 0xed, 0x19, + 0x3c, 0x1b, 0x08, 0xea, 0xf6, 0x07, 0x82, 0x56, 0x21, 0xcd, 0x5c, 0xca, 0x8d, 0xe6, 0x6d, 0x21, + 0x29, 0x0c, 0x53, 0xc1, 0x73, 0xff, 0x16, 0xbd, 0x81, 0x95, 0xd1, 0x52, 0x18, 0x57, 0xe4, 0xb6, + 0x30, 0x2d, 0xf2, 0x57, 0x65, 0xfe, 0x21, 0xe4, 0x1d, 0xb9, 0xc5, 0x4b, 0x11, 0x1e, 0x47, 0xf0, + 0x77, 0xe4, 0x16, 0xad, 0x40, 0xaa, 0x6d, 0x77, 0x39, 0xa1, 0x85, 0x19, 0xe9, 0x5f, 0xbe, 0xb4, + 0x97, 0xb0, 0xd8, 0x20, 0xb4, 0x67, 0x3b, 0x83, 0x35, 0xba, 0xe3, 0x63, 0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 0x6f, 0xfa, 0xfc, 0xd2, 0xa5, 0xf6, 0x07, 0xf1, 0xcb, 0x6b, 0x33, 0xd1, + 0xcc, 0x01, 0xf4, 0x01, 0x53, 0xef, 0x5f, 0x77, 0x6c, 0x7e, 0xe9, 0x37, 0x4b, 0x96, 0xdb, 0x2b, + 0x5f, 0xf9, 0x4d, 0x12, 0xdc, 0x1b, 0xfd, 0xdf, 0x7f, 0xac, 0x1c, 0xff, 0xd1, 0xd7, 0x71, 0x0d, + 0xab, 0x6b, 0x13, 0x87, 0x37, 0x53, 0xe2, 0x23, 0xbc, 0xfe, 0x23, 0x00, 0x00, 0xff, 0xff, 0xd4, + 0xc7, 0xa6, 0xe7, 0xc6, 0x0e, 0x00, 0x00, } diff --git a/backend/api/go_client/run.pb.gw.go b/backend/api/go_client/run.pb.gw.go index 8d5ac128691..df7e25cfb41 100755 --- a/backend/api/go_client/run.pb.gw.go +++ b/backend/api/go_client/run.pb.gw.go @@ -50,7 +50,7 @@ func request_RunService_CreateRun_0(ctx context.Context, marshaler runtime.Marsh if berr != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Run); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } diff --git a/backend/api/go_http_client/job_model/api_relationship.go b/backend/api/go_http_client/job_model/api_relationship.go index ba1bf6044d8..c9dbca975ab 100644 --- a/backend/api/go_http_client/job_model/api_relationship.go +++ b/backend/api/go_http_client/job_model/api_relationship.go @@ -42,6 +42,9 @@ const ( // APIRelationshipCREATOR captures enum value "CREATOR" APIRelationshipCREATOR APIRelationship = "CREATOR" + + // APIRelationshipBELONGING captures enum value "BELONGING" + APIRelationshipBELONGING APIRelationship = "BELONGING" ) // for schema @@ -49,7 +52,7 @@ var apiRelationshipEnum []interface{} func init() { var res []APIRelationship - if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR","BELONGING"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/go_http_client/job_model/api_resource_type.go b/backend/api/go_http_client/job_model/api_resource_type.go index cc2493d0627..655d4f4c3e5 100644 --- a/backend/api/go_http_client/job_model/api_resource_type.go +++ b/backend/api/go_http_client/job_model/api_resource_type.go @@ -48,6 +48,9 @@ const ( // APIResourceTypePIPELINEVERSION captures enum value "PIPELINE_VERSION" APIResourceTypePIPELINEVERSION APIResourceType = "PIPELINE_VERSION" + + // APIResourceTypeNAMESPACE captures enum value "NAMESPACE" + APIResourceTypeNAMESPACE APIResourceType = "NAMESPACE" ) // for schema @@ -55,7 +58,7 @@ var apiResourceTypeEnum []interface{} func init() { var res []APIResourceType - if err := json.Unmarshal([]byte(`["UNKNOWN_RESOURCE_TYPE","EXPERIMENT","JOB","PIPELINE","PIPELINE_VERSION"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RESOURCE_TYPE","EXPERIMENT","JOB","PIPELINE","PIPELINE_VERSION","NAMESPACE"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/go_http_client/pipeline_model/api_relationship.go b/backend/api/go_http_client/pipeline_model/api_relationship.go index 14793853f97..8c6fb0d6bac 100644 --- a/backend/api/go_http_client/pipeline_model/api_relationship.go +++ b/backend/api/go_http_client/pipeline_model/api_relationship.go @@ -42,6 +42,9 @@ const ( // APIRelationshipCREATOR captures enum value "CREATOR" APIRelationshipCREATOR APIRelationship = "CREATOR" + + // APIRelationshipBELONGING captures enum value "BELONGING" + APIRelationshipBELONGING APIRelationship = "BELONGING" ) // for schema @@ -49,7 +52,7 @@ var apiRelationshipEnum []interface{} func init() { var res []APIRelationship - if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR","BELONGING"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/go_http_client/pipeline_model/api_resource_type.go b/backend/api/go_http_client/pipeline_model/api_resource_type.go index 363e3e9b21d..8f5fb0f47ae 100644 --- a/backend/api/go_http_client/pipeline_model/api_resource_type.go +++ b/backend/api/go_http_client/pipeline_model/api_resource_type.go @@ -48,6 +48,9 @@ const ( // APIResourceTypePIPELINEVERSION captures enum value "PIPELINE_VERSION" APIResourceTypePIPELINEVERSION APIResourceType = "PIPELINE_VERSION" + + // APIResourceTypeNAMESPACE captures enum value "NAMESPACE" + APIResourceTypeNAMESPACE APIResourceType = "NAMESPACE" ) // for schema @@ -55,7 +58,7 @@ var apiResourceTypeEnum []interface{} func init() { var res []APIResourceType - if err := json.Unmarshal([]byte(`["UNKNOWN_RESOURCE_TYPE","EXPERIMENT","JOB","PIPELINE","PIPELINE_VERSION"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RESOURCE_TYPE","EXPERIMENT","JOB","PIPELINE","PIPELINE_VERSION","NAMESPACE"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/go_http_client/run_client/run_service/create_run_parameters.go b/backend/api/go_http_client/run_client/run_service/create_run_parameters.go index db0000de379..7f671ab5188 100644 --- a/backend/api/go_http_client/run_client/run_service/create_run_parameters.go +++ b/backend/api/go_http_client/run_client/run_service/create_run_parameters.go @@ -78,7 +78,7 @@ for the create run operation typically these are written to a http.Request type CreateRunParams struct { /*Body*/ - Body *run_model.APICreateRunRequest + Body *run_model.APIRun timeout time.Duration Context context.Context @@ -119,13 +119,13 @@ func (o *CreateRunParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the create run params -func (o *CreateRunParams) WithBody(body *run_model.APICreateRunRequest) *CreateRunParams { +func (o *CreateRunParams) WithBody(body *run_model.APIRun) *CreateRunParams { o.SetBody(body) return o } // SetBody adds the body to the create run params -func (o *CreateRunParams) SetBody(body *run_model.APICreateRunRequest) { +func (o *CreateRunParams) SetBody(body *run_model.APIRun) { o.Body = body } diff --git a/backend/api/go_http_client/run_model/BUILD.bazel b/backend/api/go_http_client/run_model/BUILD.bazel index ce8cfb453a2..9786a9bc659 100644 --- a/backend/api/go_http_client/run_model/BUILD.bazel +++ b/backend/api/go_http_client/run_model/BUILD.bazel @@ -3,7 +3,6 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ - "api_create_run_request.go", "api_list_runs_response.go", "api_parameter.go", "api_pipeline_runtime.go", diff --git a/backend/api/go_http_client/run_model/api_create_run_request.go b/backend/api/go_http_client/run_model/api_create_run_request.go deleted file mode 100644 index 48f6d09ecb8..00000000000 --- a/backend/api/go_http_client/run_model/api_create_run_request.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by go-swagger; DO NOT EDIT. - -package run_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// APICreateRunRequest api create run request -// swagger:model apiCreateRunRequest -type APICreateRunRequest struct { - - // namespace - Namespace string `json:"namespace,omitempty"` - - // run - Run *APIRun `json:"run,omitempty"` -} - -// Validate validates this api create run request -func (m *APICreateRunRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRun(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APICreateRunRequest) validateRun(formats strfmt.Registry) error { - - if swag.IsZero(m.Run) { // not required - return nil - } - - if m.Run != nil { - if err := m.Run.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("run") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *APICreateRunRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APICreateRunRequest) UnmarshalBinary(b []byte) error { - var res APICreateRunRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/backend/api/go_http_client/run_model/api_relationship.go b/backend/api/go_http_client/run_model/api_relationship.go index 8d0759b51a8..5dca88cf7a3 100644 --- a/backend/api/go_http_client/run_model/api_relationship.go +++ b/backend/api/go_http_client/run_model/api_relationship.go @@ -42,6 +42,9 @@ const ( // APIRelationshipCREATOR captures enum value "CREATOR" APIRelationshipCREATOR APIRelationship = "CREATOR" + + // APIRelationshipBELONGING captures enum value "BELONGING" + APIRelationshipBELONGING APIRelationship = "BELONGING" ) // for schema @@ -49,7 +52,7 @@ var apiRelationshipEnum []interface{} func init() { var res []APIRelationship - if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR","BELONGING"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/go_http_client/run_model/api_resource_type.go b/backend/api/go_http_client/run_model/api_resource_type.go index 7e9c02d7db7..2748aa0874c 100644 --- a/backend/api/go_http_client/run_model/api_resource_type.go +++ b/backend/api/go_http_client/run_model/api_resource_type.go @@ -48,6 +48,9 @@ const ( // APIResourceTypePIPELINEVERSION captures enum value "PIPELINE_VERSION" APIResourceTypePIPELINEVERSION APIResourceType = "PIPELINE_VERSION" + + // APIResourceTypeNAMESPACE captures enum value "NAMESPACE" + APIResourceTypeNAMESPACE APIResourceType = "NAMESPACE" ) // for schema @@ -55,7 +58,7 @@ var apiResourceTypeEnum []interface{} func init() { var res []APIResourceType - if err := json.Unmarshal([]byte(`["UNKNOWN_RESOURCE_TYPE","EXPERIMENT","JOB","PIPELINE","PIPELINE_VERSION"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RESOURCE_TYPE","EXPERIMENT","JOB","PIPELINE","PIPELINE_VERSION","NAMESPACE"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/resource_reference.proto b/backend/api/resource_reference.proto index f1ba7d70b42..a87b574065d 100644 --- a/backend/api/resource_reference.proto +++ b/backend/api/resource_reference.proto @@ -23,12 +23,14 @@ enum ResourceType { JOB = 2; PIPELINE = 3; PIPELINE_VERSION = 4; + NAMESPACE = 5; } enum Relationship { UNKNOWN_RELATIONSHIP = 0; OWNER = 1; CREATOR = 2; + BELONGING = 3; } diff --git a/backend/api/run.proto b/backend/api/run.proto index 05a559a2774..986ab7f4176 100644 --- a/backend/api/run.proto +++ b/backend/api/run.proto @@ -65,7 +65,7 @@ service RunService { rpc CreateRun(CreateRunRequest) returns (RunDetail) { option (google.api.http) = { post: "/apis/v1beta1/runs" - body: "*" + body: "run" }; } @@ -140,7 +140,6 @@ service RunService { message CreateRunRequest { Run run = 1; - string namespace = 2; } message GetRunRequest { diff --git a/backend/api/swagger/job.swagger.json b/backend/api/swagger/job.swagger.json index 2a485f7a4cd..07c58362883 100644 --- a/backend/api/swagger/job.swagger.json +++ b/backend/api/swagger/job.swagger.json @@ -65,7 +65,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, @@ -426,7 +427,8 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR" + "CREATOR", + "BELONGING" ], "default": "UNKNOWN_RELATIONSHIP" }, @@ -466,7 +468,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, diff --git a/backend/api/swagger/kfp_api_single_file.swagger.json b/backend/api/swagger/kfp_api_single_file.swagger.json index bb089db1c5e..05847f43ca6 100644 --- a/backend/api/swagger/kfp_api_single_file.swagger.json +++ b/backend/api/swagger/kfp_api_single_file.swagger.json @@ -66,7 +66,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, @@ -112,7 +113,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/apiCreateRunRequest" + "$ref": "#/definitions/apiRun" } } ], @@ -443,7 +444,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, @@ -1041,17 +1043,6 @@ ], "default": "STORAGESTATE_AVAILABLE" }, - "apiCreateRunRequest": { - "type": "object", - "properties": { - "run": { - "$ref": "#/definitions/apiRun" - }, - "namespace": { - "type": "string" - } - } - }, "apiListRunsResponse": { "type": "object", "properties": { @@ -1137,7 +1128,8 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR" + "CREATOR", + "BELONGING" ], "default": "UNKNOWN_RELATIONSHIP" }, @@ -1204,7 +1196,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, diff --git a/backend/api/swagger/pipeline.swagger.json b/backend/api/swagger/pipeline.swagger.json index 0cd2aeb1e2c..4feb86de553 100644 --- a/backend/api/swagger/pipeline.swagger.json +++ b/backend/api/swagger/pipeline.swagger.json @@ -333,7 +333,8 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR" + "CREATOR", + "BELONGING" ], "default": "UNKNOWN_RELATIONSHIP" }, @@ -373,7 +374,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, diff --git a/backend/api/swagger/run.swagger.json b/backend/api/swagger/run.swagger.json index 7e286c6e40c..28f90272606 100644 --- a/backend/api/swagger/run.swagger.json +++ b/backend/api/swagger/run.swagger.json @@ -65,7 +65,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, @@ -111,7 +112,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/apiCreateRunRequest" + "$ref": "#/definitions/apiRun" } } ], @@ -445,17 +446,6 @@ ], "default": "STORAGESTATE_AVAILABLE" }, - "apiCreateRunRequest": { - "type": "object", - "properties": { - "run": { - "$ref": "#/definitions/apiRun" - }, - "namespace": { - "type": "string" - } - } - }, "apiListRunsResponse": { "type": "object", "properties": { @@ -541,7 +531,8 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR" + "CREATOR", + "BELONGING" ], "default": "UNKNOWN_RELATIONSHIP" }, @@ -608,7 +599,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, From 05151b64a62a5f9f6d865f1cfa527830f7024844 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 13:26:39 -0800 Subject: [PATCH 04/57] pass user identity header from the gRPC server to KFP service --- backend/src/apiserver/common/const.go | 4 ++++ backend/src/apiserver/main.go | 13 ++++++++++++- backend/src/apiserver/server/BUILD.bazel | 2 ++ backend/src/apiserver/server/run_server.go | 21 +++++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/backend/src/apiserver/common/const.go b/backend/src/apiserver/common/const.go index 5a27fa7ed75..1fa5468ece3 100644 --- a/backend/src/apiserver/common/const.go +++ b/backend/src/apiserver/common/const.go @@ -35,6 +35,10 @@ const ( Creator Relationship = "Creator" ) +const ( + UserIdentityHeader string = "x-goog-authenticated-user-email" +) + func ToModelResourceType(apiType api.ResourceType) (ResourceType, error) { switch apiType { case api.ResourceType_EXPERIMENT: diff --git a/backend/src/apiserver/main.go b/backend/src/apiserver/main.go index 4c8f1b2f212..7c64c167ded 100644 --- a/backend/src/apiserver/main.go +++ b/backend/src/apiserver/main.go @@ -71,6 +71,17 @@ func main() { clientManager.Close() } +// A custom http request header matcher to pass on the user identity +// Reference: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/docs/_docs/customizingyourgateway.md#mapping-from-http-request-headers-to-grpc-client-metadata +func grpcCustomMatcher(key string) (string, bool) { + switch strings.ToLower(key) { + case common.UserIdentityHeader: + return strings.ToLower(key), true + default: + return strings.ToLower(key), false + } +} + func startRpcServer(resourceManager *resource.ResourceManager) { glog.Info("Starting RPC server") listener, err := net.Listen("tcp", *rpcPortFlag) @@ -107,7 +118,7 @@ func startHttpProxy(resourceManager *resource.ResourceManager) { defer cancel() // Create gRPC HTTP MUX and register services. - mux := runtime.NewServeMux() + mux := runtime.NewServeMux(runtime.WithIncomingHeaderMatcher(grpcCustomMatcher)) registerHttpHandlerFromEndpoint(api.RegisterPipelineServiceHandlerFromEndpoint, "PipelineService", ctx, mux) registerHttpHandlerFromEndpoint(api.RegisterExperimentServiceHandlerFromEndpoint, "ExperimentService", ctx, mux) registerHttpHandlerFromEndpoint(api.RegisterJobServiceHandlerFromEndpoint, "JobService", ctx, mux) diff --git a/backend/src/apiserver/server/BUILD.bazel b/backend/src/apiserver/server/BUILD.bazel index 83c307b0b8a..e51fd585351 100644 --- a/backend/src/apiserver/server/BUILD.bazel +++ b/backend/src/apiserver/server/BUILD.bazel @@ -35,6 +35,8 @@ go_library( "@io_bazel_rules_go//proto/wkt:timestamp_go_proto", "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//metadata:go_default_library", + "@com_github_pkg_errors//:go_default_library", ], ) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 9d09c23dbdb..05a5c745c79 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -16,11 +16,16 @@ package server import ( "context" + "strings" + "github.com/golang/glog" + "google.golang.org/grpc/metadata" + "github.com/pkg/errors" "github.com/golang/protobuf/ptypes/empty" api "github.com/kubeflow/pipelines/backend/api/go_client" "github.com/kubeflow/pipelines/backend/src/apiserver/model" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" + "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/common/util" ) @@ -30,6 +35,22 @@ type RunServer struct { func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest) (*api.RunDetail, error) { err := s.validateCreateRunRequest(request) + md, _ := metadata.FromIncomingContext(ctx) + // If the request header contains the user identity, requests are authorized + // based on the namespace field in the request. + if userIdentityHeader, ok := md[common.UserIdentityHeader]; ok { + if len(userIdentityHeader) != 1 { + return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is empty"), "Request header error: user identity value is empty") + } + userIdentityHeaderFields := strings.Split(userIdentityHeader[0], ":") + if len(userIdentityHeaderFields) != 2 { + return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), "Request header error: user identity value is incorrectly formatted") + } + userIdentity := userIdentityHeaderFields[1] + glog.Infof("User Identity: %s", userIdentity) + //TODO: authenticate the requests based on the userIdentity and the namespace. + } + if err != nil { return nil, util.Wrap(err, "Validate create run request failed.") } From e6c1443ee83453585f361bdfa985767252a294b2 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 13:31:57 -0800 Subject: [PATCH 05/57] add variables in const --- backend/src/apiserver/common/const.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/common/const.go b/backend/src/apiserver/common/const.go index 5a27fa7ed75..31941a62377 100644 --- a/backend/src/apiserver/common/const.go +++ b/backend/src/apiserver/common/const.go @@ -28,11 +28,13 @@ const ( Run ResourceType = "Run" Pipeline ResourceType = "pipeline" PipelineVersion ResourceType = "PipelineVersion" + Namespace ResourceType = "Namespace" ) const ( - Owner Relationship = "Owner" - Creator Relationship = "Creator" + Owner Relationship = "Owner" + Creator Relationship = "Creator" + Belonging Relationship = "Belonging" ) func ToModelResourceType(apiType api.ResourceType) (ResourceType, error) { From be5a16744cc38169f79b9b39bd706a8287418103 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 14:34:31 -0800 Subject: [PATCH 06/57] declare a flag and fill in the authorizations --- backend/src/apiserver/common/config.go | 11 +++++++++++ backend/src/apiserver/server/run_server.go | 22 +++++++++++++++++----- backend/src/apiserver/server/util.go | 7 +++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/backend/src/apiserver/common/config.go b/backend/src/apiserver/common/config.go index a6bec9a4ebc..3dd5256196d 100644 --- a/backend/src/apiserver/common/config.go +++ b/backend/src/apiserver/common/config.go @@ -22,6 +22,10 @@ import ( "github.com/spf13/viper" ) +const ( + deployment string = "DEPLOYMENT" + kubeflowDeployment string = "KUBEFLOW" +) func GetStringConfig(configName string) string { if !viper.IsSet(configName) { @@ -54,3 +58,10 @@ func GetDurationConfig(configName string) time.Duration { } return viper.GetDuration(configName) } + +func IsKubeflowDeployment() bool { + if !viper.IsSet(deployment) { + return false + } + return viper.GetString(deployment) == kubeflowDeployment +} diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 05a5c745c79..60b31c1888b 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -19,14 +19,14 @@ import ( "strings" "github.com/golang/glog" - "google.golang.org/grpc/metadata" - "github.com/pkg/errors" "github.com/golang/protobuf/ptypes/empty" api "github.com/kubeflow/pipelines/backend/api/go_client" + "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/model" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" - "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/common/util" + "github.com/pkg/errors" + "google.golang.org/grpc/metadata" ) type RunServer struct { @@ -47,8 +47,20 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), "Request header error: user identity value is incorrectly formatted") } userIdentity := userIdentityHeaderFields[1] - glog.Infof("User Identity: %s", userIdentity) - //TODO: authenticate the requests based on the userIdentity and the namespace. + + if common.IsKubeflowDeployment() { + //authenticate the requests based on the userIdentity and the namespace. + namespace := "" + for _, resourceRef := range request.Run.ResourceReferences { + if resourceRef.Key.Type == api.ResourceType_NAMESPACE { + namespace = resourceRef.Key.Id + break + } + } + if len(namespace) != 0 && AuthorizeRequest(userIdentity, namespace){ + glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) + } + } } if err != nil { diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index bffd1d52960..a18ab368fa8 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -8,6 +8,7 @@ import ( "compress/gzip" "encoding/json" + "github.com/golang/glog" api "github.com/kubeflow/pipelines/backend/api/go_client" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" @@ -268,3 +269,9 @@ func CheckPipelineVersionReference(resourceManager *resource.ResourceManager, re return &pipelineVersionId, nil } + +func AuthorizeRequest(userIdentity string, namespace string) bool { + //TODO: Add authorization logic by contacting the KFAM service + glog.Infof("Authorizing user %s for namespace %s", userIdentity, namespace) + return true +} \ No newline at end of file From 659165e4c7acbab6bce136c33f159e45c8989785 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 15:24:25 -0800 Subject: [PATCH 07/57] add types to toModel func --- backend/src/apiserver/common/const.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/apiserver/common/const.go b/backend/src/apiserver/common/const.go index 31941a62377..8104ba0ea31 100644 --- a/backend/src/apiserver/common/const.go +++ b/backend/src/apiserver/common/const.go @@ -45,6 +45,8 @@ func ToModelResourceType(apiType api.ResourceType) (ResourceType, error) { return Job, nil case api.ResourceType_PIPELINE_VERSION: return PipelineVersion, nil + case api.ResourceType_NAMESPACE: + return Namespace, nil default: return "", util.NewInvalidInputError("Unsupported resource type: %s", api.ResourceType_name[int32(apiType)]) } @@ -56,6 +58,8 @@ func ToModelRelationship(r api.Relationship) (Relationship, error) { return Creator, nil case api.Relationship_OWNER: return Owner, nil + case api.Relationship_BELONGING: + return Belonging, nil default: return "", util.NewInvalidInputError("Unsupported resource relationship: %s", api.Relationship_name[int32(r)]) } From 755f54236876511a573d20b2d576d855ce0392f3 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 17:56:25 -0800 Subject: [PATCH 08/57] bug fix --- backend/src/apiserver/resource/model_converter.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/apiserver/resource/model_converter.go b/backend/src/apiserver/resource/model_converter.go index 8f52b8fccfa..6af61c97755 100644 --- a/backend/src/apiserver/resource/model_converter.go +++ b/backend/src/apiserver/resource/model_converter.go @@ -244,6 +244,8 @@ func (r *ResourceManager) getResourceName(resourceType common.ResourceType, reso return "", util.Wrap(err, "Referred pipeline version not found.") } return version.Name, nil + case common.Namespace: + return resourceId, nil default: return "", util.NewInvalidInputError("Unsupported resource type: %s", string(resourceType)) } From ee45be5a81047745250d737ab6c3f623cd602bcd Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 26 Nov 2019 18:19:26 -0800 Subject: [PATCH 09/57] strip the namespace resource reference when mapping to the db model --- .../src/apiserver/resource/model_converter.go | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/src/apiserver/resource/model_converter.go b/backend/src/apiserver/resource/model_converter.go index 6af61c97755..63e1156442d 100644 --- a/backend/src/apiserver/resource/model_converter.go +++ b/backend/src/apiserver/resource/model_converter.go @@ -199,15 +199,17 @@ func (r *ResourceManager) toModelResourceReferences( if err != nil { return nil, util.Wrap(err, "Failed to find the referred resource") } - modelRef := &model.ResourceReference{ - ResourceUUID: resourceId, - ResourceType: resourceType, - ReferenceUUID: apiRef.Key.Id, - ReferenceName: referenceName, - ReferenceType: modelReferenceType, - Relationship: modelRelationship, - } - modelRefs = append(modelRefs, modelRef) + if apiRef.Key.Type != api.ResourceType_NAMESPACE { + modelRef := &model.ResourceReference{ + ResourceUUID: resourceId, + ResourceType: resourceType, + ReferenceUUID: apiRef.Key.Id, + ReferenceName: referenceName, + ReferenceType: modelReferenceType, + Relationship: modelRelationship, + } + modelRefs = append(modelRefs, modelRef) + } } return modelRefs, nil } From 204824bb6cf988738b503176a19afc94df023ad4 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 27 Nov 2019 13:28:43 -0800 Subject: [PATCH 10/57] add unit tests --- .../src/apiserver/resource/model_converter_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/src/apiserver/resource/model_converter_test.go b/backend/src/apiserver/resource/model_converter_test.go index a607ced0636..4052fc710c8 100644 --- a/backend/src/apiserver/resource/model_converter_test.go +++ b/backend/src/apiserver/resource/model_converter_test.go @@ -198,6 +198,18 @@ func TestToModelResourceReferences_UnknownRefType(t *testing.T) { assert.Contains(t, err.Error(), "Failed to convert reference type") } +func TestToModelResourceReferences_NamespaceRef(t *testing.T) { + store, manager, _ := initWithJob(t) + defer store.Close() + + modelRefs, err := manager.toModelResourceReferences("r1", common.Run, []*api.ResourceReference{ + {Key: &api.ResourceKey{Type: api.ResourceType_NAMESPACE, Id: "e1"}, Relationship: api.Relationship_BELONGING}, + }) + assert.Nil(t, err) + assert.Equal(t, 0, len(modelRefs)) +} + + func TestToModelResourceReferences_UnknownRelationship(t *testing.T) { store, manager, _ := initWithJob(t) defer store.Close() From a21b60acc46a1e2c95c9f2720413d327bd41240e Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 27 Nov 2019 16:39:05 -0800 Subject: [PATCH 11/57] add authorization --- backend/src/apiserver/client/BUILD.bazel | 2 + backend/src/apiserver/client/kfam.go | 48 +++++++++++++++ backend/src/apiserver/client_manager.go | 6 ++ backend/src/apiserver/resource/BUILD.bazel | 2 + .../apiserver/resource/client_manager_fake.go | 7 +++ .../apiserver/resource/resource_manager.go | 8 +++ backend/src/apiserver/server/run_server.go | 58 +++++++++++-------- backend/src/apiserver/server/util.go | 5 +- 8 files changed, 110 insertions(+), 26 deletions(-) create mode 100644 backend/src/apiserver/client/kfam.go diff --git a/backend/src/apiserver/client/BUILD.bazel b/backend/src/apiserver/client/BUILD.bazel index 25f6be6c30d..74716315b8f 100644 --- a/backend/src/apiserver/client/BUILD.bazel +++ b/backend/src/apiserver/client/BUILD.bazel @@ -8,10 +8,12 @@ go_library( "scheduled_workflow.go", "sql.go", "workflow.go", + "kfam.go", ], importpath = "github.com/kubeflow/pipelines/backend/src/apiserver/client", visibility = ["//visibility:public"], deps = [ + "//backend/src/common/util:go_default_library", "//backend/src/crd/pkg/client/clientset/versioned:go_default_library", "//backend/src/crd/pkg/client/clientset/versioned/typed/scheduledworkflow/v1beta1:go_default_library", "@com_github_argoproj_argo//pkg/client/clientset/versioned:go_default_library", diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go new file mode 100644 index 00000000000..88bd84a069d --- /dev/null +++ b/backend/src/apiserver/client/kfam.go @@ -0,0 +1,48 @@ +package client + +import ( + "fmt" + "io/ioutil" + "net/http" + + "github.com/golang/glog" + "github.com/kubeflow/pipelines/backend/src/common/util" +) + +type KFAMInterface interface { + IsAuthorized(userIdentity string, namespace string) (bool, error) +} + +type KFAMClient struct { + kfamServiceUrl string +} + + +func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, error) { + req, err := http.NewRequest("GET", c.kfamServiceUrl, nil) + if err != nil { + return false, util.Wrap(err, "Failed to create a KFAM http request.") + } + q := req.URL.Query() + q.Add("user", userIdentity) + req.URL.RawQuery = q.Encode() + resp, err := http.Get(req.URL.String()) + if err != nil { + return false, util.Wrap(err, "Failure to connect to the KFAM service.") + } + if resp.StatusCode != http.StatusOK { + return false, fmt.Errorf(resp.Status) + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return false, util.Wrap(err, "Unable to parse KFAM response.") + } + glog.Info(string(body)) + return true, nil +} + +func NewKFAMClient(kfamServiceHost string, kfamServicePort string) *KFAMClient{ + kfamServiceUrl := fmt.Sprintf("http://%s:%s/kfam/v1/bindings", kfamServiceHost, kfamServicePort) + return &KFAMClient{kfamServiceUrl} +} \ No newline at end of file diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index 179e9e728a5..70ec3cea7fb 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -67,6 +67,7 @@ type ClientManager struct { wfClient workflowclient.WorkflowInterface swfClient scheduledworkflowclient.ScheduledWorkflowInterface podClient v1.PodInterface + kfamClient client.KFAMInterface time util.TimeInterface uuid util.UUIDGeneratorInterface } @@ -115,6 +116,10 @@ func (c *ClientManager) PodClient() v1.PodInterface { return c.podClient } +func (c *ClientManager) KFAMClient() client.KFAMInterface { + return c.kfamClient +} + func (c *ClientManager) Time() util.TimeInterface { return c.time } @@ -154,6 +159,7 @@ func (c *ClientManager) init() { runStore := storage.NewRunStore(db, c.time) c.runStore = runStore + c.kfamClient = client.NewKFAMClient("profiles-kfam.kubeflow","8081") glog.Infof("Client manager initialized successfully") } diff --git a/backend/src/apiserver/resource/BUILD.bazel b/backend/src/apiserver/resource/BUILD.bazel index c477c49e6aa..c25e611a7e8 100644 --- a/backend/src/apiserver/resource/BUILD.bazel +++ b/backend/src/apiserver/resource/BUILD.bazel @@ -19,6 +19,7 @@ go_library( "//backend/src/apiserver/list:go_default_library", "//backend/src/apiserver/model:go_default_library", "//backend/src/apiserver/storage:go_default_library", + "//backend/src/apiserver/client:go_default_library", "//backend/src/common/util:go_default_library", "//backend/src/crd/pkg/apis/scheduledworkflow/v1beta1:go_default_library", "//backend/src/crd/pkg/client/clientset/versioned/typed/scheduledworkflow/v1beta1:go_default_library", @@ -52,6 +53,7 @@ go_test( "//backend/src/apiserver/common:go_default_library", "//backend/src/apiserver/model:go_default_library", "//backend/src/apiserver/storage:go_default_library", + "//backend/src/apiserver/client:go_default_library", "//backend/src/common/util:go_default_library", "//backend/src/crd/pkg/apis/scheduledworkflow/v1beta1:go_default_library", "@com_github_argoproj_argo//pkg/apis/workflow/v1alpha1:go_default_library", diff --git a/backend/src/apiserver/resource/client_manager_fake.go b/backend/src/apiserver/resource/client_manager_fake.go index 2cbea55c72e..2ffb70bc1b8 100644 --- a/backend/src/apiserver/resource/client_manager_fake.go +++ b/backend/src/apiserver/resource/client_manager_fake.go @@ -17,6 +17,7 @@ package resource import ( workflowclient "github.com/argoproj/argo/pkg/client/clientset/versioned/typed/workflow/v1alpha1" "github.com/golang/glog" + "github.com/kubeflow/pipelines/backend/src/apiserver/client" "github.com/kubeflow/pipelines/backend/src/apiserver/storage" "github.com/kubeflow/pipelines/backend/src/common/util" scheduledworkflowclient "github.com/kubeflow/pipelines/backend/src/crd/pkg/client/clientset/versioned/typed/scheduledworkflow/v1beta1" @@ -41,6 +42,7 @@ type FakeClientManager struct { workflowClientFake *FakeWorkflowClient scheduledWorkflowClientFake *FakeScheduledWorkflowClient podClientFake v1.PodInterface + kfamClientFake client.KFAMInterface time util.TimeInterface uuid util.UUIDGeneratorInterface } @@ -76,6 +78,7 @@ func NewFakeClientManager(time util.TimeInterface, uuid util.UUIDGeneratorInterf objectStore: storage.NewFakeObjectStore(), scheduledWorkflowClientFake: NewScheduledWorkflowClientFake(), podClientFake: FakePodClient{}, + kfamClientFake: client.NewKFAMClient("",""), time: time, uuid: uuid, }, nil @@ -146,6 +149,10 @@ func (f *FakeClientManager) PodClient() v1.PodInterface { return f.podClientFake } +func (f *FakeClientManager) KFAMClient() client.KFAMInterface { + return f.kfamClientFake +} + func (f *FakeClientManager) Close() error { return f.db.Close() } diff --git a/backend/src/apiserver/resource/resource_manager.go b/backend/src/apiserver/resource/resource_manager.go index b0f43f21362..e3bd5337bfd 100644 --- a/backend/src/apiserver/resource/resource_manager.go +++ b/backend/src/apiserver/resource/resource_manager.go @@ -24,6 +24,7 @@ import ( "github.com/cenkalti/backoff" "github.com/golang/glog" api "github.com/kubeflow/pipelines/backend/api/go_client" + "github.com/kubeflow/pipelines/backend/src/apiserver/client" "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/list" "github.com/kubeflow/pipelines/backend/src/apiserver/model" @@ -55,6 +56,7 @@ type ClientManagerInterface interface { Workflow() workflowclient.WorkflowInterface ScheduledWorkflow() scheduledworkflowclient.ScheduledWorkflowInterface PodClient() corev1.PodInterface + KFAMClient() client.KFAMInterface Time() util.TimeInterface UUID() util.UUIDGeneratorInterface } @@ -71,6 +73,7 @@ type ResourceManager struct { workflowClient workflowclient.WorkflowInterface scheduledWorkflowClient scheduledworkflowclient.ScheduledWorkflowInterface podClient corev1.PodInterface + kfamClient client.KFAMInterface time util.TimeInterface uuid util.UUIDGeneratorInterface } @@ -88,6 +91,7 @@ func NewResourceManager(clientManager ClientManagerInterface) *ResourceManager { workflowClient: clientManager.Workflow(), scheduledWorkflowClient: clientManager.ScheduledWorkflow(), podClient: clientManager.PodClient(), + kfamClient: clientManager.KFAMClient(), time: clientManager.Time(), uuid: clientManager.UUID(), } @@ -945,3 +949,7 @@ func (r *ResourceManager) GetPipelineVersionTemplate(versionId string) ([]byte, return template, nil } + +func (r *ResourceManager) IsRequestAuthorized(userIdentity string, namespace string) (bool, error) { + return r.kfamClient.IsAuthorized(userIdentity, namespace) +} \ No newline at end of file diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 60b31c1888b..d0bb83d896f 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -35,30 +35,42 @@ type RunServer struct { func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest) (*api.RunDetail, error) { err := s.validateCreateRunRequest(request) - md, _ := metadata.FromIncomingContext(ctx) - // If the request header contains the user identity, requests are authorized - // based on the namespace field in the request. - if userIdentityHeader, ok := md[common.UserIdentityHeader]; ok { - if len(userIdentityHeader) != 1 { - return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is empty"), "Request header error: user identity value is empty") - } - userIdentityHeaderFields := strings.Split(userIdentityHeader[0], ":") - if len(userIdentityHeaderFields) != 2 { - return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), "Request header error: user identity value is incorrectly formatted") - } - userIdentity := userIdentityHeaderFields[1] - - if common.IsKubeflowDeployment() { - //authenticate the requests based on the userIdentity and the namespace. - namespace := "" - for _, resourceRef := range request.Run.ResourceReferences { - if resourceRef.Key.Type == api.ResourceType_NAMESPACE { - namespace = resourceRef.Key.Id - break - } + if err != nil { + return nil, util.Wrap(err, "Validate create run request failed.") + } + if ctx != nil { + md, _ := metadata.FromIncomingContext(ctx) + // If the request header contains the user identity, requests are authorized + // based on the namespace field in the request. + if userIdentityHeader, ok := md[common.UserIdentityHeader]; ok { + if len(userIdentityHeader) != 1 { + return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is empty"), "Request header error: user identity value is empty") + } + userIdentityHeaderFields := strings.Split(userIdentityHeader[0], ":") + if len(userIdentityHeaderFields) != 2 { + return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), "Request header error: user identity value is incorrectly formatted") } - if len(namespace) != 0 && AuthorizeRequest(userIdentity, namespace){ - glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) + userIdentity := userIdentityHeaderFields[1] + + if common.IsKubeflowDeployment() { + //authenticate the requests based on the userIdentity and the namespace. + namespace := "" + for _, resourceRef := range request.Run.ResourceReferences { + if resourceRef.Key.Type == api.ResourceType_NAMESPACE { + namespace = resourceRef.Key.Id + break + } + } + if len(namespace) != 0 { + authorized, err:= IsRequestAuthorized(s.resourceManager, userIdentity, namespace) + if err != nil{ + glog.Infof("Error: ", err.Error()) + } + if authorized { + glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) + } + + } } } } diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index a18ab368fa8..0cca42f9f1e 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -270,8 +270,7 @@ func CheckPipelineVersionReference(resourceManager *resource.ResourceManager, re return &pipelineVersionId, nil } -func AuthorizeRequest(userIdentity string, namespace string) bool { - //TODO: Add authorization logic by contacting the KFAM service +func IsRequestAuthorized(resourceManager *resource.ResourceManager, userIdentity string, namespace string) (bool, error) { glog.Infof("Authorizing user %s for namespace %s", userIdentity, namespace) - return true + return resourceManager.IsRequestAuthorized(userIdentity, namespace) } \ No newline at end of file From a7d3db305995a58fafb09532dc6f5540725a6e21 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 27 Nov 2019 22:03:32 -0800 Subject: [PATCH 12/57] interpret json response --- backend/src/apiserver/client/kfam.go | 35 +++++++++++++++++++++- backend/src/apiserver/server/run_server.go | 3 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index 88bd84a069d..c9bdd1c11f5 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -1,6 +1,7 @@ package client import ( + "encoding/json" "fmt" "io/ioutil" "net/http" @@ -17,6 +18,26 @@ type KFAMClient struct { kfamServiceUrl string } +type User struct { + Kind string + Name string +} + +type RoleRef struct { + ApiGroup string + Kind string + Name string +} + +type Binding struct { + User User + ReferredNamespace string + RoleRef RoleRef +} + +type Bindings struct { + Bindings []Binding +} func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, error) { req, err := http.NewRequest("GET", c.kfamServiceUrl, nil) @@ -39,7 +60,19 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, return false, util.Wrap(err, "Unable to parse KFAM response.") } glog.Info(string(body)) - return true, nil + var jsonBindings Bindings + err = json.Unmarshal(body, &jsonBindings) + if err != nil{ + return false, util.Wrap(err, "Failure to parse KFAM response.") + } + nsFound := false + for _, jsonBinding := range jsonBindings.Bindings { + if jsonBinding.ReferredNamespace == namespace { + nsFound = true + break; + } + } + return nsFound, nil } func NewKFAMClient(kfamServiceHost string, kfamServicePort string) *KFAMClient{ diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index d0bb83d896f..593d7732146 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -68,8 +68,9 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest } if authorized { glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) + } else { + return nil, util.NewBadRequestError(errors.New("Unauthorized access"), "Unauthorized access") } - } } } From 8085cbf44dc8f65e8a3f951a273bd0bfd80cf4e2 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 2 Dec 2019 10:06:10 -0800 Subject: [PATCH 13/57] use gofmt --- backend/src/apiserver/common/const.go | 6 +++--- backend/src/apiserver/resource/model_converter_test.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/apiserver/common/const.go b/backend/src/apiserver/common/const.go index 8104ba0ea31..c50b19fb534 100644 --- a/backend/src/apiserver/common/const.go +++ b/backend/src/apiserver/common/const.go @@ -28,12 +28,12 @@ const ( Run ResourceType = "Run" Pipeline ResourceType = "pipeline" PipelineVersion ResourceType = "PipelineVersion" - Namespace ResourceType = "Namespace" + Namespace ResourceType = "Namespace" ) const ( - Owner Relationship = "Owner" - Creator Relationship = "Creator" + Owner Relationship = "Owner" + Creator Relationship = "Creator" Belonging Relationship = "Belonging" ) diff --git a/backend/src/apiserver/resource/model_converter_test.go b/backend/src/apiserver/resource/model_converter_test.go index 4052fc710c8..2c265c44278 100644 --- a/backend/src/apiserver/resource/model_converter_test.go +++ b/backend/src/apiserver/resource/model_converter_test.go @@ -209,7 +209,6 @@ func TestToModelResourceReferences_NamespaceRef(t *testing.T) { assert.Equal(t, 0, len(modelRefs)) } - func TestToModelResourceReferences_UnknownRelationship(t *testing.T) { store, manager, _ := initWithJob(t) defer store.Close() From cefc9037adf403d548984f1d596f774b7d332cb6 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 2 Dec 2019 13:47:18 -0800 Subject: [PATCH 14/57] add more meaningful error message; format --- backend/src/apiserver/client/kfam.go | 18 +++++++++--------- backend/src/apiserver/client_manager.go | 18 +++++++++--------- backend/src/apiserver/common/config.go | 4 ++-- backend/src/apiserver/main.go | 2 +- .../apiserver/resource/client_manager_fake.go | 2 +- .../src/apiserver/resource/resource_manager.go | 2 +- backend/src/apiserver/server/run_server.go | 6 +++--- backend/src/apiserver/server/util.go | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index c9bdd1c11f5..fc9485f1243 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -15,7 +15,7 @@ type KFAMInterface interface { } type KFAMClient struct { - kfamServiceUrl string + kfamServiceUrl string } type User struct { @@ -25,14 +25,14 @@ type User struct { type RoleRef struct { ApiGroup string - Kind string - Name string + Kind string + Name string } type Binding struct { - User User + User User ReferredNamespace string - RoleRef RoleRef + RoleRef RoleRef } type Bindings struct { @@ -62,20 +62,20 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, glog.Info(string(body)) var jsonBindings Bindings err = json.Unmarshal(body, &jsonBindings) - if err != nil{ + if err != nil { return false, util.Wrap(err, "Failure to parse KFAM response.") } nsFound := false for _, jsonBinding := range jsonBindings.Bindings { if jsonBinding.ReferredNamespace == namespace { nsFound = true - break; + break } } return nsFound, nil } -func NewKFAMClient(kfamServiceHost string, kfamServicePort string) *KFAMClient{ +func NewKFAMClient(kfamServiceHost string, kfamServicePort string) *KFAMClient { kfamServiceUrl := fmt.Sprintf("http://%s:%s/kfam/v1/bindings", kfamServiceHost, kfamServicePort) return &KFAMClient{kfamServiceUrl} -} \ No newline at end of file +} diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index 70ec3cea7fb..809f96b4d27 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -37,14 +37,14 @@ import ( ) const ( - minioServiceHost = "MINIO_SERVICE_SERVICE_HOST" - minioServicePort = "MINIO_SERVICE_SERVICE_PORT" - mysqlServiceHost = "DBConfig.Host" - mysqlServicePort = "DBConfig.Port" - mysqlUser = "DBConfig.User" - mysqlPassword = "DBConfig.Password" - mysqlDBName = "DBConfig.DBName" - mysqlGroupConcatMaxLen = "DBConfig.GroupConcatMaxLen" + minioServiceHost = "MINIO_SERVICE_SERVICE_HOST" + minioServicePort = "MINIO_SERVICE_SERVICE_PORT" + mysqlServiceHost = "DBConfig.Host" + mysqlServicePort = "DBConfig.Port" + mysqlUser = "DBConfig.User" + mysqlPassword = "DBConfig.Password" + mysqlDBName = "DBConfig.DBName" + mysqlGroupConcatMaxLen = "DBConfig.GroupConcatMaxLen" visualizationServiceHost = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST" visualizationServicePort = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT" @@ -159,7 +159,7 @@ func (c *ClientManager) init() { runStore := storage.NewRunStore(db, c.time) c.runStore = runStore - c.kfamClient = client.NewKFAMClient("profiles-kfam.kubeflow","8081") + c.kfamClient = client.NewKFAMClient("profiles-kfam.kubeflow", "8081") glog.Infof("Client manager initialized successfully") } diff --git a/backend/src/apiserver/common/config.go b/backend/src/apiserver/common/config.go index 3dd5256196d..57c5066796a 100644 --- a/backend/src/apiserver/common/config.go +++ b/backend/src/apiserver/common/config.go @@ -23,8 +23,8 @@ import ( ) const ( - deployment string = "DEPLOYMENT" - kubeflowDeployment string = "KUBEFLOW" + deployment string = "DEPLOYMENT" + kubeflowDeployment string = "KUBEFLOW" ) func GetStringConfig(configName string) string { diff --git a/backend/src/apiserver/main.go b/backend/src/apiserver/main.go index 7c64c167ded..0f7e8465058 100644 --- a/backend/src/apiserver/main.go +++ b/backend/src/apiserver/main.go @@ -230,4 +230,4 @@ func initConfig() { // Read in config again viper.ReadInConfig() }) -} \ No newline at end of file +} diff --git a/backend/src/apiserver/resource/client_manager_fake.go b/backend/src/apiserver/resource/client_manager_fake.go index 2ffb70bc1b8..080be538ac3 100644 --- a/backend/src/apiserver/resource/client_manager_fake.go +++ b/backend/src/apiserver/resource/client_manager_fake.go @@ -78,7 +78,7 @@ func NewFakeClientManager(time util.TimeInterface, uuid util.UUIDGeneratorInterf objectStore: storage.NewFakeObjectStore(), scheduledWorkflowClientFake: NewScheduledWorkflowClientFake(), podClientFake: FakePodClient{}, - kfamClientFake: client.NewKFAMClient("",""), + kfamClientFake: client.NewKFAMClient("", ""), time: time, uuid: uuid, }, nil diff --git a/backend/src/apiserver/resource/resource_manager.go b/backend/src/apiserver/resource/resource_manager.go index e3bd5337bfd..c7dcca0143a 100644 --- a/backend/src/apiserver/resource/resource_manager.go +++ b/backend/src/apiserver/resource/resource_manager.go @@ -952,4 +952,4 @@ func (r *ResourceManager) GetPipelineVersionTemplate(versionId string) ([]byte, func (r *ResourceManager) IsRequestAuthorized(userIdentity string, namespace string) (bool, error) { return r.kfamClient.IsAuthorized(userIdentity, namespace) -} \ No newline at end of file +} diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 593d7732146..ee94373044d 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -62,14 +62,14 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest } } if len(namespace) != 0 { - authorized, err:= IsRequestAuthorized(s.resourceManager, userIdentity, namespace) - if err != nil{ + authorized, err := IsRequestAuthorized(s.resourceManager, userIdentity, namespace) + if err != nil { glog.Infof("Error: ", err.Error()) } if authorized { glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) } else { - return nil, util.NewBadRequestError(errors.New("Unauthorized access"), "Unauthorized access") + return nil, util.NewBadRequestError(errors.New("Unauthorized access."), "Unauthorized access for "+userIdentity+" to namespace "+namespace) } } } diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 0cca42f9f1e..01991a871fc 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -273,4 +273,4 @@ func CheckPipelineVersionReference(resourceManager *resource.ResourceManager, re func IsRequestAuthorized(resourceManager *resource.ResourceManager, userIdentity string, namespace string) (bool, error) { glog.Infof("Authorizing user %s for namespace %s", userIdentity, namespace) return resourceManager.IsRequestAuthorized(userIdentity, namespace) -} \ No newline at end of file +} From a48a5545905939cba3253e14b0bc3e5899877272 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 2 Dec 2019 14:53:02 -0800 Subject: [PATCH 15/57] refactoring codes --- backend/src/apiserver/server/run_server.go | 8 +------- backend/src/apiserver/server/util.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index ee94373044d..381836cf627 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -54,13 +54,7 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest if common.IsKubeflowDeployment() { //authenticate the requests based on the userIdentity and the namespace. - namespace := "" - for _, resourceRef := range request.Run.ResourceReferences { - if resourceRef.Key.Type == api.ResourceType_NAMESPACE { - namespace = resourceRef.Key.Id - break - } - } + namespace := GetNamespaceFromRun(request.Run) if len(namespace) != 0 { authorized, err := IsRequestAuthorized(s.resourceManager, userIdentity, namespace) if err != nil { diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 01991a871fc..2970d1d8cad 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -274,3 +274,14 @@ func IsRequestAuthorized(resourceManager *resource.ResourceManager, userIdentity glog.Infof("Authorizing user %s for namespace %s", userIdentity, namespace) return resourceManager.IsRequestAuthorized(userIdentity, namespace) } + +func GetNamespaceFromRun(run *api.Run) string { + namespace := "" + for _, resourceRef := range run.ResourceReferences { + if resourceRef.Key.Type == api.ResourceType_NAMESPACE { + namespace = resourceRef.Key.Id + break + } + } + return namespace +} \ No newline at end of file From 836573a57cab40527c2f2a2595dd8c990454729e Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 3 Dec 2019 14:17:48 -0800 Subject: [PATCH 16/57] replace belonging relationshipreference to owner --- .../api/go_client/resource_reference.pb.go | 68 +++--- .../api/go_http_client/job_model/api_job.go-- | 224 ------------------ .../job_model/api_periodic_schedule.go-- | 92 ------- .../job_model/api_relationship.go | 5 +- .../pipeline_model/api_relationship.go | 5 +- .../run_model/api_relationship.go | 5 +- backend/api/resource_reference.proto | 1 - backend/api/swagger/job.swagger.json | 3 +- .../swagger/kfp_api_single_file.swagger.json | 6 +- backend/api/swagger/pipeline.swagger.json | 6 +- backend/api/swagger/run.swagger.json | 3 +- backend/src/apiserver/common/const.go | 3 - .../resource/model_converter_test.go | 2 +- .../base/argo/minio-artifact-secret.yaml | 4 +- 14 files changed, 46 insertions(+), 381 deletions(-) delete mode 100644 backend/api/go_http_client/job_model/api_job.go-- delete mode 100644 backend/api/go_http_client/job_model/api_periodic_schedule.go-- diff --git a/backend/api/go_client/resource_reference.pb.go b/backend/api/go_client/resource_reference.pb.go index f6d9ec922ec..0a834c74823 100755 --- a/backend/api/go_client/resource_reference.pb.go +++ b/backend/api/go_client/resource_reference.pb.go @@ -64,7 +64,7 @@ func (x ResourceType) String() string { return proto.EnumName(ResourceType_name, int32(x)) } func (ResourceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{0} + return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{0} } type Relationship int32 @@ -73,27 +73,24 @@ const ( Relationship_UNKNOWN_RELATIONSHIP Relationship = 0 Relationship_OWNER Relationship = 1 Relationship_CREATOR Relationship = 2 - Relationship_BELONGING Relationship = 3 ) var Relationship_name = map[int32]string{ 0: "UNKNOWN_RELATIONSHIP", 1: "OWNER", 2: "CREATOR", - 3: "BELONGING", } var Relationship_value = map[string]int32{ "UNKNOWN_RELATIONSHIP": 0, "OWNER": 1, "CREATOR": 2, - "BELONGING": 3, } func (x Relationship) String() string { return proto.EnumName(Relationship_name, int32(x)) } func (Relationship) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{1} + return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{1} } type ResourceKey struct { @@ -108,7 +105,7 @@ func (m *ResourceKey) Reset() { *m = ResourceKey{} } func (m *ResourceKey) String() string { return proto.CompactTextString(m) } func (*ResourceKey) ProtoMessage() {} func (*ResourceKey) Descriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{0} + return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{0} } func (m *ResourceKey) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResourceKey.Unmarshal(m, b) @@ -155,7 +152,7 @@ func (m *ResourceReference) Reset() { *m = ResourceReference{} } func (m *ResourceReference) String() string { return proto.CompactTextString(m) } func (*ResourceReference) ProtoMessage() {} func (*ResourceReference) Descriptor() ([]byte, []int) { - return fileDescriptor_resource_reference_5073ffe6f985b29e, []int{1} + return fileDescriptor_resource_reference_876ea904b7b7aed8, []int{1} } func (m *ResourceReference) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ResourceReference.Unmarshal(m, b) @@ -204,33 +201,32 @@ func init() { } func init() { - proto.RegisterFile("backend/api/resource_reference.proto", fileDescriptor_resource_reference_5073ffe6f985b29e) -} - -var fileDescriptor_resource_reference_5073ffe6f985b29e = []byte{ - // 377 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0x51, 0x6b, 0xdb, 0x30, - 0x14, 0x85, 0x6b, 0x3b, 0x5d, 0x97, 0x9b, 0x2c, 0xa8, 0x97, 0x0e, 0xb2, 0xb7, 0x12, 0x36, 0x28, - 0x7d, 0x88, 0xa1, 0xa5, 0x3f, 0x20, 0xc9, 0x44, 0xe7, 0x25, 0x95, 0x8c, 0xec, 0xae, 0xdb, 0x5e, - 0x8c, 0xed, 0xdc, 0xb6, 0x22, 0xae, 0x2d, 0x1c, 0x9b, 0xe1, 0xd7, 0xfd, 0xf2, 0x11, 0x33, 0xe3, - 0xf6, 0x4d, 0xe2, 0x1c, 0xbe, 0xef, 0xc0, 0x85, 0xcf, 0x49, 0x9c, 0xee, 0x28, 0xdf, 0xba, 0xb1, - 0xd1, 0x6e, 0x49, 0xfb, 0xa2, 0x2e, 0x53, 0x8a, 0x4a, 0x7a, 0xa4, 0x92, 0xf2, 0x94, 0xe6, 0xa6, - 0x2c, 0xaa, 0x02, 0x9d, 0xd8, 0xe8, 0xd9, 0x57, 0x18, 0xa9, 0xff, 0x85, 0x35, 0x35, 0xf8, 0x05, - 0x06, 0x55, 0x63, 0x68, 0x6a, 0x9d, 0x5b, 0x17, 0x93, 0xab, 0xd3, 0x79, 0x6c, 0xf4, 0xbc, 0xcb, - 0xc3, 0xc6, 0x90, 0x6a, 0x63, 0x9c, 0x80, 0xad, 0xb7, 0x53, 0xfb, 0xdc, 0xba, 0x18, 0x2a, 0x5b, - 0x6f, 0x67, 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5d, 0x3d, 0xd7, 0xc9, 0x3c, 0x2d, 0x5e, 0xdc, 0x5d, - 0x9d, 0xd0, 0x63, 0x56, 0xfc, 0x71, 0x8d, 0x36, 0x94, 0xe9, 0x9c, 0xf6, 0xee, 0xeb, 0xeb, 0x3e, - 0x15, 0x51, 0x9a, 0x69, 0xca, 0xab, 0xe4, 0x5d, 0x7b, 0xd5, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xc4, 0x3e, 0x5c, 0xbc, 0xfd, 0x01, 0x00, 0x00, + proto.RegisterFile("backend/api/resource_reference.proto", fileDescriptor_resource_reference_876ea904b7b7aed8) +} + +var fileDescriptor_resource_reference_876ea904b7b7aed8 = []byte{ + // 366 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x6b, 0x9c, 0x40, + 0x14, 0xc6, 0xa3, 0x6e, 0x9a, 0xee, 0xdb, 0xed, 0x32, 0x79, 0xa4, 0x60, 0x6f, 0x61, 0x69, 0x21, + 0xe4, 0xa0, 0x90, 0x90, 0x7b, 0xcd, 0x76, 0xa0, 0x76, 0x93, 0x51, 0x46, 0xd3, 0xb4, 0xbd, 0x88, + 0xba, 0x2f, 0xc9, 0xb0, 0x46, 0x07, 0x57, 0x29, 0x5e, 0xfb, 0x97, 0x97, 0x48, 0xc4, 0xec, 0x6d, + 0x86, 0xdf, 0xc7, 0xf7, 0xfb, 0xe0, 0xc1, 0xe7, 0x2c, 0xcd, 0xb7, 0x54, 0x6e, 0xdc, 0x54, 0x2b, + 0xb7, 0xa6, 0x5d, 0xd5, 0xd6, 0x39, 0x25, 0x35, 0x3d, 0x50, 0x4d, 0x65, 0x4e, 0x8e, 0xae, 0xab, + 0xa6, 0x42, 0x2b, 0xd5, 0x6a, 0xf9, 0x0d, 0x66, 0xf2, 0x35, 0xb0, 0xa6, 0x0e, 0xbf, 0xc0, 0xa4, + 0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, 0x70, 0x18, 0xdc, 0x0b, 0x2e, 0x99, 0x81, 0x33, 0x38, + 0x5a, 0x49, 0xee, 0xc5, 0x81, 0x64, 0xe6, 0xf5, 0xd5, 0x9f, 0xcb, 0x47, 0xd5, 0x3c, 0xb5, 0x99, + 0x93, 0x57, 0xcf, 0xee, 0xb6, 0xcd, 0xe8, 0xa1, 0xa8, 0xfe, 0xba, 0x5a, 0x69, 0x2a, 0x54, 0x49, + 0x3b, 0xf7, 0xed, 0x39, 0x1f, 0xab, 0x24, 0x2f, 0x14, 0x95, 0x4d, 0xf6, 0xae, 0x3f, 0xe3, 0xe5, + 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x58, 0x92, 0x1b, 0xee, 0x01, 0x00, 0x00, } diff --git a/backend/api/go_http_client/job_model/api_job.go-- b/backend/api/go_http_client/job_model/api_job.go-- deleted file mode 100644 index 2ae15162dd7..00000000000 --- a/backend/api/go_http_client/job_model/api_job.go-- +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package job_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// APIJob api job -// swagger:model apiJob -type APIJob struct { - - // Output. The time this job is created. - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Optional input field. Describing the purpose of the job - Description string `json:"description,omitempty"` - - // Input. Whether the job is enabled or not. - Enabled bool `json:"enabled,omitempty"` - - // In case any error happens retrieving a job field, only job ID - // and the error message is returned. Client has the flexibility of choosing - // how to handle error. This is especially useful during listing call. - Error string `json:"error,omitempty"` - - // Output. Unique run ID. Generated by API server. - ID string `json:"id,omitempty"` - - // Required input field. - // Specify how many runs can be executed concurrently. Rage [1-10] - MaxConcurrency string `json:"max_concurrency,omitempty"` - - // mode - Mode JobMode `json:"mode,omitempty"` - - // Required input field. Job name provided by user. Not unique. - Name string `json:"name,omitempty"` - - // Required input field. - // Describing what the pipeline manifest and parameters to use - // for the scheduled job. - PipelineSpec *APIPipelineSpec `json:"pipeline_spec,omitempty"` - - // Optional input field. Specify which resource this run belongs to. - ResourceReferences []*APIResourceReference `json:"resource_references"` - - // Output. The status of the job. - // One of [Enable, Disable, Error] - Status string `json:"status,omitempty"` - - // Required input field. - // Specify how a run is triggered. Support cron mode or periodic mode. - Trigger *APITrigger `json:"trigger,omitempty"` - - // Output. The last time this job is updated. - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` -} - -// Validate validates this api job -func (m *APIJob) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMode(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePipelineSpec(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResourceReferences(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTrigger(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIJob) validateCreatedAt(formats strfmt.Registry) error { - - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *APIJob) validateMode(formats strfmt.Registry) error { - - if swag.IsZero(m.Mode) { // not required - return nil - } - - if err := m.Mode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mode") - } - return err - } - - return nil -} - -func (m *APIJob) validatePipelineSpec(formats strfmt.Registry) error { - - if swag.IsZero(m.PipelineSpec) { // not required - return nil - } - - if m.PipelineSpec != nil { - if err := m.PipelineSpec.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pipeline_spec") - } - return err - } - } - - return nil -} - -func (m *APIJob) validateResourceReferences(formats strfmt.Registry) error { - - if swag.IsZero(m.ResourceReferences) { // not required - return nil - } - - for i := 0; i < len(m.ResourceReferences); i++ { - if swag.IsZero(m.ResourceReferences[i]) { // not required - continue - } - - if m.ResourceReferences[i] != nil { - if err := m.ResourceReferences[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("resource_references" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *APIJob) validateTrigger(formats strfmt.Registry) error { - - if swag.IsZero(m.Trigger) { // not required - return nil - } - - if m.Trigger != nil { - if err := m.Trigger.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("trigger") - } - return err - } - } - - return nil -} - -func (m *APIJob) validateUpdatedAt(formats strfmt.Registry) error { - - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *APIJob) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIJob) UnmarshalBinary(b []byte) error { - var res APIJob - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/backend/api/go_http_client/job_model/api_periodic_schedule.go-- b/backend/api/go_http_client/job_model/api_periodic_schedule.go-- deleted file mode 100644 index 015fa577ec7..00000000000 --- a/backend/api/go_http_client/job_model/api_periodic_schedule.go-- +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package job_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// APIPeriodicSchedule PeriodicSchedule allow scheduling the job periodically with certain interval -// swagger:model apiPeriodicSchedule -type APIPeriodicSchedule struct { - - // The end time of the periodic job - // Format: date-time - EndTime strfmt.DateTime `json:"end_time,omitempty"` - - // The time interval between the starting time of consecutive jobs - IntervalSecond string `json:"interval_second,omitempty"` - - // The start time of the periodic job - // Format: date-time - StartTime strfmt.DateTime `json:"start_time,omitempty"` -} - -// Validate validates this api periodic schedule -func (m *APIPeriodicSchedule) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEndTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIPeriodicSchedule) validateEndTime(formats strfmt.Registry) error { - - if swag.IsZero(m.EndTime) { // not required - return nil - } - - if err := validate.FormatOf("end_time", "body", "date-time", m.EndTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *APIPeriodicSchedule) validateStartTime(formats strfmt.Registry) error { - - if swag.IsZero(m.StartTime) { // not required - return nil - } - - if err := validate.FormatOf("start_time", "body", "date-time", m.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *APIPeriodicSchedule) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIPeriodicSchedule) UnmarshalBinary(b []byte) error { - var res APIPeriodicSchedule - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/backend/api/go_http_client/job_model/api_relationship.go b/backend/api/go_http_client/job_model/api_relationship.go index c9dbca975ab..ba1bf6044d8 100644 --- a/backend/api/go_http_client/job_model/api_relationship.go +++ b/backend/api/go_http_client/job_model/api_relationship.go @@ -42,9 +42,6 @@ const ( // APIRelationshipCREATOR captures enum value "CREATOR" APIRelationshipCREATOR APIRelationship = "CREATOR" - - // APIRelationshipBELONGING captures enum value "BELONGING" - APIRelationshipBELONGING APIRelationship = "BELONGING" ) // for schema @@ -52,7 +49,7 @@ var apiRelationshipEnum []interface{} func init() { var res []APIRelationship - if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR","BELONGING"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/go_http_client/pipeline_model/api_relationship.go b/backend/api/go_http_client/pipeline_model/api_relationship.go index 8c6fb0d6bac..14793853f97 100644 --- a/backend/api/go_http_client/pipeline_model/api_relationship.go +++ b/backend/api/go_http_client/pipeline_model/api_relationship.go @@ -42,9 +42,6 @@ const ( // APIRelationshipCREATOR captures enum value "CREATOR" APIRelationshipCREATOR APIRelationship = "CREATOR" - - // APIRelationshipBELONGING captures enum value "BELONGING" - APIRelationshipBELONGING APIRelationship = "BELONGING" ) // for schema @@ -52,7 +49,7 @@ var apiRelationshipEnum []interface{} func init() { var res []APIRelationship - if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR","BELONGING"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/go_http_client/run_model/api_relationship.go b/backend/api/go_http_client/run_model/api_relationship.go index 5dca88cf7a3..8d0759b51a8 100644 --- a/backend/api/go_http_client/run_model/api_relationship.go +++ b/backend/api/go_http_client/run_model/api_relationship.go @@ -42,9 +42,6 @@ const ( // APIRelationshipCREATOR captures enum value "CREATOR" APIRelationshipCREATOR APIRelationship = "CREATOR" - - // APIRelationshipBELONGING captures enum value "BELONGING" - APIRelationshipBELONGING APIRelationship = "BELONGING" ) // for schema @@ -52,7 +49,7 @@ var apiRelationshipEnum []interface{} func init() { var res []APIRelationship - if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR","BELONGING"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["UNKNOWN_RELATIONSHIP","OWNER","CREATOR"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/backend/api/resource_reference.proto b/backend/api/resource_reference.proto index a87b574065d..27b474f2d85 100644 --- a/backend/api/resource_reference.proto +++ b/backend/api/resource_reference.proto @@ -30,7 +30,6 @@ enum Relationship { UNKNOWN_RELATIONSHIP = 0; OWNER = 1; CREATOR = 2; - BELONGING = 3; } diff --git a/backend/api/swagger/job.swagger.json b/backend/api/swagger/job.swagger.json index 07c58362883..1a764619e56 100644 --- a/backend/api/swagger/job.swagger.json +++ b/backend/api/swagger/job.swagger.json @@ -427,8 +427,7 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR", - "BELONGING" + "CREATOR" ], "default": "UNKNOWN_RELATIONSHIP" }, diff --git a/backend/api/swagger/kfp_api_single_file.swagger.json b/backend/api/swagger/kfp_api_single_file.swagger.json index 85fe47227c0..818e38b6446 100644 --- a/backend/api/swagger/kfp_api_single_file.swagger.json +++ b/backend/api/swagger/kfp_api_single_file.swagger.json @@ -656,7 +656,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, @@ -1320,8 +1321,7 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR", - "BELONGING" + "CREATOR" ], "default": "UNKNOWN_RELATIONSHIP" }, diff --git a/backend/api/swagger/pipeline.swagger.json b/backend/api/swagger/pipeline.swagger.json index 62d7eef486e..4f9315f133f 100644 --- a/backend/api/swagger/pipeline.swagger.json +++ b/backend/api/swagger/pipeline.swagger.json @@ -44,7 +44,8 @@ "EXPERIMENT", "JOB", "PIPELINE", - "PIPELINE_VERSION" + "PIPELINE_VERSION", + "NAMESPACE" ], "default": "UNKNOWN_RESOURCE_TYPE" }, @@ -525,8 +526,7 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR", - "BELONGING" + "CREATOR" ], "default": "UNKNOWN_RELATIONSHIP" }, diff --git a/backend/api/swagger/run.swagger.json b/backend/api/swagger/run.swagger.json index 28f90272606..c1fb22c9a9c 100644 --- a/backend/api/swagger/run.swagger.json +++ b/backend/api/swagger/run.swagger.json @@ -531,8 +531,7 @@ "enum": [ "UNKNOWN_RELATIONSHIP", "OWNER", - "CREATOR", - "BELONGING" + "CREATOR" ], "default": "UNKNOWN_RELATIONSHIP" }, diff --git a/backend/src/apiserver/common/const.go b/backend/src/apiserver/common/const.go index c50b19fb534..4f2cda14530 100644 --- a/backend/src/apiserver/common/const.go +++ b/backend/src/apiserver/common/const.go @@ -34,7 +34,6 @@ const ( const ( Owner Relationship = "Owner" Creator Relationship = "Creator" - Belonging Relationship = "Belonging" ) func ToModelResourceType(apiType api.ResourceType) (ResourceType, error) { @@ -58,8 +57,6 @@ func ToModelRelationship(r api.Relationship) (Relationship, error) { return Creator, nil case api.Relationship_OWNER: return Owner, nil - case api.Relationship_BELONGING: - return Belonging, nil default: return "", util.NewInvalidInputError("Unsupported resource relationship: %s", api.Relationship_name[int32(r)]) } diff --git a/backend/src/apiserver/resource/model_converter_test.go b/backend/src/apiserver/resource/model_converter_test.go index 2c265c44278..196d53d2a30 100644 --- a/backend/src/apiserver/resource/model_converter_test.go +++ b/backend/src/apiserver/resource/model_converter_test.go @@ -203,7 +203,7 @@ func TestToModelResourceReferences_NamespaceRef(t *testing.T) { defer store.Close() modelRefs, err := manager.toModelResourceReferences("r1", common.Run, []*api.ResourceReference{ - {Key: &api.ResourceKey{Type: api.ResourceType_NAMESPACE, Id: "e1"}, Relationship: api.Relationship_BELONGING}, + {Key: &api.ResourceKey{Type: api.ResourceType_NAMESPACE, Id: "e1"}, Relationship: api.Relationship_OWNER}, }) assert.Nil(t, err) assert.Equal(t, 0, len(modelRefs)) diff --git a/manifests/kustomize/base/argo/minio-artifact-secret.yaml b/manifests/kustomize/base/argo/minio-artifact-secret.yaml index 29e74012f86..f18260e3688 100644 --- a/manifests/kustomize/base/argo/minio-artifact-secret.yaml +++ b/manifests/kustomize/base/argo/minio-artifact-secret.yaml @@ -5,5 +5,5 @@ data: kind: Secret metadata: name: mlpipeline-minio-artifact - namespace: kubeflow -type: Opaque \ No newline at end of file + namespace: gaoning777 +type: Opaque From 80ab78dd591b402e2d3d52360eb6ff225ccaf753 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 3 Dec 2019 14:21:33 -0800 Subject: [PATCH 17/57] put a todo for further investigation of using namespace or uuid --- backend/src/apiserver/resource/model_converter.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/apiserver/resource/model_converter.go b/backend/src/apiserver/resource/model_converter.go index 63e1156442d..23d78d804db 100644 --- a/backend/src/apiserver/resource/model_converter.go +++ b/backend/src/apiserver/resource/model_converter.go @@ -199,6 +199,7 @@ func (r *ResourceManager) toModelResourceReferences( if err != nil { return nil, util.Wrap(err, "Failed to find the referred resource") } + //TODO further investigation: Is the plain namespace a good option? maybe uuid for distinctness even with namespace deletion/recreation. if apiRef.Key.Type != api.ResourceType_NAMESPACE { modelRef := &model.ResourceReference{ ResourceUUID: resourceId, From 7cc23975bc3b6a6caa120126e589f1115b2157dd Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 3 Dec 2019 14:23:50 -0800 Subject: [PATCH 18/57] apply gofmt --- backend/src/apiserver/client_manager.go | 16 ++++++++-------- backend/src/apiserver/common/config.go | 1 - backend/src/apiserver/common/const.go | 4 ++-- backend/src/apiserver/main.go | 2 +- .../resource/resource_manager_util_test.go | 10 ++++------ backend/src/apiserver/resource/workflow_fake.go | 4 ++-- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index 179e9e728a5..c9af55c1a19 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -37,14 +37,14 @@ import ( ) const ( - minioServiceHost = "MINIO_SERVICE_SERVICE_HOST" - minioServicePort = "MINIO_SERVICE_SERVICE_PORT" - mysqlServiceHost = "DBConfig.Host" - mysqlServicePort = "DBConfig.Port" - mysqlUser = "DBConfig.User" - mysqlPassword = "DBConfig.Password" - mysqlDBName = "DBConfig.DBName" - mysqlGroupConcatMaxLen = "DBConfig.GroupConcatMaxLen" + minioServiceHost = "MINIO_SERVICE_SERVICE_HOST" + minioServicePort = "MINIO_SERVICE_SERVICE_PORT" + mysqlServiceHost = "DBConfig.Host" + mysqlServicePort = "DBConfig.Port" + mysqlUser = "DBConfig.User" + mysqlPassword = "DBConfig.Password" + mysqlDBName = "DBConfig.DBName" + mysqlGroupConcatMaxLen = "DBConfig.GroupConcatMaxLen" visualizationServiceHost = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST" visualizationServicePort = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT" diff --git a/backend/src/apiserver/common/config.go b/backend/src/apiserver/common/config.go index a6bec9a4ebc..796cce250af 100644 --- a/backend/src/apiserver/common/config.go +++ b/backend/src/apiserver/common/config.go @@ -22,7 +22,6 @@ import ( "github.com/spf13/viper" ) - func GetStringConfig(configName string) string { if !viper.IsSet(configName) { glog.Fatalf("Please specify flag %s", configName) diff --git a/backend/src/apiserver/common/const.go b/backend/src/apiserver/common/const.go index 4f2cda14530..9d261db27f3 100644 --- a/backend/src/apiserver/common/const.go +++ b/backend/src/apiserver/common/const.go @@ -32,8 +32,8 @@ const ( ) const ( - Owner Relationship = "Owner" - Creator Relationship = "Creator" + Owner Relationship = "Owner" + Creator Relationship = "Creator" ) func ToModelResourceType(apiType api.ResourceType) (ResourceType, error) { diff --git a/backend/src/apiserver/main.go b/backend/src/apiserver/main.go index 4c8f1b2f212..3234e0b20b1 100644 --- a/backend/src/apiserver/main.go +++ b/backend/src/apiserver/main.go @@ -219,4 +219,4 @@ func initConfig() { // Read in config again viper.ReadInConfig() }) -} \ No newline at end of file +} diff --git a/backend/src/apiserver/resource/resource_manager_util_test.go b/backend/src/apiserver/resource/resource_manager_util_test.go index 8d94f2ac337..7623351fa2a 100644 --- a/backend/src/apiserver/resource/resource_manager_util_test.go +++ b/backend/src/apiserver/resource/resource_manager_util_test.go @@ -235,16 +235,16 @@ status: ` var workflow util.Workflow - err := yaml.Unmarshal([]byte( wf), &workflow) + err := yaml.Unmarshal([]byte(wf), &workflow) assert.Nil(t, err) newWf, nodes, err := formulateRetryWorkflow(&workflow) newWfString, err := yaml.Marshal(newWf) assert.Nil(t, err) - assert.Equal(t, []string{"resubmit-hl9ft-3879090716"},nodes) + assert.Equal(t, []string{"resubmit-hl9ft-3879090716"}, nodes) expectedNewWfString := - `apiVersion: argoproj.io/v1alpha1 + `apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: creationTimestamp: "2019-08-02T07:15:14Z" @@ -319,7 +319,5 @@ status: startedAt: "2019-08-02T07:15:14Z" ` - assert.Equal(t, expectedNewWfString,string(newWfString)) + assert.Equal(t, expectedNewWfString, string(newWfString)) } - - diff --git a/backend/src/apiserver/resource/workflow_fake.go b/backend/src/apiserver/resource/workflow_fake.go index 257a5bcc546..32e10869891 100644 --- a/backend/src/apiserver/resource/workflow_fake.go +++ b/backend/src/apiserver/resource/workflow_fake.go @@ -88,13 +88,13 @@ func (c *FakeWorkflowClient) Delete(name string, options *v1.DeleteOptions) erro } func (c *FakeWorkflowClient) DeleteCollection(options *v1.DeleteOptions, - listOptions v1.ListOptions) error { + listOptions v1.ListOptions) error { glog.Error("This fake method is not yet implemented.") return nil } func (c *FakeWorkflowClient) Patch(name string, pt types.PatchType, data []byte, - subresources ...string) (*v1alpha1.Workflow, error) { + subresources ...string) (*v1alpha1.Workflow, error) { var dat map[string]interface{} json.Unmarshal(data, &dat) From 882872db853be49ab34a28f633e8e87b073b9373 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 3 Dec 2019 14:27:22 -0800 Subject: [PATCH 19/57] revert minor change --- manifests/kustomize/base/argo/minio-artifact-secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/kustomize/base/argo/minio-artifact-secret.yaml b/manifests/kustomize/base/argo/minio-artifact-secret.yaml index f18260e3688..33d57b1af42 100644 --- a/manifests/kustomize/base/argo/minio-artifact-secret.yaml +++ b/manifests/kustomize/base/argo/minio-artifact-secret.yaml @@ -5,5 +5,5 @@ data: kind: Secret metadata: name: mlpipeline-minio-artifact - namespace: gaoning777 + namespace: kubeflow type: Opaque From 42fa5c52802139cdd2f8e554fe893c93643f6600 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 3 Dec 2019 14:46:33 -0800 Subject: [PATCH 20/57] refactor codes --- backend/src/apiserver/server/run_server.go | 41 +++++++--------------- backend/src/apiserver/server/util.go | 26 +++++++++++++- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 381836cf627..ded41f406b4 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -16,7 +16,6 @@ package server import ( "context" - "strings" "github.com/golang/glog" "github.com/golang/protobuf/ptypes/empty" @@ -26,7 +25,6 @@ import ( "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" "github.com/pkg/errors" - "google.golang.org/grpc/metadata" ) type RunServer struct { @@ -38,34 +36,19 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest if err != nil { return nil, util.Wrap(err, "Validate create run request failed.") } - if ctx != nil { - md, _ := metadata.FromIncomingContext(ctx) - // If the request header contains the user identity, requests are authorized - // based on the namespace field in the request. - if userIdentityHeader, ok := md[common.UserIdentityHeader]; ok { - if len(userIdentityHeader) != 1 { - return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is empty"), "Request header error: user identity value is empty") + userIdentity, _ := GetUserIdentity(ctx) + if userIdentity != "" && common.IsKubeflowDeployment() { + //authenticate the requests based on the userIdentity and the namespace. + namespace := GetNamespaceFromRun(request.Run) + if len(namespace) != 0 { + authorized, err := IsRequestAuthorized(s.resourceManager, userIdentity, namespace) + if err != nil { + glog.Infof("Error: ", err.Error()) } - userIdentityHeaderFields := strings.Split(userIdentityHeader[0], ":") - if len(userIdentityHeaderFields) != 2 { - return nil, util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), "Request header error: user identity value is incorrectly formatted") - } - userIdentity := userIdentityHeaderFields[1] - - if common.IsKubeflowDeployment() { - //authenticate the requests based on the userIdentity and the namespace. - namespace := GetNamespaceFromRun(request.Run) - if len(namespace) != 0 { - authorized, err := IsRequestAuthorized(s.resourceManager, userIdentity, namespace) - if err != nil { - glog.Infof("Error: ", err.Error()) - } - if authorized { - glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) - } else { - return nil, util.NewBadRequestError(errors.New("Unauthorized access."), "Unauthorized access for "+userIdentity+" to namespace "+namespace) - } - } + if authorized { + glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) + } else { + return nil, util.NewBadRequestError(errors.New("Unauthorized access."), "Unauthorized access for "+userIdentity+" to namespace "+namespace) } } } diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 2970d1d8cad..d28adeee0f8 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -6,12 +6,16 @@ import ( "bufio" "bytes" "compress/gzip" + "context" "encoding/json" "github.com/golang/glog" api "github.com/kubeflow/pipelines/backend/api/go_client" + "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" + "github.com/pkg/errors" + "google.golang.org/grpc/metadata" "io" "io/ioutil" "net/url" @@ -270,6 +274,26 @@ func CheckPipelineVersionReference(resourceManager *resource.ResourceManager, re return &pipelineVersionId, nil } +func GetUserIdentity(ctx context.Context) (string, error) { + if ctx == nil { + return "", nil + } + md, _ := metadata.FromIncomingContext(ctx) + // If the request header contains the user identity, requests are authorized + // based on the namespace field in the request. + if userIdentityHeader, ok := md[common.UserIdentityHeader]; ok { + if len(userIdentityHeader) != 1 { + return "", util.NewBadRequestError(errors.New("Request header error: user identity value is empty"), "Request header error: user identity value is empty") + } + userIdentityHeaderFields := strings.Split(userIdentityHeader[0], ":") + if len(userIdentityHeaderFields) != 2 { + return "", util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), "Request header error: user identity value is incorrectly formatted") + } + return userIdentityHeaderFields[1], nil + } + return "", nil +} + func IsRequestAuthorized(resourceManager *resource.ResourceManager, userIdentity string, namespace string) (bool, error) { glog.Infof("Authorizing user %s for namespace %s", userIdentity, namespace) return resourceManager.IsRequestAuthorized(userIdentity, namespace) @@ -284,4 +308,4 @@ func GetNamespaceFromRun(run *api.Run) string { } } return namespace -} \ No newline at end of file +} From cd9967e0f8233bd2451c423a13863bb359204973 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 3 Dec 2019 14:51:03 -0800 Subject: [PATCH 21/57] minor change --- backend/src/apiserver/server/run_server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index ded41f406b4..29dff89f126 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -37,7 +37,9 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest return nil, util.Wrap(err, "Validate create run request failed.") } userIdentity, _ := GetUserIdentity(ctx) - if userIdentity != "" && common.IsKubeflowDeployment() { + // Authorization only happens when the userIdentity exists in the request header + // and it is the kubeflow deployment, which deploys the KFAM. + if len(userIdentity) != 0 && common.IsKubeflowDeployment() { //authenticate the requests based on the userIdentity and the namespace. namespace := GetNamespaceFromRun(request.Run) if len(namespace) != 0 { From 7c5cdc109c5f1f139c3698a80fdae317acd5b08d Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:01:21 -0800 Subject: [PATCH 22/57] use internal server error in kfam client --- backend/src/apiserver/client/kfam.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index fc9485f1243..434693cc5ed 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -8,6 +8,7 @@ import ( "github.com/golang/glog" "github.com/kubeflow/pipelines/backend/src/common/util" + "github.com/pkg/errors" ) type KFAMInterface interface { @@ -42,28 +43,28 @@ type Bindings struct { func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, error) { req, err := http.NewRequest("GET", c.kfamServiceUrl, nil) if err != nil { - return false, util.Wrap(err, "Failed to create a KFAM http request.") + return false, util.NewInternalServerError(err, "Failed to create a KFAM http request.") } q := req.URL.Query() q.Add("user", userIdentity) req.URL.RawQuery = q.Encode() resp, err := http.Get(req.URL.String()) if err != nil { - return false, util.Wrap(err, "Failure to connect to the KFAM service.") + return false, util.NewInternalServerError(err, "Failure to connect to the KFAM service.") } if resp.StatusCode != http.StatusOK { - return false, fmt.Errorf(resp.Status) + return false, util.NewInternalServerError(errors.New("Requests to the KFAM service fails."), resp.Status) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { - return false, util.Wrap(err, "Unable to parse KFAM response.") + return false, util.NewInternalServerError(err, "Unable to parse KFAM response.") } glog.Info(string(body)) var jsonBindings Bindings err = json.Unmarshal(body, &jsonBindings) if err != nil { - return false, util.Wrap(err, "Failure to parse KFAM response.") + return false, util.NewInternalServerError(err, "Failure to parse KFAM response.") } nsFound := false for _, jsonBinding := range jsonBindings.Bindings { From bf30a21103a2ce03ba69db5afceb2c215c808c94 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:02:32 -0800 Subject: [PATCH 23/57] minor change --- backend/src/apiserver/client/kfam.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index 434693cc5ed..37c1d2865e0 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -50,10 +50,10 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, req.URL.RawQuery = q.Encode() resp, err := http.Get(req.URL.String()) if err != nil { - return false, util.NewInternalServerError(err, "Failure to connect to the KFAM service.") + return false, util.NewInternalServerError(err, "Failed to connect to the KFAM service.") } if resp.StatusCode != http.StatusOK { - return false, util.NewInternalServerError(errors.New("Requests to the KFAM service fails."), resp.Status) + return false, util.NewInternalServerError(errors.New("Requests to the KFAM service failed."), resp.Status) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) @@ -64,7 +64,7 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, var jsonBindings Bindings err = json.Unmarshal(body, &jsonBindings) if err != nil { - return false, util.NewInternalServerError(err, "Failure to parse KFAM response.") + return false, util.NewInternalServerError(err, "Failed to parse KFAM response.") } nsFound := false for _, jsonBinding := range jsonBindings.Bindings { From a497f79c9e41709ca55dd43ab9febc6caa120aa1 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:15:43 -0800 Subject: [PATCH 24/57] use timeout in kfam client --- backend/src/apiserver/client/kfam.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index 37c1d2865e0..e7a6b2c8240 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -5,8 +5,8 @@ import ( "fmt" "io/ioutil" "net/http" + "time" - "github.com/golang/glog" "github.com/kubeflow/pipelines/backend/src/common/util" "github.com/pkg/errors" ) @@ -40,6 +40,10 @@ type Bindings struct { Bindings []Binding } +const ( + HTTP_TIMEOUT_SECONDS = 10 +) + func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, error) { req, err := http.NewRequest("GET", c.kfamServiceUrl, nil) if err != nil { @@ -48,7 +52,10 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, q := req.URL.Query() q.Add("user", userIdentity) req.URL.RawQuery = q.Encode() - resp, err := http.Get(req.URL.String()) + + var httpClient = &http.Client{Timeout: HTTP_TIMEOUT_SECONDS * time.Second} + + resp, err := httpClient.Get(req.URL.String()) if err != nil { return false, util.NewInternalServerError(err, "Failed to connect to the KFAM service.") } @@ -56,16 +63,13 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, return false, util.NewInternalServerError(errors.New("Requests to the KFAM service failed."), resp.Status) } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return false, util.NewInternalServerError(err, "Unable to parse KFAM response.") - } - glog.Info(string(body)) - var jsonBindings Bindings - err = json.Unmarshal(body, &jsonBindings) + jsonBindings := new(Bindings) + err = json.NewDecoder(resp.Body).Decode(jsonBindings) + if err != nil { return false, util.NewInternalServerError(err, "Failed to parse KFAM response.") } + nsFound := false for _, jsonBinding := range jsonBindings.Bindings { if jsonBinding.ReferredNamespace == namespace { From d24542aebbd0a3941c4ad73d87accb46522533e9 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:22:11 -0800 Subject: [PATCH 25/57] make kfam service host/port configurable --- backend/src/apiserver/client/kfam.go | 1 - backend/src/apiserver/client_manager.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index e7a6b2c8240..70984a724b1 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -3,7 +3,6 @@ package client import ( "encoding/json" "fmt" - "io/ioutil" "net/http" "time" diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index 809f96b4d27..f6aad869e9c 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -45,6 +45,8 @@ const ( mysqlPassword = "DBConfig.Password" mysqlDBName = "DBConfig.DBName" mysqlGroupConcatMaxLen = "DBConfig.GroupConcatMaxLen" + kfamServiceHost = "KFAM_SERVICE_HOST" + kfamServicePort = "KFAM_SERVICE_PORT" visualizationServiceHost = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_HOST" visualizationServicePort = "ML_PIPELINE_VISUALIZATIONSERVER_SERVICE_PORT" @@ -159,7 +161,7 @@ func (c *ClientManager) init() { runStore := storage.NewRunStore(db, c.time) c.runStore = runStore - c.kfamClient = client.NewKFAMClient("profiles-kfam.kubeflow", "8081") + c.kfamClient = client.NewKFAMClient(kfamServiceHost, kfamServicePort) glog.Infof("Client manager initialized successfully") } From f3a303d08063f8f342792dc302012737c7d66706 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:32:28 -0800 Subject: [PATCH 26/57] minor changes --- backend/src/apiserver/client_manager.go | 2 +- backend/src/apiserver/common/config.go | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index f6aad869e9c..4f9b0b623ba 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -161,7 +161,7 @@ func (c *ClientManager) init() { runStore := storage.NewRunStore(db, c.time) c.runStore = runStore - c.kfamClient = client.NewKFAMClient(kfamServiceHost, kfamServicePort) + c.kfamClient = client.NewKFAMClient(common.GetStringConfig(kfamServiceHost), common.GetStringConfig(kfamServicePort)) glog.Infof("Client manager initialized successfully") } diff --git a/backend/src/apiserver/common/config.go b/backend/src/apiserver/common/config.go index 57c5066796a..56ab7738ef9 100644 --- a/backend/src/apiserver/common/config.go +++ b/backend/src/apiserver/common/config.go @@ -60,8 +60,5 @@ func GetDurationConfig(configName string) time.Duration { } func IsKubeflowDeployment() bool { - if !viper.IsSet(deployment) { - return false - } - return viper.GetString(deployment) == kubeflowDeployment + return GetStringConfigWithDefault(deployment, "") == kubeflowDeployment } From d4fb0f5c119deca8805e54a8c05acfb0a3da7b1c Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:33:42 -0800 Subject: [PATCH 27/57] update name --- backend/src/apiserver/common/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/common/config.go b/backend/src/apiserver/common/config.go index 56ab7738ef9..b107f41b93e 100644 --- a/backend/src/apiserver/common/config.go +++ b/backend/src/apiserver/common/config.go @@ -23,7 +23,7 @@ import ( ) const ( - deployment string = "DEPLOYMENT" + deploymentType string = "DEPLOYMENT" kubeflowDeployment string = "KUBEFLOW" ) @@ -60,5 +60,5 @@ func GetDurationConfig(configName string) time.Duration { } func IsKubeflowDeployment() bool { - return GetStringConfigWithDefault(deployment, "") == kubeflowDeployment + return GetStringConfigWithDefault(deploymentType, "") == kubeflowDeployment } From 67f414a88de770e0e9cd1d46b3143fc97be4cb6e Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:34:49 -0800 Subject: [PATCH 28/57] rename --- backend/src/apiserver/common/const.go | 2 +- backend/src/apiserver/main.go | 2 +- backend/src/apiserver/server/util.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/apiserver/common/const.go b/backend/src/apiserver/common/const.go index ebea9ed7852..08d8db3bf32 100644 --- a/backend/src/apiserver/common/const.go +++ b/backend/src/apiserver/common/const.go @@ -37,7 +37,7 @@ const ( ) const ( - UserIdentityHeader string = "x-goog-authenticated-user-email" + GoogleIAPUserIdentityHeader string = "x-goog-authenticated-user-email" ) func ToModelResourceType(apiType api.ResourceType) (ResourceType, error) { diff --git a/backend/src/apiserver/main.go b/backend/src/apiserver/main.go index 0f7e8465058..2af96fec3ca 100644 --- a/backend/src/apiserver/main.go +++ b/backend/src/apiserver/main.go @@ -75,7 +75,7 @@ func main() { // Reference: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/docs/_docs/customizingyourgateway.md#mapping-from-http-request-headers-to-grpc-client-metadata func grpcCustomMatcher(key string) (string, bool) { switch strings.ToLower(key) { - case common.UserIdentityHeader: + case common.GoogleIAPUserIdentityHeader: return strings.ToLower(key), true default: return strings.ToLower(key), false diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index d28adeee0f8..3fea579b2e7 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -281,7 +281,7 @@ func GetUserIdentity(ctx context.Context) (string, error) { md, _ := metadata.FromIncomingContext(ctx) // If the request header contains the user identity, requests are authorized // based on the namespace field in the request. - if userIdentityHeader, ok := md[common.UserIdentityHeader]; ok { + if userIdentityHeader, ok := md[common.GoogleIAPUserIdentityHeader]; ok { if len(userIdentityHeader) != 1 { return "", util.NewBadRequestError(errors.New("Request header error: user identity value is empty"), "Request header error: user identity value is empty") } From 24e5994c80a494d768ad5695b82832c94ccf9df8 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:39:48 -0800 Subject: [PATCH 29/57] update the util function to accept a list of resourcereferences --- backend/src/apiserver/server/run_server.go | 2 +- backend/src/apiserver/server/util.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 29dff89f126..9aa1d5f1b8d 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -41,7 +41,7 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest // and it is the kubeflow deployment, which deploys the KFAM. if len(userIdentity) != 0 && common.IsKubeflowDeployment() { //authenticate the requests based on the userIdentity and the namespace. - namespace := GetNamespaceFromRun(request.Run) + namespace := GetNamespaceFromResourceReferences(request.Run.ResourceReferences) if len(namespace) != 0 { authorized, err := IsRequestAuthorized(s.resourceManager, userIdentity, namespace) if err != nil { diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 3fea579b2e7..c0685dcf4f0 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -299,9 +299,9 @@ func IsRequestAuthorized(resourceManager *resource.ResourceManager, userIdentity return resourceManager.IsRequestAuthorized(userIdentity, namespace) } -func GetNamespaceFromRun(run *api.Run) string { +func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) string { namespace := "" - for _, resourceRef := range run.ResourceReferences { + for _, resourceRef := range resourceRefs{ if resourceRef.Key.Type == api.ResourceType_NAMESPACE { namespace = resourceRef.Key.Id break From bbe6f5601b7ebd41d1c887f1dcb8a39dac632345 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:42:12 -0800 Subject: [PATCH 30/57] better error message --- backend/src/apiserver/server/util.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index c0685dcf4f0..89eaa6e2fa3 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -8,6 +8,7 @@ import ( "compress/gzip" "context" "encoding/json" + "strconv" "github.com/golang/glog" api "github.com/kubeflow/pipelines/backend/api/go_client" @@ -283,7 +284,7 @@ func GetUserIdentity(ctx context.Context) (string, error) { // based on the namespace field in the request. if userIdentityHeader, ok := md[common.GoogleIAPUserIdentityHeader]; ok { if len(userIdentityHeader) != 1 { - return "", util.NewBadRequestError(errors.New("Request header error: user identity value is empty"), "Request header error: user identity value is empty") + return "", util.NewBadRequestError(errors.New("Request header error: unexpected number of user identity header. Expect 1 got "+strconv.Itoa(len(userIdentityHeader))), "Request header error: unexpected number of user identity header. Expect 1 got "+strconv.Itoa(len(userIdentityHeader))) } userIdentityHeaderFields := strings.Split(userIdentityHeader[0], ":") if len(userIdentityHeaderFields) != 2 { @@ -301,7 +302,7 @@ func IsRequestAuthorized(resourceManager *resource.ResourceManager, userIdentity func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) string { namespace := "" - for _, resourceRef := range resourceRefs{ + for _, resourceRef := range resourceRefs { if resourceRef.Key.Type == api.ResourceType_NAMESPACE { namespace = resourceRef.Key.Id break From 96aa2e3e6bc8aacd6467c391b7c7a129ae99c133 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:43:08 -0800 Subject: [PATCH 31/57] reformat --- backend/src/apiserver/server/util.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 89eaa6e2fa3..e76a2c9fa3a 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -284,11 +284,13 @@ func GetUserIdentity(ctx context.Context) (string, error) { // based on the namespace field in the request. if userIdentityHeader, ok := md[common.GoogleIAPUserIdentityHeader]; ok { if len(userIdentityHeader) != 1 { - return "", util.NewBadRequestError(errors.New("Request header error: unexpected number of user identity header. Expect 1 got "+strconv.Itoa(len(userIdentityHeader))), "Request header error: unexpected number of user identity header. Expect 1 got "+strconv.Itoa(len(userIdentityHeader))) + return "", util.NewBadRequestError(errors.New("Request header error: unexpected number of user identity header. Expect 1 got "+strconv.Itoa(len(userIdentityHeader))), + "Request header error: unexpected number of user identity header. Expect 1 got "+strconv.Itoa(len(userIdentityHeader))) } userIdentityHeaderFields := strings.Split(userIdentityHeader[0], ":") if len(userIdentityHeaderFields) != 2 { - return "", util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), "Request header error: user identity value is incorrectly formatted") + return "", util.NewBadRequestError(errors.New("Request header error: user identity value is incorrectly formatted"), + "Request header error: user identity value is incorrectly formatted") } return userIdentityHeaderFields[1], nil } From 1815bf920c59652a90247b7ae4d61c5c44c1b04f Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 14:44:47 -0800 Subject: [PATCH 32/57] remove IsRequestAuthorized func --- backend/src/apiserver/server/run_server.go | 2 +- backend/src/apiserver/server/util.go | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 9aa1d5f1b8d..c36600b613c 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -43,7 +43,7 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest //authenticate the requests based on the userIdentity and the namespace. namespace := GetNamespaceFromResourceReferences(request.Run.ResourceReferences) if len(namespace) != 0 { - authorized, err := IsRequestAuthorized(s.resourceManager, userIdentity, namespace) + authorized, err := s.resourceManager.IsRequestAuthorized(userIdentity, namespace) if err != nil { glog.Infof("Error: ", err.Error()) } diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index e76a2c9fa3a..cca7ebf1c47 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -8,19 +8,18 @@ import ( "compress/gzip" "context" "encoding/json" + "io" + "io/ioutil" + "net/url" "strconv" + "strings" - "github.com/golang/glog" api "github.com/kubeflow/pipelines/backend/api/go_client" "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" "github.com/pkg/errors" "google.golang.org/grpc/metadata" - "io" - "io/ioutil" - "net/url" - "strings" ) // These are valid conditions of a ScheduledWorkflow. @@ -297,11 +296,6 @@ func GetUserIdentity(ctx context.Context) (string, error) { return "", nil } -func IsRequestAuthorized(resourceManager *resource.ResourceManager, userIdentity string, namespace string) (bool, error) { - glog.Infof("Authorizing user %s for namespace %s", userIdentity, namespace) - return resourceManager.IsRequestAuthorized(userIdentity, namespace) -} - func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) string { namespace := "" for _, resourceRef := range resourceRefs { From 4aa1064dd784b1cdb858815f7056e8355aded170 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Wed, 4 Dec 2019 19:28:32 -0800 Subject: [PATCH 33/57] add kfam host and port in config.json --- backend/src/apiserver/config/config.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/apiserver/config/config.json b/backend/src/apiserver/config/config.json index 7cf3bff7576..9fb5009a7ff 100644 --- a/backend/src/apiserver/config/config.json +++ b/backend/src/apiserver/config/config.json @@ -10,6 +10,8 @@ "SecretAccessKey": "minio123", "BucketName": "mlpipeline" }, + "KFAM_SERVICE_HOST": "profiles-kfam.kubeflow", + "KFAM_SERVICE_PORT": "8081", "InitConnectionTimeout": "6m", "DefaultPipelineRunnerServiceAccount": "pipeline-runner" } From aa08a9aaaaa8282e34add06419d57f9f6933ba18 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 11:15:45 -0800 Subject: [PATCH 34/57] generalize the auth code --- backend/src/apiserver/server/run_server.go | 31 ++++++++-------------- backend/src/apiserver/server/util.go | 22 +++++++++++++++ 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index c36600b613c..a1c3c565f3b 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -17,14 +17,11 @@ package server import ( "context" - "github.com/golang/glog" "github.com/golang/protobuf/ptypes/empty" api "github.com/kubeflow/pipelines/backend/api/go_client" - "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/model" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" - "github.com/pkg/errors" ) type RunServer struct { @@ -36,23 +33,17 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest if err != nil { return nil, util.Wrap(err, "Validate create run request failed.") } - userIdentity, _ := GetUserIdentity(ctx) - // Authorization only happens when the userIdentity exists in the request header - // and it is the kubeflow deployment, which deploys the KFAM. - if len(userIdentity) != 0 && common.IsKubeflowDeployment() { - //authenticate the requests based on the userIdentity and the namespace. - namespace := GetNamespaceFromResourceReferences(request.Run.ResourceReferences) - if len(namespace) != 0 { - authorized, err := s.resourceManager.IsRequestAuthorized(userIdentity, namespace) - if err != nil { - glog.Infof("Error: ", err.Error()) - } - if authorized { - glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) - } else { - return nil, util.NewBadRequestError(errors.New("Unauthorized access."), "Unauthorized access for "+userIdentity+" to namespace "+namespace) - } - } + userIdentity, err := GetUserIdentity(ctx) + if err != nil { + return nil, util.Wrap(err, "Bad request.") + } + namespace := GetNamespaceFromResourceReferences(request.Run.ResourceReferences) + isAuthorized, err := Authorize(s.resourceManager, userIdentity, namespace) + if err != nil { + return nil, util.Wrap(err, "Authorization failure.") + } + if isAuthorized == false { + return nil, util.NewBadRequestError(err, "Unauthorized access for "+userIdentity+" to namespace "+namespace) } if err != nil { diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index cca7ebf1c47..d224b074b60 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -14,6 +14,7 @@ import ( "strconv" "strings" + "github.com/golang/glog" api "github.com/kubeflow/pipelines/backend/api/go_client" "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" @@ -306,3 +307,24 @@ func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) s } return namespace } + +func Authorize(resourceManager *resource.ResourceManager, userIdentity string, namespace string) (bool, error) { + // Authorization only happens when the userIdentity exists in the request header + // and it is the kubeflow deployment, which deploys the KFAM. + if len(userIdentity) != 0 && common.IsKubeflowDeployment() { + //authenticate the requests based on the userIdentity and the namespace. + if len(namespace) != 0 { + authorized, err := resourceManager.IsRequestAuthorized(userIdentity, namespace) + if err != nil { + return false, err + } + if authorized == false { + return false, errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace) + } + glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) + } else { + return false, errors.New("Namespace required in Kubeflow deployment when the user identity exists.") + } + } + return true, nil +} From 66a1150e28afa323c65e49950a86eead9253f4d7 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 11:21:07 -0800 Subject: [PATCH 35/57] rename KFAMInterface to KFAMClientInterface --- backend/src/apiserver/client/kfam.go | 2 +- backend/src/apiserver/client_manager.go | 4 ++-- backend/src/apiserver/resource/client_manager_fake.go | 4 ++-- backend/src/apiserver/resource/resource_manager.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index 70984a724b1..dc28510ad08 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" ) -type KFAMInterface interface { +type KFAMClientInterface interface { IsAuthorized(userIdentity string, namespace string) (bool, error) } diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index 4f9b0b623ba..0498e85ed55 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -69,7 +69,7 @@ type ClientManager struct { wfClient workflowclient.WorkflowInterface swfClient scheduledworkflowclient.ScheduledWorkflowInterface podClient v1.PodInterface - kfamClient client.KFAMInterface + kfamClient client.KFAMClientInterface time util.TimeInterface uuid util.UUIDGeneratorInterface } @@ -118,7 +118,7 @@ func (c *ClientManager) PodClient() v1.PodInterface { return c.podClient } -func (c *ClientManager) KFAMClient() client.KFAMInterface { +func (c *ClientManager) KFAMClient() client.KFAMClientInterface { return c.kfamClient } diff --git a/backend/src/apiserver/resource/client_manager_fake.go b/backend/src/apiserver/resource/client_manager_fake.go index 080be538ac3..80524f93328 100644 --- a/backend/src/apiserver/resource/client_manager_fake.go +++ b/backend/src/apiserver/resource/client_manager_fake.go @@ -42,7 +42,7 @@ type FakeClientManager struct { workflowClientFake *FakeWorkflowClient scheduledWorkflowClientFake *FakeScheduledWorkflowClient podClientFake v1.PodInterface - kfamClientFake client.KFAMInterface + kfamClientFake client.KFAMClientInterface time util.TimeInterface uuid util.UUIDGeneratorInterface } @@ -149,7 +149,7 @@ func (f *FakeClientManager) PodClient() v1.PodInterface { return f.podClientFake } -func (f *FakeClientManager) KFAMClient() client.KFAMInterface { +func (f *FakeClientManager) KFAMClient() client.KFAMClientInterface { return f.kfamClientFake } diff --git a/backend/src/apiserver/resource/resource_manager.go b/backend/src/apiserver/resource/resource_manager.go index c7dcca0143a..7f8f49ca7e3 100644 --- a/backend/src/apiserver/resource/resource_manager.go +++ b/backend/src/apiserver/resource/resource_manager.go @@ -56,7 +56,7 @@ type ClientManagerInterface interface { Workflow() workflowclient.WorkflowInterface ScheduledWorkflow() scheduledworkflowclient.ScheduledWorkflowInterface PodClient() corev1.PodInterface - KFAMClient() client.KFAMInterface + KFAMClient() client.KFAMClientInterface Time() util.TimeInterface UUID() util.UUIDGeneratorInterface } @@ -73,7 +73,7 @@ type ResourceManager struct { workflowClient workflowclient.WorkflowInterface scheduledWorkflowClient scheduledworkflowclient.ScheduledWorkflowInterface podClient corev1.PodInterface - kfamClient client.KFAMInterface + kfamClient client.KFAMClientInterface time util.TimeInterface uuid util.UUIDGeneratorInterface } From 008e7a6a9900acbecba0a61a3c16a5cea936f508 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 11:38:49 -0800 Subject: [PATCH 36/57] add kfam fake for tests --- .../apiserver/resource/client_manager_fake.go | 2 +- backend/src/apiserver/resource/kfam_fake.go | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 backend/src/apiserver/resource/kfam_fake.go diff --git a/backend/src/apiserver/resource/client_manager_fake.go b/backend/src/apiserver/resource/client_manager_fake.go index 80524f93328..43eb777e4ea 100644 --- a/backend/src/apiserver/resource/client_manager_fake.go +++ b/backend/src/apiserver/resource/client_manager_fake.go @@ -78,7 +78,7 @@ func NewFakeClientManager(time util.TimeInterface, uuid util.UUIDGeneratorInterf objectStore: storage.NewFakeObjectStore(), scheduledWorkflowClientFake: NewScheduledWorkflowClientFake(), podClientFake: FakePodClient{}, - kfamClientFake: client.NewKFAMClient("", ""), + kfamClientFake: NewKFAMClientFake(), time: time, uuid: uuid, }, nil diff --git a/backend/src/apiserver/resource/kfam_fake.go b/backend/src/apiserver/resource/kfam_fake.go new file mode 100644 index 00000000000..477cd4ac8bf --- /dev/null +++ b/backend/src/apiserver/resource/kfam_fake.go @@ -0,0 +1,49 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package resource + +import ( + "github.com/pkg/errors" +) + +const ( + InternalError string = "InternalError" + Unauthorized string = "Unauthorized" + Authorized string = "Authorized" +) + +type FakeKFAMClient struct { + mode string +} + +func NewKFAMClientFake() *FakeKFAMClient { + return &FakeKFAMClient{ + Authorized, + } +} + +func (c *FakeKFAMClient) SetMode(mode string) { + c.mode = mode +} + +func (c *FakeKFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, error) { + if c.mode == InternalError { + return false, errors.New("Failed to connect to the KFAM service.") + } else if c.mode == Unauthorized { + return false, nil + } + return true, nil + +} From 39df35b1f9499299311cf9d66a0b5729f922397b Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 13:08:31 -0800 Subject: [PATCH 37/57] add build bazel --- backend/src/apiserver/resource/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/apiserver/resource/BUILD.bazel b/backend/src/apiserver/resource/BUILD.bazel index c25e611a7e8..610dfc13c9f 100644 --- a/backend/src/apiserver/resource/BUILD.bazel +++ b/backend/src/apiserver/resource/BUILD.bazel @@ -4,6 +4,7 @@ go_library( name = "go_default_library", srcs = [ "client_manager_fake.go", + "kfam_fake.go", "model_converter.go", "pod_fake.go", "resource_manager.go", From 752c8de53b90ad4c072a65c75905dc38a6d6993b Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 14:08:09 -0800 Subject: [PATCH 38/57] add unit tests for util func --- backend/src/apiserver/common/config.go | 6 +- .../apiserver/resource/client_manager_fake.go | 12 +++- backend/src/apiserver/server/BUILD.bazel | 1 + .../src/apiserver/server/run_server_test.go | 16 ++++++ backend/src/apiserver/server/test_util.go | 9 +++ backend/src/apiserver/server/util_test.go | 55 +++++++++++++++++++ 6 files changed, 95 insertions(+), 4 deletions(-) diff --git a/backend/src/apiserver/common/config.go b/backend/src/apiserver/common/config.go index b107f41b93e..e3a29c13fe3 100644 --- a/backend/src/apiserver/common/config.go +++ b/backend/src/apiserver/common/config.go @@ -23,8 +23,8 @@ import ( ) const ( - deploymentType string = "DEPLOYMENT" - kubeflowDeployment string = "KUBEFLOW" + DeploymentType string = "DEPLOYMENT" + KubeflowDeployment string = "KUBEFLOW" ) func GetStringConfig(configName string) string { @@ -60,5 +60,5 @@ func GetDurationConfig(configName string) time.Duration { } func IsKubeflowDeployment() bool { - return GetStringConfigWithDefault(deploymentType, "") == kubeflowDeployment + return GetStringConfigWithDefault(DeploymentType, "") == KubeflowDeployment } diff --git a/backend/src/apiserver/resource/client_manager_fake.go b/backend/src/apiserver/resource/client_manager_fake.go index 43eb777e4ea..c849d396ddd 100644 --- a/backend/src/apiserver/resource/client_manager_fake.go +++ b/backend/src/apiserver/resource/client_manager_fake.go @@ -42,7 +42,7 @@ type FakeClientManager struct { workflowClientFake *FakeWorkflowClient scheduledWorkflowClientFake *FakeScheduledWorkflowClient podClientFake v1.PodInterface - kfamClientFake client.KFAMClientInterface + kfamClientFake *FakeKFAMClient time util.TimeInterface uuid util.UUIDGeneratorInterface } @@ -93,6 +93,16 @@ func NewFakeClientManagerOrFatal(time util.TimeInterface) *FakeClientManager { return fakeStore } +func NewFakeClientManagerOrFatal_KFAM_Authorized(time util.TimeInterface) *FakeClientManager { + uuid := util.NewFakeUUIDGeneratorOrFatal(DefaultFakeUUID, nil) + fakeStore, err := NewFakeClientManager(time, uuid) + fakeStore.kfamClientFake.mode = Unauthorized + if err != nil { + glog.Fatalf("The fake store doesn't create successfully. Fail fast.") + } + return fakeStore +} + func (f *FakeClientManager) ExperimentStore() storage.ExperimentStoreInterface { return f.experimentStore } diff --git a/backend/src/apiserver/server/BUILD.bazel b/backend/src/apiserver/server/BUILD.bazel index e51fd585351..66c748fa956 100644 --- a/backend/src/apiserver/server/BUILD.bazel +++ b/backend/src/apiserver/server/BUILD.bazel @@ -73,5 +73,6 @@ go_test( "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", "@org_golang_google_grpc//codes:go_default_library", + "@com_github_spf13_viper//:go_default_library", ], ) diff --git a/backend/src/apiserver/server/run_server_test.go b/backend/src/apiserver/server/run_server_test.go index 44dac875b13..d03769545af 100644 --- a/backend/src/apiserver/server/run_server_test.go +++ b/backend/src/apiserver/server/run_server_test.go @@ -58,6 +58,22 @@ func TestCreateRun(t *testing.T) { assert.Equal(t, expectedRunDetail, *runDetail) } +func TestCreateRun_Unauthorized(t *testing.T) { + clients, manager, _ := initWithExperiment_KFAM_Unauthorized(t) + defer clients.Close() + server := NewRunServer(manager) + run := &api.Run{ + Name: "123", + ResourceReferences: validReference, + PipelineSpec: &api.PipelineSpec{ + WorkflowManifest: testWorkflow.ToStringForStore(), + Parameters: []*api.Parameter{{Name: "param1", Value: "world"}}, + }, + } + _, err := server.CreateRun(nil, &api.CreateRunRequest{Run: run}) + assert.Nil(t, err) +} + func TestListRun(t *testing.T) { clients, manager, experiment := initWithExperiment(t) defer clients.Close() diff --git a/backend/src/apiserver/server/test_util.go b/backend/src/apiserver/server/test_util.go index 890e992ce97..7b5ec1b9273 100644 --- a/backend/src/apiserver/server/test_util.go +++ b/backend/src/apiserver/server/test_util.go @@ -73,6 +73,15 @@ func initWithExperiment(t *testing.T) (*resource.FakeClientManager, *resource.Re return clientManager, resourceManager, experiment } +func initWithExperiment_KFAM_Unauthorized(t *testing.T) (*resource.FakeClientManager, *resource.ResourceManager, *model.Experiment) { + clientManager := resource.NewFakeClientManagerOrFatal_KFAM_Authorized(util.NewFakeTimeForEpoch()) + resourceManager := resource.NewResourceManager(clientManager) + experiment := &model.Experiment{Name: "123"} + experiment, err := resourceManager.CreateExperiment(experiment) + assert.Nil(t, err) + return clientManager, resourceManager, experiment +} + func initWithExperimentAndPipelineVersion(t *testing.T) (*resource.FakeClientManager, *resource.ResourceManager, *model.Experiment) { clientManager := resource.NewFakeClientManagerOrFatal(util.NewFakeTimeForEpoch()) resourceManager := resource.NewResourceManager(clientManager) diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index e76473202d1..cf9d7f41eb0 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -7,8 +7,10 @@ import ( "testing" api "github.com/kubeflow/pipelines/backend/api/go_client" + "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" + "github.com/spf13/viper" "github.com/stretchr/testify/assert" ) @@ -332,3 +334,56 @@ func TestValidatePipelineSpec_ParameterTooLong(t *testing.T) { assert.NotNil(t, err) assert.Contains(t, err.Error(), "The input parameter length exceed maximum size") } + +func TestGetNamespaceFromResourceReferences(t *testing.T) { + references := []*api.ResourceReference{ + { + Key: &api.ResourceKey{ + Type: api.ResourceType_EXPERIMENT, Id: "123"}, + Relationship: api.Relationship_CREATOR, + }, + { + Key: &api.ResourceKey{ + Type: api.ResourceType_NAMESPACE, Id: "ns"}, + Relationship: api.Relationship_OWNER, + }, + } + namespace := GetNamespaceFromResourceReferences(references) + assert.Equal(t, "ns", namespace) + + references = []*api.ResourceReference{ + { + Key: &api.ResourceKey{ + Type: api.ResourceType_EXPERIMENT, Id: "123"}, + Relationship: api.Relationship_CREATOR, + }, + } + namespace = GetNamespaceFromResourceReferences(references) + assert.Equal(t, "", namespace) +} + +func TestAuthorize_Unauthorized(t *testing.T) { + clients, manager, _ := initWithExperiment_KFAM_Unauthorized(t) + defer clients.Close() + viper.SetDefault(common.DeploymentType, common.KubeflowDeployment) + authorized, err := Authorize(manager, "user", "namespace") + assert.False(t, authorized) + assert.NotNil(t, err) +} + +func TestAuthorize_Authorized(t *testing.T) { + clients, manager, _ := initWithExperiment(t) + defer clients.Close() + os.Setenv(common.DeploymentType, common.KubeflowDeployment) + authorized, err := Authorize(manager, "", "") + assert.True(t, authorized) + assert.Nil(t, err) + + authorized, err = Authorize(manager, "user", "") + assert.False(t, authorized) + assert.NotNil(t, err) + + authorized, err = Authorize(manager, "user", "namespace") + assert.True(t, authorized) + assert.Nil(t, err) +} From d68ad13979ed11d8f35eed6ffc9e9b360c984644 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 15:08:49 -0800 Subject: [PATCH 39/57] remove the config --- backend/src/apiserver/config/config.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/src/apiserver/config/config.json b/backend/src/apiserver/config/config.json index 9fb5009a7ff..7cf3bff7576 100644 --- a/backend/src/apiserver/config/config.json +++ b/backend/src/apiserver/config/config.json @@ -10,8 +10,6 @@ "SecretAccessKey": "minio123", "BucketName": "mlpipeline" }, - "KFAM_SERVICE_HOST": "profiles-kfam.kubeflow", - "KFAM_SERVICE_PORT": "8081", "InitConnectionTimeout": "6m", "DefaultPipelineRunnerServiceAccount": "pipeline-runner" } From 50b1d199bca4fbd9545ecf152e323c5f8c5f1ea2 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 16:16:18 -0800 Subject: [PATCH 40/57] add unit test for authorization with httptest --- backend/src/apiserver/client/BUILD.bazel | 15 +++++++- backend/src/apiserver/client/kfam.go | 16 ++++++++ backend/src/apiserver/client/kfam_test.go | 46 +++++++++++++++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 backend/src/apiserver/client/kfam_test.go diff --git a/backend/src/apiserver/client/BUILD.bazel b/backend/src/apiserver/client/BUILD.bazel index 74716315b8f..effc134436e 100644 --- a/backend/src/apiserver/client/BUILD.bazel +++ b/backend/src/apiserver/client/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", @@ -28,3 +28,16 @@ go_library( "@io_k8s_client_go//rest:go_default_library", ], ) + +go_test( + name = "go_default_test", + srcs = [ + "kfam_test.go", + ], + data = glob(["test/**/*"]), # keep + embed = [":go_default_library"], + deps = [ + "//backend/src/common/util:go_default_library", + "@com_github_stretchr_testify//assert:go_default_library", + ], +) \ No newline at end of file diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index dc28510ad08..c3bba4bfa15 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -1,3 +1,17 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package client import ( @@ -54,6 +68,7 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, var httpClient = &http.Client{Timeout: HTTP_TIMEOUT_SECONDS * time.Second} + fmt.Println(req.URL.String()) resp, err := httpClient.Get(req.URL.String()) if err != nil { return false, util.NewInternalServerError(err, "Failed to connect to the KFAM service.") @@ -62,6 +77,7 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, return false, util.NewInternalServerError(errors.New("Requests to the KFAM service failed."), resp.Status) } defer resp.Body.Close() + jsonBindings := new(Bindings) err = json.NewDecoder(resp.Body).Decode(jsonBindings) diff --git a/backend/src/apiserver/client/kfam_test.go b/backend/src/apiserver/client/kfam_test.go new file mode 100644 index 00000000000..8dd61b0770f --- /dev/null +++ b/backend/src/apiserver/client/kfam_test.go @@ -0,0 +1,46 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package client +import( + "fmt" + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestIsAuthorize(t *testing.T) { + expect_response := []byte (`{"bindings":[{"user": {"kind": "User","name": "userA@google.com"},"referredNamespace": "nsA","RoleRef": {"apiGroup": "","kind": "ClusterRole", "name":"edit"}},{"user": {"kind": "User","name": "userA@google.com"},"referredNamespace": "nsB","RoleRef": {"apiGroup": "","kind": "ClusterRole", "name":"admin"}}]}`) + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + w.Write(expect_response) + })) + defer srv.Close() + fmt.Println(srv.URL) + kfam_client := NewKFAMClient("","") + kfam_client.kfamServiceUrl = srv.URL + authorized, err := kfam_client.IsAuthorized("user", "nsA") + assert.Nil(t, err) + assert.True(t, authorized) + + authorized, err = kfam_client.IsAuthorized("user", "nsB") + assert.Nil(t, err) + assert.True(t, authorized) + + authorized, err = kfam_client.IsAuthorized("user", "nsC") + assert.Nil(t, err) + assert.False(t, authorized) +} \ No newline at end of file From 60ded0108e9160a319235f5201b116664f6a109a Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Thu, 5 Dec 2019 16:28:27 -0800 Subject: [PATCH 41/57] only intialize the kfam client when kubeflow deployment --- backend/src/apiserver/client_manager.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index 0498e85ed55..5f15b38f6ee 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -161,7 +161,9 @@ func (c *ClientManager) init() { runStore := storage.NewRunStore(db, c.time) c.runStore = runStore - c.kfamClient = client.NewKFAMClient(common.GetStringConfig(kfamServiceHost), common.GetStringConfig(kfamServicePort)) + if common.IsKubeflowDeployment() { + c.kfamClient = client.NewKFAMClient(common.GetStringConfig(kfamServiceHost), common.GetStringConfig(kfamServicePort)) + } glog.Infof("Client manager initialized successfully") } From 20d70c71ec2eaffbf8fe3a821452aea3d591354d Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 9 Dec 2019 11:42:33 -0800 Subject: [PATCH 42/57] minor change --- backend/src/apiserver/client/kfam.go | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/apiserver/client/kfam.go b/backend/src/apiserver/client/kfam.go index c3bba4bfa15..e47bf70378a 100644 --- a/backend/src/apiserver/client/kfam.go +++ b/backend/src/apiserver/client/kfam.go @@ -68,7 +68,6 @@ func (c *KFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, var httpClient = &http.Client{Timeout: HTTP_TIMEOUT_SECONDS * time.Second} - fmt.Println(req.URL.String()) resp, err := httpClient.Get(req.URL.String()) if err != nil { return false, util.NewInternalServerError(err, "Failed to connect to the KFAM service.") From 01a0cd40231707a66fe1d3eeb7845da97acc8e30 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 9 Dec 2019 14:28:22 -0800 Subject: [PATCH 43/57] fix typo --- backend/src/apiserver/resource/client_manager_fake.go | 2 +- backend/src/apiserver/server/test_util.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/resource/client_manager_fake.go b/backend/src/apiserver/resource/client_manager_fake.go index c849d396ddd..8eff3a3aaf8 100644 --- a/backend/src/apiserver/resource/client_manager_fake.go +++ b/backend/src/apiserver/resource/client_manager_fake.go @@ -93,7 +93,7 @@ func NewFakeClientManagerOrFatal(time util.TimeInterface) *FakeClientManager { return fakeStore } -func NewFakeClientManagerOrFatal_KFAM_Authorized(time util.TimeInterface) *FakeClientManager { +func NewFakeClientManagerOrFatal_KFAM_Unauthorized(time util.TimeInterface) *FakeClientManager { uuid := util.NewFakeUUIDGeneratorOrFatal(DefaultFakeUUID, nil) fakeStore, err := NewFakeClientManager(time, uuid) fakeStore.kfamClientFake.mode = Unauthorized diff --git a/backend/src/apiserver/server/test_util.go b/backend/src/apiserver/server/test_util.go index 7b5ec1b9273..9d125a9dbba 100644 --- a/backend/src/apiserver/server/test_util.go +++ b/backend/src/apiserver/server/test_util.go @@ -74,7 +74,7 @@ func initWithExperiment(t *testing.T) (*resource.FakeClientManager, *resource.Re } func initWithExperiment_KFAM_Unauthorized(t *testing.T) (*resource.FakeClientManager, *resource.ResourceManager, *model.Experiment) { - clientManager := resource.NewFakeClientManagerOrFatal_KFAM_Authorized(util.NewFakeTimeForEpoch()) + clientManager := resource.NewFakeClientManagerOrFatal_KFAM_Unauthorized(util.NewFakeTimeForEpoch()) resourceManager := resource.NewResourceManager(clientManager) experiment := &model.Experiment{Name: "123"} experiment, err := resourceManager.CreateExperiment(experiment) From 15cfb0e231eb3258957832aac1ba08102d05a3ca Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 9 Dec 2019 14:35:08 -0800 Subject: [PATCH 44/57] wrap the whole auth func --- backend/src/apiserver/server/run_server.go | 17 +++-------------- backend/src/apiserver/server/util.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index a1c3c565f3b..7f9dd2a962c 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -33,22 +33,11 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest if err != nil { return nil, util.Wrap(err, "Validate create run request failed.") } - userIdentity, err := GetUserIdentity(ctx) - if err != nil { - return nil, util.Wrap(err, "Bad request.") - } - namespace := GetNamespaceFromResourceReferences(request.Run.ResourceReferences) - isAuthorized, err := Authorize(s.resourceManager, userIdentity, namespace) - if err != nil { - return nil, util.Wrap(err, "Authorization failure.") - } - if isAuthorized == false { - return nil, util.NewBadRequestError(err, "Unauthorized access for "+userIdentity+" to namespace "+namespace) + authorized, err := IsAuthorized(s.resourceManager, ctx, request.Run.ResourceReferences) + if authorized == false { + return nil, err } - if err != nil { - return nil, util.Wrap(err, "Validate create run request failed.") - } run, err := s.resourceManager.CreateRun(request.Run) if err != nil { return nil, util.Wrap(err, "Failed to create a new run.") diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index d224b074b60..290b6d50522 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -328,3 +328,19 @@ func Authorize(resourceManager *resource.ResourceManager, userIdentity string, n } return true, nil } + +func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error){ + userIdentity, err := GetUserIdentity(ctx) + if err != nil { + return false, util.Wrap(err, "Bad request.") + } + namespace := GetNamespaceFromResourceReferences(resourceRefs) + isAuthorized, err := Authorize(resourceManager, userIdentity, namespace) + if err != nil { + return false, util.Wrap(err, "Authorization failure.") + } + if isAuthorized == false { + return false, util.NewBadRequestError(err, "Unauthorized access for "+userIdentity+" to namespace "+namespace) + } + return true, nil +} From 1aea670e0bca3495ab7a3cf80bc6092015e8874a Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 9 Dec 2019 14:45:47 -0800 Subject: [PATCH 45/57] update authz logic to be enabled when it is kubeflow deployment --- backend/src/apiserver/server/util.go | 38 ++++++++++++----------- backend/src/apiserver/server/util_test.go | 9 +----- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 290b6d50522..a319d3455ad 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -309,33 +309,35 @@ func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) s } func Authorize(resourceManager *resource.ResourceManager, userIdentity string, namespace string) (bool, error) { - // Authorization only happens when the userIdentity exists in the request header - // and it is the kubeflow deployment, which deploys the KFAM. - if len(userIdentity) != 0 && common.IsKubeflowDeployment() { - //authenticate the requests based on the userIdentity and the namespace. - if len(namespace) != 0 { - authorized, err := resourceManager.IsRequestAuthorized(userIdentity, namespace) - if err != nil { - return false, err - } - if authorized == false { - return false, errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace) - } - glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) - } else { - return false, errors.New("Namespace required in Kubeflow deployment when the user identity exists.") - } + //authenticate the requests based on the userIdentity and the namespace. + authorized, err := resourceManager.IsRequestAuthorized(userIdentity, namespace) + if err != nil { + return false, err + } + if authorized == false { + return false, errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace) } + glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) return true, nil } -func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error){ +func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error) { + if common.IsKubeflowDeployment() == false { + // Skip authz if not kubeflow deployment. + return true, nil + } + userIdentity, err := GetUserIdentity(ctx) - if err != nil { + if err != nil || len(userIdentity) == 0 { return false, util.Wrap(err, "Bad request.") } namespace := GetNamespaceFromResourceReferences(resourceRefs) + if len(namespace) == 0 { + return false, errors.New("Namespace required in Kubeflow deployment for authorization.") + } + isAuthorized, err := Authorize(resourceManager, userIdentity, namespace) + if err != nil { return false, util.Wrap(err, "Authorization failure.") } diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index cf9d7f41eb0..5a83bbe709b 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -375,15 +375,8 @@ func TestAuthorize_Authorized(t *testing.T) { clients, manager, _ := initWithExperiment(t) defer clients.Close() os.Setenv(common.DeploymentType, common.KubeflowDeployment) - authorized, err := Authorize(manager, "", "") - assert.True(t, authorized) - assert.Nil(t, err) - - authorized, err = Authorize(manager, "user", "") - assert.False(t, authorized) - assert.NotNil(t, err) - authorized, err = Authorize(manager, "user", "namespace") + authorized, err := Authorize(manager, "user", "namespace") assert.True(t, authorized) assert.Nil(t, err) } From 71585483d9501849fa625c9c8917df98147a58d3 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 9 Dec 2019 17:51:29 -0800 Subject: [PATCH 46/57] change flag from kubeflow deployment to multiuser mode --- backend/src/apiserver/client_manager.go | 2 +- backend/src/apiserver/common/config.go | 7 +++---- backend/src/apiserver/server/util.go | 2 +- backend/src/apiserver/server/util_test.go | 5 ++--- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/src/apiserver/client_manager.go b/backend/src/apiserver/client_manager.go index 5f15b38f6ee..cf639a6df4e 100644 --- a/backend/src/apiserver/client_manager.go +++ b/backend/src/apiserver/client_manager.go @@ -161,7 +161,7 @@ func (c *ClientManager) init() { runStore := storage.NewRunStore(db, c.time) c.runStore = runStore - if common.IsKubeflowDeployment() { + if common.IsMultiUserMode() { c.kfamClient = client.NewKFAMClient(common.GetStringConfig(kfamServiceHost), common.GetStringConfig(kfamServicePort)) } glog.Infof("Client manager initialized successfully") diff --git a/backend/src/apiserver/common/config.go b/backend/src/apiserver/common/config.go index e3a29c13fe3..05bced88c86 100644 --- a/backend/src/apiserver/common/config.go +++ b/backend/src/apiserver/common/config.go @@ -23,8 +23,7 @@ import ( ) const ( - DeploymentType string = "DEPLOYMENT" - KubeflowDeployment string = "KUBEFLOW" + MultiUserMode string = "MULTIUSER" ) func GetStringConfig(configName string) string { @@ -59,6 +58,6 @@ func GetDurationConfig(configName string) time.Duration { return viper.GetDuration(configName) } -func IsKubeflowDeployment() bool { - return GetStringConfigWithDefault(DeploymentType, "") == KubeflowDeployment +func IsMultiUserMode() bool { + return GetBoolConfigWithDefault(MultiUserMode, false) } diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index a319d3455ad..1624b5397ca 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -322,7 +322,7 @@ func Authorize(resourceManager *resource.ResourceManager, userIdentity string, n } func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error) { - if common.IsKubeflowDeployment() == false { + if common.IsMultiUserMode() == false { // Skip authz if not kubeflow deployment. return true, nil } diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index 5a83bbe709b..948a0ae37d7 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -10,7 +10,6 @@ import ( "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" - "github.com/spf13/viper" "github.com/stretchr/testify/assert" ) @@ -365,7 +364,7 @@ func TestGetNamespaceFromResourceReferences(t *testing.T) { func TestAuthorize_Unauthorized(t *testing.T) { clients, manager, _ := initWithExperiment_KFAM_Unauthorized(t) defer clients.Close() - viper.SetDefault(common.DeploymentType, common.KubeflowDeployment) + os.Setenv(common.MultiUserMode, "true") authorized, err := Authorize(manager, "user", "namespace") assert.False(t, authorized) assert.NotNil(t, err) @@ -374,7 +373,7 @@ func TestAuthorize_Unauthorized(t *testing.T) { func TestAuthorize_Authorized(t *testing.T) { clients, manager, _ := initWithExperiment(t) defer clients.Close() - os.Setenv(common.DeploymentType, common.KubeflowDeployment) + os.Setenv(common.MultiUserMode, "true") authorized, err := Authorize(manager, "user", "namespace") assert.True(t, authorized) From 20de11ad6589e2ce2bb56189711102a635024d04 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Mon, 9 Dec 2019 18:21:03 -0800 Subject: [PATCH 47/57] gofmt --- backend/src/apiserver/resource/resource_manager_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/apiserver/resource/resource_manager_test.go b/backend/src/apiserver/resource/resource_manager_test.go index 964fa3f79f0..5b12d3d4d02 100644 --- a/backend/src/apiserver/resource/resource_manager_test.go +++ b/backend/src/apiserver/resource/resource_manager_test.go @@ -15,13 +15,12 @@ package resource import ( + "encoding/json" "fmt" "strings" "testing" "time" - "encoding/json" - "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" api "github.com/kubeflow/pipelines/backend/api/go_client" "github.com/kubeflow/pipelines/backend/src/apiserver/common" From c4fcb9c263de1468f07e66e489c507f7dd00b45c Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 10:29:30 -0800 Subject: [PATCH 48/57] move fake kfam to the original kfam; create multiple fake kfam clients --- backend/src/apiserver/client/BUILD.bazel | 1 + backend/src/apiserver/client/kfam_fake.go | 37 ++++++++++++++ backend/src/apiserver/resource/BUILD.bazel | 1 - .../apiserver/resource/client_manager_fake.go | 16 ++---- backend/src/apiserver/resource/kfam_fake.go | 49 ------------------- backend/src/apiserver/server/BUILD.bazel | 1 + backend/src/apiserver/server/test_util.go | 4 +- backend/src/apiserver/server/util.go | 2 +- backend/src/apiserver/server/util_test.go | 2 +- 9 files changed, 47 insertions(+), 66 deletions(-) create mode 100644 backend/src/apiserver/client/kfam_fake.go delete mode 100644 backend/src/apiserver/resource/kfam_fake.go diff --git a/backend/src/apiserver/client/BUILD.bazel b/backend/src/apiserver/client/BUILD.bazel index effc134436e..bc2af4ffa6e 100644 --- a/backend/src/apiserver/client/BUILD.bazel +++ b/backend/src/apiserver/client/BUILD.bazel @@ -9,6 +9,7 @@ go_library( "sql.go", "workflow.go", "kfam.go", + "kfam_fake.go", ], importpath = "github.com/kubeflow/pipelines/backend/src/apiserver/client", visibility = ["//visibility:public"], diff --git a/backend/src/apiserver/client/kfam_fake.go b/backend/src/apiserver/client/kfam_fake.go new file mode 100644 index 00000000000..f7cc606f4bd --- /dev/null +++ b/backend/src/apiserver/client/kfam_fake.go @@ -0,0 +1,37 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package client + +type FakeKFAMClientAuthorized struct { +} + +func NewFakeKFAMClientAuthorized() *FakeKFAMClientAuthorized { + return &FakeKFAMClientAuthorized{} +} + +func (c *FakeKFAMClientAuthorized) IsAuthorized(userIdentity string, namespace string) (bool, error) { + return true, nil +} + +type FakeKFAMClientUnauthorized struct { +} + +func NewFakeKFAMClientUnauthorized() *FakeKFAMClientUnauthorized { + return &FakeKFAMClientUnauthorized{} +} + +func (c *FakeKFAMClientUnauthorized) IsAuthorized(userIdentity string, namespace string) (bool, error) { + return false, nil +} \ No newline at end of file diff --git a/backend/src/apiserver/resource/BUILD.bazel b/backend/src/apiserver/resource/BUILD.bazel index 610dfc13c9f..c25e611a7e8 100644 --- a/backend/src/apiserver/resource/BUILD.bazel +++ b/backend/src/apiserver/resource/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", srcs = [ "client_manager_fake.go", - "kfam_fake.go", "model_converter.go", "pod_fake.go", "resource_manager.go", diff --git a/backend/src/apiserver/resource/client_manager_fake.go b/backend/src/apiserver/resource/client_manager_fake.go index 8eff3a3aaf8..0026234fec5 100644 --- a/backend/src/apiserver/resource/client_manager_fake.go +++ b/backend/src/apiserver/resource/client_manager_fake.go @@ -42,7 +42,7 @@ type FakeClientManager struct { workflowClientFake *FakeWorkflowClient scheduledWorkflowClientFake *FakeScheduledWorkflowClient podClientFake v1.PodInterface - kfamClientFake *FakeKFAMClient + KfamClientFake client.KFAMClientInterface time util.TimeInterface uuid util.UUIDGeneratorInterface } @@ -78,7 +78,7 @@ func NewFakeClientManager(time util.TimeInterface, uuid util.UUIDGeneratorInterf objectStore: storage.NewFakeObjectStore(), scheduledWorkflowClientFake: NewScheduledWorkflowClientFake(), podClientFake: FakePodClient{}, - kfamClientFake: NewKFAMClientFake(), + KfamClientFake: client.NewFakeKFAMClientAuthorized(), time: time, uuid: uuid, }, nil @@ -93,16 +93,6 @@ func NewFakeClientManagerOrFatal(time util.TimeInterface) *FakeClientManager { return fakeStore } -func NewFakeClientManagerOrFatal_KFAM_Unauthorized(time util.TimeInterface) *FakeClientManager { - uuid := util.NewFakeUUIDGeneratorOrFatal(DefaultFakeUUID, nil) - fakeStore, err := NewFakeClientManager(time, uuid) - fakeStore.kfamClientFake.mode = Unauthorized - if err != nil { - glog.Fatalf("The fake store doesn't create successfully. Fail fast.") - } - return fakeStore -} - func (f *FakeClientManager) ExperimentStore() storage.ExperimentStoreInterface { return f.experimentStore } @@ -160,7 +150,7 @@ func (f *FakeClientManager) PodClient() v1.PodInterface { } func (f *FakeClientManager) KFAMClient() client.KFAMClientInterface { - return f.kfamClientFake + return f.KfamClientFake } func (f *FakeClientManager) Close() error { diff --git a/backend/src/apiserver/resource/kfam_fake.go b/backend/src/apiserver/resource/kfam_fake.go deleted file mode 100644 index 477cd4ac8bf..00000000000 --- a/backend/src/apiserver/resource/kfam_fake.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package resource - -import ( - "github.com/pkg/errors" -) - -const ( - InternalError string = "InternalError" - Unauthorized string = "Unauthorized" - Authorized string = "Authorized" -) - -type FakeKFAMClient struct { - mode string -} - -func NewKFAMClientFake() *FakeKFAMClient { - return &FakeKFAMClient{ - Authorized, - } -} - -func (c *FakeKFAMClient) SetMode(mode string) { - c.mode = mode -} - -func (c *FakeKFAMClient) IsAuthorized(userIdentity string, namespace string) (bool, error) { - if c.mode == InternalError { - return false, errors.New("Failed to connect to the KFAM service.") - } else if c.mode == Unauthorized { - return false, nil - } - return true, nil - -} diff --git a/backend/src/apiserver/server/BUILD.bazel b/backend/src/apiserver/server/BUILD.bazel index 66c748fa956..8d6d2b8e7e3 100644 --- a/backend/src/apiserver/server/BUILD.bazel +++ b/backend/src/apiserver/server/BUILD.bazel @@ -20,6 +20,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//backend/api:go_default_library", + "//backend/src/apiserver/client:go_default_library", "//backend/src/apiserver/common:go_default_library", "//backend/src/apiserver/list:go_default_library", "//backend/src/apiserver/model:go_default_library", diff --git a/backend/src/apiserver/server/test_util.go b/backend/src/apiserver/server/test_util.go index 9d125a9dbba..a130f1e80c8 100644 --- a/backend/src/apiserver/server/test_util.go +++ b/backend/src/apiserver/server/test_util.go @@ -19,6 +19,7 @@ import ( "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" api "github.com/kubeflow/pipelines/backend/api/go_client" + "github.com/kubeflow/pipelines/backend/src/apiserver/client" "github.com/kubeflow/pipelines/backend/src/apiserver/model" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" @@ -74,7 +75,8 @@ func initWithExperiment(t *testing.T) (*resource.FakeClientManager, *resource.Re } func initWithExperiment_KFAM_Unauthorized(t *testing.T) (*resource.FakeClientManager, *resource.ResourceManager, *model.Experiment) { - clientManager := resource.NewFakeClientManagerOrFatal_KFAM_Unauthorized(util.NewFakeTimeForEpoch()) + clientManager := resource.NewFakeClientManagerOrFatal(util.NewFakeTimeForEpoch()) + clientManager.KfamClientFake = client.NewFakeKFAMClientUnauthorized() resourceManager := resource.NewResourceManager(clientManager) experiment := &model.Experiment{Name: "123"} experiment, err := resourceManager.CreateExperiment(experiment) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 1624b5397ca..d0a45dc483a 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -315,7 +315,7 @@ func Authorize(resourceManager *resource.ResourceManager, userIdentity string, n return false, err } if authorized == false { - return false, errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace) + return false, nil } glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) return true, nil diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index 948a0ae37d7..59eef280ba0 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -367,7 +367,7 @@ func TestAuthorize_Unauthorized(t *testing.T) { os.Setenv(common.MultiUserMode, "true") authorized, err := Authorize(manager, "user", "namespace") assert.False(t, authorized) - assert.NotNil(t, err) + assert.Nil(t, err) } func TestAuthorize_Authorized(t *testing.T) { From cca49c405330477e58af8e0729c034a2f4d89a49 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 11:19:15 -0800 Subject: [PATCH 49/57] combine authorize func, add unit tests for util_test --- backend/src/apiserver/server/BUILD.bazel | 1 + backend/src/apiserver/server/util.go | 19 +++-------- backend/src/apiserver/server/util_test.go | 40 +++++++++++++++++++---- 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/backend/src/apiserver/server/BUILD.bazel b/backend/src/apiserver/server/BUILD.bazel index 8d6d2b8e7e3..0266c8769b0 100644 --- a/backend/src/apiserver/server/BUILD.bazel +++ b/backend/src/apiserver/server/BUILD.bazel @@ -74,6 +74,7 @@ go_test( "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", "@io_k8s_apimachinery//pkg/types:go_default_library", "@org_golang_google_grpc//codes:go_default_library", + "@org_golang_google_grpc//metadata:go_default_library", "@com_github_spf13_viper//:go_default_library", ], ) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index d0a45dc483a..f6729cc09fb 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -308,19 +308,6 @@ func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) s return namespace } -func Authorize(resourceManager *resource.ResourceManager, userIdentity string, namespace string) (bool, error) { - //authenticate the requests based on the userIdentity and the namespace. - authorized, err := resourceManager.IsRequestAuthorized(userIdentity, namespace) - if err != nil { - return false, err - } - if authorized == false { - return false, nil - } - glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) - return true, nil -} - func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error) { if common.IsMultiUserMode() == false { // Skip authz if not kubeflow deployment. @@ -336,13 +323,15 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context return false, errors.New("Namespace required in Kubeflow deployment for authorization.") } - isAuthorized, err := Authorize(resourceManager, userIdentity, namespace) - + isAuthorized, err := resourceManager.IsRequestAuthorized(userIdentity, namespace) if err != nil { return false, util.Wrap(err, "Authorization failure.") } + if isAuthorized == false { return false, util.NewBadRequestError(err, "Unauthorized access for "+userIdentity+" to namespace "+namespace) } + + glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) return true, nil } diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index 59eef280ba0..113e78ca7c0 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -1,6 +1,7 @@ package server import ( + "context" "io/ioutil" "os" "strings" @@ -10,7 +11,9 @@ import ( "github.com/kubeflow/pipelines/backend/src/apiserver/common" "github.com/kubeflow/pipelines/backend/src/apiserver/resource" "github.com/kubeflow/pipelines/backend/src/common/util" + "github.com/spf13/viper" "github.com/stretchr/testify/assert" + "google.golang.org/grpc/metadata" ) func TestGetPipelineName_QueryStringNotEmpty(t *testing.T) { @@ -334,6 +337,14 @@ func TestValidatePipelineSpec_ParameterTooLong(t *testing.T) { assert.Contains(t, err.Error(), "The input parameter length exceed maximum size") } +func TestGetUserIdentity(t *testing.T) { + md := metadata.New(map[string]string{common.GoogleIAPUserIdentityHeader: "accounts.google.com:user@google.com"}) + ctx := metadata.NewIncomingContext(context.Background(), md) + userIdentity, err := GetUserIdentity(ctx) + assert.Nil(t, err) + assert.Equal(t, "user@google.com", userIdentity) +} + func TestGetNamespaceFromResourceReferences(t *testing.T) { references := []*api.ResourceReference{ { @@ -364,18 +375,35 @@ func TestGetNamespaceFromResourceReferences(t *testing.T) { func TestAuthorize_Unauthorized(t *testing.T) { clients, manager, _ := initWithExperiment_KFAM_Unauthorized(t) defer clients.Close() - os.Setenv(common.MultiUserMode, "true") - authorized, err := Authorize(manager, "user", "namespace") + viper.Set(common.MultiUserMode, "true") + md := metadata.New(map[string]string{common.GoogleIAPUserIdentityHeader: "accounts.google.com:user@google.com"}) + ctx := metadata.NewIncomingContext(context.Background(), md) + references := []*api.ResourceReference{ + { + Key: &api.ResourceKey{ + Type: api.ResourceType_NAMESPACE, Id: "ns"}, + Relationship: api.Relationship_OWNER, + }, + } + authorized, err := IsAuthorized(manager, ctx, references) assert.False(t, authorized) - assert.Nil(t, err) + assert.NotNil(t, err) } func TestAuthorize_Authorized(t *testing.T) { clients, manager, _ := initWithExperiment(t) defer clients.Close() - os.Setenv(common.MultiUserMode, "true") - - authorized, err := Authorize(manager, "user", "namespace") + viper.Set(common.MultiUserMode, "true") + md := metadata.New(map[string]string{common.GoogleIAPUserIdentityHeader: "accounts.google.com:user@google.com"}) + ctx := metadata.NewIncomingContext(context.Background(), md) + references := []*api.ResourceReference{ + { + Key: &api.ResourceKey{ + Type: api.ResourceType_NAMESPACE, Id: "ns"}, + Relationship: api.Relationship_OWNER, + }, + } + authorized, err := IsAuthorized(manager, ctx, references) assert.True(t, authorized) assert.Nil(t, err) } From f649b6a9b664a05f4d39e1a978aeec9e6a595c09 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 12:17:58 -0800 Subject: [PATCH 50/57] wrap errors --- backend/src/apiserver/server/run_server.go | 5 ++++- backend/src/apiserver/server/util.go | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 7f9dd2a962c..5819b6c122f 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -34,8 +34,11 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest return nil, util.Wrap(err, "Validate create run request failed.") } authorized, err := IsAuthorized(s.resourceManager, ctx, request.Run.ResourceReferences) + if err != nil { + return nil, util.Wrap(err, "Failed to authorize the requests.") + } if authorized == false { - return nil, err + return nil, util.Wrap(err, "Unauthorized access.") } run, err := s.resourceManager.CreateRun(request.Run) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index f6729cc09fb..aa4a65092fe 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -315,9 +315,12 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context } userIdentity, err := GetUserIdentity(ctx) - if err != nil || len(userIdentity) == 0 { + if err != nil { return false, util.Wrap(err, "Bad request.") } + if len(userIdentity) == 0 { + return false, errors.New("userIdentity is empty.") + } namespace := GetNamespaceFromResourceReferences(resourceRefs) if len(namespace) == 0 { return false, errors.New("Namespace required in Kubeflow deployment for authorization.") @@ -329,7 +332,8 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context } if isAuthorized == false { - return false, util.NewBadRequestError(err, "Unauthorized access for "+userIdentity+" to namespace "+namespace) + glog.Infof("Unauthorized access for %s to namespace %s", userIdentity, namespace) + return false, nil } glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) From 18864dbd73e634f02d8dd7372e9368ebd227aea9 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 12:20:22 -0800 Subject: [PATCH 51/57] fix unit test --- backend/src/apiserver/server/util_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index 113e78ca7c0..763991b39b1 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -387,7 +387,7 @@ func TestAuthorize_Unauthorized(t *testing.T) { } authorized, err := IsAuthorized(manager, ctx, references) assert.False(t, authorized) - assert.NotNil(t, err) + assert.Nil(t, err) } func TestAuthorize_Authorized(t *testing.T) { From 673db26b5d68ef176a3c8965a57acc59ed541079 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 12:48:05 -0800 Subject: [PATCH 52/57] service unauthorized info to user --- backend/src/apiserver/server/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index aa4a65092fe..4eea512d0a0 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -333,7 +333,7 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context if isAuthorized == false { glog.Infof("Unauthorized access for %s to namespace %s", userIdentity, namespace) - return false, nil + return false, errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace) } glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) From 874484814e7c42e0942e015eb48257a3cb19299d Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 13:10:09 -0800 Subject: [PATCH 53/57] better user errors --- backend/src/apiserver/server/util.go | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 4eea512d0a0..0873ef7da39 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -277,7 +277,7 @@ func CheckPipelineVersionReference(resourceManager *resource.ResourceManager, re func GetUserIdentity(ctx context.Context) (string, error) { if ctx == nil { - return "", nil + return "", util.NewBadRequestError(errors.New("Request error: context is nil"),"Request error: context is nil.") } md, _ := metadata.FromIncomingContext(ctx) // If the request header contains the user identity, requests are authorized @@ -294,18 +294,7 @@ func GetUserIdentity(ctx context.Context) (string, error) { } return userIdentityHeaderFields[1], nil } - return "", nil -} - -func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) string { - namespace := "" - for _, resourceRef := range resourceRefs { - if resourceRef.Key.Type == api.ResourceType_NAMESPACE { - namespace = resourceRef.Key.Id - break - } - } - return namespace + return "", util.NewBadRequestError(errors.New("Request header error: there is no user identity header."),"Request header error: there is no user identity header.") } func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error) { @@ -318,12 +307,13 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context if err != nil { return false, util.Wrap(err, "Bad request.") } + if len(userIdentity) == 0 { - return false, errors.New("userIdentity is empty.") + return false, util.NewBadRequestError(errors.New("Request header error: user identity is empty."), "Request header error: user identity is empty.") } - namespace := GetNamespaceFromResourceReferences(resourceRefs) + namespace := common.GetNamespaceFromResourceReferences(resourceRefs) if len(namespace) == 0 { - return false, errors.New("Namespace required in Kubeflow deployment for authorization.") + return false, util.NewBadRequestError(errors.New("Namespace required in Kubeflow deployment for authorization."), "Namespace required in Kubeflow deployment for authorization.") } isAuthorized, err := resourceManager.IsRequestAuthorized(userIdentity, namespace) @@ -333,7 +323,7 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context if isAuthorized == false { glog.Infof("Unauthorized access for %s to namespace %s", userIdentity, namespace) - return false, errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace) + return false, util.NewBadRequestError(errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace), "Unauthorized access for " + userIdentity + " to namespace " + namespace) } glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) From 52eab3ee564cf8127003b59e5e0522e5742659a2 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 13:33:49 -0800 Subject: [PATCH 54/57] revert some accidental change --- backend/src/apiserver/server/util.go | 13 ++++++++++++- backend/src/apiserver/server/util_test.go | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 0873ef7da39..79a963c54aa 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -297,6 +297,17 @@ func GetUserIdentity(ctx context.Context) (string, error) { return "", util.NewBadRequestError(errors.New("Request header error: there is no user identity header."),"Request header error: there is no user identity header.") } +func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) string { + namespace := "" + for _, resourceRef := range resourceRefs { + if resourceRef.Key.Type == api.ResourceType_NAMESPACE { + namespace = resourceRef.Key.Id + break + } + } + return namespace +} + func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error) { if common.IsMultiUserMode() == false { // Skip authz if not kubeflow deployment. @@ -311,7 +322,7 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context if len(userIdentity) == 0 { return false, util.NewBadRequestError(errors.New("Request header error: user identity is empty."), "Request header error: user identity is empty.") } - namespace := common.GetNamespaceFromResourceReferences(resourceRefs) + namespace := GetNamespaceFromResourceReferences(resourceRefs) if len(namespace) == 0 { return false, util.NewBadRequestError(errors.New("Namespace required in Kubeflow deployment for authorization."), "Namespace required in Kubeflow deployment for authorization.") } diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index 763991b39b1..113e78ca7c0 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -387,7 +387,7 @@ func TestAuthorize_Unauthorized(t *testing.T) { } authorized, err := IsAuthorized(manager, ctx, references) assert.False(t, authorized) - assert.Nil(t, err) + assert.NotNil(t, err) } func TestAuthorize_Authorized(t *testing.T) { From df09ce18f0c8e1a7e111e073b18e0fb3d7c9b0ce Mon Sep 17 00:00:00 2001 From: IronPan Date: Tue, 10 Dec 2019 15:07:28 -0800 Subject: [PATCH 55/57] Update util.go --- backend/src/apiserver/server/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 79a963c54aa..f4576146327 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -310,7 +310,7 @@ func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) s func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error) { if common.IsMultiUserMode() == false { - // Skip authz if not kubeflow deployment. + // Skip authz if not multi-user mode. return true, nil } From be2806b84d5ec9cad744180a60e00d1416c3c0e3 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 15:17:55 -0800 Subject: [PATCH 56/57] make functions local --- backend/src/apiserver/server/util.go | 8 ++++---- backend/src/apiserver/server/util_test.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index 79a963c54aa..ea77b44144e 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -275,7 +275,7 @@ func CheckPipelineVersionReference(resourceManager *resource.ResourceManager, re return &pipelineVersionId, nil } -func GetUserIdentity(ctx context.Context) (string, error) { +func getUserIdentity(ctx context.Context) (string, error) { if ctx == nil { return "", util.NewBadRequestError(errors.New("Request error: context is nil"),"Request error: context is nil.") } @@ -297,7 +297,7 @@ func GetUserIdentity(ctx context.Context) (string, error) { return "", util.NewBadRequestError(errors.New("Request header error: there is no user identity header."),"Request header error: there is no user identity header.") } -func GetNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) string { +func getNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) string { namespace := "" for _, resourceRef := range resourceRefs { if resourceRef.Key.Type == api.ResourceType_NAMESPACE { @@ -314,7 +314,7 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context return true, nil } - userIdentity, err := GetUserIdentity(ctx) + userIdentity, err := getUserIdentity(ctx) if err != nil { return false, util.Wrap(err, "Bad request.") } @@ -322,7 +322,7 @@ func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context if len(userIdentity) == 0 { return false, util.NewBadRequestError(errors.New("Request header error: user identity is empty."), "Request header error: user identity is empty.") } - namespace := GetNamespaceFromResourceReferences(resourceRefs) + namespace := getNamespaceFromResourceReferences(resourceRefs) if len(namespace) == 0 { return false, util.NewBadRequestError(errors.New("Namespace required in Kubeflow deployment for authorization."), "Namespace required in Kubeflow deployment for authorization.") } diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index 113e78ca7c0..3a042c04e12 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -340,7 +340,7 @@ func TestValidatePipelineSpec_ParameterTooLong(t *testing.T) { func TestGetUserIdentity(t *testing.T) { md := metadata.New(map[string]string{common.GoogleIAPUserIdentityHeader: "accounts.google.com:user@google.com"}) ctx := metadata.NewIncomingContext(context.Background(), md) - userIdentity, err := GetUserIdentity(ctx) + userIdentity, err := getUserIdentity(ctx) assert.Nil(t, err) assert.Equal(t, "user@google.com", userIdentity) } @@ -358,7 +358,7 @@ func TestGetNamespaceFromResourceReferences(t *testing.T) { Relationship: api.Relationship_OWNER, }, } - namespace := GetNamespaceFromResourceReferences(references) + namespace := getNamespaceFromResourceReferences(references) assert.Equal(t, "ns", namespace) references = []*api.ResourceReference{ @@ -368,7 +368,7 @@ func TestGetNamespaceFromResourceReferences(t *testing.T) { Relationship: api.Relationship_CREATOR, }, } - namespace = GetNamespaceFromResourceReferences(references) + namespace = getNamespaceFromResourceReferences(references) assert.Equal(t, "", namespace) } From c371e20f2cf2491bb79aa1914eddb4c053cc9881 Mon Sep 17 00:00:00 2001 From: Ning Gao Date: Tue, 10 Dec 2019 15:29:40 -0800 Subject: [PATCH 57/57] deduplicate return values from isauthorized --- backend/src/apiserver/server/run_server.go | 5 +---- backend/src/apiserver/server/util.go | 16 ++++++++-------- backend/src/apiserver/server/util_test.go | 6 ++---- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/backend/src/apiserver/server/run_server.go b/backend/src/apiserver/server/run_server.go index 5819b6c122f..284f8501e8a 100644 --- a/backend/src/apiserver/server/run_server.go +++ b/backend/src/apiserver/server/run_server.go @@ -33,13 +33,10 @@ func (s *RunServer) CreateRun(ctx context.Context, request *api.CreateRunRequest if err != nil { return nil, util.Wrap(err, "Validate create run request failed.") } - authorized, err := IsAuthorized(s.resourceManager, ctx, request.Run.ResourceReferences) + err = IsAuthorized(s.resourceManager, ctx, request.Run.ResourceReferences) if err != nil { return nil, util.Wrap(err, "Failed to authorize the requests.") } - if authorized == false { - return nil, util.Wrap(err, "Unauthorized access.") - } run, err := s.resourceManager.CreateRun(request.Run) if err != nil { diff --git a/backend/src/apiserver/server/util.go b/backend/src/apiserver/server/util.go index f6ae48ca03d..390867fd32e 100644 --- a/backend/src/apiserver/server/util.go +++ b/backend/src/apiserver/server/util.go @@ -308,35 +308,35 @@ func getNamespaceFromResourceReferences(resourceRefs []*api.ResourceReference) s return namespace } -func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) (bool, error) { +func IsAuthorized(resourceManager *resource.ResourceManager, ctx context.Context, resourceRefs []*api.ResourceReference) error { if common.IsMultiUserMode() == false { // Skip authz if not multi-user mode. - return true, nil + return nil } userIdentity, err := getUserIdentity(ctx) if err != nil { - return false, util.Wrap(err, "Bad request.") + return util.Wrap(err, "Bad request.") } if len(userIdentity) == 0 { - return false, util.NewBadRequestError(errors.New("Request header error: user identity is empty."), "Request header error: user identity is empty.") + return util.NewBadRequestError(errors.New("Request header error: user identity is empty."), "Request header error: user identity is empty.") } namespace := getNamespaceFromResourceReferences(resourceRefs) if len(namespace) == 0 { - return false, util.NewBadRequestError(errors.New("Namespace required in Kubeflow deployment for authorization."), "Namespace required in Kubeflow deployment for authorization.") + return util.NewBadRequestError(errors.New("Namespace required in Kubeflow deployment for authorization."), "Namespace required in Kubeflow deployment for authorization.") } isAuthorized, err := resourceManager.IsRequestAuthorized(userIdentity, namespace) if err != nil { - return false, util.Wrap(err, "Authorization failure.") + return util.Wrap(err, "Authorization failure.") } if isAuthorized == false { glog.Infof("Unauthorized access for %s to namespace %s", userIdentity, namespace) - return false, util.NewBadRequestError(errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace), "Unauthorized access for " + userIdentity + " to namespace " + namespace) + return util.NewBadRequestError(errors.New("Unauthorized access for " + userIdentity + " to namespace " + namespace), "Unauthorized access for " + userIdentity + " to namespace " + namespace) } glog.Infof("Authorized user %s in namespace %s", userIdentity, namespace) - return true, nil + return nil } diff --git a/backend/src/apiserver/server/util_test.go b/backend/src/apiserver/server/util_test.go index 3a042c04e12..37af914daea 100644 --- a/backend/src/apiserver/server/util_test.go +++ b/backend/src/apiserver/server/util_test.go @@ -385,8 +385,7 @@ func TestAuthorize_Unauthorized(t *testing.T) { Relationship: api.Relationship_OWNER, }, } - authorized, err := IsAuthorized(manager, ctx, references) - assert.False(t, authorized) + err := IsAuthorized(manager, ctx, references) assert.NotNil(t, err) } @@ -403,7 +402,6 @@ func TestAuthorize_Authorized(t *testing.T) { Relationship: api.Relationship_OWNER, }, } - authorized, err := IsAuthorized(manager, ctx, references) - assert.True(t, authorized) + err := IsAuthorized(manager, ctx, references) assert.Nil(t, err) }