Two years ago, we were given a big challenge - Transform Wix Build System, then based on Maven and Teamcity, to a new system that will support our exponentially growing scale.
But, how could we move to a system so different in so many ways than the existing one? Furthermore, we were required not to break the current build system, as we migrate to the new one.
Fast forward to today: Wix backend CI system is fully migrated to Bazel! The system builds in a fracture of the time - even with our largest codebases. In this talk, we will describe how we achieved this, why it took us so long, what tools we had to build on the way (and what we already have, and will, open source!), and share the principles that helped us.
29. โ Missing compile/runtime deps
โ Third party alignment
โ Trying to read from ./src/test/resources
โ Tests that try to download during test runtime
โ More...
TECHNICAL DEBT == MORE WORK
exodus/troubleshooting
46. โ Bazel training
โ IDE issues
โ Develop solutions!
Think local development!
CIOkay Local dev
Wix Bazel Local dev team:
โTooling alignment
โDev Cache
โWix IntelliJ Bazel Plugin
47. 1 Use a migration tool
2 Measure the system
3 Think local dev experience
51. โ Remote cache and remote execution
โ PR prechecks (no push to master)
โ Automatic discovery of deployables
โ Cloud based build server - no build queues
New Bazel CI Pipeline
60. When we started
we compiled Bazel from sources
Bazel keeps evolving
Each release
brought a lot of value, but also
required us to adjust
Tap to important issues, in๏ฌuence the priorities
Become a Bazel activist!
61. 1 Use a migration tool
2 Measure the system
3 Think local dev experience
4 Run parallel CI pipelines
5 Optimize for speed
67. Virtual mono-repo:
Virtual Mono-Repo Service holds all
repos of wix with their latest HEAD
version
Bazel wrapper generates a local bzl ๏ฌle
with `git_repository` de๏ฌnition of all
repositories
Each WORKSPACE ๏ฌle loads the
de๏ฌnition from the generated bzl ๏ฌle.
framework(031d53ce983d26a861d053c760190de669aa458d)
users(1202d41c7dc0739deddde3176c7de34ed9b978b7)
events(ab6d1d07477e3742fbc9f9c1e81e0ec402650b1b)
external_repos.bzl
git_repository(
name = "framework",
Commit = "031d53ce983d2
)
...
WORKSPACE.bazel
1
2
3
71. Migration in "Isolation Mode"
โ Faster move to Bazel CI
โ Faster feedback
โ Faster deployables
โ Keep Maven builds green
โ Reproducibility hit
โ Stale SNAPSHOT locally