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

Add restarting state and pipeline restart API #356

Merged
merged 2 commits into from Oct 13, 2023
Merged

Add restarting state and pipeline restart API #356

merged 2 commits into from Oct 13, 2023

Conversation

mwylde
Copy link
Member

@mwylde mwylde commented Oct 10, 2023

This PR adds a new state Restarting and a new api POST /pipeline/{id}/restart which together allowing restarting pipelines. This can be used to restart a running pipeline (sometimes useful if it gets into some bad state that the system isn't able to automatically detect). But it can also be used for failed jobs, which currently cannot be recovered (without editing the db).

Now, a failed pipeline can be restarted via the API like this:

$ curl -XPOST localhost:8000/api/v1/pipelines/pl_OZWnhLx5I3/restart -d "{}" \
  -H "Content-Type: application/json"

There is also UI support to restart failed pipelines:

image


Restarting is a bit awkward to model in a reconciliation-based system like the controller; in general reconciliation requires a change to drive an operation. But for restarting, we want to force a state transition without actually changing any configuration.

This PR accomplishes that by adding restart_nonce fields on the job_configs and job_statuses tables. This is a number that can be incrementing in order to change the config while leaving everything the same.

@mwylde mwylde merged commit 99f9f8d into master Oct 13, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants