build: introduce remote bazel caching (#27358)
This PR introduces: 1. Google Cloud Store bucket which contains build artifacts 2. Documentation on how to enable remote caching in development Each team member should download a service key. More convenient ways of authentication would be more obscure and prevent us from doing identity tracking of the produced artifacts. PR Close #27358
This commit is contained in:
parent
84f2928c8c
commit
ad106abece
8
.bazelrc
8
.bazelrc
@ -1,3 +1,11 @@
|
|||||||
|
# Load any settings specific to the current user
|
||||||
|
try-import .bazelrc.user
|
||||||
|
################################
|
||||||
|
# Settings for Angular team members only
|
||||||
|
################################
|
||||||
|
# To enable this feature check the "Remote caching" section in docs/BAZEL.md.
|
||||||
|
build:angular-team --remote_http_cache=https://storage.googleapis.com/angular-team-cache
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Typescript / Angular / Sass #
|
# Typescript / Angular / Sass #
|
||||||
###############################
|
###############################
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -30,3 +30,7 @@ yarn-error.log
|
|||||||
|
|
||||||
# rollup-test output
|
# rollup-test output
|
||||||
/modules/rollup-test/dist/
|
/modules/rollup-test/dist/
|
||||||
|
|
||||||
|
# User specific bazel settings
|
||||||
|
.bazelrc.user
|
||||||
|
|
||||||
|
@ -168,8 +168,23 @@ Of course, non-hermeticity in an action can cause problems.
|
|||||||
At worst, you can fetch a broken artifact from the cache, making your build non-reproducible.
|
At worst, you can fetch a broken artifact from the cache, making your build non-reproducible.
|
||||||
For this reason, we are careful to implement our Bazel rules to depend only on their inputs.
|
For this reason, we are careful to implement our Bazel rules to depend only on their inputs.
|
||||||
|
|
||||||
Currently we only use remote caching on CircleCI.
|
Currently we only use remote caching on CircleCI and we let Angular core developers enable remote caching to speed up their builds.
|
||||||
We could enable it for developer builds as well, which would make initial builds much faster for developers by fetching already-built artifacts from the cache.
|
|
||||||
|
### Remote cache in development
|
||||||
|
|
||||||
|
To enable remote caching for your build:
|
||||||
|
|
||||||
|
1. Go to the service accounts for the ["internal" project](https://console.cloud.google.com/iam-admin/serviceaccounts?project=internal-200822)
|
||||||
|
1. Select "Angular local dev", click on "Edit", scroll to the bottom, and click "Create key"
|
||||||
|
1. When the pop-up shows, select "JSON" for "Key type" and click "Create"
|
||||||
|
1. Save the key in a secure location
|
||||||
|
1. Create a file called `.bazelrc.user` in the root directory of the workspace, and add the following content:
|
||||||
|
|
||||||
|
```
|
||||||
|
build --config=angular-team --google_credentials=[ABSOLUTE_PATH_TO_SERVICE_KEY]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Remote cache for Circle CI
|
||||||
|
|
||||||
This feature is experimental, and developed by the CircleCI team with guidance from Angular.
|
This feature is experimental, and developed by the CircleCI team with guidance from Angular.
|
||||||
Contact Alex Eagle with questions.
|
Contact Alex Eagle with questions.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user