feat: update unpause action for Numaproj CRDs (#24036)

Signed-off-by: Dillen Padhiar <dillen_padhiar@intuit.com>
This commit is contained in:
Dillen Padhiar
2025-08-18 12:12:46 -07:00
committed by GitHub
parent 70c8f4612f
commit 14a22ad926
36 changed files with 621 additions and 164 deletions

View File

@@ -2,9 +2,12 @@ actionTests:
- action: pause
inputPath: testdata/monovertex.yaml
expectedOutputPath: testdata/monovertex-paused.yaml
- action: unpause
- action: unpause-gradual
inputPath: testdata/monovertex-paused.yaml
expectedOutputPath: testdata/monovertex.yaml
expectedOutputPath: testdata/monovertex-unpause-gradual.yaml
- action: unpause-fast
inputPath: testdata/monovertex-paused.yaml
expectedOutputPath: testdata/monovertex-unpause-fast.yaml
- action: force-promote
inputPath: testdata/monovertex.yaml
expectedOutputPath: testdata/monovertex-force-promote.yaml

View File

@@ -3,12 +3,19 @@ actions["pause"] = {
["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-pause"
}
actions["unpause"] = {
actions["unpause-gradual"] = {
["disabled"] = true,
["displayName"] = "Unpause (gradual)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["unpause-fast"] = {
["disabled"] = true,
["displayName"] = "Unpause (fast)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["force-promote"] = {
["disabled"] = true,
["displayName"] = "Force Promote",
["iconClass"] = "fa-solid fa-fw fa-forward"
}
@@ -18,7 +25,20 @@ if obj.spec.lifecycle ~= nil and obj.spec.lifecycle.desiredPhase ~= nil and obj.
paused = true
end
if paused then
actions["unpause"]["disabled"] = false
if obj.spec.metadata ~= nil and obj.spec.metadata.annotations ~= nil and obj.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
-- determine which unpausing strategies will be enabled
-- if annotation not found, default will be resume slow
if obj.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
actions["unpause-fast"]["disabled"] = false
elseif obj.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
actions["unpause-gradual"]["disabled"] = false
actions["unpause-fast"]["disabled"] = false
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["pause"]["disabled"] = false
end

View File

@@ -9,6 +9,8 @@ metadata:
uid: b7b9e4f8-cd4b-4771-9e4b-2880cc50467a
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
lifecycle:
desiredPhase: Paused

View File

@@ -0,0 +1,59 @@
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/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
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

View File

@@ -0,0 +1,59 @@
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/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
lifecycle:
desiredPhase: Running
replicas: null
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

View File

@@ -9,6 +9,8 @@ metadata:
uid: b7b9e4f8-cd4b-4771-9e4b-2880cc50467a
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
lifecycle:
desiredPhase: Running

View File

@@ -2,9 +2,12 @@ actionTests:
- action: pause
inputPath: testdata/pipeline.yaml
expectedOutputPath: testdata/pipeline-paused.yaml
- action: unpause
- action: unpause-gradual
inputPath: testdata/pipeline-paused.yaml
expectedOutputPath: testdata/pipeline.yaml
expectedOutputPath: testdata/pipeline-unpause-gradual.yaml
- action: unpause-fast
inputPath: testdata/pipeline-paused.yaml
expectedOutputPath: testdata/pipeline-unpause-fast.yaml
- action: force-promote
inputPath: testdata/pipeline.yaml
expectedOutputPath: testdata/pipeline-force-promote.yaml

View File

@@ -3,12 +3,19 @@ actions["pause"] = {
["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-pause"
}
actions["unpause"] = {
actions["unpause-gradual"] = {
["disabled"] = true,
["displayName"] = "Unpause (gradual)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["unpause-fast"] = {
["disabled"] = true,
["displayName"] = "Unpause (fast)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["force-promote"] = {
["disabled"] = true,
["displayName"] = "Force Promote",
["iconClass"] = "fa-solid fa-fw fa-forward"
}
@@ -18,7 +25,20 @@ if obj.spec.lifecycle ~= nil and obj.spec.lifecycle.desiredPhase ~= nil and obj.
paused = true
end
if paused then
actions["unpause"]["disabled"] = false
if obj.spec.metadata ~= nil and obj.spec.metadata.annotations ~= nil and obj.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
-- determine which unpausing strategies will be enabled
-- if annotation not found, default will be resume slow
if obj.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
actions["unpause-fast"]["disabled"] = false
elseif obj.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
actions["unpause-gradual"]["disabled"] = false
actions["unpause-fast"]["disabled"] = false
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["pause"]["disabled"] = false
end

View File

@@ -11,6 +11,8 @@ metadata:
uid: bb6cc91c-eb05-4fe7-9380-63b9532a85db
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
edges:
- from: in

View File

@@ -0,0 +1,103 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
creationTimestamp: "2024-10-08T18:22:18Z"
finalizers:
- pipeline-controller
generation: 1
name: simple-pipeline
namespace: numaflow-system
resourceVersion: "382381"
uid: bb6cc91c-eb05-4fe7-9380-63b9532a85db
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
numaflow.numaproj.io/resume-strategy: "fast"
spec:
edges:
- from: in
to: cat
- from: cat
to: out
lifecycle:
deleteGracePeriodSeconds: 30
desiredPhase: Running
pauseGracePeriodSeconds: 30
limits:
bufferMaxLength: 30000
bufferUsageLimit: 80
readBatchSize: 500
readTimeout: 1s
vertices:
- name: in
scale:
min: 1
source:
generator:
duration: 1s
jitter: 0s
msgSize: 8
rpu: 5
updateStrategy:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
- name: cat
scale:
min: 1
udf:
builtin:
name: cat
updateStrategy:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
- name: out
scale:
min: 1
sink:
log: {}
updateStrategy:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
watermark:
disabled: false
maxDelay: 0s
status:
conditions:
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: Successful
reason: Successful
status: "True"
type: Configured
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: Successful
reason: Successful
status: "True"
type: DaemonServiceHealthy
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: Successful
reason: Successful
status: "True"
type: Deployed
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: No Side Inputs attached to the pipeline
reason: NoSideInputs
status: "True"
type: SideInputsManagersHealthy
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: All vertices are healthy
reason: Successful
status: "True"
type: VerticesHealthy
lastUpdated: "2024-10-09T20:26:54Z"
mapUDFCount: 1
observedGeneration: 1
phase: Running
reduceUDFCount: 0
sinkCount: 1
sourceCount: 1
udfCount: 1
vertexCount: 3

View File

@@ -0,0 +1,103 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
creationTimestamp: "2024-10-08T18:22:18Z"
finalizers:
- pipeline-controller
generation: 1
name: simple-pipeline
namespace: numaflow-system
resourceVersion: "382381"
uid: bb6cc91c-eb05-4fe7-9380-63b9532a85db
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
numaflow.numaproj.io/resume-strategy: "slow"
spec:
edges:
- from: in
to: cat
- from: cat
to: out
lifecycle:
deleteGracePeriodSeconds: 30
desiredPhase: Running
pauseGracePeriodSeconds: 30
limits:
bufferMaxLength: 30000
bufferUsageLimit: 80
readBatchSize: 500
readTimeout: 1s
vertices:
- name: in
scale:
min: 1
source:
generator:
duration: 1s
jitter: 0s
msgSize: 8
rpu: 5
updateStrategy:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
- name: cat
scale:
min: 1
udf:
builtin:
name: cat
updateStrategy:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
- name: out
scale:
min: 1
sink:
log: {}
updateStrategy:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
watermark:
disabled: false
maxDelay: 0s
status:
conditions:
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: Successful
reason: Successful
status: "True"
type: Configured
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: Successful
reason: Successful
status: "True"
type: DaemonServiceHealthy
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: Successful
reason: Successful
status: "True"
type: Deployed
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: No Side Inputs attached to the pipeline
reason: NoSideInputs
status: "True"
type: SideInputsManagersHealthy
- lastTransitionTime: "2024-10-09T20:26:54Z"
message: All vertices are healthy
reason: Successful
status: "True"
type: VerticesHealthy
lastUpdated: "2024-10-09T20:26:54Z"
mapUDFCount: 1
observedGeneration: 1
phase: Running
reduceUDFCount: 0
sinkCount: 1
sourceCount: 1
udfCount: 1
vertexCount: 3

View File

@@ -11,6 +11,8 @@ metadata:
uid: bb6cc91c-eb05-4fe7-9380-63b9532a85db
labels:
numaplane.numaproj.io/upgrade-state: "in-progress"
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
spec:
edges:
- from: in

View File

@@ -0,0 +1,6 @@
obj.spec.lifecycle.desiredPhase = "Running"
if obj.metadata.annotations == nil then
obj.metadata.annotations = {}
end
obj.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "fast"
return obj

View File

@@ -0,0 +1,6 @@
obj.spec.lifecycle.desiredPhase = "Running"
if obj.metadata.annotations == nil then
obj.metadata.annotations = {}
end
obj.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "slow"
return obj

View File

@@ -2,6 +2,9 @@ actionTests:
- action: pause
inputPath: testdata/MonoVertexRollout/rollout.yaml
expectedOutputPath: testdata/MonoVertexRollout/rollout-paused.yaml
- action: unpause
- action: unpause-gradual
inputPath: testdata/MonoVertexRollout/rollout-paused.yaml
expectedOutputPath: testdata/MonoVertexRollout/rollout-running.yaml
expectedOutputPath: testdata/MonoVertexRollout/rollout-running-gradual.yaml
- action: unpause-fast
inputPath: testdata/MonoVertexRollout/rollout-paused.yaml
expectedOutputPath: testdata/MonoVertexRollout/rollout-running-fast.yaml

View File

@@ -3,8 +3,14 @@ actions["pause"] = {
["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-pause"
}
actions["unpause"] = {
actions["unpause-gradual"] = {
["disabled"] = true,
["displayName"] = "Unpause (gradual)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["unpause-fast"] = {
["disabled"] = true,
["displayName"] = "Unpause (fast)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
@@ -14,7 +20,20 @@ if obj.spec.monoVertex.spec.lifecycle ~= nil and obj.spec.monoVertex.spec.lifecy
paused = true
end
if paused then
actions["unpause"]["disabled"] = false
if obj.spec.monoVertex.spec.metadata ~= nil and obj.spec.monoVertex.spec.metadata.annotations ~= nil and obj.spec.monoVertex.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
-- determine which unpausing strategies will be enabled
-- if annotation not found, default will be resume slow
if obj.spec.monoVertex.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
actions["unpause-fast"]["disabled"] = false
elseif obj.spec.monoVertex.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
actions["unpause-gradual"]["disabled"] = false
actions["unpause-fast"]["disabled"] = false
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["pause"]["disabled"] = false
end

View File

@@ -1,70 +0,0 @@
apiVersion: numaplane.numaproj.io/v1alpha1
kind: MonoVertexRollout
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"sink":{"udsink":{"container":{"image":"quay.io/numaio/numaflow-go/sink-log:stable"}}},"source":{"udsource":{"container":{"image":"quay.io/numaio/numaflow-go/source-simple-source:bad-image"}}}}},"strategy":{"progressive":{"assessmentSchedule":"60,60,10"}}}}
creationTimestamp: "2025-03-03T18:51:52Z"
finalizers:
- numaplane.numaproj.io/numaplane-controller
generation: 3
name: my-monovertex
namespace: example-namespace
resourceVersion: "314047"
uid: d948cd56-e383-4a18-8100-34b513976614
spec:
monoVertex:
metadata: {}
spec:
sink:
udsink:
container:
image: quay.io/numaio/numaflow-go/sink-log:stable
source:
udsource:
container:
image: quay.io/numaio/numaflow-go/source-simple-source:bad-image
strategy:
progressive:
assessmentSchedule: 60,60,10
forcePromote: true
status:
conditions:
- lastTransitionTime: "2025-03-03T18:51:52Z"
message: Successful
observedGeneration: 2
reason: Successful
status: "True"
type: ChildResourceDeployed
- lastTransitionTime: "2025-03-03T18:54:08Z"
message: Successful
observedGeneration: 3
reason: Successful
status: "True"
type: ChildResourcesHealthy
- lastTransitionTime: "2025-03-03T18:51:52Z"
message: MonoVertex unpaused
observedGeneration: 3
reason: Unpaused
status: "False"
type: MonoVertexPausingOrPaused
- lastTransitionTime: "2025-03-03T18:54:02Z"
message: New Child Object example-namespace/my-monovertex-1 Failed
observedGeneration: 3
reason: Failed
status: "False"
type: ProgressiveUpgradeSucceeded
message: Progressing
nameCount: 2
observedGeneration: 3
phase: Pending
progressiveStatus:
promotedMonoVertexStatus:
name: my-monovertex-0
scaleValuesRestoredToOriginal: true
upgradingMonoVertexStatus:
assessmentEndTime: "2025-03-03T18:54:56Z"
assessmentResult: Failure
assessmentStartTime: "2025-03-03T18:53:53Z"
name: my-monovertex-1
upgradeInProgress: Progressive

View File

@@ -1,70 +0,0 @@
apiVersion: numaplane.numaproj.io/v1alpha1
kind: MonoVertexRollout
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"sink":{"udsink":{"container":{"image":"quay.io/numaio/numaflow-go/sink-log:stable"}}},"source":{"udsource":{"container":{"image":"quay.io/numaio/numaflow-go/source-simple-source:bad-image"}}}}},"strategy":{"progressive":{"assessmentSchedule":"60,60,10"}}}}
creationTimestamp: "2025-03-03T18:51:52Z"
finalizers:
- numaplane.numaproj.io/numaplane-controller
generation: 3
name: my-monovertex
namespace: example-namespace
resourceVersion: "314047"
uid: d948cd56-e383-4a18-8100-34b513976614
spec:
monoVertex:
metadata: {}
spec:
sink:
udsink:
container:
image: quay.io/numaio/numaflow-go/sink-log:stable
source:
udsource:
container:
image: quay.io/numaio/numaflow-go/source-simple-source:bad-image
strategy:
progressive:
assessmentSchedule: 60,60,10
forcePromote: false
status:
conditions:
- lastTransitionTime: "2025-03-03T18:51:52Z"
message: Successful
observedGeneration: 2
reason: Successful
status: "True"
type: ChildResourceDeployed
- lastTransitionTime: "2025-03-03T18:54:08Z"
message: Successful
observedGeneration: 3
reason: Successful
status: "True"
type: ChildResourcesHealthy
- lastTransitionTime: "2025-03-03T18:51:52Z"
message: MonoVertex unpaused
observedGeneration: 3
reason: Unpaused
status: "False"
type: MonoVertexPausingOrPaused
- lastTransitionTime: "2025-03-03T18:54:02Z"
message: New Child Object example-namespace/my-monovertex-1 Failed
observedGeneration: 3
reason: Failed
status: "False"
type: ProgressiveUpgradeSucceeded
message: Progressing
nameCount: 2
observedGeneration: 3
phase: Pending
progressiveStatus:
promotedMonoVertexStatus:
name: my-monovertex-0
scaleValuesRestoredToOriginal: true
upgradingMonoVertexStatus:
assessmentEndTime: "2025-03-03T18:54:56Z"
assessmentResult: Failure
assessmentStartTime: "2025-03-03T18:53:53Z"
name: my-monovertex-1
upgradeInProgress: Progressive

