Skip to content

Buildkite Builds

Render Buildkite user instead of CI hostname in Engflow UI

When the EngFlow cluster receives a Build Event Stream from Bazel, the cluster can only attribute it to the OS username of the CI runner and/or the principal in the cluster credentials. The real person who initiated the build is often different.

To fix this, you can send the Buildkite user in the BEP using Bazel keywords. Use the BUILDKITE_BUILD_CREATOR Buildkite environment variable to set a BES keyword. The cluster will use that name in the UI.

YAML
1
2
3
4
steps:
  - label: "My Build"
    command: "bazel build //:my_target ... --bes_keywords=engflow:Requester=$BUILDKITE_BUILD_CREATOR ..."
    ...

Post invocation results back to a Buildkite build

A Buildkite build annotation posted by EngFlow indicating the status of the build

Your EngFlow cluster can post invocation results directly to a Buildkite build, so you can get to the invocation page with fewer clicks.

1. Create a Buildkite API token

Follow this Buildkite guide to create a new Buildkite API token.

Make sure the token has the following permissions:

  • write_builds Allows the EngFlow cluster to post annotations to your build

2. Configure your EngFlow cluster to authenticate to Buildkite

Contact your EngFlow support engineer and securely send the Buildkite API token. They will add this to your cluster's secrets so the cluster can authenticate to Buildkite using the token.

Please contact us for instructions on how to install and configure the secret into your cluster.

3. Configure your CI Buildkite

Buildkite automatically injects the BUILDKITE_BUILD_URL environment variable into your build scripts. Pass this into the bazel command in your job's steps like so:

YAML
1
2
3
4
steps:
  - label: "My Build"
    command: "bazel build //:my_target ... --bes_keywords=engflow:BuildkiteBuildUrl=$BUILDKITE_BUILD_URL ..."
    ...