| """Build step class for starting reproxy.""" |
| |
| from __future__ import absolute_import |
| import logging |
| |
| from helpers import rbe_utils |
| from slave import base_step |
| |
| |
| class ReproxyStartStep(base_step.BaseStep): |
| """Build step class for starting the remote execution reproxy.""" |
| |
| def __init__(self, **kwargs): |
| """Creates a ReproxyStartStep instance. |
| |
| Args: |
| **kwargs: Any additional args to pass to BaseStep. |
| """ |
| super().__init__(name='reproxy start', **kwargs) |
| |
| def run(self): |
| """Starts the reproxy process. |
| |
| Starts reproxy via the bootstrap control binary. |
| |
| Returns: |
| True if reproxy has started successfully. |
| """ |
| |
| if not rbe_utils.is_installed(): |
| if self.build_system == 'catabuilder': |
| return True |
| logging.warning( |
| 'RBE was requested (via use_rbe=True) but it is not installed on ' |
| 'this branch. go/cherry-pick-rbe to fix this build error.') |
| return False |
| |
| retcode, _, _ = rbe_utils.start_reproxy(self) |
| if retcode != 0: |
| logging.error('reproxy failed to start') |
| return False |
| |
| return True |