Skip to content

Commit 73f4dd2

Browse files
vaibhavtiwari33yhl25vigith
authored
feat: enable map in monovertex (numaproj#2994)
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com> Signed-off-by: Yashash H L <yashashhl25@gmail.com> Signed-off-by: Vigith Maurice <vigith@gmail.com> Co-authored-by: Yashash H L <yashashhl25@gmail.com> Co-authored-by: Vigith Maurice <vigith@gmail.com>
1 parent f438691 commit 73f4dd2

21 files changed

Lines changed: 2330 additions & 604 deletions

File tree

api/json-schema/schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21263,6 +21263,9 @@
2126321263
},
2126421264
"type": "array"
2126521265
},
21266+
"udf": {
21267+
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.UDF"
21268+
},
2126621269
"updateStrategy": {
2126721270
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.UpdateStrategy",
2126821271
"description": "The strategy to use to replace existing pods with new ones."

api/openapi-spec/swagger.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21259,6 +21259,9 @@
2125921259
"$ref": "#/definitions/io.k8s.api.core.v1.Toleration"
2126021260
}
2126121261
},
21262+
"udf": {
21263+
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.UDF"
21264+
},
2126221265
"updateStrategy": {
2126321266
"description": "The strategy to use to replace existing pods with new ones.",
2126421267
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.UpdateStrategy"

config/base/crds/full/numaflow.numaproj.io_monovertices.yaml

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

config/install.yaml

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

config/namespace-install.yaml

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

docs/APIs.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6049,6 +6049,21 @@ Refer to the Kubernetes API documentation for the fields of the
60496049

60506050
<td>
60516051

6052+
<code>udf</code></br> <em> <a href="#numaflow.numaproj.io/v1alpha1.UDF">
6053+
UDF </a> </em>
6054+
</td>
6055+
6056+
<td>
6057+
6058+
<em>(Optional)</em>
6059+
</td>
6060+
6061+
</tr>
6062+
6063+
<tr>
6064+
6065+
<td>
6066+
60526067
<code>AbstractPodTemplate</code></br> <em>
60536068
<a href="#numaflow.numaproj.io/v1alpha1.AbstractPodTemplate">
60546069
AbstractPodTemplate </a> </em>
@@ -6546,6 +6561,21 @@ Description
65466561

65476562
<td>
65486563

6564+
<code>udf</code></br> <em> <a href="#numaflow.numaproj.io/v1alpha1.UDF">
6565+
UDF </a> </em>
6566+
</td>
6567+
6568+
<td>
6569+
6570+
<em>(Optional)</em>
6571+
</td>
6572+
6573+
</tr>
6574+
6575+
<tr>
6576+
6577+
<td>
6578+
65496579
<code>AbstractPodTemplate</code></br> <em>
65506580
<a href="#numaflow.numaproj.io/v1alpha1.AbstractPodTemplate">
65516581
AbstractPodTemplate </a> </em>
@@ -13142,7 +13172,8 @@ UDF
1314213172
<p>
1314313173

1314413174
(<em>Appears on:</em>
13145-
<a href="#numaflow.numaproj.io/v1alpha1.AbstractVertex">AbstractVertex</a>)
13175+
<a href="#numaflow.numaproj.io/v1alpha1.AbstractVertex">AbstractVertex</a>,
13176+
<a href="#numaflow.numaproj.io/v1alpha1.MonoVertexSpec">MonoVertexSpec</a>)
1314613177
</p>
1314713178

1314813179
<p>

pkg/apis/numaflow/v1alpha1/generated.pb.go

Lines changed: 606 additions & 553 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/numaflow/v1alpha1/generated.proto

