diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 0000000..dfda3e0 --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +6.1.0 diff --git a/docker/build.dockerfile b/docker/build.dockerfile index 18c360f..49ba062 100644 --- a/docker/build.dockerfile +++ b/docker/build.dockerfile @@ -51,7 +51,7 @@ RUN ${APT_COMMAND} update && ${APT_COMMAND} install -y --no-install-recommends \ RUN curl -O https://bootstrap.pypa.io/get-pip.py # Installs known working version of bazel. -ARG bazel_version=5.3.0 +ARG bazel_version=6.1.0 ENV BAZEL_VERSION ${bazel_version} RUN mkdir /bazel && \ cd /bazel && \ diff --git a/docker/build_and_test.sh b/docker/build_and_test.sh index 67609d2..dae2012 100755 --- a/docker/build_and_test.sh +++ b/docker/build_and_test.sh @@ -17,6 +17,7 @@ set -e # Flags CLEAN=false +CLEAR_CACHE=false RELEASE=false PYTHON=3.10 @@ -31,6 +32,10 @@ while [[ $# -gt -0 ]]; do CLEAN="$2" shift ;; + --clear_bazel_cache) + CLEAR_CACHE="$2" + shift + ;; --release) RELEASE="$2" shift @@ -79,7 +84,7 @@ run_docker docker build --tag launchpad:build \ run_docker docker run --rm ${MOUNT_CMD} \ launchpad:build /tmp/launchpad/oss_build.sh --python "${PYTHON}" \ - --clean ${CLEAN} --install false $RELEASE_FLAG + --clean ${CLEAN} --clear_bazel_cache ${CLEAR_CACHE} --install false $RELEASE_FLAG for python_version in $PYTHON; do diff --git a/launchpad/pip_package/launchpad_version.py b/launchpad/pip_package/launchpad_version.py index 4cde05e..3b7da8e 100644 --- a/launchpad/pip_package/launchpad_version.py +++ b/launchpad/pip_package/launchpad_version.py @@ -37,7 +37,7 @@ __dev_version__ = '{}.{}'.format(__version__, _DEV_SUFFIX) __rel_version__ = '{}{}'.format(__version__, _REL_SUFFIX) -__tensorflow_version__ = 'tensorflow~=2.12.0' +__tensorflow_version__ = 'tensorflow~=2.13.0' __reverb_version__ = 'dm-reverb==0.12.0' __nightly_tensorflow_version__ = 'tf-nightly' diff --git a/launchpad/repo.bzl b/launchpad/repo.bzl index d1b7381..f051a7a 100644 --- a/launchpad/repo.bzl +++ b/launchpad/repo.bzl @@ -235,14 +235,14 @@ cc_library( def _python_includes_repo_impl(repo_ctx): python_include_path = _find_python_include_path(repo_ctx) - python_solib = _find_python_solib_path(repo_ctx) + # python_solib = _find_python_solib_path(repo_ctx) repo_ctx.symlink(python_include_path, "python_includes") numpy_include_path = _find_numpy_include_path(repo_ctx) repo_ctx.symlink(numpy_include_path, "numpy_includes") - repo_ctx.symlink( - "{}/{}".format(python_solib.dir, python_solib.basename), - python_solib.basename, - ) + # repo_ctx.symlink( + # "{}/{}".format(python_solib.dir, python_solib.basename), + # python_solib.basename, + # ) repo_ctx.file( "BUILD", @@ -259,7 +259,7 @@ cc_library( includes = ["numpy_includes"], visibility = ["//visibility:public"], ) -""".format(python_solib.basename), +""", executable = False, ) @@ -333,16 +333,10 @@ def github_apple_deps(): def github_grpc_deps(): http_archive( name = "com_github_grpc_grpc", - patch_cmds = [ - """sed -i.bak 's/"python",/"python3",/g' third_party/py/python_configure.bzl""", - """sed -i.bak 's/PYTHONHASHSEED=0/PYTHONHASHSEED=0 python3/g' bazel/cython_library.bzl""", - ], - sha256 = "39bad059a712c6415b168cb3d922cb0e8c16701b475f047426c81b46577d844b", - strip_prefix = "grpc-reverb_fix", + strip_prefix = "grpc-1.54.2", + sha256 = "3c305f0ca5f98919bc104448f59177e7b936acd5c69c144bf4a548cad723e1e4", urls = [ - # Patched version of GRPC / boringSSL to make it compile with old TF GCC compiler - # (see b/244280763 for details). - "https://github.com/qstanczyk/grpc/archive/reverb_fix.tar.gz", + "https://github.com/grpc/grpc/archive/refs/tags/v1.54.2.tar.gz", ], ) diff --git a/oss_build.sh b/oss_build.sh index e18886c..de2acb7 100755 --- a/oss_build.sh +++ b/oss_build.sh @@ -23,6 +23,8 @@ cd "$(dirname "$0")" # Flags PYTHON_VERSIONS=3.8 # Options 3.7, 3.8, 3.9, 3.10 CLEAN=false # Set to true to run bazel clean. +# Also see https://github.com/deepmind/reverb/commit/4da8a918794b65aff4afd539e89e0ef6c35c3f35 +CLEAR_CACHE=false # Set to true to delete Bazel cache folder. b/279235134 OUTPUT_DIR=/tmp/launchpad/dist/ INSTALL=true # Should the built package be installed. @@ -42,6 +44,10 @@ while [[ $# -gt -0 ]]; do CLEAN="$2" # `true` to run bazel clean. False otherwise. shift ;; + --clear_bazel_cache) + CLEAR_CACHE="$2" + shift + ;; --install) INSTALL="$2" # `true` to install built package. False otherwise. shift @@ -56,6 +62,7 @@ while [[ $# -gt -0 ]]; do echo "--release [Indicates this is a release build. Otherwise nightly.]" echo "--python [3.7|3.8(default)|3.9]" echo "--clean [true to run bazel clean]" + echo "--clear_bazel_cache [true to delete Bazel cache folder]" echo "--install [true to install built package]" echo "--output_dir [location to copy .whl file.]" exit 1 @@ -68,6 +75,9 @@ for python_version in $PYTHON_VERSIONS; do # Cleans the environment. if [ "$CLEAN" = "true" ]; then + if [ "$CLEAR_CACHE" = "true" ]; then + rm -rf $HOME/.cache/bazel + fi bazel clean fi