Repository: numaproj/numaflow
Pull request #318 (2022-11-05 00:50:39)

doc: add few use cases
Signed-off-by: Vigith Maurice <vigith@gmail.com>

It is good to call out some use cases so users can relate to some of their problems that can be solved via Numaflow.


Patch:
diff --git a/README.md b/README.md
index 72139ccb..eed5bdca 100644
--- a/README.md
+++ b/README.md
@@ -9,9 +9,18 @@
 
 ## Summary
 
-Numaflow is a Kubernetes-native tool for running massively parallel stream processing. A Numaflow Pipeline is implemented as a Kubernetes custom resource and consists of one or more source, data processing, and sink vertices.
+Numaflow is a Kubernetes-native tool for running massively parallel stream processing. A Numaflow Pipeline is implemented 
+as a Kubernetes custom resource and consists of one or more source, data processing, and sink vertices.
 
-Numaflow installs in a few minutes and is easier and cheaper to use for simple data processing applications than a full-featured stream processing platforms.
+Numaflow installs in a few minutes and is easier and cheaper to use for simple data processing applications than a 
+full-featured stream processing platforms.
+
+## Use Cases
+
+- Real-time data analytics applications. 
+- Event driven applications such as anomaly detection, monitoring and alerting. 
+- Streaming applications such as data instrumentation and data movement. 
+- Workflows running in a streaming manner.
 
 ## Key Features
 
diff --git a/docs/README.md b/docs/README.md
index 9990e4bd..36190d9b 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,8 +1,17 @@
 # Numaflow
 
-Numaflow is a Kubernetes-native tool for running massively parallel stream processing. A Numaflow Pipeline is implemented as a Kubernetes custom resource and consists of one or more source, data processing, and sink vertices.
+Numaflow is a Kubernetes-native tool for running massively parallel stream processing. A Numaflow Pipeline is implemented 
+as a Kubernetes custom resource and consists of one or more source, data processing, and sink vertices.
 
-Numaflow installs in a few minutes and is easier and cheaper to use for simple data processing applications than a full-featured stream processing platforms.
+Numaflow installs in a few minutes and is easier and cheaper to use for simple data processing applications than a full-featured 
+stream processing platforms.
+
+## Use Cases
+
+- Real-time data analytics applications.
+- Event driven applications such as anomaly detection, monitoring and alerting.
+- Streaming applications such as data instrumentation and data movement.
+- Workflows running in a streaming manner.
 
 ## Key Features
 
diff --git a/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service.go b/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service.go
index 5c891d85..7491f340 100644
--- a/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service.go
+++ b/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service.go
@@ -178,7 +178,7 @@ func (j JetStreamBufferService) GetStatefulSetSpec(req GetJetStreamStatefulSetSp
 				ServiceAccountName:            j.ServiceAccountName,
 				Affinity:                      j.Affinity,
 				ShareProcessNamespace:         pointer.Bool(true),
-				TerminationGracePeriodSeconds: pointer.Int64(60),
+				TerminationGracePeriodSeconds: pointer.Int64(120),
 				Volumes: []corev1.Volume{
 					{Name: "pid", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
 					{
@@ -229,6 +229,7 @@ func (j JetStreamBufferService) GetStatefulSetSpec(req GetJetStreamStatefulSetSp
 							{Name: "SERVER_NAME", Value: "$(POD_NAME)"},
 							{Name: "POD_NAMESPACE", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}},
 							{Name: "CLUSTER_ADVERTISE", Value: "$(POD_NAME)." + req.ServiceName + ".$(POD_NAMESPACE).svc.cluster.local"},
+							{Name: "GOMEMLIMIT", ValueFrom: &corev1.EnvVarSource{ResourceFieldRef: &corev1.ResourceFieldSelector{ContainerName: "main", Resource: "limits.memory"}}},
 							{Name: "JS_KEY", ValueFrom: &corev1.EnvVarSource{SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{Name: req.ServerEncryptionSecretName}, Key: JetStreamServerSecretEncryptionKey}}},
 						},
 						VolumeMounts: []corev1.VolumeMount{


Test patch:
diff --git a/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service_test.go b/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service_test.go
index c5749a21..d849bc9a 100644
--- a/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service_test.go
+++ b/pkg/apis/numaflow/v1alpha1/jetstream_buffer_service_test.go
@@ -61,7 +61,7 @@ func TestJetStreamGetStatefulSetSpec(t *testing.T) {
 		for _, e := range spec.Template.Spec.Containers[0].Env {
 			envNames = append(envNames, e.Name)
 		}
-		for _, e := range []string{"POD_NAME", "SERVER_NAME", "POD_NAMESPACE", "CLUSTER_ADVERTISE", "JS_KEY"} {
+		for _, e := range []string{"POD_NAME", "SERVER_NAME", "POD_NAMESPACE", "CLUSTER_ADVERTISE", "GOMEMLIMIT", "JS_KEY"} {
 			assert.Contains(t, envNames, e)
 		}
 	})
diff --git a/test/sdks-e2e/sdks_test.go b/test/sdks-e2e/sdks_test.go
index ffb989f1..a7eb12f9 100644
--- a/test/sdks-e2e/sdks_test.go
+++ b/test/sdks-e2e/sdks_test.go
@@ -54,8 +54,8 @@ func (s *SDKsSuite) TestUDFunctionAndSink() {
 		Expect().
 		Status(204)
 
-	w.Expect().VertexPodLogContains("go-udsink", "hello", PodLogCheckOptionWithContainer("udsink"), PodLogCheckOptionWithCount(3)).
-		VertexPodLogContains("python-udsink", "hello", PodLogCheckOptionWithContainer("udsink"), PodLogCheckOptionWithCount(3))
+	w.Expect().VertexPodLogContains("python-udsink", "hello", PodLogCheckOptionWithContainer("udsink"), PodLogCheckOptionWithCount(3)).
+		VertexPodLogContains("go-udsink", "hello", PodLogCheckOptionWithContainer("udsink"), PodLogCheckOptionWithCount(3))
 }
 
 func TestHTTPSuite(t *testing.T) {