View File

@@ -17,6 +17,9 @@ metadata:
spec:
monoVertex:
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Paused
sink:

View File

@@ -9,7 +9,7 @@ metadata:
- numaplane.numaproj.io/numaplane-controller
generation: 1
labels:
argocd.argoproj.io/instance: demo-app
argocd.argoproj.io/instance: demo-app
name: my-monovertex
namespace: example-namespace
resourceVersion: '947414'
@@ -17,6 +17,9 @@ metadata:
spec:
monoVertex:
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Running
sink:

View File

@@ -0,0 +1,53 @@
apiVersion: numaplane.numaproj.io/v1alpha1
kind: MonoVertexRollout
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: >
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"MonoVertexRollout","metadata":{"annotations":{},"labels":{"argocd.argoproj.io/instance":"demo-app"},"name":"my-monovertex","namespace":"example-namespace"},"spec":{"monoVertex":{"spec":{"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"}}}}}}}
creationTimestamp: '2024-08-21T20:44:18Z'
finalizers:
- numaplane.numaproj.io/numaplane-controller
generation: 1
labels:
argocd.argoproj.io/instance: demo-app
name: my-monovertex
namespace: example-namespace
resourceVersion: '947414'
uid: a63f377e-1500-437e-9267-579f4a790518
spec:
monoVertex:
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
replicas: null
lifecycle:
desiredPhase: Running
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'
status:
conditions:
- lastTransitionTime: '2024-08-21T20:44:18Z'
message: Successful
observedGeneration: 1
reason: Successful
status: 'True'
type: ChildResourceDeployed
- lastTransitionTime: '2024-08-22T21:10:23Z'
message: Successful
observedGeneration: 1
reason: Successful
status: 'True'
type: ChildResourcesHealthy
message: Deployed
observedGeneration: 1
phase: Deployed

