Revert "api: artifacts, payload: Properly plumb chroot parameters for tempdir"
This reverts commit e2876a64b6fc8ba56cbce53eb649fbaec3542aa2.
Reason for revert: Breaks cbuildbot.commands.GeneratePayloads().
Not sure whether that affects any production builders today, but
erring on the side of ChromeOS's "revert first" policy.
Original change's description:
> api: artifacts, payload: Properly plumb chroot parameters for tempdir
>
> 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: I128ca7bbc865d5bb3ae333a61f9935d2b4b4a026
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4621999
> Reviewed-by: Anuj Jamwal <anujjamwal@google.com>
> Commit-Queue: Brian Norris <briannorris@chromium.org>
> Tested-by: Brian Norris <briannorris@chromium.org>
BUG=b:265885353
Change-Id: I4a5de436a02246ac411c92692aa6b420e617d920
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4638014
Reviewed-by: Brian Norris <briannorris@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Greg Edelston <gredelston@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
diff --git a/api/controller/artifacts.py b/api/controller/artifacts.py
index 70ee650..3766db9 100644
--- a/api/controller/artifacts.py
+++ b/api/controller/artifacts.py
@@ -275,7 +275,6 @@
"""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.
@@ -302,7 +301,7 @@
)
image = valid_images[0]
- payloads = artifacts.BundleTestUpdatePayloads(chroot, image, output_dir)
+ payloads = artifacts.BundleTestUpdatePayloads(image, output_dir)
for payload in payloads:
output_proto.artifacts.add().path = payload