sdk_subtools: Refactor into a build api endpoint.
Methods from scripts/build_sdk_subtools that are shared with the recipe
are moved mostly verbatim into chromite/service/sdk_subtools.py.
A `sudo` argument is added to setup_base_sdk, and the subtools chroot
sentinel file is created with osutils.WriteText(sudo=True) to reduce
friction when invoking from the build api layer.
api/controller/sdk_subtools.py is added with unit tests and a
call_scripts template, and the proto is registered with the router.
BUG=b:277992359
TEST=call_scripts/build_sdk_subtools__build_sdk_subtools
Change-Id: I5907e1a92050b0d781962eb4812112efe41b5684
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4792625
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Tested-by: Trent Apted <tapted@chromium.org>
diff --git a/api/router.py b/api/router.py
index 7e53f8d..8ddfa96 100644
--- a/api/router.py
+++ b/api/router.py
@@ -37,6 +37,7 @@
from chromite.api.gen.chromite.api import payload_pb2
from chromite.api.gen.chromite.api import portage_explorer_pb2
from chromite.api.gen.chromite.api import sdk_pb2
+from chromite.api.gen.chromite.api import sdk_subtools_pb2
from chromite.api.gen.chromite.api import sysroot_pb2
from chromite.api.gen.chromite.api import test_pb2
from chromite.api.gen.chromite.api import toolchain_pb2
@@ -621,6 +622,7 @@
router.Register(payload_pb2)
router.Register(portage_explorer_pb2)
router.Register(sdk_pb2)
+ router.Register(sdk_subtools_pb2)
router.Register(sysroot_pb2)
router.Register(test_pb2)
router.Register(toolchain_pb2)