[bazel] Use bigger disk when compiling task drivers

The root disk on our GCE VMs typically only have 15GB
and have a much larger disk attached to them.

We want the Bazel cache to be on this larger disk so
we don't run out of disk space as often.

BuildTaskDrivers was not doing that, but the task
drivers which use Bazel are.

Change-Id: I0f797188576707341972a1db7418e8916633333c
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525456
Reviewed-by: Ravi Mistry <rmistry@google.com>
This commit is contained in:
Kevin Lubick 2022-03-29 08:33:06 -04:00
parent b4f177ef05
commit 1ddbe1aa69
4 changed files with 13 additions and 6 deletions

View File

@ -18,8 +18,13 @@ cd ../..
PLATFORM=${2:-linux_amd64} # use linux_amd64 if not specified
# Build the executables and extract them to the folder in the first argument.
bazelisk build //infra/bots:all_task_drivers \
--platforms=@io_bazel_rules_go//go/toolchain:${PLATFORM}
# We specify the cache directory to be somewhere other than the default (home directory)
# Because the home directory is mounted on / which typically does not have a lot of disk space.
# /mnt/pd0 is the bigger disk mounted to the GCE VM.
# https://bazel.build/docs/output_directories#layout
bazelisk --output_user_root=/mnt/pd0/bazel_cache \
build //infra/bots:all_task_drivers --platforms=@io_bazel_rules_go//go/toolchain:${PLATFORM}
tar -xf bazel-bin/infra/bots/built_task_drivers.tar -C ${1}
# Bazel outputs are write-protected, so we make sure everybody can write them. This way there
# are no expected errors in deleting them later.

View File

@ -46,8 +46,8 @@ func main() {
skiaDir := filepath.Join(wd, "skia")
opts := bazel.BazelOptions{
// We choose a path that is not in the home directory (which is the default) so it is easier
// to monitor/clean up if we are running low on disk space.
// We want the cache to be on a bigger disk than default. The root disk, where the home
// directory (and default Bazel cache) lives, is only 15 GB on our GCE VMs.
CachePath: "/mnt/pd0/bazel_cache",
}
if err := bazel.EnsureBazelRCFile(ctx, opts); err != nil {

View File

@ -48,8 +48,8 @@ func main() {
skiaDir := filepath.Join(wd, "skia")
opts := bazel.BazelOptions{
// We choose a path that is not in the home directory (which is the default) so it is easier
// to monitor/clean up if we are running low on disk space.
// We want the cache to be on a bigger disk than default. The root disk, where the home
// directory (and default Bazel cache) lives, is only 15 GB on our GCE VMs.
CachePath: "/mnt/pd0/bazel_cache",
}
if err := bazel.EnsureBazelRCFile(ctx, opts); err != nil {

View File

@ -112,6 +112,8 @@ func main() {
}
opts := bazel.BazelOptions{
// We want the cache to be on a bigger disk than default. The root disk, where the home
// directory (and default Bazel cache) lives, is only 15 GB on our GCE VMs.
CachePath: "/mnt/pd0/bazel_cache",
}
if err := bazel.EnsureBazelRCFile(ctx, opts); err != nil {