Reland: api: artifacts, payload: Properly plumb chroot parameters for tempdir

Originally at:
https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4621999

With missing changes for cbuildbot/commands.py / GeneratePayloads

 ---

The payload and artifacts services tend to be using the wrong chroot tmp
directory, because they use chroot_util.TempDirInChroot(), which doesn't
provide the ability to map non-default chroot parameters. This sometimes
works out OK if the exact path doesn't matter, but sometimes we hit up
against non-existent paths or other mismatches.

Drop chroot_util.TempDirInChroot() and use chroot_lib.Chroot.tempdir()
(where Chroot encourages carrying the correct parameters), and plumb the
Chroot params through the payload APIs.

For a few of these refactorings, construct a default Chroot object
instead of bothering with all the plumbing (even though that's likely
incorrect in some cases), because:
(1) it's functionally equivalent and
(2) I suspect some of it only sources back to (dead?) cbuildbot code.

SignerPayloadsClientGoogleStorage note: this class didn't require a work
directory, but all users pass one. Make this param required, so we can
drop any directory-creating fallback.

BUG=b:265885353
TEST=./run_tests

Change-Id: I2b5a4d44b36e95a9d2a9dfa153b08d084780f233
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4638455
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Commit-Queue: Brian Norris <briannorris@chromium.org>
diff --git a/api/controller/artifacts.py b/api/controller/artifacts.py
index 3766db9..70ee650 100644
--- a/api/controller/artifacts.py
+++ b/api/controller/artifacts.py
@@ -275,6 +275,7 @@
     """Generate minimal update payloads for the build target for testing."""
     target = input_proto.build_target.name
     output_dir = input_proto.output_dir
+    chroot = controller_util.ParseChroot(input_proto.chroot)
     build_root = constants.SOURCE_ROOT
 
     # Use the first available image to create the update payload.
@@ -301,7 +302,7 @@
         )
     image = valid_images[0]
 
-    payloads = artifacts.BundleTestUpdatePayloads(image, output_dir)
+    payloads = artifacts.BundleTestUpdatePayloads(chroot, image, output_dir)
     for payload in payloads:
         output_proto.artifacts.add().path = payload