Skip to content

Commit

Permalink
Fully disable all test/build targets that run tensorflow during build.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunan committed Dec 8, 2016
1 parent 6dc8dea commit f38ae0f
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 128 deletions.
41 changes: 21 additions & 20 deletions tensorflow/cc/saved_model/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,27 @@ cc_library(
],
)

tf_cc_test(
name = "loader_test",
srcs = ["loader_test.cc"],
data = [
"//tensorflow/python/saved_model/example:saved_model_half_plus_two_data",
],
linkstatic = 1,
tags = ["manual"],
deps = [
":constants",
":loader",
":signature_constants",
":tag_constants",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
],
)
# Reenable target once half_plus_two_data does not run TF during build.
# tf_cc_test(
# name = "loader_test",
# srcs = ["loader_test.cc"],
# data = [
# "//tensorflow/python/saved_model/example:saved_model_half_plus_two_data",
# ],
# linkstatic = 1,
# tags = ["manual"],
# deps = [
# ":constants",
# ":loader",
# ":signature_constants",
# ":tag_constants",
# "//tensorflow/core:lib",
# "//tensorflow/core:protos_all_cc",
# "//tensorflow/core:test",
# "//tensorflow/core:test_main",
# "//tensorflow/core:testlib",
# ],
# )

# -----------------------------------------------------------------------------
# Google-internal targets.
Expand Down
137 changes: 70 additions & 67 deletions tensorflow/contrib/session_bundle/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -136,28 +136,29 @@ cc_library(
]),
)

cc_test(
name = "session_bundle_test",
size = "small",
srcs = ["session_bundle_test.cc"],
data = [
"//tensorflow/contrib/session_bundle/example:half_plus_two",
],
# Link in all registered kernels.
linkstatic = 1,
tags = ["manual"],
visibility = ["//visibility:private"],
deps = [
":session_bundle",
":test_util",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
],
)
# Reenable target once half_plus_two_data does not run TF during build.
# cc_test(
# name = "session_bundle_test",
# size = "small",
# srcs = ["session_bundle_test.cc"],
# data = [
# "//tensorflow/contrib/session_bundle/example:half_plus_two",
# ],
# # Link in all registered kernels.
# linkstatic = 1,
# tags = ["manual"],
# visibility = ["//visibility:private"],
# deps = [
# ":session_bundle",
# ":test_util",
# "//tensorflow/core:core_cpu",
# "//tensorflow/core:framework",
# "//tensorflow/core:lib",
# "//tensorflow/core:test",
# "//tensorflow/core:test_main",
# "//tensorflow/core:testlib",
# ],
# )

py_library(
name = "session_bundle_py",
Expand All @@ -172,26 +173,27 @@ py_library(
],
)

py_test(
name = "session_bundle_py_test",
size = "small",
srcs = [
"session_bundle_test.py",
],
data = [
"//tensorflow/contrib/session_bundle/example:half_plus_two",
],
main = "session_bundle_test.py",
srcs_version = "PY2AND3",
tags = ["manual"],
deps = [
":constants",
":manifest_proto_py",
":session_bundle_py",
"//tensorflow:tensorflow_py",
"//tensorflow/core:protos_all_py",
],
)
# Reenable target once half_plus_two_data does not run TF during build.
# py_test(
# name = "session_bundle_py_test",
# size = "small",
# srcs = [
# "session_bundle_test.py",
# ],
# data = [
# "//tensorflow/contrib/session_bundle/example:half_plus_two",
# ],
# main = "session_bundle_test.py",
# srcs_version = "PY2AND3",
# tags = ["manual"],
# deps = [
# ":constants",
# ":manifest_proto_py",
# ":session_bundle_py",
# "//tensorflow:tensorflow_py",
# "//tensorflow/core:protos_all_py",
# ],
# )

# This is a lite version of the signature target that does not link in any
# Tensorflow ops in order to minimize its size. Clients using this should
Expand Down Expand Up @@ -277,31 +279,32 @@ cc_library(
]),
)

cc_test(
name = "bundle_shim_test",
size = "small",
srcs = ["bundle_shim_test.cc"],
data = [
"//tensorflow/contrib/session_bundle/example:half_plus_two",
"//tensorflow/python/saved_model/example:saved_model_half_plus_two_data",
],
# Link in all registered kernels.
linkstatic = 1,
tags = ["manual"],
deps = [
":bundle_shim",
":test_util",
"//tensorflow/cc/saved_model:loader",
"//tensorflow/cc/saved_model:signature_constants",
"//tensorflow/cc/saved_model:tag_constants",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
],
)
# Reenable target once half_plus_two_data does not run TF during build.
# cc_test(
# name = "bundle_shim_test",
# size = "small",
# srcs = ["bundle_shim_test.cc"],
# data = [
# "//tensorflow/contrib/session_bundle/example:half_plus_two",
# "//tensorflow/python/saved_model/example:saved_model_half_plus_two_data",
# ],
# # Link in all registered kernels.
# linkstatic = 1,
# tags = ["manual"],
# deps = [
# ":bundle_shim",
# ":test_util",
# "//tensorflow/cc/saved_model:loader",
# "//tensorflow/cc/saved_model:signature_constants",
# "//tensorflow/cc/saved_model:tag_constants",
# "//tensorflow/core:core_cpu",
# "//tensorflow/core:framework",
# "//tensorflow/core:lib",
# "//tensorflow/core:test",
# "//tensorflow/core:test_main",
# "//tensorflow/core:testlib",
# ],
# )

