Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Feature: Reattach to a pipeline run by latest or sequence id #4042

Merged
merged 14 commits into from
Oct 17, 2022

Conversation

briancain
Copy link
Member

@briancain briancain commented Oct 12, 2022

This pull request introduces a new CLI flag for pipeline run to enable the CLI to reattach to an existing pipeline run, either by the latest known run, or by a specific sequence id. It will attempt to reply the job ids in the order defined in the pipeline run message.

Fixes #4010

@briancain briancain added the pr/no-changelog No automatic changelog entry required for this pull request label Oct 12, 2022
@briancain briancain requested review from a team, demophoon and xiaolin-ninja October 12, 2022 18:17
@briancain briancain removed the pr/no-changelog No automatic changelog entry required for this pull request label Oct 12, 2022
Copy link
Contributor

@xiaolin-ninja xiaolin-ninja left a comment

Choose a reason for hiding this comment

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

This feels like it's repeating code that's in the pipeline run command and introduces more maintenance surface and not very dry.

If the key is so the user knows that happens to the run, there is existing waypoint job list -pipeline=<pipeline> -run=<seq> to monitor the state of the job, or waypoint pipeline inspect -run=<seq> for the state of previous runs.

So they could just run job get-stream on the latest job... though I guess if the point is to re-attach them to the stream in real-time... maybe we can figure out how to extract this code so it's not repeated, or add a -reattach command to the existing pipeline run.

@briancain
Copy link
Member Author

@xiaolin-ninja so the main thing this provides is being able to replay or attach to an existing pipeline run (maybe that run was invoked in the UI or automatically by the server and a CLI client wants to follow along, for example).

Using waypoint job get-stream isn't a great user experience. They'd have to figure out what jobs are associated with pipeline runs, and then manually run the get-stream command for every job id. The appeal of something like this PR is only having to provide a pipeline name or run sequence number and replaying or reattaching to a running jobstream for all jobs in execution order.

I'm good with adding a -reattach flag to waypoint pipeline run. The majority of the code in the CLI command on this PR is building up protobufs for requests and sending them over the API so I don't think the duplication is a huge deal, but adding a -reattach to waypoint pipeline run makes sense.

@briancain briancain force-pushed the feat/pipelines/reattach-pipeline-run branch from 17337ef to 17c2cea Compare October 14, 2022 15:16
@briancain
Copy link
Member Author

Done via c4d5c28 @xiaolin-ninja !

Copy link
Contributor

@xiaolin-ninja xiaolin-ninja left a comment

Choose a reason for hiding this comment

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

Tested & looks great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli: Provide a way to re-attach to a pipeline run
3 participants