From aabb8af0a9dee4338c2ece6c35eaee4f4a169a20 Mon Sep 17 00:00:00 2001
From: Derek Wang
Date: Thu, 31 Aug 2023 08:19:37 -0700
Subject: [PATCH] feat: scaleUpCooldownSeconds and scaleDownCooldownSeconds to
replace cooldownSeconds (#1008)
Signed-off-by: Derek Wang
---
api/json-schema/schema.json | 12 +-
api/openapi-spec/swagger.json | 12 +-
.../full/numaflow.numaproj.io_pipelines.yaml | 6 +
.../full/numaflow.numaproj.io_vertices.yaml | 6 +
config/install.yaml | 12 +
config/namespace-install.yaml | 12 +
docs/APIs.md | 29 +-
docs/user-guide/reference/autoscaling.md | 7 +-
pkg/apis/numaflow/v1alpha1/generated.pb.go | 289 +++++++++++-------
pkg/apis/numaflow/v1alpha1/generated.proto | 13 +-
.../numaflow/v1alpha1/openapi_generated.go | 16 +-
pkg/apis/numaflow/v1alpha1/vertex_types.go | 32 +-
.../numaflow/v1alpha1/vertex_types_test.go | 12 +-
.../v1alpha1/zz_generated.deepcopy.go | 14 +-
pkg/reconciler/vertex/scaling/scaling.go | 55 ++--
15 files changed, 373 insertions(+), 154 deletions(-)
diff --git a/api/json-schema/schema.json b/api/json-schema/schema.json
index 1728b25eb2..ca13ed2b51 100644
--- a/api/json-schema/schema.json
+++ b/api/json-schema/schema.json
@@ -19063,7 +19063,7 @@
"description": "Scale defines the parameters for autoscaling.",
"properties": {
"cooldownSeconds": {
- "description": "Cooldown seconds after a scaling operation before another one.",
+ "description": "Deprecated: Use scaleUpCooldownSeconds and scaleDownCooldownSeconds instead. Cooldown seconds after a scaling operation before another one.",
"format": "int64",
"type": "integer"
},
@@ -19091,6 +19091,16 @@
"format": "int64",
"type": "integer"
},
+ "scaleDownCooldownSeconds": {
+ "description": "ScaleDownCooldownSeconds defines the cooldown seconds after a scaling operation, before a follow-up scaling down. It defaults to the CooldownSeconds if not set.",
+ "format": "int64",
+ "type": "integer"
+ },
+ "scaleUpCooldownSeconds": {
+ "description": "ScaleUpCooldownSeconds defines the cooldown seconds after a scaling operation, before a follow-up scaling up. It defaults to the CooldownSeconds if not set.",
+ "format": "int64",
+ "type": "integer"
+ },
"targetBufferAvailability": {
"description": "TargetBufferAvailability is used to define the target percentage of the buffer availability. A valid and meaningful value should be less than the BufferUsageLimit defined in the Edge spec (or Pipeline spec), for example, 50. It only applies to UDF and Sink vertices because only they have buffers to read.",
"format": "int64",
diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json
index 1d265f819f..7f4d697f91 100644
--- a/api/openapi-spec/swagger.json
+++ b/api/openapi-spec/swagger.json
@@ -19050,7 +19050,7 @@
"type": "object",
"properties": {
"cooldownSeconds": {
- "description": "Cooldown seconds after a scaling operation before another one.",
+ "description": "Deprecated: Use scaleUpCooldownSeconds and scaleDownCooldownSeconds instead. Cooldown seconds after a scaling operation before another one.",
"type": "integer",
"format": "int64"
},
@@ -19078,6 +19078,16 @@
"type": "integer",
"format": "int64"
},
+ "scaleDownCooldownSeconds": {
+ "description": "ScaleDownCooldownSeconds defines the cooldown seconds after a scaling operation, before a follow-up scaling down. It defaults to the CooldownSeconds if not set.",
+ "type": "integer",
+ "format": "int64"
+ },
+ "scaleUpCooldownSeconds": {
+ "description": "ScaleUpCooldownSeconds defines the cooldown seconds after a scaling operation, before a follow-up scaling up. It defaults to the CooldownSeconds if not set.",
+ "type": "integer",
+ "format": "int64"
+ },
"targetBufferAvailability": {
"description": "TargetBufferAvailability is used to define the target percentage of the buffer availability. A valid and meaningful value should be less than the BufferUsageLimit defined in the Edge spec (or Pipeline spec), for example, 50. It only applies to UDF and Sink vertices because only they have buffers to read.",
"type": "integer",
diff --git a/config/base/crds/full/numaflow.numaproj.io_pipelines.yaml b/config/base/crds/full/numaflow.numaproj.io_pipelines.yaml
index 9df4a3969d..5d06f3012f 100644
--- a/config/base/crds/full/numaflow.numaproj.io_pipelines.yaml
+++ b/config/base/crds/full/numaflow.numaproj.io_pipelines.yaml
@@ -5687,6 +5687,12 @@ spec:
replicasPerScale:
format: int32
type: integer
+ scaleDownCooldownSeconds:
+ format: int32
+ type: integer
+ scaleUpCooldownSeconds:
+ format: int32
+ type: integer
targetBufferAvailability:
format: int32
type: integer
diff --git a/config/base/crds/full/numaflow.numaproj.io_vertices.yaml b/config/base/crds/full/numaflow.numaproj.io_vertices.yaml
index 909383a310..71f00964a3 100644
--- a/config/base/crds/full/numaflow.numaproj.io_vertices.yaml
+++ b/config/base/crds/full/numaflow.numaproj.io_vertices.yaml
@@ -1530,6 +1530,12 @@ spec:
replicasPerScale:
format: int32
type: integer
+ scaleDownCooldownSeconds:
+ format: int32
+ type: integer
+ scaleUpCooldownSeconds:
+ format: int32
+ type: integer
targetBufferAvailability:
format: int32
type: integer
diff --git a/config/install.yaml b/config/install.yaml
index 31397588b8..ee46de76da 100644
--- a/config/install.yaml
+++ b/config/install.yaml
@@ -8216,6 +8216,12 @@ spec:
replicasPerScale:
format: int32
type: integer
+ scaleDownCooldownSeconds:
+ format: int32
+ type: integer
+ scaleUpCooldownSeconds:
+ format: int32
+ type: integer
targetBufferAvailability:
format: int32
type: integer
@@ -12871,6 +12877,12 @@ spec:
replicasPerScale:
format: int32
type: integer
+ scaleDownCooldownSeconds:
+ format: int32
+ type: integer
+ scaleUpCooldownSeconds:
+ format: int32
+ type: integer
targetBufferAvailability:
format: int32
type: integer
diff --git a/config/namespace-install.yaml b/config/namespace-install.yaml
index c13cc30c56..01dd6ec22a 100644
--- a/config/namespace-install.yaml
+++ b/config/namespace-install.yaml
@@ -8216,6 +8216,12 @@ spec:
replicasPerScale:
format: int32
type: integer
+ scaleDownCooldownSeconds:
+ format: int32
+ type: integer
+ scaleUpCooldownSeconds:
+ format: int32
+ type: integer
targetBufferAvailability:
format: int32
type: integer
@@ -12871,6 +12877,12 @@ spec:
replicasPerScale:
format: int32
type: integer
+ scaleDownCooldownSeconds:
+ format: int32
+ type: integer
+ scaleUpCooldownSeconds:
+ format: int32
+ type: integer
targetBufferAvailability:
format: int32
type: integer
diff --git a/docs/APIs.md b/docs/APIs.md
index a02f549e6a..49634a3758 100644
--- a/docs/APIs.md
+++ b/docs/APIs.md
@@ -4054,7 +4054,8 @@ processing rate.
(Optional)
-Cooldown seconds after a scaling operation before another one.
+Deprecated: Use scaleUpCooldownSeconds and scaleDownCooldownSeconds
+instead. Cooldown seconds after a scaling operation before another one.
|
@@ -4112,6 +4113,32 @@ once. The is use to prevent too aggressive scaling operations
+
+
+scaleUpCooldownSeconds uint32
+ |
+
+(Optional)
+
+ScaleUpCooldownSeconds defines the cooldown seconds after a scaling
+operation, before a follow-up scaling up. It defaults to the
+CooldownSeconds if not set.
+
+ |
+
+
+
+scaleDownCooldownSeconds uint32
+ |
+
+(Optional)
+
+ScaleDownCooldownSeconds defines the cooldown seconds after a scaling
+operation, before a follow-up scaling down. It defaults to the
+CooldownSeconds if not set.
+
+ |
+