Skip to content

automatically start/upgrade buildkitd - #149

Merged
aluzzardi merged 4 commits into
mainfrom
autostart-buildkit
Mar 3, 2021
Merged

aluzzardi merged 4 commits into
mainfrom
autostart-buildkit

Conversation

@aluzzardi

@aluzzardi aluzzardi commented Mar 3, 2021 •

Copy link
Copy Markdown
Contributor

Removed one setup step by automatically taking care of starting buildkitd (e.g. only docker is now required to getting started)

  • Automatically start a buildkit daemon if no BUILDKIT_HOST is
    provided (and if not already started)
  • Using a custom buildkit (e.g. through BUILDKIT_HOST) is still possible, just like before (the code kicks in only if no BUILDKIT_HOST is provided).
  • Automatically upgrade the managed daemon to the version used by dagger
    if necessary: we've had panics in the past when using a new buildkit client against an old daemon
  • Add CI test to make sure the managed buildkit and the vendored
    buildkit versions match

Note: this is using the docker CLI rather than the client library, on purpose, because of permissions (e.g. we might not be able to read/write on the docker unix socket, whereas the CLI can)

@aluzzardi
aluzzardi requested a review from shykes March 3, 2021 00:26
@aluzzardi
aluzzardi force-pushed the autostart-buildkit branch from 6104865 to c271cc8 Compare March 3, 2021 00:27
- Automatically start a buildkit daemon if no BUILDKIT_HOST is
  provided (and if not already started)
- Customization of BUILDKIT_HOST is still possible, just like before
- Automatically upgrade the managed daemon to the version used by dagger
  if necessary
- Add CI test to make sure the managed buildkit and the vendored
  buildkit versions match

Signed-off-by: Andrea Luzzardi <[email protected]>
@aluzzardi
aluzzardi force-pushed the autostart-buildkit branch from c271cc8 to 14ff14e Compare March 3, 2021 02:37
@aluzzardi
aluzzardi force-pushed the autostart-buildkit branch from cadc9b5 to 408053f Compare March 3, 2021 03:09
@verdverm

verdverm commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

hmm, not sure how I feel about automagically starting a privileged container. Feels like it violates some SecOps ideas or best practices

@aluzzardi

Copy link
Copy Markdown
Contributor Author

Indeed, that's not great.

The upside though is by automating the creation of buildkit, we can now implement more advanced setups.

For instance, it wouldn't be too hard to do a follow up that drops --privileged by running a rootless buildkit daemon:

https://github.com/moby/buildkit/blob/master/docs/rootless.md

@verdverm

verdverm commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

For instance, it wouldn't be too hard to do a follow up that drops --privileged by running a rootless buildkit daemon:

By that, do you mean something like?

  1. Run BuildKit in privileged mode
  2. Modify kernel params via the privileged BK
  3. Restart BK in rootless mode

@aluzzardi

Copy link
Copy Markdown
Contributor Author

No I don't think we should mess with that. I'm just saying we can do something better than --privileged now that we control how the daemon is started (e.g. perhaps we can drop --privileged by providing more fine grained --security-opts).

@aluzzardi

Copy link
Copy Markdown
Contributor Author

Opened an issue to track the --privileged issue #151

I'll move this forward in the meantime as it's not worse than the instructions in the README, it just automates them.

@aluzzardi
aluzzardi merged commit 16fe08c into main Mar 3, 2021
@aluzzardi
aluzzardi deleted the autostart-buildkit branch March 3, 2021 19:14
TomChv added a commit that referenced this pull request Nov 26, 2026
v1.3.0 is the first release carrying #120, which has the bindings generators
style identifiers through the engine's `Naming.formatIdentifiers` rather than
guessing from schema names. v1.1.0's codegen guessed, and guessed wrong for API
newer than its own pairing: `ArtifactUriOpts` and `ImageMediaTypes.Oci` where
this engine says `ArtifactURIOpts` and `OCI`.

It also carries the codegen module (#149), so the renderer arrives as a
dependency instead of a `go build` recipe kept here — the thing the two sides
agreeing was never checked against.

Signed-off-by: Tom Chauveau <[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