Skip to content

Commit

Permalink
[BugFix] Fix cycle dependency when build TFServing. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuhailin committed Jan 18, 2022
1 parent ce80561 commit c1b5aea
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 257 deletions.
25 changes: 0 additions & 25 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,6 @@ http_archive(
urls = ["http://www.colm.net/files/ragel/ragel-7.0.0.11.tar.gz"],
)

http_archive(
name = "lz4",
build_file = "//third_party:lz4.BUILD",
sha256 = "658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc",
strip_prefix = "lz4-1.9.2/lib",
urls = ["https://github.com/lz4/lz4/archive/v1.9.2.tar.gz"],
)

http_archive(
name = "sctp",
build_file = "//third_party:sctp.BUILD",
Expand Down Expand Up @@ -230,20 +222,3 @@ http_archive(
],
urls = ["https://pagure.io/libaio/archive/libaio-0.3.112/libaio-libaio-0.3.112.tar.gz"],
)

http_archive(
name = "kafka150",
build_file = "//third_party:kafka.BUILD",
patch_cmds = [
"rm -f src/win32_config.h",
# TODO: Remove the fowllowing once librdkafka issue is resolved.
"""sed -i.bak '\|rd_kafka_log(rk,|,/ exceeded);/ s/^/\/\//' src/rdkafka_cgrp.c""",
],
sha256 = "f7fee59fdbf1286ec23ef0b35b2dfb41031c8727c90ced6435b8cf576f23a656",
strip_prefix = "librdkafka-1.5.0",
urls = [
"https://mirror.tensorflow.org/github.com/edenhill/librdkafka/archive/v1.5.0.tar.gz",
"https://github.com/edenhill/librdkafka/archive/v1.5.0.tar.gz",
],
)

3 changes: 1 addition & 2 deletions tensorflow/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3011,7 +3011,6 @@ tf_cuda_library(
"//tensorflow/core:framework/bfloat16",
"//tensorflow/core:framework/numeric_types",
"//tensorflow/core/kernels:bounds_check",
"//tensorflow/core/profiler:nvtx_utils",
"//tensorflow/core/profiler/lib:traceme",
"//third_party/eigen3",
] + if_static(
Expand Down Expand Up @@ -3055,7 +3054,7 @@ tf_cuda_library(
"//tensorflow/core/kernels:bounds_check",
"//tensorflow/core:gpu_id",
"//third_party/eigen3",
"core_cpu_lib",
"@sparsehash_c11//:dense_hash_map",
] + if_static(
extra_deps = ["@com_google_protobuf//:protobuf"],
otherwise = ["@com_google_protobuf//:protobuf_headers"],
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/kernels/data/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ tf_kernel_library(
name = "kafka_dataset_op",
srcs = ["kafka_dataset_op.cc"],
deps = [
"@kafka150",
"@kafka",
":name_utils",
"//tensorflow/core:core_cpu_internal",
"//tensorflow/core:dataset_ops_op_lib",
Expand Down
38 changes: 25 additions & 13 deletions tensorflow/workspace.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TensorFlow external dependencies that can be loaded in WORKSPACE files.

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//third_party/gpus:cuda_configure.bzl", "cuda_configure")
load("//third_party/gpus:rocm_configure.bzl", "rocm_configure")
load("//third_party/tensorrt:tensorrt_configure.bzl", "tensorrt_configure")
Expand Down Expand Up @@ -691,18 +691,6 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
],
)

tf_http_archive(
name = "kafka",
build_file = clean_dep("//third_party:kafka/BUILD"),
patch_file = clean_dep("//third_party/kafka:config.patch"),
sha256 = "cc6ebbcd0a826eec1b8ce1f625ffe71b53ef3290f8192b6cae38412a958f4fd3",
strip_prefix = "librdkafka-0.11.5",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/edenhill/librdkafka/archive/v0.11.5.tar.gz",
"https://github.com/edenhill/librdkafka/archive/v0.11.5.tar.gz",
],
)

java_import_external(
name = "junit",
jar_sha256 = "59721f0805e223d84b90677887d9ff567dc534d7c502ca903c0c2b17f05c116a",
Expand Down Expand Up @@ -1053,6 +1041,30 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
],
)

http_archive(
name = "lz4",
build_file = str(Label("//third_party:lz4.BUILD")),
sha256 = "658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc",
strip_prefix = "lz4-1.9.2/lib",
urls = ["https://github.com/lz4/lz4/archive/v1.9.2.tar.gz"],
)

http_archive(
name = "kafka",
build_file = str(Label("//third_party:kafka.BUILD")),
patch_cmds = [
"rm -f src/win32_config.h",
# TODO: Remove the fowllowing once librdkafka issue is resolved.
"""sed -i.bak '\\|rd_kafka_log(rk,|,/ exceeded);/ s/^/\\/\\//' src/rdkafka_cgrp.c""",
],
sha256 = "f7fee59fdbf1286ec23ef0b35b2dfb41031c8727c90ced6435b8cf576f23a656",
strip_prefix = "librdkafka-1.5.0",
urls = [
"https://mirror.tensorflow.org/github.com/edenhill/librdkafka/archive/v1.5.0.tar.gz",
"https://github.com/edenhill/librdkafka/archive/v1.5.0.tar.gz",
],
)

def tf_bind():
"""Bind targets for some external repositories"""
##############################################################################
Expand Down
2 changes: 1 addition & 1 deletion third_party/kafka.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ licenses(["notice"]) # 2-clause BSD license
exports_files(["LICENSE"])

cc_library(
name = "kafka150",
name = "kafka",
srcs = glob(
[
"src-cpp/*.h",
Expand Down
171 changes: 0 additions & 171 deletions third_party/kafka/BUILD

This file was deleted.

44 changes: 0 additions & 44 deletions third_party/kafka/config.patch

This file was deleted.

0 comments on commit c1b5aea

Please sign in to comment.