Skip to content

feat: rewrite Container.withExec to use DagOp - #10457

Merged
jedevc merged 14 commits into
dagger:mainfrom
jedevc:dagop-exec
Jun 30, 2025
Merged

jedevc merged 14 commits into
dagger:mainfrom
jedevc:dagop-exec

Conversation

@jedevc

@jedevc jedevc commented May 22, 2025 •

Copy link
Copy Markdown
Contributor

The continuation of #10367, converts withExec to completely avoid generating LLB, and instead lifting all the relevant functionality into dagger.

TODO:

  • Something about the RawDigest functionality I've added so we can get a form of content-caching for operations doesn't make me super happy.

@jedevc
jedevc force-pushed the dagop-exec branch 9 times, most recently from 05d12af to be52f19 Compare May 28, 2025 16:01
@jedevc
jedevc force-pushed the dagop-exec branch 5 times, most recently from e3b8085 to 862bb9c Compare May 30, 2025 14:48
@jedevc

This comment was marked as resolved.

@jedevc
jedevc force-pushed the dagop-exec branch 8 times, most recently from b64c751 to 3bd62cc Compare June 3, 2025 15:04
@jedevc
jedevc force-pushed the dagop-exec branch 4 times, most recently from 7206f93 to 553e1f2 Compare June 13, 2025 14:10
@jedevc
jedevc marked this pull request as ready for review June 20, 2025 11:56
@jedevc
jedevc requested a review from sipsma June 20, 2025 12:08
@jedevc
jedevc force-pushed the dagop-exec branch 3 times, most recently from 6a10622 to fae6ff1 Compare June 23, 2025 15:36
@jedevc
jedevc force-pushed the dagop-exec branch 5 times, most recently from 9bdf407 to a18bce9 Compare June 26, 2025 16:27
jedevc and others added 14 commits June 30, 2025 14:18
This is no longer allowed, since we'd require a dagop for this - we can
instead just re-call `withExec` through the server to get it working.

Signed-off-by: Justin Chadwell <[email protected]>
We need to make sure that we pass this into the top-most context, since
it can be used during `Load`.

Signed-off-by: Justin Chadwell <[email protected]>
This is useful, so now we can use dag.Select over it.

Signed-off-by: Justin Chadwell <[email protected]>
We already have this implemented through the Server function. Don't
really know why it needed to be duplicated (seems like a past-me
brainfart).

Signed-off-by: Justin Chadwell <[email protected]>
Various improvements, including:
- Allow configuring the entire buildkit cache map, instead of just the
  cache key
- Track the cause context.Context, useful for tracing (this is ideally
  where spans should be attached to)
- Fallback to getting client metadata using the weird hacky session
  manager thing that buildkit has. This is annoying, but if we don't do
  this, it's very easy to end up in strange edge merging bugs (and I
  don't want to remove that as part of this work).

Signed-off-by: Justin Chadwell <[email protected]>
This helps to pass JSON-serializable objects through the schema easily.
It's not a directly exposed type, just a helper.

Signed-off-by: Justin Chadwell <[email protected]>
Reimplement it *entirely* inside of dagop!

There are a few different things components that this interacts with
that makes it a bit tricky to integrate.
- `asService` had a dependency on `ExecOp` - this needed to be entirely
  removed, which is a real pain for the legacy case, so we do
  an ID inspection.
- `ExecError` also depended on using `ExecOp`, so this needed reworking,
  it's now a `RichError` type which can be used for *any* sort of live
  ref debugging.
- Module calls, these for now still depend on using `withExec` in a
  super hacky way, but in the future, this should hopefully be removed
  as we cache module calls natively in dagql caching.

Signed-off-by: Justin Chadwell <[email protected]>
Co-authored-by: Alex Couture-Beil <[email protected]>
Signed-off-by: Justin Chadwell <[email protected]>
@jedevc
jedevc merged commit 4fa9bf5 into dagger:main Jun 30, 2025
@jedevc
jedevc deleted the dagop-exec branch June 30, 2025 17:29
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.

3 participants