Improve compatibility of Buildstream with Buildbarn and Buildfarm

Background

Buildstream is currently not compatible with Buildbarn, Buildfarm or RBE.

Task description

Non exhaustive list of tasks

Discussion

With the goal of improving Buildstream compatibility with alternative RE server implementations aside from the tested buildgrid. Buildstream requires the extension of bst-artifact-server to work with remote execution (RE) services which follow the RE spec. This is fine as the overhead is not too large on the artifact server and !1540 (merged) will allow for separate endpoints to be used for the CAS and index server instances.

Buildbarn

Testing compatibility with Buildbarn is detailed and it is clear that Buildbarn is not following the spec. Buildbarn will have to correct the implementation of output_directories to be relative to the working_directory which is currently (correctly) relative to the input root. This is an unseen issue when Buildbarn interacts with Bazel as builds appear to specify the working_directory as . which is relative to the input_root. Following these changes, Buildstream should be compatible with Buildbarn given an appropriate image for sandboxing as detailed in slack.

Mickaël Carl 3:47 PM
--------------------
So indeed, bb-runner is currently provided on top of a Ubuntu image that’s also in use by RBE if I’m not mistaken
You are of course free to decide for yourself which base to use and move to a different base image

It’s actually incredibly simple, see https://github.com/buildbarn/bb-remote-execution/blob/master/cmd/bb_runner/BUILD.bazel

Specifically line 41

Buildfarm

Buildfarm also causes issues while working with Buildstream however I am currently unsure of whether this an issue with Buildstream or Buildfarm. remote-apis-testing/remote-apis-testing#43 (closed) details how to reproduce the issues I found and provides a stack trace pointing to an issue while uploading results. It is likely that Buildstream interacts with Buildfarm in a way that has gone unnoticed whilst Bazel has been used with Buildfarm.


Edited by Benjamin Schubert