openllb / hlb

A developer-first language to build and test any software efficiently
https://openllb.github.io/hlb/
Apache License 2.0
108 stars 12 forks source link

Remove SessionID from local op #336

Closed aaronlehmann closed 1 year ago

aaronlehmann commented 1 year ago

This ends up referring to an ID that isn't used by the actual session, so it causes problems. For example, "local" ops take at least 5 seconds because they try to wait for a session with this ID that never shows up: https://github.com/moby/buildkit/blob/abde08a5531d809a395cf648a31bca932b009af0/source/local/local.go#L95-L101

Ideally, we should set SessionID to the actual session ID instead of leaving it unspecified, because this relies on buildkit to iterate over the sessions and find one that works, which can be nondeterministic. But it seems like this would take a pretty significant refactor to create the session in advance, and then add FSSyncProviders as we go. The change here should be a strict improvement over the current behavior.

aaronlehmann commented 1 year ago

We have a helper func: https://github.com/aaronlehmann/hlb/blob/304e004c45688ea5af8eea22ecd8df99e6a85dad/pkg/llbutil/id.go#L38

so maybe it makes sense to use that like we do here https://github.com/aaronlehmann/hlb/blob/304e004c45688ea5af8eea22ecd8df99e6a85dad/pkg/llbutil/id.go#L18-L22 ?

Yeah, the ID is derived from the output of that helper func, with the opts hashed in.