Skip to content

Commit

Permalink
Add .bazelrc configs to allow for internal remote caching
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 725317788
  • Loading branch information
Matt-Hurd authored and copybara-github committed Feb 10, 2025
1 parent af6d96c commit e4615b2
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,59 @@ build:windows --linkopt=/OPT:REF
build:windows --host_linkopt=/OPT:REF
build:windows --linkopt=/OPT:ICF
build:windows --host_linkopt=/OPT:ICF

# #############################################################################
# RBE config options below. These inherit the CI configs above and set the
# remote execution backend and authentication options required to run builds
# with RBE. Linux x86 and Windows builds use RBE.
# Based off of https://github.com/tensorflow/tensorflow/blob/master/.bazelrc
# #############################################################################

# Allow creation of resultstore URLs for any bazel invocation
build:resultstore --google_default_credentials
build:resultstore --bes_backend=buildeventservice.googleapis.com
build:resultstore --bes_instance_name="tensorflow-testing"
build:resultstore --bes_results_url="https://source.cloud.google.com/results/invocations"
build:resultstore --bes_timeout=600s

build:avx_linux --copt=-mavx
build:avx_linux --host_copt=-mavx

# Flag to enable remote config
common --experimental_repo_remote_exec

# Make Bazel not try to probe the host system for a C++ toolchain.
build:rbe_base --config=resultstore
build:rbe_base --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build:rbe_base --define=EXECUTOR=remote
build:rbe_base --jobs=800
build:rbe_base --remote_executor=grpcs://remotebuildexecution.googleapis.com
build:rbe_base --remote_timeout=3600
build:rbe_base --spawn_strategy=remote,worker,standalone,local
# Attempt to minimize the amount of data transfer between bazel and the remote
# workers:
build:rbe_base --remote_download_toplevel
test:rbe_base --test_env=USER=anon

build:rbe_linux --config=rbe_base
build:rbe_linux --action_env=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"
# Non-rbe settings we should include because we do not run configure
build:rbe_linux --config=avx_linux
build:rbe_linux --linkopt=-lrt
build:rbe_linux --host_linkopt=-lrt
build:rbe_linux --linkopt=-lm
build:rbe_linux --host_linkopt=-lm

build:rbe_linux_cpu --config=rbe_linux
# Linux cpu and cuda builds share the same toolchain now.
build:rbe_linux_cpu --host_crosstool_top="@local_config_cuda//crosstool:toolchain"
build:rbe_linux_cpu --crosstool_top="@local_config_cuda//crosstool:toolchain"
build:rbe_linux_cpu --extra_toolchains="@local_config_cuda//crosstool:toolchain-linux-x86_64"
build:rbe_linux_cpu --repo_env=CC="/usr/lib/llvm-18/bin/clang"
build:rbe_linux_cpu --repo_env=TF_SYSROOT="/dt9"
build:rbe_linux_cpu --extra_execution_platforms="@ml_build_config_platform//:platform"
build:rbe_linux_cpu --host_platform="@ml_build_config_platform//:platform"
build:rbe_linux_cpu --platforms="@ml_build_config_platform//:platform"
# Python config is the same across all containers because the binary is the same
build:rbe_linux_cpu --python_path="/usr/bin/python3"
common:rbe_linux_cpu --remote_instance_name=projects/tensorflow-testing/instances/default_instance

0 comments on commit e4615b2

Please sign in to comment.