Skip to content

Commit 4b1397c

Browse files
andylou2tfx-copybara
authored andcommitted
update tf workspace dependencies.
PiperOrigin-RevId: 353139640
1 parent 455a61e commit 4b1397c

File tree

4 files changed

+75
-75
lines changed

4 files changed

+75
-75
lines changed

WORKSPACE

Lines changed: 31 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2424

2525
tf_configure(name = "local_config_tf")
2626

27+
# boost is required for @thrift
2728
git_repository(
2829
name = "com_github_nelhage_rules_boost",
2930
commit = "9f9fb8b2f0213989247c9d5c0e814a8451d18d7f",
@@ -34,56 +35,25 @@ git_repository(
3435
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
3536
boost_deps()
3637

37-
http_archive(
38-
name = "com_github_google_flatbuffers",
39-
sha256 = "12a13686cab7ffaf8ea01711b8f55e1dbd3bf059b7c46a25fefa1250bdd9dd23",
40-
strip_prefix = "flatbuffers-b99332efd732e6faf60bb7ce1ce5902ed65d5ba3",
41-
urls = [
42-
"https://mirror.bazel.build/github.com/google/flatbuffers/archive/b99332efd732e6faf60bb7ce1ce5902ed65d5ba3.tar.gz",
43-
"https://github.com/google/flatbuffers/archive/b99332efd732e6faf60bb7ce1ce5902ed65d5ba3.tar.gz",
44-
],
45-
)
46-
47-
# LINT.IfChange(thrift_archive_version)
48-
http_archive(
49-
name = "thrift",
50-
build_file = "//third_party:thrift.BUILD",
51-
sha256 = "b7452d1873c6c43a580d2b4ae38cfaf8fa098ee6dc2925bae98dce0c010b1366",
52-
strip_prefix = "thrift-0.12.0",
53-
urls = [
54-
"https://github.com/apache/thrift/archive/0.12.0.tar.gz",
55-
],
56-
)
57-
# LINT.ThenChange(third_party/thrift.BUILD:thrift_gen_version)
58-
59-
# LINT.IfChange(arrow_archive_version)
60-
http_archive(
61-
name = "arrow",
62-
build_file = "//third_party:arrow.BUILD",
63-
sha256 = "d7b3838758a365c8c47d55ab0df1006a70db951c6964440ba354f81f518b8d8d",
64-
strip_prefix = "arrow-apache-arrow-0.16.0",
65-
urls = [
66-
"https://github.com/apache/arrow/archive/apache-arrow-0.16.0.tar.gz",
67-
],
68-
)
69-
# LINT.ThenChange(third_party/arrow.BUILD:parquet_gen_version)
70-
71-
# https://github.com/protocolbuffers/protobuf/tree/v3.8.0
72-
PROTOBUF_COMMIT="09745575a923640154bcf307fba8aedff47f240a"
73-
74-
# This is needed by the version of tensorflow metadata we depend on.
75-
# TODO(andylou): remove this once com_github_tensorflow_metadata is updated.
76-
git_repository(
77-
name = "protobuf_archive",
78-
commit = PROTOBUF_COMMIT,
79-
remote = "https://github.com/google/protobuf.git",
80-
shallow_since = "1558721209 -0700",
81-
)
8238

8339
#####################################################################################
8440

85-
_TENSORFLOW_GIT_COMMIT = "b36436b087bd8e8701ef51718179037cccdfc26e" # 2.3.0
86-
_TENSORFLOW_ARCHIVE_SHA256 = "a474d4328524de1951655cd6afb4888d256c37a0b4a47e6c623b353ab382b39f"
41+
# ===== TensorFlow dependency =====
42+
#
43+
# TensorFlow is imported here instead of in tf_serving_workspace() because
44+
# existing automation scripts that bump the TF commit hash expect it here.
45+
#
46+
# To update TensorFlow to a new revision.
47+
# 1. Update the 'git_commit' args below to include the new git hash.
48+
# 2. Get the sha256 hash of the archive with a command such as...
49+
# curl -L https://github.com/tensorflow/tensorflow/archive/<git hash>.tar.gz | sha256sum
50+
# and update the 'sha256' arg with the result.
51+
# 3. Request the new archive to be mirrored on mirror.bazel.build for more
52+
# reliable downloads.
53+
54+
# TODO(b/178125783): update this commit when TF 2.5 is released.
55+
_TENSORFLOW_GIT_COMMIT = "d2460be38bd655520dd16a0a64096e0161d52331" # 1/15/2021 commit
56+
_TENSORFLOW_ARCHIVE_SHA256 = "80aa4e312b3e98403098ee051834eb481158bdfd05d9c9de0195d6540ab63e78"
8757

8858
http_archive(
8959
name = "org_tensorflow",
@@ -95,29 +65,24 @@ http_archive(
9565
strip_prefix = "tensorflow-%s" % _TENSORFLOW_GIT_COMMIT,
9666
)
9767

98-
# START: Upstream TensorFlow dependencies
99-
# TensorFlow build depends on these dependencies.
100-
# Needs to be in-sync with TensorFlow sources.
101-
http_archive(
102-
name = "io_bazel_rules_closure",
103-
sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9",
104-
strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149",
105-
urls = [
106-
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",
107-
"https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", # 2019-06-13
108-
],
109-
)
110-
# END: Upstream TensorFlow dependencies
111-
112-
# Please add all new TensorFlow struct2tensor dependencies in workspace.bzl.
68+
# Please add all new struct2tensor dependencies in workspace.bzl.
11369
load("//struct2tensor:workspace.bzl", "struct2tensor_workspace")
11470
struct2tensor_workspace()
11571

116-
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
117-
protobuf_deps()
72+
# Initialize TensorFlow's external dependencies.
73+
load("@org_tensorflow//tensorflow:workspace3.bzl", "workspace")
74+
workspace()
75+
load("@org_tensorflow//tensorflow:workspace2.bzl", "workspace") # buildozer: disable=load
76+
workspace()
77+
load("@org_tensorflow//tensorflow:workspace1.bzl", "workspace") # buildozer: disable=load
78+
workspace()
79+
load("@org_tensorflow//tensorflow:workspace0.bzl", "workspace") # buildozer: disable=load
80+
workspace()
81+
82+
# Initialize bazel package rules' external dependencies.
83+
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
84+
rules_pkg_dependencies()
11885

11986
# Specify the minimum required bazel version.
12087
load("@org_tensorflow//tensorflow:version_check.bzl", "check_bazel_version_at_least")
121-
12288
check_bazel_version_at_least("2.0.0")
123-

struct2tensor/workspace.bzl

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,53 @@
1414

1515
# CPU kernels for struct2tensors.
1616

17-
"""TensorFlow struct2tensor external dependencies that can be loaded in WORKSPACE files.
18-
"""
17+
"""struct2tensor external dependencies that can be loaded in WORKSPACE files."""
1918

2019
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
21-
load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
2220

2321
def struct2tensor_workspace():
24-
"""All TensorFlow struct2tensor external dependencies."""
25-
tf_workspace(
26-
path_prefix = "",
27-
tf_repo_name = "org_tensorflow",
22+
"""All struct2tensor external dependencies."""
23+
24+
# ===== Bazel package rules dependency =====
25+
http_archive(
26+
name = "rules_pkg",
27+
sha256 = "352c090cc3d3f9a6b4e676cf42a6047c16824959b438895a76c2989c6d7c246a",
28+
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.5/rules_pkg-0.2.5.tar.gz",
29+
)
30+
31+
http_archive(
32+
name = "com_github_google_flatbuffers",
33+
sha256 = "12a13686cab7ffaf8ea01711b8f55e1dbd3bf059b7c46a25fefa1250bdd9dd23",
34+
strip_prefix = "flatbuffers-b99332efd732e6faf60bb7ce1ce5902ed65d5ba3",
35+
urls = [
36+
"https://mirror.bazel.build/github.com/google/flatbuffers/archive/b99332efd732e6faf60bb7ce1ce5902ed65d5ba3.tar.gz",
37+
"https://github.com/google/flatbuffers/archive/b99332efd732e6faf60bb7ce1ce5902ed65d5ba3.tar.gz",
38+
],
39+
)
40+
41+
# LINT.IfChange(thrift_archive_version)
42+
http_archive(
43+
name = "thrift",
44+
build_file = "//third_party:thrift.BUILD",
45+
sha256 = "b7452d1873c6c43a580d2b4ae38cfaf8fa098ee6dc2925bae98dce0c010b1366",
46+
strip_prefix = "thrift-0.12.0",
47+
urls = [
48+
"https://github.com/apache/thrift/archive/0.12.0.tar.gz",
49+
],
50+
)
51+
# LINT.ThenChange(third_party/thrift.BUILD:thrift_gen_version)
52+
53+
# LINT.IfChange(arrow_archive_version)
54+
http_archive(
55+
name = "arrow",
56+
build_file = "//third_party:arrow.BUILD",
57+
sha256 = "d7b3838758a365c8c47d55ab0df1006a70db951c6964440ba354f81f518b8d8d",
58+
strip_prefix = "arrow-apache-arrow-0.16.0",
59+
urls = [
60+
"https://github.com/apache/arrow/archive/apache-arrow-0.16.0.tar.gz",
61+
],
2862
)
63+
# LINT.ThenChange(third_party/arrow.BUILD:parquet_gen_version)
2964

3065
_TFMD_COMMIT_HASH = "1194a9de032c1eaf9d4e13efb31934f88e4fa4f5" # 0.26.0
3166
http_archive(

third_party/arrow.BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ genrule(
5959
"-e 's/@PARQUET_VERSION_PATCH@/1/g' " +
6060
"$< >$@"),
6161
)
62-
# LINT.ThenChange(../WORKSPACE:arrow_archive_version)
62+
# LINT.ThenChange(../workspace.bzl:arrow_archive_version)
6363

6464
cc_library(
6565
name = "xxhash",

third_party/thrift.BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@ genrule(
8080
"-e 's/$${PACKAGE_STRING}/thrift 0.12.0/g' " +
8181
"$< >$@"),
8282
)
83-
# LINT.ThenChange(../WORKSPACE:thrift_archive_version)
83+
# LINT.ThenChange(../workspace.bzl:thrift_archive_version)

0 commit comments

Comments
 (0)