Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Build fix for v0.6.0 #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.1.0
2 changes: 1 addition & 1 deletion docker/build.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down
7 changes: 6 additions & 1 deletion docker/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set -e

# Flags
CLEAN=false
CLEAR_CACHE=false
RELEASE=false
PYTHON=3.10

Expand All @@ -31,6 +32,10 @@ while [[ $# -gt -0 ]]; do
CLEAN="$2"
shift
;;
--clear_bazel_cache)
CLEAR_CACHE="$2"
shift
;;
--release)
RELEASE="$2"
shift
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion launchpad/pip_package/launchpad_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
24 changes: 9 additions & 15 deletions launchpad/repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor Author

@ethanluoyc ethanluoyc Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is based on the google-deepmind/reverb#106 I did for Reverb. It's not necessary to include the .so and that actually causes troubles for some Python environments that do not install libpython.so at the system location (aka conda).

I can clean this up if tests pass.

# 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",
Expand All @@ -259,7 +259,7 @@ cc_library(
includes = ["numpy_includes"],
visibility = ["//visibility:public"],
)
""".format(python_solib.basename),
""",
executable = False,
)

Expand Down Expand Up @@ -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",
],
)

Expand Down
10 changes: 10 additions & 0 deletions oss_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down