Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/operator-manual/resource_actions_builtin.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
actionTests:
- action: force-promote
inputPath: testdata/isbservice.yaml
expectedOutputPath: testdata/isbservice-force-promote.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local actions = {}
actions["force-promote"] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not clear on the difference between this "force-promote" action and "enable-force-promote" ? Maybe add some comment somewhere to explain this and why we will replace that action with this one

Copy link
Contributor

@juliev0 juliev0 May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main motivation is so it's more of a one time action than a state which can be enabled and disabled.

When we "enable force promote" on the ISBServiceRollout/PipelineRollout/MonoVertexRollout, then the user needs to remember to "disable force promote" after. If instead it's a one time action on the individual child object, it can happen once with no other action that needs to be taken (because the next time there's a new upgrade, it would be a new child).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the plan will be to remove the "Enable Force Promote" and "Disable Force Promote" in a later PR.

["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-forward"
}

-- force-promote
local forcePromote = false
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/upgrade-state"] == "in-progress") then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be good to do some status/health checks on the resource before these?
i.e. obj.status.health ~= nil and obj.status.health.status == "Degraded"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we don't require the resource to be in a Degraded state in order to force promote it. It could have just started being assessed for example.

forcePromote = true
end
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/force-promote"] == "true") then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this and the others, can we only show it if the "upgrade-state" label is set to "in-progress"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good now, thanks

