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

[WIP] support for cache volume mounts from host #7646

Closed
wants to merge 5 commits into from

Conversation

sipsma
Copy link
Contributor

@sipsma sipsma commented Jun 13, 2024

As mentioned here, moving this from POC to fleshed out implementation ended up calling for a very different approach.

Will flesh out description more, but high level:

  • Needed to fork buildkit; corresponding PR for dagger's buildkit fork is here [WIP) volume snapshotter support buildkit#3
    • Trying to keep modifications there minimally invasive and mostly plumbing-only
  • Cache volumes are implemented via a custom snapshotter (which lives in this dagger repo)
    • Makes it much easier to reuse existing buildkit code without special casing
    • Allows the implementation to be shareable across concurrent engines (by avoiding use of boltdb for metadata, instead we use flat files, flock and some careful maneuvering with atomic renames and such)

Currently passing tests other than a few expected failures from tests for cache volume ownership/mode, which is a TODO below.


TODOs:

  • Add support for pruning just cache volumes (including specific ones) to the API added in core: add API for local engine cache and integ tests #7767
  • Way more tests (need to backfill coverage + add more, including sharing of volumes between separate engines)
  • Support for sharing mode private
  • Support for base layers underneath cache mount (which also gets us support for permissions+mode)
  • Double-check against cloud cache.
    • New implementation is compatible with it now in theory, but need to test to confirm and also think through whether it even makes sense to have both working together.

@sipsma sipsma changed the title WIP support for cache volume mounts from host [WIP] support for cache volume mounts from host Jun 13, 2024
Copy link
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Copy link
Contributor

github-actions bot commented Jul 6, 2024

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Jul 6, 2024
@sipsma
Copy link
Contributor Author

sipsma commented Jul 10, 2024

(finishing up #7804 first, then getting back to this)

@sipsma sipsma reopened this Jul 10, 2024
@sipsma sipsma mentioned this pull request Jul 22, 2024
2 tasks
@sipsma
Copy link
Contributor Author

sipsma commented Jul 30, 2024

Update on this:

  • Been struggling with the split responsibilities between buildkit + dagger that come along with a fleshed out implementation of this
  • Tried to just layer on top of buildkit but proving to not be tenable, so for now going with a fork of buildkit that includes all the customizations we need here
  • After trying a few things there, think I've honed in on a good approach:
    1. Support for these special "mutable-only, shareable" mounts will be a custom Snapshotter implementation (i.e. the interface from containerd).
      • This allows us to enforce all the properties we want in a mostly self-contained place rather than leaking too much all over. Also potentially more re-usable in the future.
      • E.g. we can enforce the mutability, re-use based on key, locking, etc. there. We can also store the metadata however we want, so we won't be tied to a non-shareable boltdb implementation while still re-using most of the existing buildkit+dagger machinery
    2. For pruning, cache mounts stored on the host will be able to be automatically pruned after all (different than I originally thought), but I will update our default pruning policy to exclude them so out-of-the-box users will need to manually prune them

EDIT: Got the above idea basically working, updated PR description

Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Copy link
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Copy link
Contributor

github-actions bot commented Sep 4, 2024

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Sep 4, 2024
@marcosnils marcosnils reopened this Sep 24, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Oct 1, 2024
@wingyplus wingyplus reopened this Oct 1, 2024
Copy link
Contributor

github-actions bot commented Oct 9, 2024

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this Oct 9, 2024
@wingyplus wingyplus reopened this Oct 9, 2024
@bitgandtter
Copy link

Has something been done in this direction? I have been following the PR for a long time, and the GH bot has more interactions than the code

Copy link
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Copy link
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

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

Successfully merging this pull request may close these issues.

4 participants