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

Enhance RunnerSet to optionally retain PVs accross restarts #1340

Merged
merged 2 commits into from
May 16, 2022

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Apr 13, 2022

This is my initial attempt to bring back the ability to retain PVs across runner pod restarts when using RunnerSet.
The implementation is composed of two new controllers, runnerpersistentvolumeclaim-controller and runnerpersistentvolume-controller.

It all starts from our existing runnerset-controller. The controller now tries to mark any PVCs created by StatefulSets created for the RunnerSet.

Once the controller terminated statefulsets, their corresponding PVCs are clean up by runnerpersistentvolumeclaim-controller. Shortly after that, PVs are unbound from their corresponding PVCs by runnerpersistentvolume-controller so that they can be reused by future PVCs created for future StatefulSets that share the same StorageClass.

Ref #1286

@erplsf
Copy link

erplsf commented Apr 14, 2022

looks very promising indeed, although I don't see how acceptance/testdata converts into an actual test of this implementation.

@mumoshu
Copy link
Collaborator Author

mumoshu commented Apr 14, 2022

@erplsf What do you mean by "actual test of this implementation"? It's used as a part of e2e_test.go which I use to test ARC.

This is our initial attempt to bring back the ability to retain PVs across runner pod restarts when using RunnerSet.
The implementation is composed of two new controllers, `runnerpersistentvolumeclaim-controller` and `runnerpersistentvolume-controller`.
It all starts from our existing `runnerset-controller`. The controller now tries to mark any PVCs created by StatefulSets created for the RunnerSet.
Once the controller terminated statefulsets, their corresponding PVCs are clean up by `runnerpersistentvolumeclaim-controller`, then PVs are unbound from their corresponding PVCs by `runnerpersistentvolume-controller` so that they can be reused by future PVCs createf for future StatefulSets that shares the same same StorageClass.

Ref #1286
@mumoshu mumoshu force-pushed the retain-pv-across-restarts-runnerset branch from c815c00 to 6997357 Compare May 12, 2022 02:21
@mumoshu
Copy link
Collaborator Author

mumoshu commented May 16, 2022

Merging this anyway so that you can test the canary version of ARC released for each commit to the master branch. I'd appreciate it if anyone could help testing it! Thanks.

@mumoshu mumoshu merged commit b5194fd into master May 16, 2022
@mumoshu mumoshu deleted the retain-pv-across-restarts-runnerset branch May 16, 2022 00:26
mumoshu added a commit that referenced this pull request May 20, 2022
In relation to #1286 and as a follow-up for #1340
mumoshu added a commit that referenced this pull request May 21, 2022
In relation to #1286 and as a follow-up for #1340
)

// RunnerPersistentVolumeReconciler reconciles a PersistentVolume object
type RunnerPersistentVolumeReconciler struct {
Copy link

Choose a reason for hiding this comment

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

Is watching PersistentVolumes necessary? Should it be up to the PV controller to decide how to reclaim/recreate when PVs the PVC is deleted.

return ctrl.Result{}, client.IgnoreNotFound(err)
}

log.Info("Reconciling runner pvc")
Copy link

Choose a reason for hiding this comment

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

This confusingly logs PVC skipped in syncPVC.

image

mumoshu added a commit that referenced this pull request May 25, 2022
* doc: Use RunnerSet to retain various cache

In relation to #1286 and as a follow-up for #1340

* docs: clarify client vs daemon

* docs: better wording

* Separate RunnerSet examples for docker iimage layer caching

* Revert changes on testdata as it is going to be added via #1471 instead

* Update README.md

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>

* fixup! Update README.md

* Remove the outdated RunnerSet limitation

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>
cablespaghetti pushed a commit to cablespaghetti/actions-runner-controller that referenced this pull request Jun 22, 2022
…1464)

* doc: Use RunnerSet to retain various cache

In relation to actions#1286 and as a follow-up for actions#1340

* docs: clarify client vs daemon

* docs: better wording

* Separate RunnerSet examples for docker iimage layer caching

* Revert changes on testdata as it is going to be added via actions#1471 instead

* Update README.md

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>

* fixup! Update README.md

* Remove the outdated RunnerSet limitation

Co-authored-by: Callum Tait <15716903+toast-gear@users.noreply.github.com>
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

3 participants