Home | History | Annotate | Download | only in kafka
      1 package(
      2     default_visibility = ["//visibility:private"],
      3 )
      4 
      5 licenses(["notice"])  # Apache 2.0
      6 
      7 exports_files(["LICENSE"])
      8 
      9 load("//tensorflow:tensorflow.bzl", "tf_gen_op_libs")
     10 load("//tensorflow:tensorflow.bzl", "tf_gen_op_wrapper_py")
     11 load("//tensorflow:tensorflow.bzl", "tf_kernel_library")
     12 load("//tensorflow:tensorflow.bzl", "tf_py_test")
     13 
     14 tf_kernel_library(
     15     name = "kafka_kernels",
     16     srcs = ["kernels/kafka_dataset_ops.cc"],
     17     visibility = ["//visibility:public"],
     18     deps = [
     19         "//tensorflow/core:framework",
     20         "//tensorflow/core:lib",
     21         "//tensorflow/core:lib_internal",
     22         "//tensorflow/core/kernels:bounds_check_lib",
     23         "//tensorflow/core/kernels:dataset",
     24         "//third_party/eigen3",
     25         "@kafka",
     26     ],
     27 )
     28 
     29 tf_gen_op_libs(
     30     op_lib_names = ["kafka_ops"],
     31     deps = [
     32         "//tensorflow/core:lib",
     33     ],
     34 )
     35 
     36 tf_gen_op_wrapper_py(
     37     name = "gen_kafka_ops",
     38     out = "python/ops/gen_kafka_ops.py",
     39     require_shape_functions = True,
     40     deps = [":kafka_ops_op_lib"],
     41 )
     42 
     43 py_library(
     44     name = "kafka",
     45     srcs = [
     46         "__init__.py",
     47         "python/ops/kafka_dataset_ops.py",
     48     ],
     49     srcs_version = "PY2AND3",
     50     visibility = ["//visibility:public"],
     51     deps = [
     52         ":gen_kafka_ops",
     53         "//tensorflow/contrib/util:util_py",
     54         "//tensorflow/python:array_ops",
     55         "//tensorflow/python:control_flow_ops",
     56         "//tensorflow/python:framework",
     57         "//tensorflow/python:framework_for_generated_wrappers",
     58         "//tensorflow/python:platform",
     59         "//tensorflow/python:state_ops",
     60         "//tensorflow/python:training",
     61         "//tensorflow/python/data/ops:dataset_ops",
     62         "//tensorflow/python/data/ops:iterator_ops",
     63         "//tensorflow/python/data/ops:readers",
     64     ],
     65 )
     66 
     67 # The Kafka server has to be setup before running the test.
     68 # The Kafka server is setup through Docker so the Docker engine
     69 # has to be installed.
     70 #
     71 # Once the Docker engine is ready:
     72 # To setup the Kafka server:
     73 # $ bash tensorflow/contrib/kafka/python/kernel_tests/kafka_test.sh start kafka
     74 #
     75 # After the test is complete:
     76 # To team down the Kafka server:
     77 # $ bash tensorflow/contrib/kafka/python/kernel_tests/kafka_test.sh stop kafka
     78 tf_py_test(
     79     name = "kafka_test",
     80     srcs = ["python/kernel_tests/kafka_test.py"],
     81     additional_deps = [
     82         ":kafka",
     83         "//third_party/py/numpy",
     84         "//tensorflow/python:client_testlib",
     85         "//tensorflow/python:framework",
     86         "//tensorflow/python:framework_test_lib",
     87         "//tensorflow/python:platform_test",
     88     ],
     89     tags = [
     90         "manual",
     91         "notap",
     92     ],
     93 )
     94 
     95 filegroup(
     96     name = "all_files",
     97     srcs = glob(
     98         ["**/*"],
     99         exclude = [
    100             "**/METADATA",
    101             "**/OWNERS",
    102         ],
    103     ),
    104     visibility = ["//tensorflow:__subpackages__"],
    105 )
    106