Skip to content

fix: prevent double buildkit caching on remote git operations - #9840

Merged
jedevc merged 1 commit into
dagger:mainfrom
jedevc:fix-double-buildkit-caching
Mar 12, 2025
Merged

jedevc merged 1 commit into
dagger:mainfrom
jedevc:fix-double-buildkit-caching

Conversation

@jedevc

@jedevc jedevc commented Mar 11, 2025

Copy link
Copy Markdown
Contributor

This was probably causing flakes, and had the potential to cause big issues. Should hopefully fix the issue noted in #9730 (comment).

Essentially, for remote operations we were caching twice:

  • The DagOp for the Git.tree operation (with a cache key of the git ID)
  • The underlying git operation (with a cache key of the git commit) This was very confusing to think about, and probably could have resulted in lots of weird cache issues.

The simple fix here is to just remove the extra DagOp layer when caching remote git sources, and to take more manual control over DagOp caching in this case.

Ideally! We would have core interfaces, which would then allow us to have different specializations of GitRef and GitRepository at the dagql handler level, so we wouldn't actually need this kind of refactor. But it's not super trivial to add them, so this is quick hacky fix to get the behavior working as desired.

@jedevc jedevc added this to the v0.16.3 milestone Mar 11, 2025
@jedevc
jedevc requested a review from sipsma March 11, 2025 14:36
This was *probably* causing flakes, and had the potential to cause big
issues.

Essentially, for remote operations we were caching twice:
- The DagOp for the `Git.tree` operation (with a cache key of the git ID)
- The underlying git operation (with a cache key of the git commit)
This was very confusing to think about, and probably could have resulted
in lots of weird cache issues.

The simple fix here is to just remove the extra DagOp layer when caching
remote git sources, and to take more manual control over DagOp caching
in this case.

Ideally! We would have core interfaces, which would then allow us to
have different specializations of `GitRef` and `GitRepository` at the
dagql handler level, so we wouldn't actually need this kind of refactor.
But it's not *super* trivial to add them, so this is quick hacky fix to
get the behavior working as desired.

Signed-off-by: Justin Chadwell <[email protected]>
@jedevc
jedevc force-pushed the fix-double-buildkit-caching branch from b535c0f to 37d6263 Compare March 11, 2025 15:08
@jedevc
jedevc merged commit 7dbe139 into dagger:main Mar 12, 2025
vikram-dagger pushed a commit to vikram-dagger/dagger that referenced this pull request Mar 17, 2025
…#9840)

This was *probably* causing flakes, and had the potential to cause big
issues.

Essentially, for remote operations we were caching twice:
- The DagOp for the `Git.tree` operation (with a cache key of the git ID)
- The underlying git operation (with a cache key of the git commit)
This was very confusing to think about, and probably could have resulted
in lots of weird cache issues.

The simple fix here is to just remove the extra DagOp layer when caching
remote git sources, and to take more manual control over DagOp caching
in this case.

Ideally! We would have core interfaces, which would then allow us to
have different specializations of `GitRef` and `GitRepository` at the
dagql handler level, so we wouldn't actually need this kind of refactor.
But it's not *super* trivial to add them, so this is quick hacky fix to
get the behavior working as desired.

Signed-off-by: Justin Chadwell <[email protected]>
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.

2 participants