View File

@@ -17,6 +17,9 @@ metadata:
spec:
monoVertex:
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
sink:
udsink:
container:

View File

@@ -0,0 +1,3 @@
obj.spec.monoVertex.spec.lifecycle.desiredPhase = "Running"
obj.spec.monoVertex.spec.replicas = null
return obj

View File

@@ -2,9 +2,12 @@ actionTests:
- action: pause
inputPath: testdata/PipelineRollout/rollout.yaml
expectedOutputPath: testdata/PipelineRollout/rollout-paused.yaml
- action: unpause
- action: unpause-gradual
inputPath: testdata/PipelineRollout/rollout-paused.yaml
expectedOutputPath: testdata/PipelineRollout/rollout-running.yaml
expectedOutputPath: testdata/PipelineRollout/rollout-running-gradual.yaml
- action: unpause-fast
inputPath: testdata/PipelineRollout/rollout-paused.yaml
expectedOutputPath: testdata/PipelineRollout/rollout-running-fast.yaml
- action: allow-data-loss
inputPath: testdata/PipelineRollout/rollout-in-ppnd.yaml
expectedOutputPath: testdata/PipelineRollout/rollout-allowing-data-loss.yaml

View File

@@ -3,13 +3,19 @@ actions["pause"] = {
["disabled"] = true,
["iconClass"] = "fa-solid fa-fw fa-pause"
}
actions["unpause"] = {
actions["unpause-gradual"] = {
["disabled"] = true,
["displayName"] = "Unpause (gradual)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["unpause-fast"] = {
["disabled"] = true,
["displayName"] = "Unpause (fast)",
["iconClass"] = "fa-solid fa-fw fa-play"
}
actions["allow-data-loss"] = {
["disabled"] = true,
["displayName"] = "Allow Data Loss",
["displayName"] = "Allow (Possible) Data Loss",
["iconClass"] = "fa-solid fa-fw fa-unlock"
}
actions["disallow-data-loss"] = {
@@ -24,7 +30,20 @@ if obj.spec.pipeline.spec.lifecycle ~= nil and obj.spec.pipeline.spec.lifecycle.
paused = true
end
if paused then
actions["unpause"]["disabled"] = false
if obj.spec.pipeline.spec.metadata ~= nil and obj.spec.pipeline.spec.metadata.annotations ~= nil and obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] ~= nil then
-- determine which unpausing strategies will be enabled
-- if annotation not found, default will be resume slow
if obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "fast" then
actions["unpause-fast"]["disabled"] = false
elseif obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/allowed-resume-strategies"] == "slow, fast" then
actions["unpause-gradual"]["disabled"] = false
actions["unpause-fast"]["disabled"] = false
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["unpause-gradual"]["disabled"] = false
end
else
actions["pause"]["disabled"] = false
end

View File

@@ -15,6 +15,9 @@ metadata:
spec:
pipeline:
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Paused
edges:

View File

@@ -15,6 +15,10 @@ metadata:
spec:
pipeline:
spec:
metadata:
annotations:
numaflow.numaproj.io/resume-strategy: "fast"
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Running
edges:

View File

@@ -0,0 +1,67 @@
apiVersion: numaplane.numaproj.io/v1alpha1
kind: PipelineRollout
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"numaplane.numaproj.io/v1alpha1","kind":"PipelineRollout","metadata":{"annotations":{},"name":"my-pipeline","namespace":"example-namespace"},"spec":{"pipeline":{"spec":{"edges":[{"from":"in","to":"cat"},{"from":"cat","to":"out"}],"interStepBufferServiceName":"my-isbsvc","vertices":[{"name":"in","source":{"generator":{"duration":"1s","rpu":5}}},{"name":"cat","udf":{"builtin":{"name":"cat"}}},{"name":"out","sink":{"log":{}}}]}}}}
creationTimestamp: "2024-09-26T20:54:55Z"
finalizers:
- numaplane.numaproj.io/numaplane-controller
generation: 1
name: my-pipeline
namespace: example-namespace
resourceVersion: "14008"
uid: ab9286a1-f453-433e-846e-48900ab2068a
spec:
pipeline:
spec:
metadata:
annotations:
numaflow.numaproj.io/resume-strategy: "slow"
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
lifecycle:
desiredPhase: Running
edges:
- from: in
to: cat
- from: cat
to: out
interStepBufferServiceName: my-isbsvc
vertices:
- name: in
source:
generator:
duration: 1s
rpu: 5
- name: cat
udf:
builtin:
name: cat
- name: out
sink:
log: {}
status:
conditions:
- lastTransitionTime: "2024-09-26T20:54:55Z"
message: Successful
observedGeneration: 1
reason: Successful
status: "True"
type: ChildResourceDeployed
- lastTransitionTime: "2024-09-26T20:55:07Z"
message: Pipeline Phase=Failed
observedGeneration: 1
reason: PipelineFailed
status: "False"
type: ChildResourcesHealthy
- lastTransitionTime: "2024-09-26T20:54:55Z"
message: Pipeline unpaused
observedGeneration: 1
reason: Unpaused
status: "False"
type: PipelinePausingOrPaused
message: Deployed
nameCount: 0
observedGeneration: 1
pauseStatus: {}
phase: Deployed

