|
| 1 | +# Aspect Workflows demonstration deployment |
| 2 | + |
| 3 | +`bazel-examples` is a demonstration deployment of [Aspect Workflows](https://www.aspect.build/workflows) configured to run on Buildkite, CircleCI and GitHub Actions. |
| 4 | + |
| 5 | +You can see this Aspect Workflows demonstration deployment live for each CI host |
| 6 | +at the following URLS: |
| 7 | + |
| 8 | +- Buildkite: https://buildkite.com/aspect/bazel-examples |
| 9 | +- CircleCI: https://app.circleci.com/pipelines/github/aspect-build/bazel-examples-cci |
| 10 | +- GitHub Actions: https://github.com/aspect-build/bazel-examples-gha/actions/workflows/aspect-workflows.yaml |
| 11 | + |
| 12 | +## Aspect Workflows configuration yaml |
| 13 | + |
| 14 | +This is the [config.yaml](./config.yaml) file in this directory. |
| 15 | + |
| 16 | +## Buildkite pipeline configuration (in the Buildkite UI) |
| 17 | + |
| 18 | +There are two pipelines configured on Buildkite. |
| 19 | + |
| 20 | +1. Main build & test pipeline: https://buildkite.com/aspect/bazel-examples |
| 21 | +2. Scheduled warming pipeline: https://buildkite.com/aspect/bazel-examples-warming |
| 22 | + |
| 23 | +### Main build & test pipeline configuration |
| 24 | + |
| 25 | +The main build & test pipeline found at https://buildkite.com/aspect/bazel-examples is configured |
| 26 | +with the following yaml steps: |
| 27 | + |
| 28 | +``` |
| 29 | +steps: |
| 30 | + - label: ":aspect: Setup Aspect Workflows" |
| 31 | + commands: |
| 32 | + - "rosetta steps | buildkite-agent pipeline upload" |
| 33 | + agents: |
| 34 | + queue: aspect-small |
| 35 | +``` |
| 36 | + |
| 37 | +> [!IMPORTANT] |
| 38 | +> The Setup Aspect Workflows step above is configured to run on the `aspect-small` queue that is serviced by a runner group made up of lightweight and inexpensive `t3a.small` AWS instances. |
| 39 | +
|
| 40 | +### Scheduled warming pipeline configuration |
| 41 | + |
| 42 | +The scheduled warming pipeline found at https://buildkite.com/aspect/bazel-examples-warming is |
| 43 | +configured with the following yaml steps: |
| 44 | + |
| 45 | +``` |
| 46 | +env: |
| 47 | + ASPECT_WORKFLOWS_BIN_DIR: /etc/aspect/workflows/bin |
| 48 | +steps: |
| 49 | + - label: ":fire: Create warming archives" |
| 50 | + commands: | |
| 51 | + echo "--- :aspect-build: Workflows environment" |
| 52 | + ${ASPECT_WORKFLOWS_BIN_DIR}/configure_workflows_env |
| 53 | + echo "--- :stethoscope: Agent health check" |
| 54 | + ${ASPECT_WORKFLOWS_BIN_DIR}/agent_health_check |
| 55 | + echo "--- :bazel: Create warming archive" |
| 56 | + rosetta run warming |
| 57 | + ${ASPECT_WORKFLOWS_BIN_DIR}/warming_archive |
| 58 | + agents: |
| 59 | + queue: aspect-warming |
| 60 | +``` |
| 61 | + |
| 62 | +The warming pipeline is not configured to trigger on commits or PRs. Instead, it is triggered |
| 63 | +by a Buildkite pipeline schedule with the cron interval `0 1 * * 1-5 America/Los_Angeles`. It |
| 64 | +runs nightly on weekdays to create up-to-date warming archives containing cached external repositories. |
| 65 | +The most recent warming archive is restored during bootstrap of the "default" runner group to speed up |
| 66 | +the first build on cold runners. |
| 67 | + |
| 68 | +## GitHub Actions pipeline configuration |
| 69 | + |
| 70 | +This includes 3 files: |
| 71 | + |
| 72 | +1. [.github/workflows/aspect-workflows.yaml](../../.github/workflows/aspect-workflows.yaml) : Aspect Workflows CI workflow |
| 73 | + |
| 74 | +1. [.github/workflows/aspect-workflows-warming.yaml](../../.github/workflows/aspect-workflows-warming.yaml) : Aspect Workflows warming cron workflow |
| 75 | + |
| 76 | +1. [.github/workflows/.aspect-workflows-reusable.yaml](../../.github/workflows/.aspect-workflows-reusable.yaml) : Aspect Workflows Reusable Workflow for GitHub Actions. |
| 77 | + This files is vendored from the upstream [.aspect-workflows-reusable.yaml](https://github.com/aspect-build/workflows-action/blob/main/.github/workflows/.aspect-workflows-reusable.yaml) for the Workflows version configured in the deployment. |
| 78 | + |
| 79 | +## CircleCI pipeline configuration (generated) |
| 80 | + |
| 81 | +The CircleCI pipeline configuration, [.circleci/config.yml](../../.circleci/config.yml), is generated by the Aspect Workflows `rosetta` tool. |
| 82 | + |
| 83 | +`rosetta` is fetched by Bazel as a WORKSPACE dep (defined in [.aspect/workflows/deps.bzl](./deps.bzl)). |
| 84 | +The BUILD file targets to generate the CircleCI pipeline from the Aspect Workflows [config.yaml](./config.yaml) and a demostration user CircleCI configuration, [.circleci/user.yml](../../.circleci/user.yml), for non-Workflows steps are defined in [.circleci/BUILD.bazel](../../.circleci/BUILD.bazel) |
0 commit comments