Skip to content

Commit

Permalink
Update MediaPipe to 0.10.3
Browse files Browse the repository at this point in the history
* Bump oneTBB to avoid using deprecated selection in build files
bazelbuild/bazel#8622
* Bump TF and remove patches
* Fix oneTBB patch
* Fix order of glog include
* Fixes in UT's after gtest bump
Gtest now detects that there are parametrized fixtures and there is no
instantiation of that fixture and reports that a test failure.
* Update TFS Model Metadata tests after TFS update
With updated TFS the model metadata response through REST API contains
additional field.
* New patch for TF after update

JIRA:CVS-114360
  • Loading branch information
atobiszei committed Oct 9, 2023
1 parent fc28a6d commit 0b205e4
Show file tree
Hide file tree
Showing 26 changed files with 804 additions and 215 deletions.
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ cc_library(
"@minitrace//:trace",
"@com_github_grpc_grpc//:grpc++",
"@org_tensorflow//tensorflow/core:framework",
"@org_tensorflow//tensorflow/lite/c:c_api",
"@org_tensorflow//tensorflow/lite:framework_stable",
"@com_github_tencent_rapidjson//:rapidjson",
"@com_github_gabime_spdlog//:spdlog",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ RUN if [ "$NVIDIA" == "1" ] ; then true ; else exit 0 ; fi ; \
echo '<ie><plugins><plugin location="libopenvino_nvidia_gpu_plugin.so" name="NVIDIA"></plugin></plugins></ie>' > /opt/intel/openvino/runtime/lib/intel64/plugins.xml

# Set up Bazel
ENV BAZEL_VERSION 5.3.1
ENV BAZEL_VERSION 6.0.0
WORKDIR /bazel
RUN curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36" -fSsL -o /bazel/LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \
Expand Down
46 changes: 26 additions & 20 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "3.7.2")

