Skip to content

Commit

Permalink
Buildbody (#14)
Browse files Browse the repository at this point in the history
Remote cacheing and execution
  • Loading branch information
frank-bee authored Oct 22, 2024
1 parent 53ba2ed commit 73f4a91
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 13 deletions.
13 changes: 13 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
build:ci --build_metadata=ROLE=CI
build:ci --bes_results_url=https://app.buildbuddy.io/invocation/
build:ci --bes_backend=grpcs://remote.buildbuddy.io
build:ci --remote_cache=grpcs://yaku.buildbuddy.io
build:ci --remote_timeout=3600
build:ci --experimental_remote_cache_compression
build:ci --experimental_remote_cache_compression_threshold=100
build:ci --nolegacy_important_outputs
build:ci --remote_executor=grpcs://yaku.buildbuddy.io
build:ci --jobs=50
build:ci --noslim_profile
build:ci --experimental_profile_include_target_label
build:ci --experimental_profile_include_primary_output
15 changes: 13 additions & 2 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,19 @@ jobs:
disk-cache: ${{ github.workflow }}
repository-cache: true

- name: Build and Test
run: bazel test //...
- name: Build
run: |
bazel build \
--config=ci \
--remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} \
//...
- name: Test
run: |
bazel test \
--config=ci \
--remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} \
//...
####
## only on push to main
Expand Down
58 changes: 48 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,54 @@
# yaku
# Yaku
[![Build all](https://github.com/B-S-F/yaku/actions/workflows/build-all.yml/badge.svg)](https://github.com/B-S-F/yaku/actions/workflows/build-all.yml)

!! THIS PROJECT IS UNDER CONSTRUCTION !!

<img src="./misc/under-construction.jpg" alt="Under Construction" width="300"/>
<figcaption>
Foto from Mabel Amber from <a href="https://www.pexels.com/de-de/foto/nahaufnahme-fotografie-der-roten-und-weissen-strassenbeschilderung-117602/" target="_blank" style="color: #555;">Pexels</a>
</figcaption>

## Bazel
[![Build all](https://github.com/B-S-F/yaku/actions/workflows/build-all.yml/badge.svg)](https://github.com/B-S-F/yaku/actions/workflows/build-all.yml)
## Locally build

#### Prerequisites
In order to locally build, make user you have bazelisk installed:

On macOS:
```bash
brew install bazelisk
````

On Windows:
```bash
choco install bazelisk.
```
#### Build

```bash
bazel build //...
```

#### Test

```bash
bazel test //...
```


### Overview
## CI/CD
For the CI/CD pipeline, GitHub Actions is used. The workflow is defined in `.github/workflows/build-all.yml`.

### Bazel Remote caching and remote execution
Remote caching and remote execution in Bazel are powerful features that enhance build efficiency and speed. Remote caching allows Bazel to store build outputs on a server, enabling reuse of these outputs across different builds and machines, which reduces redundant computations and speeds up the build process. Remote execution, on the other hand, offloads the execution of build actions to remote servers, distributing the workload and further accelerating the build process.

### BuildBuddy
Incorporating BuildBuddy into your GitHub workflow leverages these capabilities by integrating a remote cache and execution service directly into your CI/CD pipeline. This setup ensures that builds are consistently fast and reliable, as BuildBuddy manages the caching and execution of build actions, optimizing resource usage and minimizing build times

It is not require for contributers to have a BuildBuddy account. The BuildBuddy instance is hosted by the project owner.
However, if you want to follow the remote execution and caching, you can sign up for a free BuildBuddy account at [buildbuddy.io](https://buildbuddy.io/).
Afterwards you are able to [join our organization](https://yaku.buildbuddy.io/join/) and see the build results, stats and so on in [our BuildBuddy dashboard](https://yaku.buildbuddy.io).

## Components

| Component | Build | Test | Artifact Upload | Comments |
|-------------|-----|------|-----------------|----------------------------------------------------------------------------------|
Expand All @@ -23,23 +62,22 @@ Foto from Mabel Amber from <a href="https://www.pexels.com/de-de/foto/nahaufnahm

✔️ works
(✔) partially works
❌ does not work

### Components
❌ does not work

#### Onyx
### Onyx
- `BUILD` files created with `gazelle -go_prefix github.com/B-S-F/yaku` (from root)
- derived from this tutorial: https://earthly.dev/blog/build-golang-bazel-gazelle/

#### Chart
### Chart
- see https://github.com/abrisco/rules_helm
- chart is pushed to this OCI repo here: [ghcr.io/b-s-f/charts/yaku](https://github.com/B-S-F/yaku/pkgs/container/charts%2Fyaku)

#### Python Apps
### Python Apps
- see https://github.com/B-S-F/yaku/tree/main/yaku-apps-python

...

## Misc
### Dependency graph
Overview of the dependencies between the components (click to open in GraphvizOnline)
[![](./misc/depgraph.svg)](https://dreampuf.github.io/GraphvizOnline/?compressed=CYSw5gTghgDgFgAgLYE9K0QbwFAIQOwHtgBTBAbQGc5YSBeAI0IA8BdAblwQCIB6XgMY0IAFwBcKKAGsArgH04JADZJuFBAMJLCEOt0gkS%2BbgBoElESiX1uAMxBLrwbhy59Bw8ZNkLlqhAC0AHw8-EJQomIiJEgwSlDRlLy%2BSjAkEJQAdCJxADr4YZ5iAG5QSjIkWZJISvmFEeIAwp6Z1bUFHg1iAhDASRFghAEA7jpSttrDlAE9fa1QNdxu9ZHe8ooqasE8AAIbSHKkMHIDhHKjEOOTSbxi%2B4ckx6fnYxOEU0t47uGr0ut%2BWxC3x0JACICQUDAJDEMBk1DBEKhn1CnV%2BPn2gN29yOciQIHwIEI-DufgexzxBMIyOBEFB4Mh0Nh8PpSLw5E02l0%2BlpRlM5ks1j09kcJGcri%2BYRBCIZMLhcGlrO2NLpiOhImg%2BEoIBEhPworkLJI1MltIVjLlZsxyrNYgsCzSzmWgilhttIntouNztNrrtsU9gSBJpVMrkfod2ViSi9mh9qqiGq1OsIeuABtVanZWh0egMvLMFisNmFThcnAl3pDUITUE12t1%2BsNVp2cQSth0SBuAlhYgiSAAbAAWGMu%2BPq2tJhtppuBlGxqvQptO%2Bc28d15Op9MM5utkTtiCdsI95gADn7ciHI7jMrXk5TjYzs%2B4Lfie47XZ7UAiQkvy9HN8Tet72nR8lRfNt334QhKDEJR8RkZgrwXGt1ynLdFSBHYIBkaxKDkQZ%2BAIkRCC0cJ8W6QY5EIWxbGpLCcMqfCiV4IiSKUMj8Aos5qNotx6NwpjCKJYjSJociBEonjm2wg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U-OpSi4VLLhXMywNdb6yUIbNiJszYWytrqG2dsHaW2dnxTpBsjZ9PNqpQZKZhkWFGU7d6uxJndOmfwU2syUzzM1HcEZwxHbOw6XrKZvStn9LmUBfZtsllHLGVMdxKkFnqSrqA9ZPStAzIGTcxZ9sHkrLwswIcLy1KmSrsifBUBCFKGITsT5mzeDbN%2BdbA59zjlPPsWCkyBkq6Sktn80%2BJBbBQBwppZhCKzkbIuciq5uyiV3IBZivC2LjJvJEB86lXzjaXJ2YStFTLllTTkCCwcOKOUu3jEnd%2BUBU4QDUO7bMXJvZ%2BwDkHEO-IixCgjp6ZhCdXQypTmnYG2k8IwCkGAfgFqrUwELqUaIMJ7WhXVrEB40QBCco6CmFAzBBBIMEHBMQPqGofTNXIG11rLW8DtSAB1jJnXlPDO6kgnrUohv9cAQNIBg34F9YqrMnI9Cp0cO8PkhZBR2F1WKTgABfbAQA)
Expand Down
22 changes: 21 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,24 @@ helm_import_repository(
version = "5.2.0",
sha256 = "8ef4212d7d51be6c8192b3e91138a9ca918ca56142c42500028cfd3b80e0b2dd",
chart_name = "minio",
)
)

###
# Buildbuddy, needed only for remote execution
###
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_buildbuddy_buildbuddy_toolchain",
sha256 = "baa9af1b9fcc96d18ac90a4dd68ebd2046c8beb76ed89aea9aabca30959ad30c",
strip_prefix = "buildbuddy-toolchain-287d6042ad151be92de03c83ef48747ba832c4e2",
urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/287d6042ad151be92de03c83ef48747ba832c4e2.tar.gz"],
)

load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps")

buildbuddy_deps()

load("@io_buildbuddy_buildbuddy_toolchain//:rules.bzl", "buildbuddy")

buildbuddy(name = "buildbuddy_toolchain")

0 comments on commit 73f4a91

Please sign in to comment.