Skip to content

Commit

Permalink
Chrobalt build acceleration.
Browse files Browse the repository at this point in the history
Set up Chrobalt build acceleration with RBE making it the default
accelerator for both developers and the CI system.

Remove fetching of RBE cfg files with CIPD. Instead rely on local cfg
files which use public docker images rather than private ones. Taken
from Chromium's trunk.

b/384982606
  • Loading branch information
briantting committed Jan 14, 2025
1 parent 5e6a0d9 commit 5440dc1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
8 changes: 1 addition & 7 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:
run: echo "$GITHUB_WORKSPACE/depot_tools" >> $GITHUB_PATH
shell: bash
- name: Generate gclient file
run: gclient config --name=src https://github.com/${{ github.repository }}
run: gclient config --name=src https://github.com/${{ github.repository }} --custom-var=download_remoteexec_cfg=True --custom-var='rbe_instance="projects/cobalt-actions-prod/instances/default_instance"'
shell: bash
- name: Set target OS for Android
if: ${{ contains(matrix.platform, 'android') }}
Expand All @@ -25,9 +25,6 @@ runs:
- name: Gclient sync
run: gclient sync -v --shallow --no-history -r ${{ github.sha }}
shell: bash
- name: sccache check
run: sccache -s
shell: bash
- name: gn gen
run: |
cd src
Expand All @@ -46,9 +43,6 @@ runs:
cd src
ninja -C out/${{ matrix.platform }}_${{ matrix.config }} $(echo "${TARGETS}" | tr -d '"')
shell: bash
- name: Dump sccache stats
run: sccache -s
shell: bash
- name: Archive Android APKs
if: startsWith(matrix.platform, 'android') && matrix.config == 'qa'
uses: actions/upload-artifact@v4
Expand Down
4 changes: 4 additions & 0 deletions buildtools/reclient_cfgs/fetch_reclient_cfgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ def main():
return 1
if not GenerateReproxyCfg(args.reproxy_cfg_template, args.rbe_instance):
return 1
# COBALT Disables CIPD fetch of rewrapper configs in favor of local rewrapper configs.
return 0
return 1
# COBALT END

if not args.rewrapper_cfg_project and not args.rbe_instance:
logging.error(
Expand Down
7 changes: 3 additions & 4 deletions cobalt/build/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ def write_build_args(build_args_path, original_lines, dict_settings,
f'The following args cannot be set in configs: {controlled_args}')
gen_comment = '# Set by gn.py'
with open(build_args_path, 'w', encoding='utf-8') as f:
if os.getenv('IS_CI', default='0') == '1':
f.write(f'cc_wrapper = "{CC_WRAPPER}" {gen_comment}\n')
else:
f.write(f'use_remoteexec = true {gen_comment}\n')
f.write(f'use_remoteexec = true {gen_comment}\n')
f.write(
f'rbe_cfg_dir = rebase_path("//cobalt/reclient_cfgs") {gen_comment}\n')
f.write(f'build_type = "{build_type}" {gen_comment}\n')
for key, value in _BUILD_TYPES[build_type].items():
f.write(f'{key} = {value} {gen_comment}\n')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
platform=container-image=docker://gcr.io/chops-public-images-prod/rbe/siso-chromium/linux@sha256:26de99218a1a8b527d4840490bcbf1690ee0b55c84316300b60776e6b3a03fe1,label:action_default=1
server_address=unix:///tmp/reproxy.sock
labels=type=compile,compiler=clang,lang=cpp
exec_strategy=remote_local_fallback
dial_timeout=10m
exec_timeout=2m
reclient_timeout=2m
canonicalize_working_dir=true
8 changes: 8 additions & 0 deletions cobalt/reclient_cfgs/python/rewrapper_linux.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
platform=container-image=docker://gcr.io/chops-public-images-prod/rbe/siso-chromium/linux@sha256:26de99218a1a8b527d4840490bcbf1690ee0b55c84316300b60776e6b3a03fe1,label:action_default=1
server_address=unix:///tmp/reproxy.sock
labels=type=tool
exec_strategy=remote_local_fallback
dial_timeout=10m
canonicalize_working_dir=true
exec_timeout=2m
reclient_timeout=2m

0 comments on commit 5440dc1

Please sign in to comment.