forcePromote = false
end
if forcePromote then
actions["force-promote"]["disabled"] = false
else
actions["force-promote"]["disabled"] = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if obj.metadata.labels == nil then
obj.metadata.labels = {}
end
obj.metadata.labels["numaplane.numaproj.io/force-promote"] = "true"
return obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: InterStepBufferService
metadata:
creationTimestamp: '2025-04-28T22:39:27Z'
finalizers:
- numaflow.numaproj.io/isbsvc-controller
generation: 1
labels:
numaplane.numaproj.io/force-promote: "true"
numaplane.numaproj.io/parent-rollout-name: my-isbsvc
numaplane.numaproj.io/upgrade-state: "in-progress"
name: my-isbsvc-0
namespace: demo
ownerReferences:
- apiVersion: numaplane.numaproj.io/v1alpha1
blockOwnerDeletion: true
controller: true
kind: ISBServiceRollout
name: my-isbsvc
uid: b38035d8-546a-4f24-b1fa-7bb5b0a3a565
resourceVersion: '1687384'
uid: 889839c6-2982-4b70-b2a5-84afb4272ab6
spec:
jetstream:
persistence:
volumeSize: 1Gi
replicas: 1
version: 2.10.3
status:
conditions:
- lastTransitionTime: '2025-04-28T22:39:57Z'
message: |
partitioned roll out complete: 1 new pods have been updated...
reason: Healthy
status: 'True'
type: ChildrenResourcesHealthy
- lastTransitionTime: '2025-04-28T22:39:57Z'
message: Successful
reason: Successful
status: 'True'
type: Configured
- lastTransitionTime: '2025-04-28T22:39:57Z'
message: Successful
reason: Successful
status: 'True'
type: Deployed
config:
jetstream:
auth:
basic:
password:
key: client-auth-password
name: isbsvc-my-isbsvc-0-js-client-auth
user:
key: client-auth-user
name: isbsvc-my-isbsvc-0-js-client-auth
streamConfig: |
consumer:
ackwait: 60s
maxackpending: 25000
otbucket:
history: 1
maxbytes: 0
maxvaluesize: 0
replicas: 1
storage: 0
ttl: 3h
procbucket:
history: 1
maxbytes: 0
maxvaluesize: 0
replicas: 1
storage: 0
ttl: 72h
stream:
duplicates: 60s
maxage: 72h
maxbytes: -1
maxmsgs: 100000
replicas: 1
retention: 0
storage: 0
url: nats://isbsvc-my-isbsvc-0-js-svc.demo.svc:4222
observedGeneration: 1
phase: Running
type: jetstream
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: InterStepBufferService
metadata:
creationTimestamp: '2025-04-28T22:39:27Z'
finalizers:
- numaflow.numaproj.io/isbsvc-controller
generation: 1
labels:
numaplane.numaproj.io/parent-rollout-name: my-isbsvc
numaplane.numaproj.io/upgrade-state: "in-progress"
name: my-isbsvc-0
namespace: demo
ownerReferences:
- apiVersion: numaplane.numaproj.io/v1alpha1
blockOwnerDeletion: true
controller: true
kind: ISBServiceRollout
name: my-isbsvc
uid: b38035d8-546a-4f24-b1fa-7bb5b0a3a565
resourceVersion: '1687384'
uid: 889839c6-2982-4b70-b2a5-84afb4272ab6
spec:
jetstream:
persistence:
volumeSize: 1Gi
replicas: 1
version: 2.10.3
status:
conditions:
- lastTransitionTime: '2025-04-28T22:39:57Z'
message: |
partitioned roll out complete: 1 new pods have been updated...
reason: Healthy
status: 'True'
type: ChildrenResourcesHealthy
- lastTransitionTime: '2025-04-28T22:39:57Z'
message: Successful
reason: Successful
status: 'True'
type: Configured
- lastTransitionTime: '2025-04-28T22:39:57Z'
message: Successful
reason: Successful
status: 'True'
type: Deployed
config:
jetstream:
auth:
basic:
password:
key: client-auth-password
name: isbsvc-my-isbsvc-0-js-client-auth
user:
key: client-auth-user
name: isbsvc-my-isbsvc-0-js-client-auth
streamConfig: |
consumer:
ackwait: 60s
maxackpending: 25000
otbucket:
history: 1
maxbytes: 0
maxvaluesize: 0
replicas: 1
storage: 0
ttl: 3h
procbucket:
history: 1
maxbytes: 0
maxvaluesize: 0
replicas: 1
storage: 0
ttl: 72h
stream:
duplicates: 60s
maxage: 72h
maxbytes: -1
maxmsgs: 100000
replicas: 1
retention: 0
storage: 0
url: nats://isbsvc-my-isbsvc-0-js-svc.demo.svc:4222
observedGeneration: 1
phase: Running
type: jetstream
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ actionTests:
expectedOutputPath: testdata/monovertex-paused.yaml
- action: unpause
inputPath: testdata/monovertex-paused.yaml
expectedOutputPath: testdata/monovertex.yaml
expectedOutputPath: testdata/monovertex.yaml
- action: force-promote
inputPath: testdata/monovertex.yaml
expectedOutputPath: testdata/monovertex-force-promote.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
local actions = {}
actions["pause"] = {["disabled"] = true}
actions["unpause"] = {["disabled"] = true}
actions["pause"] = {
["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-pause"
}
actions["unpause"] = {
["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["force-promote"] = {
["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-forward"
}

-- pause/unpause
local paused = false
if obj.spec.lifecycle ~= nil and obj.spec.lifecycle.desiredPhase ~= nil and obj.spec.lifecycle.desiredPhase == "Paused" then
paused = true
Expand All @@ -10,4 +21,17 @@ if paused then
actions["unpause"]["disabled"] = false
else
actions["pause"]["disabled"] = false
end
end

-- force-promote
local forcePromote = false
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/upgrade-state"] == "in-progress") then
forcePromote = true
end
if (obj.metadata.labels ~= nil and obj.metadata.labels["numaplane.numaproj.io/force-promote"] == "true") then
forcePromote = false
end
if forcePromote then
actions["force-promote"]["disabled"] = false
else
actions["force-promote"]["disabled"] = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if obj.metadata.labels == nil then
obj.metadata.labels = {}
end
obj.metadata.labels["numaplane.numaproj.io/force-promote"] = "true"
return obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: MonoVertex
metadata:
creationTimestamp: "2024-10-09T21:18:37Z"
generation: 1
name: simple-mono-vertex
namespace: numaflow-system
resourceVersion: "1382"
uid: b7b9e4f8-cd4b-4771-9e4b-2880cc50467a
labels:
numaplane.numaproj.io/force-promote: "true"
numaplane.numaproj.io/upgrade-state: "in-progress"
spec:
lifecycle:
desiredPhase: Running
replicas: 1
sink:
udsink:
container:
image: quay.io/numaio/numaflow-java/simple-sink:stable
source:
transformer:
container:
image: quay.io/numaio/numaflow-rs/source-transformer-now:stable
udsource:
container:
image: quay.io/numaio/numaflow-java/source-simple-source:stable
updateStrategy:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
status:
conditions:
- lastTransitionTime: "2024-10-09T21:18:41Z"
message: Successful
reason: Successful
status: "True"
type: DaemonHealthy
- lastTransitionTime: "2024-10-09T21:18:37Z"
message: Successful
reason: Successful
status: "True"
type: Deployed
- lastTransitionTime: "2024-10-09T21:18:37Z"
message: All pods are healthy
reason: Running
status: "True"
type: PodsHealthy
currentHash: 8ed34d9058faa60997ee13083ccb3d80691df37b45a34eaa347af99f237e8df6
desiredReplicas: 1
lastScaledAt: "2024-10-09T21:18:37Z"
lastUpdated: "2024-10-09T21:18:41Z"
observedGeneration: 1
phase: Running
replicas: 1
selector: app.kubernetes.io/component=mono-vertex,numaflow.numaproj.io/mono-vertex-name=simple-mono-vertex
updateHash: 8ed34d9058faa60997ee13083ccb3d80691df37b45a34eaa347af99f237e8df6
updatedReplicas: 1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
namespace: numaflow-system
resourceVersion: "1382"
uid: b7b9e4f8-cd4b-4771-9e4b-2880cc50467a
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
spec:
lifecycle:
desiredPhase: Paused
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
namespace: numaflow-system
resourceVersion: "1382"
uid: b7b9e4f8-cd4b-4771-9e4b-2880cc50467a
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
spec:
lifecycle:
desiredPhase: Running
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ actionTests:
expectedOutputPath: testdata/pipeline-paused.yaml
- action: unpause
inputPath: testdata/pipeline-paused.yaml
expectedOutputPath: testdata/pipeline.yaml
expectedOutputPath: testdata/pipeline.yaml
- action: force-promote
inputPath: testdata/pipeline.yaml
expectedOutputPath: testdata/pipeline-force-promote.yaml
Loading
Loading