Mount Bazel repository_cache, Go mod cache and Go build cache as volumes

This leaves us with only git_repository rules not being cached,
the worst offender being the edk2 recursive submodule clone.

See: https://github.com/bazelbuild/bazel/issues/5116

gazelle's repo lookup (running `go list`) is also not cached, even if the
repositories themselves are.

We can eliminate most of the remaining rebuild time by mounting
the entire execroot, however, this is currently foiled by a podman bug
(Bazel needs to execute lots of binaries inside the root):

https://github.com/containers/libpod/issues/4318

Test Plan:
Ran `bazel build scripts:launch`, recreated container, ran it again.

Build times decreased significantly:

    INFO: Elapsed time: 279.951s, Critical Path: 119.05s
    INFO: 477 processes: 476 linux-sandbox, 1 local.
    INFO: Build completed successfully, 497 total actions

X-Origin-Diff: phab/D206
GitOrigin-RevId: 2d17a7eeb5d8b70ad4e26c13a0c6b31c4edfb33f
1 file changed
tree: f07f5a23d75445789a1cbb116e8ca30471106ab2
  1. build/
  2. cmd/
  3. internal/
  4. pkg/
  5. scripts/
  6. .bazelignore
  7. .bazelrc
  8. .bazelversion
  9. BUILD
  10. README.md
  11. WORKSPACE
README.md

Smalltown Operating System

Run build

The build uses a Fedora 30 base image with a set of dependencies. Guide has been tested on a Fedora 30 host, with latest rW deployed.

Build the base image:

podman build -t smalltown-builder .

Launch the VM:

scripts/bin/bazel run scripts:launch

Exit qemu using the monitor console: Ctrl-A c quit.