-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Closed
Labels
ReleaseStatusItem of high enough importance that it should be called out in release status meetingsItem of high enough importance that it should be called out in release status meetingsTeam:OperationsPlatform Operations Team t//Platform Operations Team t//buildchoreepic
Description
We are planning to slowly introduce and using Bazel as our main build tool.
That issues summarises the steps we plan to take during the process.
Phase 1 (COMPLETED) #79757 #92220
Goals
- Introduce the first building blocks in order to be possible to use bazel into the project
- Build
packages/**
using Bazel - Share built code on the CI for
packages/**
with subsequent CI builds and local developer installations
Expected Benefits
- Little reduction on CI build times because in the majority of the times packages won't need to be rebuilt
- Reduce bootstrap time on local development installations specially when switching between branches
- Introducing the benefits on Bazel for
packages/**
: reproducible and correct builds that only rebuilds when the inputs changes
Rough Planned Timeline
We are planning to land the phase 1 between 7.13
-7.14
Steps
- migrate to lodash@4 chore(NA): upgrade to lodash@4 #69868
- investigate and learn about bazel basics (aside from basics, learning bazel is an always in progress step 😄 )
- playing out with https://github.com/tylersmalley/bazel-ts-js-jest
- put up a POC with kibana using bazel to install dependencies, build packages along with a remote cache server. That step will include other steps and might be split into multiple steps. ( Build kbn packages with bazel build POC #74104 , Integrate bazel remote cache server with the bazel build POC #74105 )
- move into a single package.json Move into a single package.json #76412
- removes auto install of pre-commit hook [discuss] Changes to pre-commit hook #81504
- support monorepo packages both used locally and publish into the npm registry on bazel (merged feature on bazel nodejs rules)
- solve cache invalidation by
fsevents
native module chore(NA): add resolution for chokidar to prevent fsevents@1.x #85171 - host a presentation and a learning meeting about bazel
- write the rfc for the phase 1 according to the verified use cases in the POC [RFC] Bazel #92758
- hosting architecture review meeting
- introduce Bazel tools within
kbn bootstrap
chore(NA): bazel machinery installation on kbn bootstrap #89469, chore(NA): introduce new yarn kbn reset command to support bazel workflow #89597, chore(NA): support bazel and kbn packages in parallel on kbn pm and on distributable build scripts #89961, chore(NA): build bazel projects all at once in the distributable build process #90328, chore(NA): add safe guard to remove bazelisk from yarn global at bootstrap #90538, chore(NA): assure bazel bin is available on kbn clean and reset commands #91406, chore(NA): stop grouping bazel out symlink folders #96066, chore(NA): upgrade bazel rules nodejs to v3.2.3 #95413, chore(NA): enable preserve symlinks for ts without breaking packages development #95433, chore(NA): @kbn/pm new commands to support development on Bazel packages #96465, chore(NA): upgrades iBazel to v0.15.10 #97489 - manage dependencies install with Bazel chore(NA): support yarn install using bazel managed directories for dependencies #89883, chore(NA): remove yarn extra options from kbn bootstrap #90098, chore(NA): manage npm dependencies within bazel #92864
- build all
packages/**
with bazel chore(NA): moving @elastic/datemath into bazel #94665, fix(NA): support inspect flags on ensure_node_preserve_symlinks script #95344, chore(NA): moving @kbn/apm-utils into bazel #96227, chore(NA): moving @kbn/config-schema into bazel #96273, chore(NA): moving @kbn/tinymath into bazel #97022, chore(NA): moving @kbn/babel-preset into bazel #97271, chore(NA): chore(NA): moving @kbn/std into bazel #97771, chore(NA): chore(NA): moving @kbn/utils into bazel #97833, chore(NA): moving @elastic/safer-lodash-set into bazel #98187, chore(NA): moving @kbn/expect into bazel #98322, chore(NA): moving @kbn/apm-config-loader into bazel #98323, chore(NA): moving @kbn/dev-utils into bazel #98496, chore(NA): moving @kbn/logging into bazel #98564, chore(NA): moving @elastic/eslint-config-kibana into bazel #98648, chore(NA): moving @kbn/babel-code-parser into bazel #97675, chore(NA): moving @kbn/utility-types into bazel #97151, fix(NA): correct source root path on @kbn/config-schema #98788, chore(NA): moving @kbn/eslint-import-resolver-kibana into bazel #98798, [packages] Move @kbn/legacy-logging to Bazel #98810, chore(NA): moving @kbn/analytics into bazel #98917, chore(NA): moving @kbn/config into bazel #99199, [packages] Move @kbn/ace to Bazel #99129, chore(NA): moving @kbn/es into bazel #99371, chore(NA): moving @kbn/plugin-generator into bazel #99646, [packages] Move @kbn/telemetry-tools to Bazel #99726, chore(NA): moving @kbn/docs-utils into bazel #100051, chore(NA): moving @kbn/server-http-tools into bazel #100153, chore(NA): moving @kbn/monaco into bazel #100709, chore(NA): moving @kbn/io-ts-utils into bazel #100810, [packages] Move @kbn/interpreter to Bazel #101089, chore(NA): moving @kbn/rule-data-utils into bazel #101290, chore(NA): moving @kbn/server-route-repository into bazel #101484, chore(NA): moving @kbn/ui-shared-deps into bazel #101669, chore(NA): moving @kbn/storybook into bazel #102731, chore(NA): moving @kbn/ui-framework into bazel #102908, chore(NA): moving @kbn/optimizer into bazel #102965, chore(NA): moving @kbn/cli-dev-mode into bazel #103067, chore(NA): moving @kbn/plugin-helpers into bazel #103181, [packages] Migrate @kbn/test to Bazel #103122, chore(NA): moving @kbn/spec-to-console into bazel #103470, chore(NA): moving @kbn/test-subj-selector into bazel #103562, chore(NA): moving @kbn/es-archiver into bazel #103770 - setup and enable a bazel remote cache server using BuildBuddy chore(NA): integrate build buddy with our bazel setup and remote cache for ci #90116, Integrate bazel remote cache server with the bazel build for packages #79764
Phase 2 (ON GOING) #104519
Rough Planned Timeline
We are planning to land the phase 2 between 8.0
-8.1
Goals
- Improve the developer experience on the features introduced on the previous Phase 1
- Enable the benefit of the remote cache for the majority of the developers
- Remove legacy code from the previous bootstrap process
- Simplify Windows development
Expected Benefits
- Further reduction in the bootstrap time for packages
- Improve running time of unit tests for packages
Steps
- Use non-minified packages in dev mode #104253
- Use babel as a transpiler
- Start iBazel with Kibana dev server and Storybooks
- Change kbn build kbn watch defaults to use Bazel #105240
- Remove legacy build support from @kbn/pm #105241
- Run package Jest test through Bazel
- Remote cache for OSX
- Create WSL documentation and start sunsetting Windows dev support
Phase 3
Goals
- Migrate production build system to Bazel (rpm, deb, Docker, tar, zip)
- Migrate plugins to build with Bazel (keep both legacy and Bazel build systems running in parallel). We will continue to use the legacy build system until all plugins have been migrated and will cut over.
- Builds will no longer copy to target directories, which was used in Phase 1.
babel/register
can be completely removed since server-side code will be pre-built.- Server restarts can be optimized to only restart on non-type changes as identified by Bazel.
- Open questions:
- Should we move scripts to run through Bazel, or update the existing scripts to reference Bazel dist?
Phase 4
Goals
- Improve identification of when tests should be ran - no more need to explicitly check docs.
- Remove kbn/pm, or simplify enough to remove build step
- Implement CI automated merging queue to run unit tests prior to merging
jinmu03, timroes and nickofthymetimroes and nickofthyme
Metadata
Metadata
Assignees
Labels
ReleaseStatusItem of high enough importance that it should be called out in release status meetingsItem of high enough importance that it should be called out in release status meetingsTeam:OperationsPlatform Operations Team t//Platform Operations Team t//buildchoreepic