Lines changed: 13 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/numaflow/v1alpha1/mono_vertex_types.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -482,38 +482,40 @@ type MonoVertexSpec struct {
482482
Source *Source `json:"source,omitempty" protobuf:"bytes,2,opt,name=source"`
483483
Sink *Sink `json:"sink,omitempty" protobuf:"bytes,3,opt,name=sink"`
484484
// +optional
485-
AbstractPodTemplate `json:",inline" protobuf:"bytes,4,opt,name=abstractPodTemplate"`
485+
UDF *UDF `json:"udf,omitempty" protobuf:"bytes,4,opt,name=udf"`
486+
// +optional
487+
AbstractPodTemplate `json:",inline" protobuf:"bytes,5,opt,name=abstractPodTemplate"`
486488
// Container template for the main numa container.
487489
// +optional
488-
ContainerTemplate *ContainerTemplate `json:"containerTemplate,omitempty" protobuf:"bytes,5,opt,name=containerTemplate"`
490+
ContainerTemplate *ContainerTemplate `json:"containerTemplate,omitempty" protobuf:"bytes,6,opt,name=containerTemplate"`
489491
// +optional
490492
// +patchStrategy=merge
491493
// +patchMergeKey=name
492-
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,6,rep,name=volumes"`
494+
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=volumes"`
493495
// Limits define the limitations such as read batch size for the mono vertex.
494496
// +optional
495-
Limits *MonoVertexLimits `json:"limits,omitempty" protobuf:"bytes,7,opt,name=limits"`
497+
Limits *MonoVertexLimits `json:"limits,omitempty" protobuf:"bytes,8,opt,name=limits"`
496498
// Settings for autoscaling
497499
// +optional
498-
Scale Scale `json:"scale,omitempty" protobuf:"bytes,8,opt,name=scale"`
500+
Scale Scale `json:"scale,omitempty" protobuf:"bytes,9,opt,name=scale"`
499501
// List of customized init containers belonging to the pod.
500502
// More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
501503
// +optional
502-
InitContainers []corev1.Container `json:"initContainers,omitempty" protobuf:"bytes,9,rep,name=initContainers"`
504+
InitContainers []corev1.Container `json:"initContainers,omitempty" protobuf:"bytes,10,rep,name=initContainers"`
503505
// List of customized sidecar containers belonging to the pod.
504506
// +optional
505-
Sidecars []corev1.Container `json:"sidecars,omitempty" protobuf:"bytes,10,rep,name=sidecars"`
507+
Sidecars []corev1.Container `json:"sidecars,omitempty" protobuf:"bytes,11,rep,name=sidecars"`
506508
// Template for the daemon service deployment.
507509
// +optional
508-
DaemonTemplate *DaemonTemplate `json:"daemonTemplate,omitempty" protobuf:"bytes,11,opt,name=daemonTemplate"`
510+
DaemonTemplate *DaemonTemplate `json:"daemonTemplate,omitempty" protobuf:"bytes,12,opt,name=daemonTemplate"`
509511
// The strategy to use to replace existing pods with new ones.
510512
// +kubebuilder:default={"type": "RollingUpdate", "rollingUpdate": {"maxUnavailable": "25%"}}
511513
// +optional
512-
UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,12,opt,name=updateStrategy"`
514+
UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,13,opt,name=updateStrategy"`
513515
// Lifecycle defines the Lifecycle properties of a MonoVertex
514516
// +kubebuilder:default={"desiredPhase": Running}
515517
// +optional
516-
Lifecycle MonoVertexLifecycle `json:"lifecycle,omitempty" protobuf:"bytes,13,opt,name=lifecycle"`
518+
Lifecycle MonoVertexLifecycle `json:"lifecycle,omitempty" protobuf:"bytes,14,opt,name=lifecycle"`
517519
}
518520

519521
func (mvspec MonoVertexSpec) DeepCopyWithoutReplicas() MonoVertexSpec {
@@ -537,6 +539,9 @@ func (mvspec MonoVertexSpec) buildContainers(req getContainerReq) ([]corev1.Cont
537539
if mvspec.Source.UDSource != nil { // Only support UDSource for now.
538540
sidecarContainers = append(sidecarContainers, mvspec.Source.getUDSourceContainer(req))
539541
}
542+
if mvspec.UDF != nil {
543+
sidecarContainers = append(sidecarContainers, mvspec.UDF.getUDFContainer(req))
544+
}
540545
if mvspec.Source.UDTransformer != nil {
541546
sidecarContainers = append(sidecarContainers, mvspec.Source.getUDTransformerContainer(req))
542547
}

pkg/apis/numaflow/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)