Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specifying the name of the default pool to use #16

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,18 @@ def post_configure():
pass
```

### Define large pool
### Define pools to run on

#### Define default pool

By default, actions will not specify which pool to run on, so they will be run on the default worker
pool. You can customize the name of the pool to run actions on as follows:

```
python3 configure_reclient.py --default_pool_name=<NAME_OF_DEFAULT_POOL>
```

#### Define large pool

Chromium now supports running actions on a different worker pool that might otherwise run into
an OOM. See [Reclient](https://source.chromium.org/chromium/chromium/src/+/4f94ce92c8c657cbfeb4dd386581340704c9dd11).
Expand All @@ -157,4 +168,10 @@ You can define the name of the large pool by passing the following flag when run
python3 configure_reclient.py --large_pool_name=<NAME_OF_LARGE_POOL>
```

By default, these actions will use the default worker pool, same as other actions.
Thus, large actions are run on the following pool:

- If `--large_pool_name` is set, on the pool with the specified name.
- If `--large_pool_name` is not set and `--default_pool_name` is set, on the pool with the specified
name.
- If neither `--large_pool_name` nor `--default_pool_name` are set, on the remote's default pool,
i.e., the pool used when actions do not request being run on a specific pool.
14 changes: 13 additions & 1 deletion configure_reclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,17 @@ def parse_args():
help='Prints out files modified.',
action='store_true',
)
parser.add_argument(
'--default_pool_name',
help=('The remote pool name to run actions on. If unspecified, uses '
' the remote\'s default pool.'),
default='',
)
parser.add_argument(
'--large_pool_name',
help=('The remote pool name to run large actions on.'),
help=('The remote pool name to run large actions on. If unspecified, '
'uses the pool specified with --default_pool_name, or else the '
'remote\'s default pool.'),
default='',
)

Expand Down Expand Up @@ -270,6 +278,8 @@ def generate_rewrapper_cfg(self, tool, host_os):
f'{Paths.script_dir}/{tool}/rewrapper_{host_os}.cfg',
]

if self.args.default_pool_name:
rewrapper_cfg['platform']['Pool'] = self.args.default_pool_name
for source_cfg_path in source_cfg_paths:
rewrapper_cfg = ReclientCfg.merge_cfg(rewrapper_cfg,
source_cfg_path)
Expand Down Expand Up @@ -302,6 +312,8 @@ def generate_rewrapper_large_cfg(self, tool, host_os):
]
if self.args.large_pool_name:
rewrapper_cfg['platform']['Pool'] = self.args.large_pool_name
elif self.args.default_pool_name:
rewrapper_cfg['platform']['Pool'] = self.args.default_pool_name
for source_cfg_path in source_cfg_paths:
rewrapper_cfg = ReclientCfg.merge_cfg(rewrapper_cfg,
source_cfg_path)
Expand Down