Skip to content

Commit 9bce23d

Browse files
authored
chore: update Aspect Workflows README (#386)
1 parent ebe941f commit 9bce23d

File tree

5 files changed

+87
-1
lines changed

5 files changed

+87
-1
lines changed

.aspect/workflows/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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)

.aspect/workflows/bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
common --remote_download_outputs=minimal
33
common --nobuild_runfile_links
44

5+
# remote execution
56
common:rbe --extra_execution_platforms=//bazel/platforms:x86_64_linux_remote
67
common:rbe --host_platform=//bazel/platforms:x86_64_linux_remote
78
common:rbe --remote_executor=unix:///mnt/ephemeral/buildbarn/.cache/bb_clientd/grpc

.aspect/workflows/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# See https://docs.aspect.build/workflows/configuration
12
tasks:
23
- checkout:
34
update_strategy: rebase

.circleci/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file")
22

33
CIRCLECI_ORG = "aspect-build"
44

5-
CIRCLECI_USER_CONFIG_FILE = "//.circleci:user-config.yml"
5+
CIRCLECI_USER_CONFIG_FILE = "//.circleci:user.yml"
66

77
alias(
88
name = "rosetta",

0 commit comments

Comments
 (0)