Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add timeout for pausing pipeline. Fixes #992 #1138

Merged
merged 32 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7a04ebc
feat: add timeout for pausing pipeline
dpadhiar Oct 2, 2023
dd060a7
Merge branch 'main' into pause-grace
dpadhiar Oct 2, 2023
fdc7426
feat: expose annotation as constant
dpadhiar Oct 3, 2023
03068af
feat: update needsUpdate func to check annotations
dpadhiar Oct 3, 2023
250c13f
feat: remove watch for annotation changes on pipeline
dpadhiar Oct 3, 2023
7461d0c
Merge branch 'main' into pause-grace
dpadhiar Oct 3, 2023
7beff03
Merge branch 'main' into pause-grace
dpadhiar Oct 3, 2023
df73e51
feat: revert start.go
dpadhiar Oct 3, 2023
6e1f7e7
Merge branch 'main' into pause-grace
dpadhiar Oct 4, 2023
94e1bf1
test: add check that annotation is set
dpadhiar Oct 4, 2023
bd8af3c
docs: add that pausing pipeline now has grace period (timeout)
dpadhiar Oct 4, 2023
5612e8b
feat: annotation update check changed
dpadhiar Oct 4, 2023
fcc3cab
feat: refine annotation check to just numaproj labels
dpadhiar Oct 5, 2023
4b6109e
chore: lint
dpadhiar Oct 5, 2023
dc8033d
feat: check prefix
dpadhiar Oct 5, 2023
5cd79be
Merge branch 'main' into pause-grace
dpadhiar Oct 5, 2023
1376ea8
chore: revert to previous
dpadhiar Oct 6, 2023
4137b00
feat: use patch instead of update
dpadhiar Oct 6, 2023
a4c5b13
Merge branch 'pause-grace' of https://github.com/dpadhiar/numaflow in…
dpadhiar Oct 6, 2023
33162f1
Merge branch 'main' into pause-grace
dpadhiar Oct 6, 2023
4611cc7
feat: change patch to remove annotation
dpadhiar Oct 7, 2023
879b279
Merge branch 'pause-grace' of https://github.com/dpadhiar/numaflow in…
dpadhiar Oct 7, 2023
b130230
feat: add json patch to delete annotation
dpadhiar Oct 7, 2023
5d2412d
Merge branch 'main' into pause-grace
dpadhiar Oct 7, 2023
be51316
feat: update err check
dpadhiar Oct 10, 2023
c65a097
Merge branch 'pause-grace' of https://github.com/dpadhiar/numaflow in…
dpadhiar Oct 10, 2023
7f6028f
Merge branch 'main' into pause-grace
dpadhiar Oct 10, 2023
ba46a9f
test: update test case
dpadhiar Oct 10, 2023
1a914b5
Merge branch 'pause-grace' of https://github.com/dpadhiar/numaflow in…
dpadhiar Oct 10, 2023
e5ffd03
Merge branch 'main' into pause-grace
dpadhiar Oct 10, 2023
20626e3
feat: error case for resume pipeline
dpadhiar Oct 10, 2023
a45a8d1
Merge branch 'pause-grace' of https://github.com/dpadhiar/numaflow in…
dpadhiar Oct 10, 2023
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
5 changes: 5 additions & 0 deletions api/json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18539,6 +18539,11 @@
"desiredPhase": {
"description": "DesiredPhase used to bring the pipeline from current phase to desired phase",
"type": "string"
},
"pauseGracePeriodSeconds": {
"description": "PauseGracePeriodSeconds used to pause pipeline gracefully",
"format": "int32",
"type": "integer"
}
},
"type": "object"
Expand Down
5 changes: 5 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -18535,6 +18535,11 @@
"desiredPhase": {
"description": "DesiredPhase used to bring the pipeline from current phase to desired phase",
"type": "string"
},
"pauseGracePeriodSeconds": {
"description": "PauseGracePeriodSeconds used to pause pipeline gracefully",
"type": "integer",
"format": "int32"
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions config/base/crds/full/numaflow.numaproj.io_pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ spec:
default:
deleteGracePeriodSeconds: 30
desiredPhase: Running
pauseGracePeriodSeconds: 30
properties:
deleteGracePeriodSeconds:
default: 30
Expand All @@ -113,6 +114,10 @@ spec:
- Paused
- Deleting
type: string
pauseGracePeriodSeconds:
default: 30
format: int32
type: integer
type: object
limits:
default:
Expand Down
5 changes: 5 additions & 0 deletions config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,7 @@ spec:
default:
deleteGracePeriodSeconds: 30
desiredPhase: Running
pauseGracePeriodSeconds: 30
properties:
deleteGracePeriodSeconds:
default: 30
Expand All @@ -2642,6 +2643,10 @@ spec:
- Paused
- Deleting
type: string
pauseGracePeriodSeconds:
default: 30
format: int32
type: integer
type: object
limits:
default:
Expand Down
5 changes: 5 additions & 0 deletions config/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,7 @@ spec:
default:
deleteGracePeriodSeconds: 30
desiredPhase: Running
pauseGracePeriodSeconds: 30
properties:
deleteGracePeriodSeconds:
default: 30
Expand All @@ -2642,6 +2643,10 @@ spec:
- Paused
- Deleting
type: string
pauseGracePeriodSeconds:
default: 30
format: int32
type: integer
type: object
limits:
default:
Expand Down
11 changes: 11 additions & 0 deletions docs/APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,17 @@ phase
</p>
</td>
</tr>
<tr>
<td>
<code>pauseGracePeriodSeconds</code></br> <em> int32 </em>
</td>
<td>
<em>(Optional)</em>
<p>
PauseGracePeriodSeconds used to pause pipeline gracefully
</p>
</td>
</tr>
</tbody>
</table>
<h3 id="numaflow.numaproj.io/v1alpha1.Log">
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/reference/pipeline-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To pause a pipeline, use the command below, it will bring the pipeline to `Pause

Pausing a pipeline will not cause data loss. It does not clean up the unprocessed data in the pipeline, but just terminates the running pods. When the pipeline is resumed, the pods will be restarted and continue processing the unprocessed data.

When pausing a pipeline, it will shutdown the source vertex pods first, and then wait for the other vertices to finish the backlog before terminating them.
When pausing a pipeline, it will shutdown the source vertex pods first, and then wait for the other vertices to finish the backlog before terminating them. However, it will not wait forever and will terminate the pods after `pauseGracePeriodSeconds`. This is default set to 30 and can be customized by setting `spec.lifecycle.pauseGracePeriodSeconds`.

If there's a [reduce](../user-defined-functions/reduce/reduce.md) vertex in the pipeline, please make sure it uses [Persistent Volume Claim](../user-defined-functions/reduce/reduce.md#persistent-volume-claim-pvc) for storage, otherwise the data will be lost.

Expand Down
1 change: 1 addition & 0 deletions pkg/apis/numaflow/v1alpha1/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
KeyVertexName = "numaflow.numaproj.io/vertex-name"
KeyReplica = "numaflow.numaproj.io/replica"
KeySideInputName = "numaflow.numaproj.io/side-input-name"
KeyPauseTimestamp = "numaflow.numaproj.io/pause-timestamp"
KeyDefaultContainer = "kubectl.kubernetes.io/default-container"

// ID key in the header of sources like http
Expand Down
Loading
Loading