Make GCS ops work in open source
authorBrennan Saeta <saeta@google.com>
Wed, 13 Jun 2018 22:46:12 +0000 (15:46 -0700)
committerBrennan Saeta <saeta@google.com>
Thu, 14 Jun 2018 00:03:04 +0000 (17:03 -0700)
tensorflow/contrib/cloud/__init__.py
tensorflow/contrib/cloud/kernels/BUILD
tensorflow/core/platform/cloud/gcs_file_system.cc
tensorflow/core/platform/default/build_config.bzl

index a6e13ea..ef7aa76 100644 (file)
@@ -27,8 +27,9 @@ from tensorflow.python.util.all_util import remove_undocumented
 
 _allowed_symbols = [
     'BigQueryReader',
-    'ConfigureColabSession',
-    'ConfigureGcs',
+    'BlockCacheParams',
+    'configure_colab_session',
+    'configure_gcs',
     'ConfigureGcsHook',
 ]
 remove_undocumented(__name__, _allowed_symbols)
index 4016070..1311063 100644 (file)
@@ -79,6 +79,7 @@ tf_kernel_library(
     srcs = ["gcs_config_ops.cc"],
     visibility = ["//tensorflow:internal"],
     deps = [
+        "//tensorflow/contrib/cloud:gcs_config_ops_op_lib",
         "//tensorflow/core:framework",
         "//tensorflow/core:lib",
         "//tensorflow/core/platform/cloud:curl_http_request",
index 22ae612..803b08f 100644 (file)
@@ -804,7 +804,9 @@ void GcsFileSystem::ResetFileBlockCache(size_t block_size_bytes,
   mutex_lock l(block_cache_lock_);
   file_block_cache_ =
       MakeFileBlockCache(block_size_bytes, max_bytes, max_staleness_secs);
-  stats_->Configure(this, &throttle_, file_block_cache_.get());
+  if (stats_) {
+    stats_->Configure(this, &throttle_, file_block_cache_.get());
+  }
 }
 
 // A helper function to build a FileBlockCache for GcsFileSystem.
index 9e52ba3..f12732b 100644 (file)
@@ -633,6 +633,7 @@ def tf_additional_cloud_op_deps():
       "//tensorflow:with_gcp_support_ios_override": [],
       "//tensorflow:with_gcp_support": [
         "//tensorflow/contrib/cloud:bigquery_reader_ops_op_lib",
+        "//tensorflow/contrib/cloud:gcs_config_ops_op_lib",
       ],
       "//conditions:default": [],
   })
@@ -645,6 +646,7 @@ def tf_additional_cloud_kernel_deps():
       "//tensorflow:with_gcp_support_ios_override": [],
       "//tensorflow:with_gcp_support": [
         "//tensorflow/contrib/cloud/kernels:bigquery_reader_ops",
+        "//tensorflow/contrib/cloud/kernels:gcs_config_ops",
       ],
       "//conditions:default": [],
   })