Skip to content

Commit ddb1021

Browse files
authored
feat: improve numa actions (#22835)
Signed-off-by: Dillen Padhiar <[email protected]>
1 parent b8051c6 commit ddb1021

File tree

32 files changed

+460
-280
lines changed

32 files changed

+460
-280
lines changed

docs/operator-manual/resource_actions_builtin.md

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
actionTests:
2+
- action: force-promote
3+
inputPath: testdata/isbservice.yaml
4+
expectedOutputPath: testdata/isbservice-force-promote.yaml
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
local actions = {}
2+
actions["force-promote"] = {
3+
["disabled"] = true,
4+
["iconClass"] = "fa-solid fa-fw fa-forward"
5+
}
6+
7+
-- force-promote
8+
local forcePromote = false
9+
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/upgrade-state"] == "in-progress") then
10+
forcePromote = true
11+
end
12+
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/force-promote"] == "true") then
13+
forcePromote = false
14+
end
15+
if forcePromote then
16+
actions["force-promote"]["disabled"] = false
17+
else
18+
actions["force-promote"]["disabled"] = true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if obj.metadata.labels == nil then
2+
obj.metadata.labels = {}
3+
end
4+
obj.metadata.labels["numaplane.numaproj.io/force-promote"] = "true"
5+
return obj
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
apiVersion: numaflow.numaproj.io/v1alpha1
2+
kind: InterStepBufferService
3+
metadata:
4+
creationTimestamp: '2025-04-28T22:39:27Z'
5+
finalizers:
6+
- numaflow.numaproj.io/isbsvc-controller
7+
generation: 1
8+
labels:
9+
numaplane.numaproj.io/force-promote: "true"
10+
numaplane.numaproj.io/parent-rollout-name: my-isbsvc
11+
numaplane.numaproj.io/upgrade-state: "in-progress"
12+
name: my-isbsvc-0
13+
namespace: demo
14+
ownerReferences:
15+
- apiVersion: numaplane.numaproj.io/v1alpha1
16+
blockOwnerDeletion: true
17+
controller: true
18+
kind: ISBServiceRollout
19+
name: my-isbsvc
20+
uid: b38035d8-546a-4f24-b1fa-7bb5b0a3a565
21+
resourceVersion: '1687384'
22+
uid: 889839c6-2982-4b70-b2a5-84afb4272ab6
23+
spec:
24+
jetstream:
25+
persistence:
26+
volumeSize: 1Gi
27+
replicas: 1
28+
version: 2.10.3
29+
status:
30+
conditions:
31+
- lastTransitionTime: '2025-04-28T22:39:57Z'
32+
message: |
33+
partitioned roll out complete: 1 new pods have been updated...
34+
reason: Healthy
35+
status: 'True'
36+
type: ChildrenResourcesHealthy
37+
- lastTransitionTime: '2025-04-28T22:39:57Z'
38+
message: Successful
39+
reason: Successful
40+
status: 'True'
41+
type: Configured
42+
- lastTransitionTime: '2025-04-28T22:39:57Z'
43+
message: Successful
44+
reason: Successful
45+
status: 'True'
46+
type: Deployed
47+
config:
48+
jetstream:
49+
auth:
50+
basic:
51+
password:
52+
key: client-auth-password
53+
name: isbsvc-my-isbsvc-0-js-client-auth
54+
user:
55+
key: client-auth-user
56+
name: isbsvc-my-isbsvc-0-js-client-auth
57+
streamConfig: |
58+
consumer:
59+
ackwait: 60s
60+
maxackpending: 25000
61+
otbucket:
62+
history: 1
63+
maxbytes: 0
64+
maxvaluesize: 0
65+
replicas: 1
66+
storage: 0
67+
ttl: 3h
68+
procbucket:
69+
history: 1
70+
maxbytes: 0
71+
maxvaluesize: 0
72+
replicas: 1
73+
storage: 0
74+
ttl: 72h
75+
stream:
76+
duplicates: 60s
77+
maxage: 72h
78+
maxbytes: -1
79+
maxmsgs: 100000
80+
replicas: 1
81+
retention: 0
82+
storage: 0
83+
url: nats://isbsvc-my-isbsvc-0-js-svc.demo.svc:4222
84+
observedGeneration: 1
85+
phase: Running
86+
type: jetstream
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
apiVersion: numaflow.numaproj.io/v1alpha1
2+
kind: InterStepBufferService
3+
metadata:
4+
creationTimestamp: '2025-04-28T22:39:27Z'
5+
finalizers:
6+
- numaflow.numaproj.io/isbsvc-controller
7+
generation: 1
8+
labels:
9+
numaplane.numaproj.io/parent-rollout-name: my-isbsvc
10+
numaplane.numaproj.io/upgrade-state: "in-progress"
11+
name: my-isbsvc-0
12+
namespace: demo
13+
ownerReferences:
14+
- apiVersion: numaplane.numaproj.io/v1alpha1
15+
blockOwnerDeletion: true
16+
controller: true
17+
kind: ISBServiceRollout
18+
name: my-isbsvc
19+
uid: b38035d8-546a-4f24-b1fa-7bb5b0a3a565
20+
resourceVersion: '1687384'
21+
uid: 889839c6-2982-4b70-b2a5-84afb4272ab6
22+
spec:
23+
jetstream:
24+
persistence:
25+
volumeSize: 1Gi
26+
replicas: 1
27+
version: 2.10.3
28+
status:
29+
conditions:
30+
- lastTransitionTime: '2025-04-28T22:39:57Z'
31+
message: |
32+
partitioned roll out complete: 1 new pods have been updated...
33+
reason: Healthy
34+
status: 'True'
35+
type: ChildrenResourcesHealthy
36+
- lastTransitionTime: '2025-04-28T22:39:57Z'
37+
message: Successful
38+
reason: Successful
39+
status: 'True'
40+
type: Configured
41+
- lastTransitionTime: '2025-04-28T22:39:57Z'
42+
message: Successful
43+
reason: Successful
44+
status: 'True'
45+
type: Deployed
46+
config:
47+
jetstream:
48+
auth:
49+
basic:
50+
password:
51+
key: client-auth-password
52+
name: isbsvc-my-isbsvc-0-js-client-auth
53+
user:
54+
key: client-auth-user
55+
name: isbsvc-my-isbsvc-0-js-client-auth
56+
streamConfig: |
57+
consumer:
58+
ackwait: 60s
59+
maxackpending: 25000
60+
otbucket:
61+
history: 1
62+
maxbytes: 0
63+
maxvaluesize: 0
64+
replicas: 1
65+
storage: 0
66+
ttl: 3h
67+
procbucket:
68+
history: 1
69+
maxbytes: 0
70+
maxvaluesize: 0
71+
replicas: 1
72+
storage: 0
73+
ttl: 72h
74+
stream:
75+
duplicates: 60s
76+
maxage: 72h
77+
maxbytes: -1
78+
maxmsgs: 100000
79+
replicas: 1
80+
retention: 0
81+
storage: 0
82+
url: nats://isbsvc-my-isbsvc-0-js-svc.demo.svc:4222
83+
observedGeneration: 1
84+
phase: Running
85+
type: jetstream

resource_customizations/numaflow.numaproj.io/MonoVertex/actions/action_test.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ actionTests:
44
expectedOutputPath: testdata/monovertex-paused.yaml
55
- action: unpause
66
inputPath: testdata/monovertex-paused.yaml
7-
expectedOutputPath: testdata/monovertex.yaml
7+
expectedOutputPath: testdata/monovertex.yaml
8+
- action: force-promote
9+
inputPath: testdata/monovertex.yaml
10+
expectedOutputPath: testdata/monovertex-force-promote.yaml
Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
local actions = {}
2-
actions["pause"] = {["disabled"] = true}
3-
actions["unpause"] = {["disabled"] = true}
2+
actions["pause"] = {
3+
["disabled"] = true,
4+
["iconClass"] = "fa-solid fa-fw fa-pause"
5+
}
6+
actions["unpause"] = {
7+
["disabled"] = true,
8+
["iconClass"] = "fa-solid fa-fw fa-play"
9+
}
10+
actions["force-promote"] = {
11+
["disabled"] = true,
12+
["iconClass"] = "fa-solid fa-fw fa-forward"
13+
}
414

15+
-- pause/unpause
516
local paused = false
617
if obj.spec.lifecycle ~= nil and obj.spec.lifecycle.desiredPhase ~= nil and obj.spec.lifecycle.desiredPhase == "Paused" then
718
paused = true
@@ -10,4 +21,17 @@ if paused then
1021
actions["unpause"]["disabled"] = false
1122
else
1223
actions["pause"]["disabled"] = false
13-
end
24+
end
25+
26+
-- force-promote
27+
local forcePromote = false
28+
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/upgrade-state"] == "in-progress") then
29+
forcePromote = true
30+
end
31+
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/force-promote"] == "true") then
32+
forcePromote = false
33+
end
34+
if forcePromote then
35+
actions["force-promote"]["disabled"] = false
36+
else
37+
actions["force-promote"]["disabled"] = true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if obj.metadata.labels == nil then
2+
obj.metadata.labels = {}
3+
end
4+
obj.metadata.labels["numaplane.numaproj.io/force-promote"] = "true"
5+
return obj
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
apiVersion: numaflow.numaproj.io/v1alpha1
2+
kind: MonoVertex
3+
metadata:
4+
creationTimestamp: "2024-10-09T21:18:37Z"
5+
generation: 1
6+
name: simple-mono-vertex
7+
namespace: numaflow-system
8+
resourceVersion: "1382"
9+
uid: b7b9e4f8-cd4b-4771-9e4b-2880cc50467a
10+
labels:
11+
numaplane.numaproj.io/force-promote: "true"
12+
numaplane.numaproj.io/upgrade-state: "in-progress"
13+
spec:
14+
lifecycle:
15+
desiredPhase: Running
16+
replicas: 1
17+
sink:
18+
udsink:
19+
container:
20+
image: quay.io/numaio/numaflow-java/simple-sink:stable
21+
source:
22+
transformer:
23+
container:
24+
image: quay.io/numaio/numaflow-rs/source-transformer-now:stable
25+
udsource:
26+
container:
27+
image: quay.io/numaio/numaflow-java/source-simple-source:stable
28+
updateStrategy:
29+
rollingUpdate:
30+
maxUnavailable: 25%
31+
type: RollingUpdate
32+
status:
33+
conditions:
34+
- lastTransitionTime: "2024-10-09T21:18:41Z"
35+
message: Successful
36+
reason: Successful
37+
status: "True"
38+
type: DaemonHealthy
39+
- lastTransitionTime: "2024-10-09T21:18:37Z"
40+
message: Successful
41+
reason: Successful
42+
status: "True"
43+
type: Deployed
44+
- lastTransitionTime: "2024-10-09T21:18:37Z"
45+
message: All pods are healthy
46+
reason: Running
47+
status: "True"
48+
type: PodsHealthy
49+
currentHash: 8ed34d9058faa60997ee13083ccb3d80691df37b45a34eaa347af99f237e8df6
50+
desiredReplicas: 1
51+
lastScaledAt: "2024-10-09T21:18:37Z"
52+
lastUpdated: "2024-10-09T21:18:41Z"
53+
observedGeneration: 1
54+
phase: Running
55+
replicas: 1
56+
selector: app.kubernetes.io/component=mono-vertex,numaflow.numaproj.io/mono-vertex-name=simple-mono-vertex
57+
updateHash: 8ed34d9058faa60997ee13083ccb3d80691df37b45a34eaa347af99f237e8df6
58+
updatedReplicas: 1

0 commit comments

Comments
 (0)