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.

b/384982606
  • Loading branch information
briantting committed Dec 18, 2024
1 parent 1f79302 commit d6ff771
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
21 changes: 9 additions & 12 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ runs:
- name: Get depot tools
run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
shell: bash
- name: Add directory to PATH
- name: Add depot tools to PATH
run: echo "$GITHUB_WORKSPACE/depot_tools" >> $GITHUB_PATH
shell: bash
- name: Disable Chromium client side build telemetry
run: build_telemetry opt-out
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
shell: bash
- name: Set target OS for Android
if: ${{ contains(matrix.platform, 'android') }}
run: |
echo "target_os=['android']" >> .gclient
gclient validate
shell: bash
- name: Gclient sync
- 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
- name: GN gen
run: |
cd src
cobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }}
shell: bash
- name: Dump GN args
- name: List GN args
run: |
cd src
gn args --list --short --overrides-only out/${{ matrix.platform }}_${{ matrix.config }}
Expand All @@ -44,10 +44,7 @@ runs:
run: |
set -x
cd src
ninja -C out/${{ matrix.platform }}_${{ matrix.config }} $(echo "${TARGETS}" | tr -d '"')
shell: bash
- name: Dump sccache stats
run: sccache -s
time autoninja -C out/${{ matrix.platform }}_${{ matrix.config }} $(echo "${TARGETS}" | tr -d '"')
shell: bash
- name: Archive Android APKs
if: startsWith(matrix.platform, 'android') && matrix.config == 'qa'
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ vars = {
# Fetch configuration files required for the 'use_remoteexec' gn arg
'download_remoteexec_cfg': False,
# RBE instance to use for running remote builds
'rbe_instance': Str('projects/rbe-chrome-untrusted/instances/default_instance'),
'rbe_instance': Str('projects/cobalt-actions-devel/instances/default_instance'),
# RBE project to download rewrapper config files for. Only needed if
# different from the project used in 'rbe_instance'
'rewrapper_cfg_project': Str(''),
Expand Down
5 changes: 4 additions & 1 deletion buildtools/reclient_cfgs/fetch_reclient_cfgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ class CipdError(Exception):
def CipdEnsure(pkg_name, ref, directory, quiet):
logging.info('ensure %s %s in %s' % (pkg_name, ref, directory))
log_level = 'warning' if quiet else 'debug'
auth = []
if os.getenv('IS_CI', default='0') == '1':
auth = ['-service-account-json', ':gce']
ensure_file = """
$ParanoidMode CheckPresence
{pkg} {ref}
""".format(pkg=pkg_name, ref=ref)
try:
output = subprocess.check_output(
' '.join(['cipd', 'ensure', '-log-level=' + log_level,
'-root', directory, '-ensure-file', '-']),
'-root', directory, '-ensure-file', '-'] + auth),
shell=True, input=ensure_file, stderr=subprocess.STDOUT,
universal_newlines=True)
logging.info(output)
Expand Down
2 changes: 1 addition & 1 deletion cobalt/build/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ 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':
if os.getenv('USE_CC_WRAPPER', default='0') == '1':
f.write(f'cc_wrapper = "{CC_WRAPPER}" {gen_comment}\n')
else:
f.write(f'use_remoteexec = true {gen_comment}\n')
Expand Down

0 comments on commit d6ff771

Please sign in to comment.