From 5c6832bbddb4b20d8601eb7e5145d86ff2bead6a Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Thu, 20 May 2021 14:34:32 -0700 Subject: [PATCH] feat: report rate --- api/v1alpha1/const.go | 1 + api/v1alpha1/generated.pb.go | 600 ++++++++++-------- api/v1alpha1/generated.proto | 12 + api/v1alpha1/kafka.go | 3 + api/v1alpha1/metrics.go | 1 + api/v1alpha1/pipeline_types.go | 4 +- api/v1alpha1/source_statuses.go | 5 +- api/v1alpha1/source_statuses_test.go | 10 +- api/v1alpha1/stan.go | 3 + api/v1alpha1/step_spec.go | 8 +- api/v1alpha1/step_status.go | 41 +- api/v1alpha1/step_status_test.go | 12 +- api/v1alpha1/step_types.go | 8 +- api/v1alpha1/step_types_test.go | 30 +- api/v1alpha1/zz_generated.deepcopy.go | 22 +- config/ci.yaml | 55 ++ .../bases/dataflow.argoproj.io_pipelines.yaml | 20 + .../crd/bases/dataflow.argoproj.io_steps.yaml | 35 + config/default.yaml | 55 ++ config/dev.yaml | 55 ++ config/dev/input-pod.yaml | 2 +- config/quick-start.yaml | 55 ++ examples/examples_test.go | 21 +- go.mod | 1 + go.sum | 2 + manager/controllers/pipeline_controller.go | 8 +- manager/controllers/step_controller.go | 33 +- runner/init/init.go | 8 +- runner/sidecar/sidecar.go | 174 ++--- runner/util/spec.go | 13 - 30 files changed, 831 insertions(+), 466 deletions(-) delete mode 100644 runner/util/spec.go diff --git a/api/v1alpha1/const.go b/api/v1alpha1/const.go index cd8677a2..40cb6618 100644 --- a/api/v1alpha1/const.go +++ b/api/v1alpha1/const.go @@ -19,6 +19,7 @@ const ( EnvPipelineName = "ARGO_DATAFLOW_PIPELINE_NAME" EnvReplica = "ARGO_DATAFLOW_REPLICA" EnvStepSpec = "ARGO_DATAFLOW_STEP_SPEC" + EnvStepStatus = "ARGO_DATAFLOW_STEP_STATUS" EnvPeekDelay = "ARGO_DATAFLOW_PEEK_DELAY" // how long between peeking (default 4m) EnvPullPolicy = "ARGO_DATAFLOW_PULL_POLICY" // default "" EnvScalingDelay = "ARGO_DATAFLOW_SCALING_DELAY" // // how long to wait between any scaling events (including peeking) default "4m" diff --git a/api/v1alpha1/generated.pb.go b/api/v1alpha1/generated.pb.go index 74f11ba2..38abc354 100644 --- a/api/v1alpha1/generated.pb.go +++ b/api/v1alpha1/generated.pb.go @@ -1105,177 +1105,180 @@ func init() { } var fileDescriptor_7a4218a80d7ff35f = []byte{ - // 2707 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4f, 0x6f, 0x1b, 0xc7, - 0x15, 0xf7, 0x8a, 0xff, 0x1f, 0x29, 0xc5, 0x1e, 0x07, 0xe8, 0x96, 0x88, 0x25, 0x61, 0xd3, 0x38, - 0x72, 0x61, 0x53, 0xb6, 0xe2, 0x00, 0x56, 0x52, 0xc7, 0x10, 0x69, 0xd9, 0x51, 0x43, 0xcb, 0xea, - 0x90, 0xb6, 0xdb, 0x26, 0xad, 0x32, 0x5a, 0x0e, 0xa9, 0x8d, 0x96, 0xbb, 0x9b, 0xdd, 0xa1, 0x62, - 0xdd, 0x7c, 0x48, 0x0b, 0xf4, 0x96, 0x63, 0x51, 0xa0, 0xb7, 0xde, 0x0a, 0xf4, 0xde, 0x7e, 0x02, - 0x1f, 0x7d, 0x2a, 0xd2, 0x8b, 0x50, 0x2b, 0x1f, 0xa0, 0xa7, 0xf6, 0x20, 0xa0, 0x40, 0x31, 0xff, - 0x76, 0x97, 0x14, 0x8d, 0xc8, 0x64, 0x1d, 0xe4, 0x44, 0xee, 0x7b, 0x6f, 0x7e, 0x33, 0xef, 0xcd, - 0x7b, 0x6f, 0xde, 0x9b, 0x81, 0x46, 0xcf, 0x61, 0xbb, 0x83, 0x9d, 0x9a, 0xed, 0xf7, 0x97, 0x49, - 0xd8, 0xf3, 0x83, 0xd0, 0xff, 0xec, 0x8a, 0x4b, 0x76, 0x22, 0xf1, 0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12, 0x14, 0x43, 0xdd, 0x9c, 0xfc, 0x40, 0x34, 0x1a, 0x15, 0x1e, 0xaf, - 0x71, 0x67, 0x12, 0x73, 0xb9, 0x31, 0x23, 0xde, 0x09, 0x99, 0xe6, 0x14, 0xc6, 0x14, 0xbd, 0x94, - 0x34, 0xa6, 0xf8, 0x8b, 0x25, 0x26, 0xea, 0x42, 0x21, 0x12, 0x27, 0x8b, 0xae, 0x1e, 0xdf, 0x9f, - 0xe2, 0x74, 0x4a, 0x75, 0x87, 0x12, 0x13, 0x6b, 0x70, 0x9e, 0x74, 0x22, 0xc7, 0xdb, 0xd3, 0x67, - 0xe0, 0xea, 0xc4, 0x35, 0x6a, 0xea, 0x22, 0x80, 0xe3, 0x61, 0x09, 0x8b, 0xb6, 0x61, 0x36, 0xa4, - 0x11, 0x23, 0x21, 0x53, 0xcf, 0x41, 0xb2, 0xbb, 0x5d, 0xd5, 0xdd, 0x27, 0x4e, 0x33, 0x8f, 0x0f, - 0x17, 0x16, 0xc7, 0xbc, 0x08, 0x0d, 0xc9, 0xe0, 0x61, 0x3c, 0xb4, 0x02, 0xc0, 0x68, 0xd8, 0x77, - 0x3c, 0xc2, 0xfc, 0xd0, 0x04, 0x71, 0x53, 0x1e, 0x1f, 0x4c, 0xed, 0x98, 0x83, 0x53, 0x52, 0x68, - 0x1d, 0x0a, 0xf2, 0x51, 0x36, 0x32, 0x67, 0x5f, 0xfc, 0x82, 0x22, 0x5f, 0x71, 0x53, 0x17, 0xd0, - 0x72, 0x08, 0xd6, 0x63, 0xd1, 0x4f, 0x01, 0x45, 0x34, 0xdc, 0x77, 0x6c, 0xba, 0x66, 0xdb, 0xfe, - 0xc0, 0x63, 0xe2, 0xc5, 0x6f, 0x6e, 0xe8, 0x3d, 0x00, 0xb5, 0x4e, 0x48, 0xe0, 0x31, 0xa3, 0x50, - 0x2f, 0x75, 0xb4, 0x9c, 0x9d, 0xe2, 0xc4, 0xd4, 0x97, 0x9f, 0xd2, 0x6b, 0xf5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 0x05, 0x00, 0x00, 0xff, 0xff, 0x30, 0xa0, 0x52, 0xf2, 0xb4, - 0x25, 0x00, 0x00, + // 2765 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xcf, 0x6f, 0x1b, 0xc7, + 0xf5, 0xf7, 0xf2, 0x37, 0x1f, 0x29, 0xc5, 0x9e, 0x04, 0xf8, 0xee, 0x97, 0x48, 0x24, 0x61, 0xd3, + 0xa4, 0x4a, 0x91, 0x50, 0xb1, 0x92, 0x00, 0x56, 0x52, 0xc7, 0x10, 0x69, 0xd9, 0x51, 0x43, 0xcb, + 0xea, 0x90, 0xb6, 0xdb, 0x26, 0xad, 0x3a, 0x5a, 0x0e, 0xa9, 0x8d, 0x96, 0xbb, 0x9b, 0xdd, 0xa1, + 0x62, 0xdd, 0x7c, 0x48, 0x0b, 0xf4, 0x96, 0x63, 0xd1, 0x63, 0x81, 0x02, 0x05, 0x02, 0xf4, 0xd0, + 0x3f, 0xa0, 0x67, 0x1f, 0x7d, 0x2a, 0xd2, 0x8b, 0x50, 0x2b, 0x7f, 0x40, 0x4f, 0xed, 0x41, 0xa7, + 0x62, 0x7e, 0xed, 0x0f, 0x89, 0x86, 0x65, 0xb2, 0x0e, 0x72, 0x12, 0xf7, 0xbd, 0x37, 0x9f, 0x99, + 0x79, 0xf3, 0x7e, 0xce, 0x08, 0xda, 0x43, 0x87, 0xed, 0x8d, 0x77, 0x9b, 0xb6, 0x3f, 0x5a, 0x21, + 0xe1, 0xd0, 0x0f, 0x42, 0xff, 0xb3, 0xb7, 0x5c, 0xb2, 0x1b, 0x89, 0xaf, 0xb7, 0xfa, 0x84, 0x91, + 0x81, 0xeb, 0x7f, 0xb1, 0x42, 0x02, 0x67, 0xe5, 0xe0, 0x32, 0x71, 0x83, 0x3d, 0x72, 0x79, 0x65, + 0x48, 0x3d, 0x1a, 0x12, 0x46, 0xfb, 0xcd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xe1, 0xd1, 0xe3, 0x85, 0x0b, 0xdf, 0x3c, + 0x5e, 0xb8, 0xf0, 0xe0, 0x78, 0xc1, 0x78, 0x78, 0xbc, 0x60, 0x3c, 0x3a, 0x5e, 0x30, 0xbe, 0x39, + 0x5e, 0x30, 0xfe, 0x79, 0xbc, 0x60, 0x7c, 0xf5, 0xed, 0xc2, 0x85, 0x5f, 0x54, 0xf4, 0x22, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0x84, 0x74, 0x07, 0x5a, 0xb4, 0x26, 0x00, 0x00, } func (m *Cat) Marshal() (dAtA []byte, err error) { @@ -1524,6 +1527,16 @@ func (m *GetPodSpecReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.StepStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 i = encodeVarintGenerated(dAtA, i, uint64(m.UpdateInterval)) i-- dAtA[i] = 0x38 @@ -1844,6 +1857,9 @@ func (m *Kafka) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.Parallel)) + i-- + dAtA[i] = 0x30 if m.NET != nil { { size, err := m.NET.MarshalToSizedBuffer(dAtA[:i]) @@ -2070,6 +2086,9 @@ func (m *Metrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.Rate)) + i-- + dAtA[i] = 0x30 i = encodeVarintGenerated(dAtA, i, uint64(m.Errors)) i-- dAtA[i] = 0x28 @@ -2099,18 +2118,16 @@ func (m *Pipeline) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x1a + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2285,6 +2302,9 @@ func (m *STAN) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + i = encodeVarintGenerated(dAtA, i, uint64(m.Parallel)) + i-- + dAtA[i] = 0x38 i -= len(m.SubjectPrefix) copy(dAtA[i:], m.SubjectPrefix) i = encodeVarintGenerated(dAtA, i, uint64(len(m.SubjectPrefix))) @@ -2676,18 +2696,16 @@ func (m *Step) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x1a + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a { size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -3065,18 +3083,16 @@ func (m *StepStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(len(m.Selector))) i-- dAtA[i] = 0x3a - if m.LastScaledAt != nil { - { - size, err := m.LastScaledAt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) + { + size, err := m.LastScaledAt.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x32 + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 i = encodeVarintGenerated(dAtA, i, uint64(m.Replicas)) i-- dAtA[i] = 0x28 @@ -3109,14 +3125,14 @@ func (m *StepStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } - if len(m.SourceStatues) > 0 { - keysForSourceStatues := make([]string, 0, len(m.SourceStatues)) - for k := range m.SourceStatues { - keysForSourceStatues = append(keysForSourceStatues, string(k)) + if len(m.SourceStatuses) > 0 { + keysForSourceStatuses := make([]string, 0, len(m.SourceStatuses)) + for k := range m.SourceStatuses { + keysForSourceStatuses = append(keysForSourceStatuses, string(k)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForSourceStatues) - for iNdEx := len(keysForSourceStatues) - 1; iNdEx >= 0; iNdEx-- { - v := m.SourceStatues[string(keysForSourceStatues[iNdEx])] + github_com_gogo_protobuf_sortkeys.Strings(keysForSourceStatuses) + for iNdEx := len(keysForSourceStatuses) - 1; iNdEx >= 0; iNdEx-- { + v := m.SourceStatuses[string(keysForSourceStatuses[iNdEx])] baseI := i { size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) @@ -3128,9 +3144,9 @@ func (m *StepStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - i -= len(keysForSourceStatues[iNdEx]) - copy(dAtA[i:], keysForSourceStatues[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSourceStatues[iNdEx]))) + i -= len(keysForSourceStatuses[iNdEx]) + copy(dAtA[i:], keysForSourceStatuses[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForSourceStatuses[iNdEx]))) i-- dAtA[i] = 0xa i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) @@ -3328,6 +3344,8 @@ func (m *GetPodSpecReq) Size() (n int) { l = len(m.PullPolicy) n += 1 + l + sovGenerated(uint64(l)) n += 1 + sovGenerated(uint64(m.UpdateInterval)) + l = m.StepStatus.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -3457,6 +3475,7 @@ func (m *Kafka) Size() (n int) { l = m.NET.Size() n += 1 + l + sovGenerated(uint64(l)) } + n += 1 + sovGenerated(uint64(m.Parallel)) return n } @@ -3528,6 +3547,7 @@ func (m *Metrics) Size() (n int) { _ = l n += 1 + sovGenerated(uint64(m.Total)) n += 1 + sovGenerated(uint64(m.Errors)) + n += 1 + sovGenerated(uint64(m.Rate)) return n } @@ -3541,10 +3561,8 @@ func (m *Pipeline) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -3615,6 +3633,7 @@ func (m *STAN) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.SubjectPrefix) n += 1 + l + sovGenerated(uint64(l)) + n += 1 + sovGenerated(uint64(m.Parallel)) return n } @@ -3751,10 +3770,8 @@ func (m *Step) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + l = m.Status.Size() + n += 1 + l + sovGenerated(uint64(l)) return n } @@ -3880,8 +3897,8 @@ func (m *StepStatus) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Message) n += 1 + l + sovGenerated(uint64(l)) - if len(m.SourceStatues) > 0 { - for k, v := range m.SourceStatues { + if len(m.SourceStatuses) > 0 { + for k, v := range m.SourceStatuses { _ = k _ = v l = v.Size() @@ -3899,10 +3916,8 @@ func (m *StepStatus) Size() (n int) { } } n += 1 + sovGenerated(uint64(m.Replicas)) - if m.LastScaledAt != nil { - l = m.LastScaledAt.Size() - n += 1 + l + sovGenerated(uint64(l)) - } + l = m.LastScaledAt.Size() + n += 1 + l + sovGenerated(uint64(l)) l = len(m.Selector) n += 1 + l + sovGenerated(uint64(l)) l = len(m.Reason) @@ -4024,6 +4039,7 @@ func (this *GetPodSpecReq) String() string { `RunnerImage:` + fmt.Sprintf("%v", this.RunnerImage) + `,`, `PullPolicy:` + fmt.Sprintf("%v", this.PullPolicy) + `,`, `UpdateInterval:` + fmt.Sprintf("%v", this.UpdateInterval) + `,`, + `StepStatus:` + strings.Replace(strings.Replace(this.StepStatus.String(), "StepStatus", "StepStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -4121,6 +4137,7 @@ func (this *Kafka) String() string { `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `NET:` + strings.Replace(this.NET.String(), "KafkaNET", "KafkaNET", 1) + `,`, + `Parallel:` + fmt.Sprintf("%v", this.Parallel) + `,`, `}`, }, "") return s @@ -4193,6 +4210,7 @@ func (this *Metrics) String() string { s := strings.Join([]string{`&Metrics{`, `Total:` + fmt.Sprintf("%v", this.Total) + `,`, `Errors:` + fmt.Sprintf("%v", this.Errors) + `,`, + `Rate:` + fmt.Sprintf("%v", this.Rate) + `,`, `}`, }, "") return s @@ -4204,7 +4222,7 @@ func (this *Pipeline) String() string { s := strings.Join([]string{`&Pipeline{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PipelineSpec", "PipelineSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(this.Status.String(), "PipelineStatus", "PipelineStatus", 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PipelineStatus", "PipelineStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -4267,6 +4285,7 @@ func (this *STAN) String() string { `NATSURL:` + fmt.Sprintf("%v", this.NATSURL) + `,`, `ClusterID:` + fmt.Sprintf("%v", this.ClusterID) + `,`, `SubjectPrefix:` + fmt.Sprintf("%v", this.SubjectPrefix) + `,`, + `Parallel:` + fmt.Sprintf("%v", this.Parallel) + `,`, `}`, }, "") return s @@ -4363,7 +4382,7 @@ func (this *Step) String() string { s := strings.Join([]string{`&Step{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v11.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "StepSpec", "StepSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(this.Status.String(), "StepStatus", "StepStatus", 1) + `,`, + `Status:` + strings.Replace(strings.Replace(this.Status.String(), "StepStatus", "StepStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -4449,16 +4468,16 @@ func (this *StepStatus) String() string { if this == nil { return "nil" } - keysForSourceStatues := make([]string, 0, len(this.SourceStatues)) - for k := range this.SourceStatues { - keysForSourceStatues = append(keysForSourceStatues, k) + keysForSourceStatuses := make([]string, 0, len(this.SourceStatuses)) + for k := range this.SourceStatuses { + keysForSourceStatuses = append(keysForSourceStatuses, k) } - github_com_gogo_protobuf_sortkeys.Strings(keysForSourceStatues) - mapStringForSourceStatues := "SourceStatuses{" - for _, k := range keysForSourceStatues { - mapStringForSourceStatues += fmt.Sprintf("%v: %v,", k, this.SourceStatues[k]) + github_com_gogo_protobuf_sortkeys.Strings(keysForSourceStatuses) + mapStringForSourceStatuses := "SourceStatuses{" + for _, k := range keysForSourceStatuses { + mapStringForSourceStatuses += fmt.Sprintf("%v: %v,", k, this.SourceStatuses[k]) } - mapStringForSourceStatues += "}" + mapStringForSourceStatuses += "}" keysForSinkStatues := make([]string, 0, len(this.SinkStatues)) for k := range this.SinkStatues { keysForSinkStatues = append(keysForSinkStatues, k) @@ -4472,10 +4491,10 @@ func (this *StepStatus) String() string { s := strings.Join([]string{`&StepStatus{`, `Phase:` + fmt.Sprintf("%v", this.Phase) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `SourceStatues:` + mapStringForSourceStatues + `,`, + `SourceStatuses:` + mapStringForSourceStatuses + `,`, `SinkStatues:` + mapStringForSinkStatues + `,`, `Replicas:` + fmt.Sprintf("%v", this.Replicas) + `,`, - `LastScaledAt:` + strings.Replace(fmt.Sprintf("%v", this.LastScaledAt), "Time", "v11.Time", 1) + `,`, + `LastScaledAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastScaledAt), "Time", "v11.Time", 1), `&`, ``, 1) + `,`, `Selector:` + fmt.Sprintf("%v", this.Selector) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `}`, @@ -5366,6 +5385,39 @@ func (m *GetPodSpecReq) Unmarshal(dAtA []byte) error { break } } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StepStatus", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StepStatus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -6408,6 +6460,25 @@ func (m *Kafka) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Parallel", wireType) + } + m.Parallel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Parallel |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7051,6 +7122,25 @@ func (m *Metrics) Unmarshal(dAtA []byte) error { break } } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Rate", wireType) + } + m.Rate = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Rate |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -7196,9 +7286,6 @@ func (m *Pipeline) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Status == nil { - m.Status = &PipelineStatus{} - } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -7762,6 +7849,25 @@ func (m *STAN) Unmarshal(dAtA []byte) error { } m.SubjectPrefix = SubjectPrefix(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Parallel", wireType) + } + m.Parallel = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Parallel |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -8989,9 +9095,6 @@ func (m *Step) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Status == nil { - m.Status = &StepStatus{} - } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -10102,7 +10205,7 @@ func (m *StepStatus) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SourceStatues", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceStatuses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10129,8 +10232,8 @@ func (m *StepStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SourceStatues == nil { - m.SourceStatues = make(SourceStatuses) + if m.SourceStatuses == nil { + m.SourceStatuses = make(SourceStatuses) } var mapkey string mapvalue := &SourceStatus{} @@ -10227,7 +10330,7 @@ func (m *StepStatus) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.SourceStatues[mapkey] = *mapvalue + m.SourceStatuses[mapkey] = *mapvalue iNdEx = postIndex case 4: if wireType != 2 { @@ -10406,9 +10509,6 @@ func (m *StepStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.LastScaledAt == nil { - m.LastScaledAt = &v11.Time{} - } if err := m.LastScaledAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/api/v1alpha1/generated.proto b/api/v1alpha1/generated.proto index 9b3f250b..c9d9b540 100644 --- a/api/v1alpha1/generated.proto +++ b/api/v1alpha1/generated.proto @@ -77,6 +77,8 @@ message GetPodSpecReq { optional string pullPolicy = 6; optional int64 updateInterval = 7; + + optional StepStatus stepStatus = 8; } message Git { @@ -138,6 +140,10 @@ message Kafka { optional string version = 4; optional KafkaNET net = 5; + + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:default=1 + optional uint32 parallel = 6; } message KafkaNET { @@ -164,6 +170,8 @@ message Metrics { optional uint64 total = 1; optional uint64 errors = 5; + + optional uint64 rate = 6; } // +kubebuilder:object:root=true @@ -210,6 +218,10 @@ message STAN { optional string subject = 3; optional string subjectPrefix = 6; + + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:default=1 + optional uint32 parallel = 7; } message Scale { diff --git a/api/v1alpha1/kafka.go b/api/v1alpha1/kafka.go index eacd5862..bd9345c4 100644 --- a/api/v1alpha1/kafka.go +++ b/api/v1alpha1/kafka.go @@ -11,4 +11,7 @@ type Kafka struct { Topic string `json:"topic" protobuf:"bytes,3,opt,name=topic"` Version string `json:"version,omitempty" protobuf:"bytes,4,opt,name=version"` NET *KafkaNET `json:"net,omitempty" protobuf:"bytes,5,opt,name=net"` + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:default=1 + Parallel uint32 `json:"parallel,omitempty" protobuf:"varint,6,opt,name=parallel"` } diff --git a/api/v1alpha1/metrics.go b/api/v1alpha1/metrics.go index 6614fc96..ec148ed9 100644 --- a/api/v1alpha1/metrics.go +++ b/api/v1alpha1/metrics.go @@ -3,4 +3,5 @@ package v1alpha1 type Metrics struct { Total uint64 `json:"total,omitempty" protobuf:"varint,1,opt,name=total"` Errors uint64 `json:"errors,omitempty" protobuf:"varint,5,opt,name=errors"` + Rate uint64 `json:"rate,omitempty" protobuf:"varint,6,opt,name=rate"` // current rate of messages per second } diff --git a/api/v1alpha1/pipeline_types.go b/api/v1alpha1/pipeline_types.go index 75ea0df2..fbcb4d54 100644 --- a/api/v1alpha1/pipeline_types.go +++ b/api/v1alpha1/pipeline_types.go @@ -29,8 +29,8 @@ type Pipeline struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Spec PipelineSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - Status *PipelineStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` + Spec PipelineSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + Status PipelineStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // +kubebuilder:object:root=true diff --git a/api/v1alpha1/source_statuses.go b/api/v1alpha1/source_statuses.go index 840de8da..3be64fae 100644 --- a/api/v1alpha1/source_statuses.go +++ b/api/v1alpha1/source_statuses.go @@ -6,9 +6,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -type SourceStatuses map[string]SourceStatus +type SourceStatuses map[string]SourceStatus // key is replica -func (in SourceStatuses) Set(name string, replica int, msg string) { +func (in SourceStatuses) Set(name string, replica int, msg string, rate uint64) { x := in[name] x.LastMessage = &Message{Data: trunc(msg), Time: metav1.Now()} if x.Metrics == nil { @@ -16,6 +16,7 @@ func (in SourceStatuses) Set(name string, replica int, msg string) { } m := x.Metrics[strconv.Itoa(replica)] m.Total++ + m.Rate = rate x.Metrics[strconv.Itoa(replica)] = m in[name] = x } diff --git a/api/v1alpha1/source_statuses_test.go b/api/v1alpha1/source_statuses_test.go index 1c6fbc81..fa3c0809 100644 --- a/api/v1alpha1/source_statuses_test.go +++ b/api/v1alpha1/source_statuses_test.go @@ -11,7 +11,7 @@ import ( func TestSourceStatuses_Set(t *testing.T) { ss := SourceStatuses{} - ss.Set("bar", 1, strings.Repeat("x", 33)) + ss.Set("bar", 1, strings.Repeat("x", 33), 1) if assert.Len(t, ss, 1) { s := ss["bar"] @@ -20,10 +20,11 @@ func TestSourceStatuses_Set(t *testing.T) { } if assert.Len(t, s.Metrics, 1) { assert.Equal(t, uint64(1), s.Metrics["1"].Total) + assert.Equal(t, uint64(1), s.Metrics["1"].Rate) } } - ss.Set("bar", 1, "bar") + ss.Set("bar", 1, "bar", 1) if assert.Len(t, ss, 1) { s := ss["bar"] @@ -32,10 +33,11 @@ func TestSourceStatuses_Set(t *testing.T) { } if assert.Len(t, s.Metrics, 1) { assert.Equal(t, uint64(2), s.Metrics["1"].Total) + assert.Equal(t, uint64(1), s.Metrics["1"].Rate) } } - ss.Set("bar", 0, "foo") + ss.Set("bar", 0, "foo", 0) if assert.Len(t, ss, 1) { s := ss["bar"] @@ -48,7 +50,7 @@ func TestSourceStatuses_Set(t *testing.T) { } } - ss.Set("baz", 0, "foo") + ss.Set("baz", 0, "foo", 0) if assert.Len(t, ss, 2) { s := ss["baz"] diff --git a/api/v1alpha1/stan.go b/api/v1alpha1/stan.go index 2909c3e6..b170aa88 100644 --- a/api/v1alpha1/stan.go +++ b/api/v1alpha1/stan.go @@ -7,4 +7,7 @@ type STAN struct { ClusterID string `json:"clusterId,omitempty" protobuf:"bytes,5,opt,name=clusterId"` Subject string `json:"subject" protobuf:"bytes,3,opt,name=subject"` SubjectPrefix SubjectPrefix `json:"subjectPrefix,omitempty" protobuf:"bytes,6,opt,name=subjectPrefix,casttype=SubjectPrefix"` + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:default=1 + Parallel uint32 `json:"parallel,omitempty" protobuf:"varint,7,opt,name=parallel"` } diff --git a/api/v1alpha1/step_spec.go b/api/v1alpha1/step_spec.go index 565cae02..22f12992 100644 --- a/api/v1alpha1/step_spec.go +++ b/api/v1alpha1/step_spec.go @@ -44,7 +44,6 @@ type StepSpec struct { Tolerations []corev1.Toleration `json:"tolerations,omitempty" protobuf:"bytes,19,rep,name=tolerations"` } -// +kubebuilder:skipversion type GetPodSpecReq struct { PipelineName string `protobuf:"bytes,1,opt,name=pipelineName"` Namespace string `protobuf:"bytes,2,opt,name=namespace"` @@ -53,6 +52,7 @@ type GetPodSpecReq struct { RunnerImage string `protobuf:"bytes,5,opt,name=runnerImage"` PullPolicy corev1.PullPolicy `protobuf:"bytes,6,opt,name=pullPolicy,casttype=k8s.io/api/core/v1.PullPolicy"` UpdateInterval time.Duration `protobuf:"varint,7,opt,name=updateInterval,casttype=time.Duration"` + StepStatus StepStatus `protobuf:"bytes,8,opt,name=stepStatus"` } func (in *StepSpec) GetPodSpec(req GetPodSpecReq) corev1.PodSpec { @@ -60,13 +60,15 @@ func (in *StepSpec) GetPodSpec(req GetPodSpecReq) corev1.PodSpec { Name: "var-run-argo-dataflow", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}, } - data, _ := json.Marshal(in) + stepSpec, _ := json.Marshal(in) + stepStatus, _ := json.Marshal(req.StepStatus) volumeMounts := []corev1.VolumeMount{{Name: volume.Name, MountPath: PathVarRun}} envVars := []corev1.EnvVar{ {Name: EnvPipelineName, Value: req.PipelineName}, {Name: EnvNamespace, Value: req.Namespace}, {Name: EnvReplica, Value: strconv.Itoa(int(req.Replica))}, - {Name: EnvStepSpec, Value: string(data)}, + {Name: EnvStepSpec, Value: string(stepSpec)}, + {Name: EnvStepStatus, Value: string(stepStatus)}, {Name: EnvUpdateInterval, Value: req.UpdateInterval.String()}, } return corev1.PodSpec{ diff --git a/api/v1alpha1/step_status.go b/api/v1alpha1/step_status.go index e9d5dbb3..b247bc1a 100644 --- a/api/v1alpha1/step_status.go +++ b/api/v1alpha1/step_status.go @@ -1,43 +1,24 @@ package v1alpha1 import ( - "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type StepStatus struct { - Phase StepPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=StepPhase"` - Reason string `json:"reason,omitempty" protobuf:"bytes,8,opt,name=reason"` - Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` - Replicas uint32 `json:"replicas,omitempty" protobuf:"varint,5,opt,name=replicas"` - Selector string `json:"selector,omitempty" protobuf:"bytes,7,opt,name=selector"` - LastScaledAt *metav1.Time `json:"lastScaledAt,omitempty" protobuf:"bytes,6,opt,name=lastScaledAt"` - SourceStatues SourceStatuses `json:"sourceStatuses,omitempty" protobuf:"bytes,3,rep,name=sourceStatuses"` - SinkStatues SinkStatuses `json:"sinkStatuses,omitempty" protobuf:"bytes,4,rep,name=sinkStatuses"` -} - -func (m *StepStatus) GetSourceStatues() SourceStatuses { - if m == nil { - return nil - } - return m.SourceStatues + Phase StepPhase `json:"phase" protobuf:"bytes,1,opt,name=phase,casttype=StepPhase"` + Reason string `json:"reason" protobuf:"bytes,8,opt,name=reason"` + Message string `json:"message" protobuf:"bytes,2,opt,name=message"` + Replicas uint32 `json:"replicas" protobuf:"varint,5,opt,name=replicas"` + Selector string `json:"selector" protobuf:"bytes,7,opt,name=selector"` + LastScaledAt metav1.Time `json:"lastScaledAt" protobuf:"bytes,6,opt,name=lastScaledAt"` + SourceStatuses SourceStatuses `json:"sourceStatuses" protobuf:"bytes,3,rep,name=sourceStatuses"` + SinkStatues SinkStatuses `json:"sinkStatuses" protobuf:"bytes,4,rep,name=sinkStatuses"` } -func (m *StepStatus) GetReplicas() int { - if m == nil { - return -1 - } +func (m StepStatus) GetReplicas() int { return int(m.Replicas) } -func (m *StepStatus) GetLastScaledAt() time.Time { - if m == nil || m.LastScaledAt == nil { - return time.Time{} - } - return m.LastScaledAt.Time -} - -func (in *StepStatus) AnyErrors() bool { - return in.SinkStatues.AnyErrors() || in.SourceStatues.AnyErrors() +func (in StepStatus) AnyErrors() bool { + return in.SinkStatues.AnyErrors() || in.SourceStatuses.AnyErrors() } diff --git a/api/v1alpha1/step_status_test.go b/api/v1alpha1/step_status_test.go index 2912ba08..a43721eb 100644 --- a/api/v1alpha1/step_status_test.go +++ b/api/v1alpha1/step_status_test.go @@ -2,20 +2,10 @@ package v1alpha1 import ( "testing" - "time" "github.com/stretchr/testify/assert" ) func TestStepStatus_AnyErrors(t *testing.T) { - assert.False(t, (&StepStatus{}).AnyErrors()) -} - -func TestStepStatus_GetLastScaledAt(t *testing.T) { - assert.Equal(t, time.Time{}, (&StepStatus{}).GetLastScaledAt()) -} - -func TestStepStatus_GetReplicas(t *testing.T) { - var x *StepStatus - assert.Equal(t, -1, x.GetReplicas()) + assert.False(t, StepStatus{}.AnyErrors()) } diff --git a/api/v1alpha1/step_types.go b/api/v1alpha1/step_types.go index d291f803..a9b02a16 100644 --- a/api/v1alpha1/step_types.go +++ b/api/v1alpha1/step_types.go @@ -34,19 +34,19 @@ type Step struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - Spec StepSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` - Status *StepStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` + Spec StepSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` + Status StepStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } func (in *Step) GetTargetReplicas(scalingDelay, peekDelay time.Duration) int { - lastScaledAt := in.Status.GetLastScaledAt() + lastScaledAt := in.Status.LastScaledAt.Time currentReplicas := in.Status.GetReplicas() // can be -1 if time.Since(lastScaledAt) < scalingDelay { return currentReplicas } - pending := in.Status.GetSourceStatues().GetPending() + pending := in.Status.SourceStatuses.GetPending() targetReplicas := in.Spec.CalculateReplicas(pending) // do we need to peek? currentReplicas and targetReplicas must both be zero diff --git a/api/v1alpha1/step_types_test.go b/api/v1alpha1/step_types_test.go index 9dfc040b..3b73995f 100644 --- a/api/v1alpha1/step_types_test.go +++ b/api/v1alpha1/step_types_test.go @@ -9,9 +9,9 @@ import ( ) func TestStep_GetTargetReplicas(t *testing.T) { - old := &metav1.Time{} - recent := &metav1.Time{Time: time.Now().Add(-2 * time.Minute)} - now := &metav1.Time{Time: time.Now()} + old := metav1.Time{} + recent := metav1.Time{Time: time.Now().Add(-2 * time.Minute)} + now := metav1.Time{Time: time.Now()} scalingDelay := time.Minute peekDelay := 4 * time.Minute t.Run("Init", func(t *testing.T) { @@ -26,57 +26,57 @@ func TestStep_GetTargetReplicas(t *testing.T) { }) t.Run("ScalingUp", func(t *testing.T) { t.Run("Min=2,Replicas=1,LastScaledAt=old", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 2}}, Status: &StepStatus{Replicas: 1, LastScaledAt: old}} + s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 2}}, Status: StepStatus{Replicas: 1, LastScaledAt: old}} assert.Equal(t, 2, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=2,Replicas=1,LastScaledAt=recent", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 2}}, Status: &StepStatus{Replicas: 1, LastScaledAt: recent}} + s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 2}}, Status: StepStatus{Replicas: 1, LastScaledAt: recent}} assert.Equal(t, 2, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=2,Replicas=1,LastScaledAt=now", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 2}}, Status: &StepStatus{Replicas: 1, LastScaledAt: now}} + s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 2}}, Status: StepStatus{Replicas: 1, LastScaledAt: now}} assert.Equal(t, 1, s.GetTargetReplicas(scalingDelay, peekDelay)) }) }) t.Run("ScalingDown", func(t *testing.T) { t.Run("Min=1,Replicas=2,LastScaledAt=old", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 1}}, Status: &StepStatus{Replicas: 2, LastScaledAt: old}} + s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 1}}, Status: StepStatus{Replicas: 2, LastScaledAt: old}} assert.Equal(t, 1, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=1,Replicas=2,LastScaledAt=recent", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 1}}, Status: &StepStatus{Replicas: 2, LastScaledAt: recent}} + s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 1}}, Status: StepStatus{Replicas: 2, LastScaledAt: recent}} assert.Equal(t, 1, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=1,Replicas=2,LastScaledAt=now", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 1}}, Status: &StepStatus{Replicas: 2, LastScaledAt: now}} + s := &Step{Spec: StepSpec{Scale: &Scale{MinReplicas: 1}}, Status: StepStatus{Replicas: 2, LastScaledAt: now}} assert.Equal(t, 2, s.GetTargetReplicas(scalingDelay, peekDelay)) }) }) t.Run("ScaleToZero", func(t *testing.T) { t.Run("Min=0,Replicas=1,LastScaledAt=old", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: &StepStatus{Replicas: 1, LastScaledAt: old}} + s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: StepStatus{Replicas: 1, LastScaledAt: old}} assert.Equal(t, 0, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=0,Replicas=1,LastScaledAt=recent", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: &StepStatus{Replicas: 1, LastScaledAt: recent}} + s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: StepStatus{Replicas: 1, LastScaledAt: recent}} assert.Equal(t, 0, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=0,Replicas=1,LastScaledAt=now", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: &StepStatus{Replicas: 1, LastScaledAt: now}} + s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: StepStatus{Replicas: 1, LastScaledAt: now}} assert.Equal(t, 1, s.GetTargetReplicas(scalingDelay, peekDelay)) }) }) t.Run("Peek", func(t *testing.T) { t.Run("Min=0,Replicas=0,LastScaledAt=old", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: &StepStatus{Replicas: 0, LastScaledAt: old}} + s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: StepStatus{Replicas: 0, LastScaledAt: old}} assert.Equal(t, 1, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=0,Replicas=0,LastScaledAt=recent", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: &StepStatus{Replicas: 0, LastScaledAt: now}} + s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: StepStatus{Replicas: 0, LastScaledAt: now}} assert.Equal(t, 0, s.GetTargetReplicas(scalingDelay, peekDelay)) }) t.Run("Min=0,Replicas=0,LastScaledAt=now", func(t *testing.T) { - s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: &StepStatus{Replicas: 0, LastScaledAt: now}} + s := &Step{Spec: StepSpec{Scale: &Scale{}}, Status: StepStatus{Replicas: 0, LastScaledAt: now}} assert.Equal(t, 0, s.GetTargetReplicas(scalingDelay, peekDelay)) }) }) diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 664d5e1e..011f51fc 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -149,6 +149,7 @@ func (in *Flatten) DeepCopy() *Flatten { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GetPodSpecReq) DeepCopyInto(out *GetPodSpecReq) { *out = *in + in.StepStatus.DeepCopyInto(&out.StepStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GetPodSpecReq. @@ -414,11 +415,7 @@ func (in *Pipeline) DeepCopyInto(out *Pipeline) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(PipelineStatus) - (*in).DeepCopyInto(*out) - } + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pipeline. @@ -758,11 +755,7 @@ func (in *Step) DeepCopyInto(out *Step) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(StepStatus) - (*in).DeepCopyInto(*out) - } + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step. @@ -923,12 +916,9 @@ func (in *StepSpec) DeepCopy() *StepSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StepStatus) DeepCopyInto(out *StepStatus) { *out = *in - if in.LastScaledAt != nil { - in, out := &in.LastScaledAt, &out.LastScaledAt - *out = (*in).DeepCopy() - } - if in.SourceStatues != nil { - in, out := &in.SourceStatues, &out.SourceStatues + in.LastScaledAt.DeepCopyInto(&out.LastScaledAt) + if in.SourceStatuses != nil { + in, out := &in.SourceStatuses, &out.SourceStatuses *out = make(SourceStatuses, len(*in)) for key, val := range *in { (*out)[key] = *val.DeepCopy() diff --git a/config/ci.yaml b/config/ci.yaml index b235ced2..f5d0de51 100644 --- a/config/ci.yaml +++ b/config/ci.yaml @@ -730,6 +730,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -751,6 +756,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -794,6 +804,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -813,6 +828,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2559,6 +2579,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2580,6 +2605,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2623,6 +2653,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2642,6 +2677,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -3642,6 +3682,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3682,6 +3725,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3692,6 +3738,15 @@ spec: type: integer type: object type: object + required: + - lastScaledAt + - message + - phase + - reason + - replicas + - selector + - sinkStatuses + - sourceStatuses type: object required: - spec diff --git a/config/crd/bases/dataflow.argoproj.io_pipelines.yaml b/config/crd/bases/dataflow.argoproj.io_pipelines.yaml index 1ad0622a..57728934 100644 --- a/config/crd/bases/dataflow.argoproj.io_pipelines.yaml +++ b/config/crd/bases/dataflow.argoproj.io_pipelines.yaml @@ -1096,6 +1096,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -1117,6 +1122,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -1160,6 +1170,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -1179,6 +1194,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: diff --git a/config/crd/bases/dataflow.argoproj.io_steps.yaml b/config/crd/bases/dataflow.argoproj.io_steps.yaml index 9e394b6e..7cd6a461 100644 --- a/config/crd/bases/dataflow.argoproj.io_steps.yaml +++ b/config/crd/bases/dataflow.argoproj.io_steps.yaml @@ -1056,6 +1056,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -1077,6 +1082,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -1120,6 +1130,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -1139,6 +1154,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2689,6 +2709,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -2729,6 +2752,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -2739,6 +2765,15 @@ spec: type: integer type: object type: object + required: + - lastScaledAt + - message + - phase + - reason + - replicas + - selector + - sinkStatuses + - sourceStatuses type: object required: - spec diff --git a/config/default.yaml b/config/default.yaml index c351d47e..8c65d863 100644 --- a/config/default.yaml +++ b/config/default.yaml @@ -730,6 +730,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -751,6 +756,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -794,6 +804,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -813,6 +828,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2559,6 +2579,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2580,6 +2605,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2623,6 +2653,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2642,6 +2677,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -3642,6 +3682,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3682,6 +3725,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3692,6 +3738,15 @@ spec: type: integer type: object type: object + required: + - lastScaledAt + - message + - phase + - reason + - replicas + - selector + - sinkStatuses + - sourceStatuses type: object required: - spec diff --git a/config/dev.yaml b/config/dev.yaml index 66e3392b..e89d418e 100644 --- a/config/dev.yaml +++ b/config/dev.yaml @@ -730,6 +730,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -751,6 +756,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -794,6 +804,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -813,6 +828,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2559,6 +2579,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2580,6 +2605,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2623,6 +2653,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2642,6 +2677,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -3642,6 +3682,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3682,6 +3725,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3692,6 +3738,15 @@ spec: type: integer type: object type: object + required: + - lastScaledAt + - message + - phase + - reason + - replicas + - selector + - sinkStatuses + - sourceStatuses type: object required: - spec diff --git a/config/dev/input-pod.yaml b/config/dev/input-pod.yaml index c5f23f7e..9d5885a0 100644 --- a/config/dev/input-pod.yaml +++ b/config/dev/input-pod.yaml @@ -17,6 +17,6 @@ spec: kafka -topic input-topic create-topic kafka -topic output-topic create-topic # change sleep to 10ms to flood the topic - kafka -topic input-topic -sleep 2s pump-topic + kafka -topic input-topic -sleep 50ms pump-topic sleep 5s done diff --git a/config/quick-start.yaml b/config/quick-start.yaml index 03dacca3..72d6ff61 100644 --- a/config/quick-start.yaml +++ b/config/quick-start.yaml @@ -730,6 +730,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -751,6 +756,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -794,6 +804,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -813,6 +828,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2559,6 +2579,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2580,6 +2605,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -2623,6 +2653,11 @@ spec: tls: type: object type: object + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer topic: type: string version: @@ -2642,6 +2677,11 @@ spec: type: string natsUrl: type: string + parallel: + default: 1 + format: int32 + minimum: 1 + type: integer subject: type: string subjectPrefix: @@ -3642,6 +3682,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3682,6 +3725,9 @@ spec: errors: format: int64 type: integer + rate: + format: int64 + type: integer total: format: int64 type: integer @@ -3692,6 +3738,15 @@ spec: type: integer type: object type: object + required: + - lastScaledAt + - message + - phase + - reason + - replicas + - selector + - sinkStatuses + - sourceStatuses type: object required: - spec diff --git a/examples/examples_test.go b/examples/examples_test.go index c5d04e63..a31c7bb9 100644 --- a/examples/examples_test.go +++ b/examples/examples_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/argoproj-labs/argo-dataflow/shared/util" dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1" + "github.com/argoproj-labs/argo-dataflow/shared/util" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -77,16 +77,15 @@ func Test(t *testing.T) { pipeline := &dfv1.Pipeline{} err := runtime.DefaultUnstructuredConverter.FromUnstructured(un.Object, pipeline) assert.NoError(t, err) - if s := pipeline.Status; s != nil { - conditions := make(map[string]bool) - for _, c := range s.Conditions { - conditions[c.Type] = true - } - logger.Info("changed", "condition", conditions, "phase", pipeline.Status.Phase, "message", pipeline.Status.Message) - if conditions[condition] { - logger.Info("condition found", "after", time.Since(start).Truncate(time.Second).String()) - return - } + s := pipeline.Status + conditions := make(map[string]bool) + for _, c := range s.Conditions { + conditions[c.Type] = true + } + logger.Info("changed", "condition", conditions, "phase", pipeline.Status.Phase, "message", pipeline.Status.Message) + if conditions[condition] { + logger.Info("condition found", "after", time.Since(start).Truncate(time.Second).String()) + return } } } diff --git a/go.mod b/go.mod index 13196bca..3fd52681 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( github.com/nats-io/stan.go v0.8.3 github.com/onsi/ginkgo v1.14.1 github.com/onsi/gomega v1.10.2 + github.com/paulbellamy/ratecounter v0.2.0 github.com/robfig/cron/v3 v3.0.0 github.com/stretchr/testify v1.7.0 golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect diff --git a/go.sum b/go.sum index 0f3fb606..e3fb44fb 100644 --- a/go.sum +++ b/go.sum @@ -438,6 +438,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/paulbellamy/ratecounter v0.2.0 h1:2L/RhJq+HA8gBQImDXtLPrDXK5qAj6ozWVK/zFXVJGs= +github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= diff --git a/manager/controllers/pipeline_controller.go b/manager/controllers/pipeline_controller.go index e425113f..a540349a 100644 --- a/manager/controllers/pipeline_controller.go +++ b/manager/controllers/pipeline_controller.go @@ -110,10 +110,7 @@ func (r *PipelineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c } pending, running, succeeded, failed := 0, 0, 0, 0 - newStatus := pipeline.Status.DeepCopy() - if newStatus == nil { - newStatus = &dfv1.PipelineStatus{} - } + newStatus := *pipeline.Status.DeepCopy() newStatus.Phase = dfv1.PipelineUnknown terminate, sunkMessages, errors := false, false, false for _, step := range steps.Items { @@ -126,9 +123,6 @@ func (r *PipelineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c } continue } - if step.Status == nil { - continue - } switch step.Status.Phase { case dfv1.StepUnknown, dfv1.StepPending: newStatus.Phase = dfv1.MinPipelinePhase(newStatus.Phase, dfv1.PipelinePending) diff --git a/manager/controllers/step_controller.go b/manager/controllers/step_controller.go index eedd3b0d..61542cc6 100644 --- a/manager/controllers/step_controller.go +++ b/manager/controllers/step_controller.go @@ -73,18 +73,31 @@ func (r *StepReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. hash := util.MustHash(step.Spec) - oldStatus := step.Status.DeepCopy() - if oldStatus == nil { - oldStatus = &dfv1.StepStatus{} + oldStatus := dfv1.StepStatus{ + Phase: step.Status.Phase, + Reason: step.Status.Reason, + Message: step.Status.Message, + Replicas: step.Status.Replicas, + Selector: step.Status.Selector, + LastScaledAt: step.Status.LastScaledAt, + SinkStatues: dfv1.SinkStatuses{}, + SourceStatuses: dfv1.SourceStatuses{}, } + // we need to delete the fields we do not own and should now be allowed in update - oldStatus.SinkStatues = nil - oldStatus.SourceStatues = nil - newStatus := oldStatus.DeepCopy() - newStatus.Phase = dfv1.StepUnknown + newStatus := dfv1.StepStatus{ + Phase: dfv1.StepUnknown, + Reason: "", + Message: "", + Replicas: step.Status.Replicas, + Selector: step.Status.Selector, + LastScaledAt: step.Status.LastScaledAt, + SinkStatues: dfv1.SinkStatuses{}, + SourceStatuses: dfv1.SourceStatuses{}, + } stepName := step.Spec.Name - if step.Status == nil || !step.Status.Phase.Completed() { // once a step is completed, we do not schedule or create pods + if !step.Status.Phase.Completed() { // once a step is completed, we do not schedule or create pods for replica := 0; replica < targetReplicas; replica++ { podName := fmt.Sprintf("%s-%d", step.Name, replica) log.Info("applying pod", "podName", podName) @@ -113,7 +126,6 @@ func (r *StepReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. Name: podName, Labels: _labels, Annotations: annotations, - OwnerReferences: []metav1.OwnerReference{ *metav1.NewControllerRef(step.GetObjectMeta(), dfv1.StepGroupVersionKind), }, @@ -127,6 +139,7 @@ func (r *StepReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. RunnerImage: runnerImage, PullPolicy: pullPolicy, UpdateInterval: updateInterval, + StepStatus: step.Status, }, ), }, @@ -171,9 +184,9 @@ func (r *StepReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. } if currentReplicas != targetReplicas { - newStatus.LastScaledAt = &metav1.Time{Time: time.Now()} newStatus.Replicas = uint32(targetReplicas) newStatus.Selector = fmt.Sprintf("%s=%s,%s=%s", dfv1.KeyPipelineName, pipelineName, dfv1.KeyStepName, step.Name) + newStatus.LastScaledAt = metav1.Time{Time: time.Now()} r.Recorder.Eventf(step, "Normal", eventReason(currentReplicas, targetReplicas), "Scaling from %d to %d", currentReplicas, targetReplicas) } diff --git a/runner/init/init.go b/runner/init/init.go index 128acfc7..7c0a7bb4 100644 --- a/runner/init/init.go +++ b/runner/init/init.go @@ -16,7 +16,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1" - "github.com/argoproj-labs/argo-dataflow/runner/util" ) var logger = zap.New() @@ -39,10 +38,9 @@ func Exec() error { } } } - spec, err := util.UnmarshallSpec() - if err != nil { - return err - } + spec := dfv1.StepSpec{} + util2.MustUnJSON(os.Getenv(dfv1.EnvStepSpec), &spec) + if spec.GetIn().FIFO { logger.Info("creating in fifo") if err := syscall.Mkfifo(dfv1.PathFIFOIn, 0600); util2.IgnoreExist(err) != nil { diff --git a/runner/sidecar/sidecar.go b/runner/sidecar/sidecar.go index f5005577..bf31797a 100644 --- a/runner/sidecar/sidecar.go +++ b/runner/sidecar/sidecar.go @@ -1,5 +1,7 @@ package sidecar +import "github.com/paulbellamy/ratecounter" + import ( "bufio" "bytes" @@ -43,10 +45,10 @@ var ( replica = 0 pipelineName = os.Getenv(dfv1.EnvPipelineName) namespace = os.Getenv(dfv1.EnvNamespace) - spec *dfv1.StepSpec - sourceStatues = dfv1.SourceStatuses{} - sinkStatues = dfv1.SinkStatuses{} - mu = sync.RWMutex{} + spec = dfv1.StepSpec{} + status = dfv1.StepStatus{} + lastStatus = dfv1.StepStatus{} + mu = sync.Mutex{} ) func withLock(f func()) { @@ -73,11 +75,22 @@ func Exec(ctx context.Context) error { dynamicInterface = dynamic.NewForConfigOrDie(restConfig) kubernetesInterface = kubernetes.NewForConfigOrDie(restConfig) - if v, err := util.UnmarshallSpec(); err != nil { - return err - } else { - spec = v + util2.MustUnJSON(os.Getenv(dfv1.EnvStepSpec), &spec) + util2.MustUnJSON(os.Getenv(dfv1.EnvStepStatus), &status) + + logger.Info("status", "status", util2.MustJSON(status)) + + // re-created the status, only keeping information on this replica + x := strconv.Itoa(replica) + status = dfv1.StepStatus{ + SourceStatuses: dfv1.SourceStatuses{x: status.SourceStatuses[x]}, + SinkStatues: dfv1.SinkStatuses{x: status.SinkStatues[x]}, } + + logger.Info("this replica's status", "status", util2.MustJSON(status)) + + lastStatus = *status.DeepCopy() + if v, err := strconv.Atoi(os.Getenv(dfv1.EnvReplica)); err != nil { return err } else { @@ -111,17 +124,8 @@ func Exec(ctx context.Context) error { return err } - lastStatus := &dfv1.StepStatus{} - go wait.JitterUntil(func() { - status := &dfv1.StepStatus{ - SourceStatues: sourceStatues, - SinkStatues: sinkStatues, - } - if notEqual, _ := util2.NotEqual(lastStatus, status); notEqual { - patchStepStatus(ctx) - lastStatus = status.DeepCopy() - } - }, updateInterval, 1.2, true, ctx.Done()) + go wait.JitterUntil(func() { patchStepStatus(ctx) }, updateInterval, 1.2, true, ctx.Done()) + logger.Info("ready") <-ctx.Done() logger.Info("done") @@ -129,27 +133,25 @@ func Exec(ctx context.Context) error { } func patchStepStatus(ctx context.Context) { - // we need to be careful to just patch fields we own - patch := util2.MustJSON(map[string]interface{}{ - "status": map[string]interface{}{ - "sourceStatuses": sourceStatues, - "sinkStatuses": sinkStatues, - }, + withLock(func() { + if notEqual, patch := util2.NotEqual(dfv1.Step{Status: lastStatus}, dfv1.Step{Status: status}); notEqual { + logger.Info("patching step status", "patch", patch) + if _, err := dynamicInterface. + Resource(dfv1.StepGroupVersionResource). + Namespace(namespace). + Patch( + ctx, + pipelineName+"-"+spec.Name, + types.MergePatchType, + []byte(patch), + metav1.PatchOptions{}, + "status", + ); err != nil { + logger.Error(err, "failed to patch step status") + } + lastStatus = *status.DeepCopy() + } }) - logger.Info("patching step status", "patch", patch) - if _, err := dynamicInterface. - Resource(dfv1.StepGroupVersionResource). - Namespace(namespace). - Patch( - ctx, - pipelineName+"-"+spec.Name, - types.MergePatchType, - []byte(patch), - metav1.PatchOptions{}, - "status", - ); err != nil { - logger.Error(err, "failed to patch step status") - } } func enrichSpec(ctx context.Context) error { @@ -245,12 +247,19 @@ func connectSources(ctx context.Context, toMain func([]byte) error) error { return fmt.Errorf("duplicate source named %q", sourceName) } sources[sourceName] = true + + rateCounter := ratecounter.NewRateCounter(updateInterval) + f := func(msg []byte) error { debug.Info("◷ →", "source", sourceName, "msg", printable(msg)) - withLock(func() { sourceStatues.Set(sourceName, replica, printable(msg)) }) + rateCounter.Incr(1) + + withLock(func() { + status.SourceStatuses.Set(sourceName, replica, printable(msg), uint64(rateCounter.Rate()/int64(updateInterval/time.Second))) + }) if err := toMain(msg); err != nil { logger.Error(err, "⚠ →", "source", sourceName) - withLock(func() { sourceStatues.IncErrors(sourceName, replica, err) }) + withLock(func() { status.SourceStatuses.IncErrors(sourceName, replica, err) }) return err } return nil @@ -263,27 +272,29 @@ func connectSources(ctx context.Context, toMain func([]byte) error) error { return fmt.Errorf("failed to schedule cron %q: %w", x.Schedule, err) } } else if x := source.STAN; x != nil { - clientID := fmt.Sprintf("%s-%s-%d-%s", pipelineName, spec.Name, replica, sourceName) + clientID := fmt.Sprintf("%s-%s-%d-source-%s", pipelineName, spec.Name, replica, sourceName) sc, err := stan.Connect(x.ClusterID, clientID, stan.NatsURL(x.NATSURL)) if err != nil { return fmt.Errorf("failed to connect to stan url=%s clusterID=%s clientID=%s subject=%s: %w", x.NATSURL, x.ClusterID, clientID, x.Subject, err) } closers = append(closers, sc.Close) - if sub, err := sc.QueueSubscribe(x.Subject, fmt.Sprintf("%s-%s", pipelineName, spec.Name), func(m *stan.Msg) { - _ = f(m.Data) - }, stan.DurableName(clientID)); err != nil { - return fmt.Errorf("failed to subscribe: %w", err) - } else { - closers = append(closers, sub.Close) - if replica == 0 { - go wait.JitterUntil(func() { - if pending, _, err := sub.Pending(); err != nil { - logger.Error(err, "failed to get pending", "subject", x.Subject) - } else { - debug.Info("setting pending", "subject", x.Subject, "pending", pending) - withLock(func() { sourceStatues.SetPending(sourceName, uint64(pending)) }) - } - }, updateInterval, 1.2, true, ctx.Done()) + for i := 0; i < int(x.Parallel); i++ { + if sub, err := sc.QueueSubscribe(x.Subject, fmt.Sprintf("%s-%s", pipelineName, spec.Name), func(m *stan.Msg) { + _ = f(m.Data) + }, stan.DurableName(clientID)); err != nil { + return fmt.Errorf("failed to subscribe: %w", err) + } else { + closers = append(closers, sub.Close) + if i == 0 && replica == 0 { + go wait.JitterUntil(func() { + if pending, _, err := sub.Pending(); err != nil { + logger.Error(err, "failed to get pending", "source", sourceName) + } else if pending >= 0 { + logger.Info("setting pending", "source", sourceName, "pending", pending) + withLock(func() { status.SourceStatuses.SetPending(sourceName, uint64(pending)) }) + } + }, updateInterval, 1.2, true, ctx.Done()) + } } } } else if x := source.Kafka; x != nil { @@ -298,32 +309,31 @@ func connectSources(ctx context.Context, toMain func([]byte) error) error { return err } closers = append(closers, client.Close) - group, err := sarama.NewConsumerGroup(x.Brokers, pipelineName+"-"+spec.Name, config) - if err != nil { - return fmt.Errorf("failed to create kafka consumer group: %w", err) - } - closers = append(closers, group.Close) - handler := &handler{f: f} - go wait.JitterUntil(func() { - if err := group.Consume(ctx, []string{x.Topic}, handler); err != nil { - logger.Error(err, "failed to create kafka consumer") + for i := 0; i < int(x.Parallel); i++ { + group, err := sarama.NewConsumerGroup(x.Brokers, pipelineName+"-"+spec.Name, config) + if err != nil { + return fmt.Errorf("failed to create kafka consumer group: %w", err) } - }, 10*time.Second, 1.2, true, ctx.Done()) - if replica == 0 { + closers = append(closers, group.Close) + handler := &handler{f: f} go wait.JitterUntil(func() { - if handler.offset > 0 { - withLock(func() { - newestOffset, err := client.GetOffset(x.Topic, handler.partition, sarama.OffsetNewest) + if err := group.Consume(ctx, []string{x.Topic}, handler); err != nil { + logger.Error(err, "failed to create kafka consumer") + } + }, 10*time.Second, 1.2, true, ctx.Done()) + if i == 0 && replica == 0 { + go wait.JitterUntil(func() { + if handler.offset > 0 { + nextOffset, err := client.GetOffset(x.Topic, handler.partition, sarama.OffsetNewest) if err != nil { - logger.Error(err, "failed to get offset", "topic", x.Topic) - } else if newestOffset > handler.offset { // zero implies we've not processed a message yet - pending := uint64(newestOffset - handler.offset) - debug.Info("setting pending", "type", "kafka", "topic", x.Topic, "pending", pending) - sourceStatues.SetPending(sourceName, pending) + logger.Error(err, "failed to get offset", "source", sourceName) + } else if pending := nextOffset - 1 - handler.offset; pending >= 0 { + logger.Info("setting pending", "source", sourceName, "pending", pending) + withLock(func() { status.SourceStatuses.SetPending(sourceName, uint64(pending)) }) } - }) - } - }, updateInterval, 1.2, true, ctx.Done()) + } + }, updateInterval, 1.2, true, ctx.Done()) + } } } else if x := source.HTTP; x != nil { http.HandleFunc("/sources/"+sourceName, func(w http.ResponseWriter, r *http.Request) { @@ -493,7 +503,7 @@ func connectSink() (func([]byte) error, error) { return nil, fmt.Errorf("duplicate sink named %q", sinkName) } if x := sink.STAN; x != nil { - clientID := fmt.Sprintf("%s-%s-%s", pipelineName, spec.Name, sinkName) + clientID := fmt.Sprintf("%s-%s-%d-sink-%s", pipelineName, spec.Name, replica, sinkName) sc, err := stan.Connect(x.ClusterID, clientID, stan.NatsURL(x.NATSURL)) if err != nil { return nil, fmt.Errorf("failed to connect to stan url=%s clusterID=%s clientID=%s subject=%s: %w", x.NATSURL, x.ClusterID, clientID, x.Subject, err) @@ -539,9 +549,9 @@ func connectSink() (func([]byte) error, error) { } return func(msg []byte) error { for sinkName, f := range sinks { - withLock(func() { sinkStatues.Set(sinkName, replica, printable(msg)) }) + withLock(func() { status.SinkStatues.Set(sinkName, replica, printable(msg)) }) if err := f(msg); err != nil { - withLock(func() { sinkStatues.IncErrors(sinkName, replica, err) }) + withLock(func() { status.SinkStatues.IncErrors(sinkName, replica, err) }) return err } } diff --git a/runner/util/spec.go b/runner/util/spec.go deleted file mode 100644 index 760dbdd3..00000000 --- a/runner/util/spec.go +++ /dev/null @@ -1,13 +0,0 @@ -package util - -import ( - "encoding/json" - "os" - - dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1" -) - -func UnmarshallSpec() (*dfv1.StepSpec, error) { - spec := &dfv1.StepSpec{} - return spec, json.Unmarshal([]byte(os.Getenv(dfv1.EnvStepSpec)), spec) -}