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 a button to invalidate all workflows for a repo #6308

Merged
merged 7 commits into from
Apr 29, 2024
Merged

Conversation

maggie-lou
Copy link
Contributor

@maggie-lou maggie-lou commented Apr 5, 2024

This PR changes the behavior of the "rerun from clean runner" button to only invalidate the relevant workflow snapshot. Previously, the button would invalidate all workflows for that repo.

Add a new button to the workflows page to invalidate all workflows for a repo. We may need this if we make a breaking change that requires a universal snapshot upgrade, like a firecracker version increase, for example.

Also remove usages of ExecuteWorkflowRequest.Clean in preparation of deprecating that field. It's strange behavior that we could invalidate snapshots of unrelated workflows when invoking ExecuteWorkflow. We should use the new targeted API for this case.

Related issues: N/A

@maggie-lou maggie-lou force-pushed the invalidate_button branch 2 times, most recently from 67c62ee to c3deae1 Compare April 5, 2024 21:34
@maggie-lou maggie-lou force-pushed the invalidate_button branch 2 times, most recently from 487cfcc to 0ec6641 Compare April 7, 2024 19:51
@maggie-lou maggie-lou force-pushed the clean_clean branch 2 times, most recently from 1e78db5 to f4ecaa5 Compare April 7, 2024 20:08
@maggie-lou maggie-lou changed the title WIP Add a separate button to invalidate all workflows for a repo Add a button to invalidate all workflows for a repo Apr 7, 2024
@maggie-lou maggie-lou force-pushed the clean_clean branch 2 times, most recently from 77bf556 to c5adc6e Compare April 7, 2024 20:14
@maggie-lou maggie-lou marked this pull request as ready for review April 7, 2024 20:16
enterprise/app/workflows/workflows.tsx Outdated Show resolved Hide resolved
go.work Outdated Show resolved Hide resolved
server/buildbuddy_server/buildbuddy_server.go Outdated Show resolved Hide resolved
// In the latter case, we want to be careful to not fallback to an older,
// invalid snapshot. So here we generate a new version ID to guarantee
// we start from a clean snapshot.
return l.env.GetSnapshotService().InvalidateSnapshot(ctx, key)
Copy link
Member

Choose a reason for hiding this comment

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

what's the difference between calling InvalidateSnapshot here and returning a new random string directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

InvalidateSnapshot saves the version metadata in the cache. We want to make sure it's set, or every VM will generate a new version ID.

Ex. Let's say the version metadata expires from the cache.
T0: A VM starts up. There's no version metadata in the cache, so it generates a new version. It completes and saves a snapshot (saving a snapshot does not update the version metadata)
T1: Another VM starts up. If we hadn't saved the version metadata at T0, this will also generate a new version

@maggie-lou maggie-lou force-pushed the invalidate_button branch 5 times, most recently from a8dd9cb to c8d0eaa Compare April 12, 2024 17:47
Base automatically changed from invalidate_button to master April 18, 2024 16:35
enterprise/app/workflows/workflows.tsx Outdated Show resolved Hide resolved
@maggie-lou maggie-lou merged commit be19fc5 into master Apr 29, 2024
18 of 20 checks passed
@maggie-lou maggie-lou deleted the clean_clean branch April 29, 2024 15:54
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