Skip to content

feat: fail when connecting to vanilla buildkit - #5892

Merged
sipsma merged 1 commit into
dagger:mainfrom
jedevc:fail-on-connecting-to-vanilla-buildkit
Oct 17, 2023
Merged

sipsma merged 1 commit into
dagger:mainfrom
jedevc:fail-on-connecting-to-vanilla-buildkit

Conversation

@jedevc

@jedevc jedevc commented Oct 13, 2023 •

Copy link
Copy Markdown
Contributor

This adds a sanity check to check that when we connect to a remote buildkit instance, that it's running the dagger engine, and not a vanilla instance of buildkit.

See #5852 (comment):

If you are trying to connect to a host that was provisioned via buildx then it's not expected to work at this time. Dagger has a bit of divergence from the buildkitd that buildx uses.

We should hard fail on this kind of scenario, since it's possible to detect this by inspecting the Package value from buildkit's Info call. However, to do this, I've had to change the meaning of Package to contain the go package name, and smuggle the engine name through the Revision field. This would make this a breaking change for users with mismatched cli and engine versions - I'm not sure if this is important, if it is, we could do a weaker form of the check and just fail on the case that info.BuildkitVersion.Package == "github.com/moby/buildkit".

It might be useful to upstream the "engine name" functionality into buildkit (e.g. jedevc/buildkit@f0fe58a), to avoid the need to smuggle through another field, wdyt @sipsma?

@jedevc
jedevc requested a review from sipsma October 13, 2023 11:26
@sipsma

sipsma commented Oct 13, 2023 •

Copy link
Copy Markdown
Contributor

This would make this a breaking change for users with mismatched cli and engine versions - I'm not sure if this is important, if it is, we could do a weaker form of the check and just fail on the case that info.BuildkitVersion.Package == "github.com/moby/buildkit".

@vito the upcoming release is going to be a breaking change that requires everyone update both CLI and Engine to compatible versions right? If so, then I think you can leave the stronger check in place @jedevc.

However, if the upcoming release isn't breaking CLI<->Engine then I'd prefer to have the weaker check for now, while still updating our Package to be github.com/dagger/dagger. That way, once this has been in place long enough we can eventually just upgrade to the stronger check too if we want.

(This is my only concern, other than that LGTM.)

@vito

vito commented Oct 13, 2023

Copy link
Copy Markdown
Contributor

@sipsma The two breaking PRs are #5557 and #5881, which are both at the API layer, so now that the API lives in the engine that implies at least an engine bump, vs the old world where this was technically CLI-only. Given that we're breaking the API already it seems fine to break anything "beneath" that in terms of exposure.

@sipsma
sipsma merged commit 99dce8c into dagger:main Oct 17, 2023
@jedevc
jedevc deleted the fail-on-connecting-to-vanilla-buildkit branch October 17, 2023 15:01
@gerhard gerhard added this to the v0.9.0 milestone Oct 20, 2023
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
Signed-off-by: Justin Chadwell <[email protected]>
Signed-off-by: Christian Schlatter <[email protected]>
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
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.

5 participants