# overriding tensorflow serving bazel dependency
# alternative would be to use cmake build of grpc and flag
# to use system ssl instead
Expand Down Expand Up @@ -61,7 +74,7 @@ cc_library(
git_repository(
name = "tensorflow_serving",
remote = "https://github.com/tensorflow/serving.git",
tag = "2.6.5",
tag = "2.13.0",
patch_args = ["-p1"],
patches = ["net_http.patch", "listen.patch"]
# ^^^^^^^^^^^^
Expand Down Expand Up @@ -89,7 +102,7 @@ http_archive(
git_repository(
name = "mediapipe",
remote = "https://github.com/openvinotoolkit/mediapipe",
commit = "576df1403d2861d3308d229ff0e2f31c4d7277c9", # Fix tensors handling (#34)
commit = "3e30533e39f5ebc6db159ead9d87185b4ce857d8", # mediapipe bump to 0.10.3
)

# DEV mediapipe 1 source - adjust local repository path for build
Expand Down Expand Up @@ -133,12 +146,13 @@ http_archive(
)

http_archive(
name = "rules_foreign_cc",
strip_prefix = "rules_foreign_cc-0.1.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.1.0.zip",
name = "rules_foreign_cc",
sha256 = "2a4d07cd64b0719b39a7c12218a3e507672b82a97b98c6a89d38565894cf7c51",
strip_prefix = "rules_foreign_cc-0.9.0",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/refs/tags/0.9.0.tar.gz",
)

load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")

rules_foreign_cc_dependencies()

Expand Down Expand Up @@ -250,9 +264,9 @@ cc_library(
#)

# TensorFlow repo should always go after the other external dependencies.
# TF on 2022-08-10.
_TENSORFLOW_GIT_COMMIT = "af1d5bc4fbb66d9e6cc1cf89503014a99233583b"
_TENSORFLOW_SHA256 = "f85a5443264fc58a12d136ca6a30774b5bc25ceaf7d114d97f252351b3c3a2cb"
# TF on 2023-06-13.
_TENSORFLOW_GIT_COMMIT = "491681a5620e41bf079a582ac39c585cc86878b9"
_TENSORFLOW_SHA256 = "9f76389af7a2835e68413322c1eaabfadc912f02a76d71dc16be507f9ca3d3ac"
http_archive(
name = "org_tensorflow",
urls = [
Expand All @@ -276,13 +290,6 @@ http_archive(
load("@tensorflow_serving//tensorflow_serving:workspace.bzl", "tf_serving_workspace")
tf_serving_workspace()

# Check bazel version requirement, which is stricter than TensorFlow's.
load(
"@org_tensorflow//tensorflow:version_check.bzl",
"check_bazel_version_at_least"
)
check_bazel_version_at_least("5.3.1")

# Initialize TensorFlow's external dependencies.
load("@org_tensorflow//tensorflow:workspace3.bzl", "workspace")
workspace()
Expand Down Expand Up @@ -350,9 +357,8 @@ google_cloud_cpp_common_deps()

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()

load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()
#load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
#grpc_extra_deps()

# cxxopts
http_archive(
Expand Down Expand Up @@ -425,7 +431,7 @@ cc_library(

git_repository(
name = "oneTBB",
branch = "v2021.8.0",
branch = "v2021.10.0", # need newer version to be compatible with bazel 6.0
remote = "https://github.com/oneapi-src/oneTBB/",
patch_args = ["-p1"],
patches = ["mwaitpkg.patch",]
Expand Down
5 changes: 2 additions & 3 deletions external/mwaitpkg.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
diff --git a/BUILD.bazel b/BUILD.bazel
index 7aecb3e0..5c81961e 100644
index 3881d684..49175945 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -37,7 +37,7 @@ cc_library(
]),
copts = ["-w"] + select({
"@bazel_tools//platforms:windows": [""],
"@platforms//os:windows": [""],
- "//conditions:default": ["-mwaitpkg"],
+ "//conditions:default": [""],
}),
defines =
select({

34 changes: 17 additions & 17 deletions external/net_http.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/tensorflow_serving/util/BUILD b/tensorflow_serving/util/BUILD
index 5beb2fb1..e7b166c1 100644
index 4802a79f..4f676b8b 100644
--- a/tensorflow_serving/util/BUILD
+++ b/tensorflow_serving/util/BUILD
@@ -4,7 +4,7 @@ load("//tensorflow_serving:serving.bzl", "serving_proto_library")

package(
default_visibility = [
- "//tensorflow_serving:internal",
Expand All @@ -12,13 +12,13 @@ index 5beb2fb1..e7b166c1 100644
features = ["-layering_check"],
)
diff --git a/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc b/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc
index 237443dd..1b7d0563 100644
index 36c925a8..78e0eb66 100644
--- a/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc
+++ b/tensorflow_serving/util/net_http/server/internal/evhttp_server.cc
@@ -105,13 +105,18 @@ bool EvHTTPServer::Initialize() {
return false;
}

+ std::size_t maxBodySize = 1024 * 1024 * 1024;
+ evhttp_set_max_body_size(ev_http_, maxBodySize);
+ std::size_t maxHeadersSize = 8 * 1024;
Expand All @@ -33,20 +33,20 @@ index 237443dd..1b7d0563 100644
- EVHTTP_REQ_PATCH);
+ EVHTTP_REQ_CONNECT | EVHTTP_REQ_TRACE | EVHTTP_REQ_PATCH);
evhttp_set_gencb(ev_http_, &DispatchEvRequestFn, this);

return true;
diff --git a/tensorflow_serving/util/net_http/server/public/BUILD b/tensorflow_serving/util/net_http/server/public/BUILD
index e7f96d98..89d1a9c0 100644
index 1953a10d..f0f6efdc 100644
--- a/tensorflow_serving/util/net_http/server/public/BUILD
+++ b/tensorflow_serving/util/net_http/server/public/BUILD
@@ -2,9 +2,7 @@

package(
default_visibility = [
- ":http_server_clients",
- "//tensorflow_serving:internal",
- "//tensorflow_serving/util/net_http:__subpackages__",
+ "//visibility:public",
],
)

@@ -1,9 +1,7 @@
# Description: a lightweight http server and related utils to support Web clients

package(default_visibility = [
- "//tensorflow_serving:internal",
- "//tensorflow_serving/util/net_http:__subpackages__",
- "//tensorflow_serving/util/net_http/public:http_server_clients",
+ "//visibility:public",
])

licenses(["notice"])
Loading

0 comments on commit 0b205e4

Please sign in to comment.