Repository navigation
propagate progrock parents - #6456
Conversation
ba44e0a to
b3afa96
Compare
|
Weird that the tests seem to be timing out from this. Happened on a re-run too. 🤔 Investigating locally! |
There was a problem hiding this comment.
It seems like this is what we were doing before so not a big deal, but I did just realize we set c.Recorder both here and above on line 147 and am confused now why (or if we actually need to in both places).
There was a problem hiding this comment.
Yeah I can't see a good reason to, and I obviously just kept pattern-matching here, guessing it ended up this way through little changes over time. I think at one point there was a local recorder := var involved, and it was consolidated to just c.Recorder since it ended up being assigned to it anyway. Will clean up
b3afa96 to
8317455
Compare
|
Still a bit confounded by the CI failures for this one.
Beyond that I've been seeing edit: whoa, nevermind, I can repro |
8317455 to
9b89f88
Compare
|
Ok, weird, the dagger/engine/buildkit/client.go Line 256 in 9b89f88 I thought changes within that value wouldn't bust any caches, since that's the whole point of the Does this mean we're actually busting caches across sessions right now, since Maybe there's something in the Buildkit plumbing that's caching by Op digest instead of by |
|
@vito very very confused right now too, can repro the same thing of putting random data in the The existing func TestTODO(t *testing.T) {
t.Parallel()
c1, ctx1 := connect(t)
_, err := c1.Container().From(alpineImage).
WithMountedDirectory("/src", c1.Directory()).
WithExec([]string{"sleep", "5"}).
WithExec([]string{"sleep", "5"}).
Sync(ctx1)
require.NoError(t, err)
c1.Close()
c2, ctx2 := connect(t)
_, err = c2.Container().From(alpineImage).
WithMountedDirectory("/src", c2.Directory()).
WithExec([]string{"sleep", "5"}).
WithExec([]string{"sleep", "5"}).
Sync(ctx2)
require.NoError(t, err)
}And can see that even if I put completely random data in the ftp proxy settings, starting w/ empty cache it only runs just over 10s (i.e. second client is cached) and re-running the test only takes a little over 1s. So at least we have that 😮💨 I'll dig a bit more into what could be happening in that |
|
@vito Hit my current timebox but will revisit ASAP, what I've found so far: Caching across sessions, even with completely random data in ftp proxy is working completely as expected. E.g. if you do a local run of The problem I'm seeing is that having random data in there that changes within the session appears to invalidate the cache of any other calls in the session. So with a change to have random data in ftp proxy that changes each solve call, then there won't be cache hits on the Not sure what's going on here. Feel somewhat reassured that our existing usage is okay because all the stuff we put in there was unchanging within the context of a single session, but it makes no sense to me yet that data changing in a session (like the use case here) would impact this... |
|
Picked this back up for a while. Basically, within the context of a single session buildkit's solver does not seem to de-duplicate two vertices that have different digests but resolve to the same cache map. Across sessions it's fine, just doesn't work within one session it seems. You only get de-duping within the session if the vertex digests exactly match. It checks whether it can re-use an existing As far as I can tell, this just isn't handled in the solver logic. When the exec op is supposed to probe cache of deps here, I'm seeing that the Disclaimer: I have fairly low confidence in this. It's too convoluted to know anything. If I'm on the right track, this feels like a bug. I gave a shot at fixing by updating cc @jedevc (know you have been looking in this area, just in case you have any ideas). @vito in the spirit of abandoning all hope, we may want to assume that the limit of the ftp proxy hack is data that doesn't change across a session, unfortunately... I can imagine at least one way to maybe get this to work without radical changes, which would be that you continue to store the Obviously we need a new general approach here. I thought through a few other things that might be possible in the short-ish term, but they didn't pan out. Clearly on thin ice at the moment though. |
|
Heads up - some of the failures could definitely be related to having taken #6481 yesterday. I've seen the same kind of deadlocks as before - unfortunately this one seems persistently tricky to repro locally, so I'm going to spend some time improving our engine deadlock handling.
This definitely feels strange. Don't have context for this exact convoluted code path but my prior observations:
|
Yeah that's the other thing, I do see edges being merged in the logs, but only after the duplicated exec has already run 🤷♂️ |
|
Thanks both of you for investigating! I'll see what I can do. We've also been having lurking issues with Progrock events not draining properly, and I've been meaning to get around to that, so I'll look for an opportunity to clean that up along the way (knowing full well that might be another pandora's box...). |
1d09d70 to
c2ec68e
Compare
|
Turns out we can just delete the accursed Progrock socket forwarding from the shim entirely! I'm not sure when exactly this became possible, but it turns out 99% of the progress output is making its way out via the API server anyway, which the shim already connects to using I did a 11,12c11
< 2 check hut14q0g6ablk.ei5211547ktm4.dagger.local 1234/tcp
< 12 checkVersionCompatibility
---
> 2 check hut14q0g6ablk.b51rbqli15fg4.dagger.local 1234/tcp
14c13
< 40 connect
---
> 2 connect
22c21
< 16 defaultPlatform
---
> 2 defaultPlatform
So it seems completely worth just nuking this hairy progress forwarding code path from orbit. The biggest difference is that codegen progress just goes to |
sipsma
left a comment
There was a problem hiding this comment.
Looks great, glad we could tear out all that plumbing!
Signed-off-by: Alex Suraci <[email protected]>
progrock now supports parent/child vertex relationships which are mechanically very similar to groups, but which result in otel-style span semantics instead. this change adopts it for the DagQL telemetry func and propagates the value through module function calls. Signed-off-by: Alex Suraci <[email protected]>
not worth the perf hit yet, but this seems like code we might want someday Signed-off-by: Alex Suraci <[email protected]>
rather than making an 'init' group and putting a singleton 'starting-engine' vertex in it, now we have a separate vertex for each time we call connect, which happens repeatedly with nesting scenarios like Zenith; feels weird to lie about it by making them all have the same vertex ID. Signed-off-by: Alex Suraci <[email protected]>
expected comes first Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
turns out we don't actually need this anymore! the only events it's been forwarding are internal engine calls, i.e. the following vertices: * connect * checkVersionCompatibility(...) * defaultPlatform all of the juicy progress is actually already forwarded and associated to the correct parent via the ClientCallContext plumbing in core/schema/schema.go Signed-off-by: Alex Suraci <[email protected]>
not worth whatever amount of time this spends since we're guaranteed to be pointing to a compatible version anyway. Signed-off-by: Alex Suraci <[email protected]>
purely DX driven. otherwise loadModuleFromID shows up in the progress output which feels kinda clunky. Signed-off-by: Alex Suraci <[email protected]>
f355313 to
758415d
Compare
These are the necessary changes for the Zenith visualization experiments I've been working on. I figure we can sneak these out even if we don't have anything that uses them yet, just to have the ability to record a journal file and test the new UI/TUI against it.
The only real change is that Progrock now supports parent/child vertex relationships, which are analogous to parent/child spans in OpenTelemetry. The DagQL telemetry now uses this instead of the weird group-that's-really-a-vertex from before, which was also contributing to a lot of noisy output. Now when a resolver performs a self-call or runs something with Buildkit, the resulting vertices will be children of the calling vertex.
Most of the effort is just getting the parent vertex ID plumbed through all the right places for nesting/modules. If/when we want to add support for OpenTelemetry, this is a good breadcrumb trail to follow. I took a swing at it but couldn't quite get it to work how I wanted to so I backed out for now.