Skip to content

Dazzle Rewrite#7

Merged
csweichel merged 25 commits into
masterfrom
rewrite
Jun 4, 2021
Merged

Dazzle Rewrite#7
csweichel merged 25 commits into
masterfrom
rewrite

Conversation

@csweichel
Copy link
Copy Markdown
Collaborator

@csweichel csweichel commented Mar 9, 2021

This is a complete rewrite of dazzle. It is deliberately incompatible with the previous version. With this rewrite dazzle uses buildkit to build the individual chunks, and combines them by producing OCI manifests and configurations directly. Using buildkit/containerd's resolver provides several benefits:

  • builds are orders of magnitude faster, because of buildkit's caching
  • combinations run orders of magnitudes faster, because we don't need to export the entire image anymore
  • all of this is way less of a hack, but rather uses more standard processes

There's a release build for this version here: https://github.com/gitpod-io/dazzle/releases/tag/v0.1.0

New project format

In addition, this rewrite changes the format of a dazzle project. Previously everything was contained within a single Dockerfile and now is split across several folders. See here for how building workspace-full (and variants) looks like with this rewrite. Again, there are several benefits to this method:

  • changes are easier to understand, because they are more local
  • files required for individual chunks are located closely to where they're needed
  • the chunks can be combined more freely rather than in a single prescribed way
  • chunks have an identity of their own, which means they can be used individually

Note: thanks to these more flexible means of combination, we can now build all workspace-full variants (including workspace-base) in dazzle itself. This significantly speeds up workspace-image builds.

Environment Variables

This version also sports more flexible merging abilities for environment variables. For each env var one can configure how they are to be merged if multiple chunks define the same variable. The following modes are available:

  • merge which appends all values separated by :
  • merge-unique which is like merge, except that only appends unique values, but in random order
  • use-first uses the first value we've seen
  • use-last uses the last value we've seen

Tests

Tests work much the same way as they have before.

Image Combination Prologue

There is one feature that's currently missing, and I'm not sure we actually need it: the prologue. The old dazzle could perform some operations on the merged image, the new version of dazzle can no longer do this.

@csweichel csweichel marked this pull request as ready for review June 4, 2021 08:54
@csweichel csweichel merged commit 9a6f310 into master Jun 4, 2021
@csweichel csweichel deleted the rewrite branch June 4, 2021 08:55
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