File tree 4 files changed +26
-0
lines changed 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ user.bazelrc
2
+ remote-cache.bazelrc
Original file line number Diff line number Diff line change @@ -197,3 +197,9 @@ module "aspect_workflows_grafana_dashboards" {
197
197
grafana_url = module. managed_grafana . grafana_endpoint
198
198
managed_prometheus_endpoint = module. aspect_workflows . managed_prometheus_endpoint
199
199
}
200
+
201
+ resource "aws_ssm_parameter" "external_cache_endpoint" {
202
+ name = " aw_external_cache_endpoint"
203
+ type = " String"
204
+ value = module. aspect_workflows . external_remote_cache_endpoint
205
+ }
Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ common --noincompatible_disallow_empty_glob
23
23
common --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
24
24
common --incompatible_enable_cc_toolchain_resolution
25
25
26
+ # Load any settings & overrides specific to the external remote cache from `.aspect/bazelrc/remote-cache.bazelrc`.
27
+ # This file should appear in `.gitignore` so that settings are not shared with team members. This
28
+ # should be last statement in this config so the user configuration is able to overwrite flags from
29
+ # this file. See https://bazel.build/configure/best-practices#bazelrc-file.
30
+ # Setup of this file is automated by running the setup_remote_cache.sh Bash script.
31
+ try-import %workspace%/.aspect/bazelrc/remote-cache.bazelrc
32
+
26
33
# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`.
27
34
# This file should appear in `.gitignore` so that settings are not shared with team members. This
28
35
# should be last statement in this config so the user configuration is able to overwrite flags from
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Fetch the external remote cache configuration and add it to the user's Bazel RC file.
4
+
5
+ set -o errexit -o nounset -o pipefail
6
+
7
+ ENDPOINT=$( aws ssm get-parameter --region us-west-2 --name " aw_external_cache_endpoint" --query Parameter.Value --output text)
8
+ AUTH_STRING=$( aws ssm get-parameter --region us-west-2 --with-decryption --name " aw_external_cache_auth_header" --query Parameter.Value --output text)
9
+ SELF_PATH=$( dirname " ${BASH_SOURCE[0]:- " $( command -v -- " $0 " ) " } " )
10
+
11
+ echo -e " build --remote_cache=\" grpcs://${ENDPOINT} :8980\" --remote_header=\" Authorization=Basic ${AUTH_STRING} \" --remote_accept_cached --remote_upload_local_results" > " ${SELF_PATH} /.aspect/bazelrc/remote-cache.bazelrc"
You can’t perform that action at this time.
0 commit comments