-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This project needs to compile and link against tensorflow-cpu. Before, the tensorflow-cpu pip package had to be installed manually (e.g. in the devcontainer) but now Bazel manages it as part of the build system. This project now uses Bazel's hermetic python interpreter instead of relying on what is installed on the host system. This prevents python version mismatches which are a problem because cpython's ABI changes across minor versions.
- Loading branch information
1 parent
6711f52
commit 114afb2
Showing
26 changed files
with
2,648 additions
and
561 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
build --enable_bzlmod | ||
|
||
build -c opt | ||
|
||
build --spawn_strategy=standalone | ||
build --strategy=Genrule=standalone | ||
build --spawn_strategy=sandboxed | ||
|
||
build --cxxopt='-std=c++17' | ||
build --cxxopt='-D_GLIBCXX_USE_CXX11_ABI=1' | ||
|
||
build:test --cxxopt='-DPYBIND11_ABSEIL_STATUS_MODULE_PATH=pybind11_abseil.pybind11_abseil.status' | ||
|
||
build:release --cxxopt='-DPYBIND11_ABSEIL_STATUS_MODULE_PATH=pybind11_abseil.status' | ||
|
||
build:asan --strip=never | ||
build:asan --copt -fsanitize=address | ||
build:asan --copt -DADDRESS_SANITIZER | ||
build:asan --copt -O1 | ||
build:asan --copt -g | ||
build:asan --copt -fno-omit-frame-pointer | ||
build:asan --linkopt -fsanitize=address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
load("//:version.bzl", "VERSION_LABEL") | ||
load("@rules_python//python:pip.bzl", "compile_pip_requirements") | ||
load("@python_versions//3.8:defs.bzl", compile_pip_requirements_3_8 = "compile_pip_requirements") | ||
load("@python_versions//3.8:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements") | ||
load("@python_versions//3.8:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements") | ||
load("@python_versions//3.8:defs.bzl", compile_pip_requirements_3_11 = "compile_pip_requirements") | ||
|
||
load("@pip//:requirements.bzl", "requirement") | ||
load("@rules_python//python:defs.bzl", "py_binary") | ||
load("@rules_python//python:packaging.bzl", "py_wheel") | ||
|
@@ -9,16 +13,43 @@ exports_files([ | |
"LICENSE", | ||
"setup.py", | ||
"requirements.in", | ||
"requirements.txt", | ||
"requirements_3_8.txt", | ||
"requirements_3_9.txt", | ||
"requirements_3_10.txt", | ||
"requirements_3_11.txt", | ||
"README.md", | ||
"DESCRIPTION.md", | ||
]) | ||
|
||
compile_pip_requirements( | ||
name = "requirements", | ||
compile_pip_requirements_3_8( | ||
name = "requirements_3_8", | ||
extra_args = ["--allow-unsafe"], # need setuptools | ||
requirements_in = "//:requirements.in", | ||
requirements_txt = "//:requirements_3_8.txt", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
compile_pip_requirements_3_9( | ||
name = "requirements_3_9", | ||
extra_args = ["--allow-unsafe"], # need setuptools | ||
requirements_in = "//:requirements.in", | ||
requirements_txt = "//:requirements_3_9.txt", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
compile_pip_requirements_3_10( | ||
name = "requirements_3_10", | ||
extra_args = ["--allow-unsafe"], # need setuptools | ||
requirements_in = "//:requirements.in", | ||
requirements_txt = "//:requirements_3_10.txt", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
compile_pip_requirements_3_11( | ||
name = "requirements_3_11", | ||
extra_args = ["--allow-unsafe"], # need setuptools | ||
requirements_in = "//:requirements.in", | ||
requirements_txt = "//:requirements.txt", | ||
requirements_txt = "//:requirements_3_11.txt", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
|
@@ -54,16 +85,31 @@ py_binary( | |
], | ||
) | ||
|
||
py_binary( | ||
name = "wheel_rename", | ||
srcs = ["//tools:wheel_rename.py"], | ||
python_version = "PY3", | ||
srcs_version = "PY3", | ||
visibility = [ | ||
"//:__pkg__", | ||
], | ||
deps = [ | ||
requirement("packaging"), | ||
], | ||
) | ||
|
||
py_wheel( | ||
name = "wheel", | ||
abi = "ABI", | ||
author = "Google Inc.", | ||
author_email = "[email protected]", | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Security :: Cryptography", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Scientific/Engineering :: Mathematics", | ||
], | ||
description_file = "//:DESCRIPTION.md", | ||
description_file = "//:README.md", | ||
distribution = "tf-shell", | ||
extra_distinfo_files = { | ||
"//:LICENSE": "LICENSE", | ||
|
@@ -82,6 +128,7 @@ py_wheel( | |
python_requires = ">=3.8.0", | ||
python_tag = "INTERPRETER", | ||
requires = ["tensorflow-cpu==2.13.0"], | ||
summary = "TF-Shell: Privacy preserving machine learning with Tensorflow and the SHELL encryption library", | ||
version = VERSION_LABEL, | ||
deps = [ | ||
"//shell_ml:shell_ml_pkg", | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.