tf_proto_library(
name = "manifest_proto",
Expand Down
42 changes: 21 additions & 21 deletions tensorflow/contrib/session_bundle/example/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ py_binary(
],
)

genrule(
name = "half_plus_two",
outs = [
"half_plus_two/00000123/export.meta",
"half_plus_two/00000123/export-00000-of-00001",
"half_plus_two_ckpt_v2/00000123/export.meta",
"half_plus_two_ckpt_v2/00000123/export.index",
"half_plus_two_ckpt_v2/00000123/export.data-00000-of-00001",
],
cmd =
"rm -rf /tmp/half_plus_two; " +
"$(PYTHON_BIN_PATH) $(locations :export_half_plus_two); " +
"cp -r /tmp/half_plus_two/* $(@D)/half_plus_two; " +
"rm -rf /tmp/half_plus_two_ckpt_v2; " +
"$(PYTHON_BIN_PATH) $(locations :export_half_plus_two) --export_dir=/tmp/half_plus_two_ckpt_v2 --use_checkpoint_v2=true; " +
"cp -r /tmp/half_plus_two_ckpt_v2/* $(@D)/half_plus_two_ckpt_v2",
tools = [
":export_half_plus_two",
],
visibility = ["//visibility:public"],
)
# genrule(
# name = "half_plus_two",
# outs = [
# "half_plus_two/00000123/export.meta",
# "half_plus_two/00000123/export-00000-of-00001",
# "half_plus_two_ckpt_v2/00000123/export.meta",
# "half_plus_two_ckpt_v2/00000123/export.index",
# "half_plus_two_ckpt_v2/00000123/export.data-00000-of-00001",
# ],
# cmd =
# "rm -rf /tmp/half_plus_two; " +
# "$(PYTHON_BIN_PATH) $(locations :export_half_plus_two); " +
# "cp -r /tmp/half_plus_two/* $(@D)/half_plus_two; " +
# "rm -rf /tmp/half_plus_two_ckpt_v2; " +
# "$(PYTHON_BIN_PATH) $(locations :export_half_plus_two) --export_dir=/tmp/half_plus_two_ckpt_v2 --use_checkpoint_v2=true; " +
# "cp -r /tmp/half_plus_two_ckpt_v2/* $(@D)/half_plus_two_ckpt_v2",
# tools = [
# ":export_half_plus_two",
# ],
# visibility = ["//visibility:public"],
# )
40 changes: 20 additions & 20 deletions tensorflow/python/saved_model/example/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,23 @@ py_binary(
# with TensorFlow Serving model server requirements of a versioned subdirectory.
# Please note that SavedModel itself accepts any valid directory as the save
# location and does not perform any versioning.
genrule(
name = "saved_model_half_plus_two_data",
outs = [
"saved_model_half_plus_two/00000123/saved_model.pb",
"saved_model_half_plus_two/00000123/assets/foo.txt",
"saved_model_half_plus_two/00000123/variables/variables.data-00000-of-00001",
"saved_model_half_plus_two/00000123/variables/variables.index",
"saved_model_half_plus_two_pbtxt/00000123/saved_model.pbtxt",
"saved_model_half_plus_two_pbtxt/00000123/assets/foo.txt",
"saved_model_half_plus_two_pbtxt/00000123/variables/variables.data-00000-of-00001",
"saved_model_half_plus_two_pbtxt/00000123/variables/variables.index",
],
cmd =
"rm -rf $(@D)/saved_model_half_plus_two $(@D)/saved_model_half_plus_two_pbtxt; " +
"./$(locations :saved_model_half_plus_two) --output_dir=$(@D)/saved_model_half_plus_two/00000123 --output_dir_pbtxt=$(@D)/saved_model_half_plus_two_pbtxt/00000123",
tools = [
":saved_model_half_plus_two",
],
visibility = ["//visibility:public"],
)
# genrule(
# name = "saved_model_half_plus_two_data",
# outs = [
# "saved_model_half_plus_two/00000123/saved_model.pb",
# "saved_model_half_plus_two/00000123/assets/foo.txt",
# "saved_model_half_plus_two/00000123/variables/variables.data-00000-of-00001",
# "saved_model_half_plus_two/00000123/variables/variables.index",
# "saved_model_half_plus_two_pbtxt/00000123/saved_model.pbtxt",
# "saved_model_half_plus_two_pbtxt/00000123/assets/foo.txt",
# "saved_model_half_plus_two_pbtxt/00000123/variables/variables.data-00000-of-00001",
# "saved_model_half_plus_two_pbtxt/00000123/variables/variables.index",
# ],
# cmd =
# "rm -rf $(@D)/saved_model_half_plus_two $(@D)/saved_model_half_plus_two_pbtxt; " +
# "./$(locations :saved_model_half_plus_two) --output_dir=$(@D)/saved_model_half_plus_two/00000123 --output_dir_pbtxt=$(@D)/saved_model_half_plus_two_pbtxt/00000123",
# tools = [
# ":saved_model_half_plus_two",
# ],
# visibility = ["//visibility:public"],
# )

0 comments on commit f38ae0f

Please sign in to comment.