View File

@@ -15,6 +15,9 @@ metadata:
spec:
pipeline:
spec:
metadata:
annotations:
numaflow.numaproj.io/allowed-resume-strategies: "slow, fast"
edges:
- from: in
to: cat

View File

@@ -0,0 +1,9 @@
obj.spec.pipeline.spec.lifecycle.desiredPhase = "Running"
if obj.spec.pipeline.spec.metadata == nil then
obj.spec.pipeline.spec.metadata = {}
end
if obj.spec.pipeline.spec.metadata.annotations == nil then
obj.spec.pipeline.spec.metadata.annotations = {}
end
obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "fast"
return obj

View File

@@ -0,0 +1,9 @@
obj.spec.pipeline.spec.lifecycle.desiredPhase = "Running"
if obj.spec.pipeline.spec.metadata == nil then
obj.spec.pipeline.spec.metadata = {}
end
if obj.spec.pipeline.spec.metadata.annotations == nil then
obj.spec.pipeline.spec.metadata.annotations = {}
end
obj.spec.pipeline.spec.metadata.annotations["numaflow.numaproj.io/resume-strategy"] = "slow"
return obj

View File

@@ -1,2 +0,0 @@
obj.spec.pipeline.spec.lifecycle.desiredPhase = "Running"
return obj