All Projects β†’ thundergolfer β†’ example-bazel-monorepo

thundergolfer / example-bazel-monorepo

Licence: MIT License
πŸŒΏπŸ’š Example Bazel-ified monorepo, supporting Golang, Java, Python, Scala, and Typescript

Programming Languages

Starlark
911 projects
java
68154 projects - #9 most used programming language
shell
77523 projects
python
139335 projects - #7 most used programming language
HCL
1544 projects
typescript
32286 projects

Projects that are alternatives of or similar to example-bazel-monorepo

Please
High-performance extensible build system for reproducible multi-language builds.
Stars: ✭ 1,856 (+771.36%)
Mutual labels:  bazel, buck, build-tool
Buck
A fast build system that encourages the creation of small, reusable modules over a variety of platforms and languages.
Stars: ✭ 8,162 (+3731.92%)
Mutual labels:  buck, build-tool
Tulsi
An Xcode Project Generator For Bazel
Stars: ✭ 365 (+71.36%)
Mutual labels:  bazel, build-tool
Bazel Remote
A remote cache for Bazel
Stars: ✭ 260 (+22.07%)
Mutual labels:  bazel, build-tool
Intellij
IntelliJ plugin for Bazel projects
Stars: ✭ 500 (+134.74%)
Mutual labels:  bazel, build-tool
Gke Bazel Demo
Building applications with bazel and deploying them on to GKE. This demo contains a java-spring-boot rest service and an angular front-end. Both containers are deployed on GKE.
Stars: ✭ 92 (-56.81%)
Mutual labels:  bazel, build-tool
Fastdex
πŸš€ 加快 apk ηš„ηΌ–θ―‘ι€ŸεΊ¦ πŸš€
Stars: ✭ 1,457 (+584.04%)
Mutual labels:  buck, build-tool
Buildtools
A bazel BUILD file formatter and editor
Stars: ✭ 538 (+152.58%)
Mutual labels:  bazel, build-tool
android-build-eval
This project includes Uber-agnostic auto-generated project(s) with a comparable complexity to existing Uber Production mobile apps. These are buildable on Buck, Bazel and Gradle- therefore enable build time benchmarking.
Stars: ✭ 82 (-61.5%)
Mutual labels:  bazel, buck
eclipse
Eclipse For Bazel (deprecated, see https://github.com/salesforce/bazel-eclipse instead)
Stars: ✭ 31 (-85.45%)
Mutual labels:  bazel, build-tool
bob-build
Meta-build system using Blueprint and ninja
Stars: ✭ 24 (-88.73%)
Mutual labels:  build-tool
shipwright.nvim
βš“ Build stuff, or don't. IDC.
Stars: ✭ 27 (-87.32%)
Mutual labels:  build-tool
modular-styles
Extract CSS into CSS Modules for any language!
Stars: ✭ 25 (-88.26%)
Mutual labels:  build-tool
rules clojure
Clojure rules for Bazel
Stars: ✭ 27 (-87.32%)
Mutual labels:  bazel
rules node
Node rules for Bazel (unsupported)
Stars: ✭ 51 (-76.06%)
Mutual labels:  bazel
obs-docu
Official Open Build Service Documentation. Content gets reviewed and edited. Generated books are available at http://www.openbuildservice.org
Stars: ✭ 26 (-87.79%)
Mutual labels:  build-tool
vcluster
vcluster - Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
Stars: ✭ 1,360 (+538.5%)
Mutual labels:  platform-engineering
AnyStatus
A remote control for your CI/CD pipelines and more
Stars: ✭ 38 (-82.16%)
Mutual labels:  build-tool
awesome-blaze
πŸ”₯A curated list of awesome things related to Blaze
Stars: ✭ 29 (-86.38%)
Mutual labels:  blaze
pack
πŸ“¦ Packs the assets for your web server.
Stars: ✭ 18 (-91.55%)
Mutual labels:  build-tool

Example Bazel Monorepo


Note: Currently supporting the latest Bazel version as at mid June 2021, 4.1.0

Example Bazel-ified monorepo, supporting Golang, Java, Python, Scala, and Typescript.

Cloud Infrastructure-as-Code is done using Terraform.

I use this project to explore how Bazel works with different languages and developer tools, and keep a record of best-practices I've learnt. So it is a work in progress. Others can use it to check out the Bazel way of doing things and use parts as a reference implementation.

Rather than the typical To-Do list, this project's code uses the contrived scenario of a book shop and reading catalogue website called Antilibrary. πŸ“—πŸ“•πŸ“’πŸ“š

Getting Started

Prerequisites:

Bazel aims to be 'build anything, anywhere' system, so building and testing should be as simple as bazel test //.... If it's not, please create an issue.

Why use a Monorepo?

The following few articles together provide a good overview of the motivations behind maintaining a Monorepo. For heaps more information, korfuri/awesome-monorepo is a good place to go.

Related Projects

  • github.com/lucperkins/colossus - A demo using Bazel in monorepo fashion. Compared with this project, it goes far deeper on microservice architecture components and Kubernetes, and is not focused on Bazel.
  • github.com/enginoid/monorepo-base - Employs Bazel, gRPC, and Kubernetes like the above, and is similarly not as broad and deep on Bazel as this project.

Project Structure

Golang Support

There's Golang code in /cli. It implements a simple CLI for the common 'Blind Date With a πŸ“–' product.

Dependency Management

Third-party dependencies are managed in 3rdparty/go_workspace.bzl.

Java Support

There's a Spring Boot (with PostGres) application in /store-api and some other Java code in /store/layoutsolver.

Dependency Management

Its third-party dependencies are managed by rules_jvm_external in the WORKSPACE (See the # JAVA SUPPORT section).

Scala Support

There's Scala code contained in scala-book-sorting.

Dependency Management

Its third-party dependencies are managed by johnynek/bazel-deps. The usage of that tool is wrapped up in a script as tools/update_jvm_dependencies.sh.

To use it, you update tools/dependencies/jvm_dependencies.yaml and then run the script.

Python Support

There's Python code in the /book_sorting and /scraping.

bazelbuild/rules_python is used for the core py_* rules.

Dependency Management

In order to add new third-party packages for Python, add them to 3rdparty/requirements.in and run bazel run //3rdparty:requirements.update.

Gradual Type-Checking (MyPy)

thundergolfer/bazel-mypy-integration is used to check any type annotations at bazel build time.

Infrastructure-as-Code (Hashicorp Terraform)

The infrastructure/ top-level folder contains Terraform defining various AWS resources and their configuration.


Development

Build

bazel build //...

Testing

bazel test //...

Continuous Integration (CI)

This repository's CI is managed by Buildkite, the CI platform used by Pinterest and Canva to manage Bazel monorepos, as well as being used by the Bazel open-source project itself.

Deployment & Distribution

Deployable artifacts are pushed to S3 under commit-hash-versioned keys. Currently only the store-api deploy/fat JAR is deployable.

graknlabs/bazel-distribution is used to publish Python packages to PyPi.

Build Observability + Analysis

This project is using Buildbuddy.IO. Every build run locally or in CI get its own https://app.buildbuddy.io/invocation/xyz123... URL which analyses and records the build's information.

Linting

thundergolfer/bazel-linting-system is used. ./tools/linting/lint.sh will lint all source-code in the repo and ./tools/linting/lint_bzl_files.sh will lint all Bazel files.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].