From dd5112fe5e2495913422e6078d0fe5077a71ee21 Mon Sep 17 00:00:00 2001 From: Karthik Ramasamy Date: Wed, 17 Aug 2016 21:23:57 -0700 Subject: [PATCH 01/10] move cli, explorer, tracker and ui and tools common files into heron/tools --- heron/common/src/python/BUILD | 35 ++-- heron/common/tests/python/BUILD | 20 +- heron/common/tests/python/basics/BUILD | 44 ++-- heron/common/tests/python/network/BUILD | 64 +++--- heron/common/tests/python/pex_loader/BUILD | 22 +- heron/common/tests/python/utils/BUILD | 198 +++++++++--------- heron/config/src/yaml/BUILD | 5 - heron/examples/src/python/BUILD | 34 +-- heron/executor/src/python/BUILD | 10 +- heron/executor/tests/python/BUILD | 2 +- heron/instance/src/python/basics/BUILD | 16 +- heron/instance/src/python/instance/BUILD | 22 +- heron/instance/src/python/network/BUILD | 12 +- heron/instance/tests/python/basics/BUILD | 24 +-- heron/instance/tests/python/network/BUILD | 48 ++--- heron/pyheron/src/python/BUILD | 14 +- heron/pyheron/tests/python/BUILD | 72 +++---- heron/{ => tools}/cli/src/python/BUILD | 9 +- heron/{ => tools}/cli/src/python/README.md | 0 heron/{ => tools}/cli/src/python/activate.py | 2 +- heron/{ => tools}/cli/src/python/args.py | 2 +- .../{ => tools}/cli/src/python/cli_helper.py | 8 +- .../{ => tools}/cli/src/python/deactivate.py | 2 +- heron/{ => tools}/cli/src/python/execute.py | 6 +- heron/{ => tools}/cli/src/python/help.py | 3 +- .../{ => tools}/cli/src/python/heronrc.sample | 0 heron/{ => tools}/cli/src/python/jars.py | 2 +- heron/{ => tools}/cli/src/python/kill.py | 2 +- heron/{ => tools}/cli/src/python/main.py | 18 +- heron/{ => tools}/cli/src/python/opts.py | 0 heron/{ => tools}/cli/src/python/restart.py | 8 +- heron/{ => tools}/cli/src/python/submit.py | 10 +- heron/{ => tools}/cli/src/python/version.py | 4 +- heron/{ => tools}/cli/tests/python/BUILD | 4 +- .../cli/tests/python/heronparser_unittest.py | 8 +- .../{ => tools}/cli/tests/python/heronrc.test | 0 .../cli/tests/python/opts_unittest.py | 2 +- heron/tools/common/src/python/BUILD | 20 ++ .../common/src/python}/access/__init__.py | 0 .../common/src/python}/access/fetch.py | 2 +- .../common/src/python}/access/heron.py | 0 .../common/src/python}/access/query.py | 0 .../src/python/access}/tracker_access.py | 2 +- .../common/src/python/utils/config.py | 2 +- .../common/src/python/utils}/heronparser.py | 4 +- heron/tools/config/src/yaml/BUILD | 8 + .../src/yaml/tracker/heron_tracker.yaml | 0 heron/{ => tools}/explorer/src/python/BUILD | 9 +- heron/{ => tools}/explorer/src/python/args.py | 0 .../explorer/src/python/clusters.py | 4 +- heron/{ => tools}/explorer/src/python/help.py | 2 +- .../explorer/src/python/logicalplan.py | 4 +- heron/{ => tools}/explorer/src/python/main.py | 20 +- heron/{ => tools}/explorer/src/python/opts.py | 0 .../explorer/src/python/physicalplan.py | 4 +- .../explorer/src/python/topologies.py | 4 +- .../explorer/src/python/version.py | 4 +- heron/{ => tools}/explorer/tests/python/BUILD | 5 +- .../tests/python/explorer_unittest.py | 8 +- .../explorer/tests/python/info.json | 0 .../explorer/tests/python/logicalplan.json | 0 .../explorer/tests/python/metrics.json | 0 .../explorer/tests/python/physicalplan.json | 0 .../explorer/tests/python/topologies.json | 0 heron/{ => tools}/tracker/src/python/BUILD | 6 +- .../{ => tools}/tracker/src/python/config.py | 0 .../tracker/src/python/constants.py | 0 .../tracker/src/python/handlers/__init__.py | 0 .../src/python/handlers/basehandler.py | 2 +- .../src/python/handlers/clustershandler.py | 2 +- .../python/handlers/containerfilehandler.py | 7 +- .../src/python/handlers/defaulthandler.py | 2 +- .../src/python/handlers/exceptionhandler.py | 6 +- .../handlers/exceptionsummaryhandler.py | 6 +- .../python/handlers/executionstatehandler.py | 2 +- .../src/python/handlers/jmaphandler.py | 7 +- .../src/python/handlers/jstackhandler.py | 8 +- .../src/python/handlers/logicalplanhandler.py | 2 +- .../src/python/handlers/machineshandler.py | 4 +- .../src/python/handlers/mainhandler.py | 2 +- .../python/handlers/memoryhistogramhandler.py | 7 +- .../src/python/handlers/metricshandler.py | 8 +- .../python/handlers/metricsqueryhandler.py | 4 +- .../python/handlers/metricstimelinehandler.py | 7 +- .../python/handlers/physicalplanhandler.py | 2 +- .../tracker/src/python/handlers/pidhandler.py | 5 +- .../handlers/schedulerlocationhandler.py | 2 +- .../src/python/handlers/stateshandler.py | 4 +- .../src/python/handlers/topologieshandler.py | 4 +- .../src/python/handlers/topologyhandler.py | 2 +- .../{ => tools}/tracker/src/python/javaobj.py | 0 heron/{ => tools}/tracker/src/python/main.py | 11 +- .../tracker/src/python/metricstimeline.py | 2 +- heron/{ => tools}/tracker/src/python/query.py | 2 +- .../tracker/src/python/query_operators.py | 2 +- .../tracker/src/python/topology.py | 0 .../tracker/src/python/topology_helpers.py | 2 +- .../{ => tools}/tracker/src/python/tracker.py | 8 +- heron/{ => tools}/tracker/src/python/utils.py | 0 heron/{ => tools}/tracker/tests/python/BUILD | 10 +- .../tracker/tests/python/mock_proto.py | 3 +- .../tests/python/query_operator_unittest.py | 8 +- .../tracker/tests/python/query_unittest.py | 2 +- .../tests/python/topology_helpers_unittest.py | 2 +- .../tracker/tests/python/topology_unittest.py | 2 +- .../tracker/tests/python/tracker_unittest.py | 4 +- heron/{ => tools}/ui/resources/BUILD | 0 .../ui/resources/static/css/bootstrap.css | 0 .../ui/resources/static/css/bootstrap.min.css | 0 .../ui/resources/static/css/main.css | 0 .../ui/resources/static/css/visstyle.css | 0 .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../static/icomoon/fonts/icomoon.dev.svg | 0 .../static/icomoon/fonts/icomoon.eot | Bin .../static/icomoon/fonts/icomoon.svg | 0 .../static/icomoon/fonts/icomoon.ttf | Bin .../static/icomoon/fonts/icomoon.woff | Bin .../ui/resources/static/icomoon/index.html | 0 .../ui/resources/static/icomoon/license.txt | 0 .../ui/resources/static/icomoon/lte-ie7.js | 0 .../ui/resources/static/icomoon/style.css | 0 .../ui/resources/static/img/edit-icon.png | Bin .../static/img/glyphicons-halflings-white.png | Bin .../static/img/glyphicons-halflings.png | Bin .../ui/resources/static/img/hue.png | Bin .../ui/resources/static/img/icn-green.png | Bin .../ui/resources/static/img/icn-red.png | Bin .../ui/resources/static/img/logo54x54.png | Bin .../ui/resources/static/img/trash-icon.png | Bin .../ui/resources/static/js/alltopologies.js | 0 .../ui/resources/static/js/bootstrap.js | 0 .../ui/resources/static/js/bootstrap.min.js | 0 .../ui/resources/static/js/colors.js | 0 .../ui/resources/static/js/common.js | 0 .../ui/resources/static/js/config.js | 0 .../ui/resources/static/js/exceptions.js | 0 .../ui/resources/static/js/graphic.js | 0 .../ui/resources/static/js/html5-trunk.js | 0 .../static/js/jquery-ui-1.8.23.custom.min.js | 0 .../ui/resources/static/js/jquery.min.js | 0 .../ui/resources/static/js/jquery.pailer.js | 0 .../ui/resources/static/js/logical-plan.js | 0 .../resources/static/js/moment.min.2.8.3.js | 0 .../ui/resources/static/js/physical-plan.js | 0 .../ui/resources/static/js/plan-controller.js | 0 .../ui/resources/static/js/plan-stats.js | 0 .../ui/resources/static/js/stat-trendlines.js | 0 .../ui/resources/static/js/topologies.js | 0 .../static/js/underscore-min.1.6.0.js | 0 .../ui/resources/templates/application.html | 0 .../ui/resources/templates/browse.html | 0 .../ui/resources/templates/config.html | 0 .../ui/resources/templates/error.html | 0 .../ui/resources/templates/exception.html | 0 .../ui/resources/templates/file.html | 0 .../ui/resources/templates/nav.html | 0 .../ui/resources/templates/topologies.html | 0 .../ui/resources/templates/topology.html | 0 heron/{ => tools}/ui/src/python/BUILD | 8 +- heron/{ => tools}/ui/src/python/args.py | 0 heron/{ => tools}/ui/src/python/consts.py | 0 .../ui/src/python/handlers/__init__.py | 0 .../ui/src/python/handlers/api/__init__.py | 0 .../ui/src/python/handlers/api/metrics.py | 0 .../ui/src/python/handlers/api/topology.py | 0 .../ui/src/python/handlers/base.py | 0 .../ui/src/python/handlers/common/__init__.py | 0 .../ui/src/python/handlers/common/consts.py | 0 .../ui/src/python/handlers/common/graph.py | 0 .../ui/src/python/handlers/common/utils.py | 0 .../ui/src/python/handlers/mainhandler.py | 0 .../ui/src/python/handlers/notfound.py | 0 .../ui/src/python/handlers/ranges.py | 0 .../ui/src/python/handlers/topology.py | 0 heron/{ => tools}/ui/src/python/main.py | 0 .../src/python/integration_test/common/BUILD | 10 +- .../src/python/integration_test/core/BUILD | 10 +- .../python/integration_test/topology/BUILD | 28 +-- tools/rules/heron_client.bzl | 4 +- tools/rules/heron_tools.bzl | 6 +- 183 files changed, 534 insertions(+), 525 deletions(-) rename heron/{ => tools}/cli/src/python/BUILD (71%) rename heron/{ => tools}/cli/src/python/README.md (100%) rename heron/{ => tools}/cli/src/python/activate.py (94%) rename heron/{ => tools}/cli/src/python/args.py (98%) rename heron/{ => tools}/cli/src/python/cli_helper.py (92%) rename heron/{ => tools}/cli/src/python/deactivate.py (94%) rename heron/{ => tools}/cli/src/python/execute.py (97%) rename heron/{ => tools}/cli/src/python/help.py (96%) rename heron/{ => tools}/cli/src/python/heronrc.sample (100%) rename heron/{ => tools}/cli/src/python/jars.py (96%) rename heron/{ => tools}/cli/src/python/kill.py (94%) rename heron/{ => tools}/cli/src/python/main.py (92%) rename heron/{ => tools}/cli/src/python/opts.py (100%) rename heron/{ => tools}/cli/src/python/restart.py (92%) rename heron/{ => tools}/cli/src/python/submit.py (97%) rename heron/{ => tools}/cli/src/python/version.py (91%) rename heron/{ => tools}/cli/tests/python/BUILD (83%) rename heron/{ => tools}/cli/tests/python/heronparser_unittest.py (96%) rename heron/{ => tools}/cli/tests/python/heronrc.test (100%) rename heron/{ => tools}/cli/tests/python/opts_unittest.py (97%) create mode 100644 heron/tools/common/src/python/BUILD rename heron/{common/src/python/handler => tools/common/src/python}/access/__init__.py (100%) rename heron/{common/src/python/handler => tools/common/src/python}/access/fetch.py (97%) rename heron/{common/src/python/handler => tools/common/src/python}/access/heron.py (100%) rename heron/{common/src/python/handler => tools/common/src/python}/access/query.py (100%) rename heron/{common/src/python/utils => tools/common/src/python/access}/tracker_access.py (98%) rename heron/{ => tools}/common/src/python/utils/config.py (99%) rename heron/{common/src/python => tools/common/src/python/utils}/heronparser.py (99%) create mode 100644 heron/tools/config/src/yaml/BUILD rename heron/{ => tools}/config/src/yaml/tracker/heron_tracker.yaml (100%) rename heron/{ => tools}/explorer/src/python/BUILD (67%) rename heron/{ => tools}/explorer/src/python/args.py (100%) rename heron/{ => tools}/explorer/src/python/clusters.py (94%) rename heron/{ => tools}/explorer/src/python/help.py (96%) rename heron/{ => tools}/explorer/src/python/logicalplan.py (97%) rename heron/{ => tools}/explorer/src/python/main.py (91%) rename heron/{ => tools}/explorer/src/python/opts.py (100%) rename heron/{ => tools}/explorer/src/python/physicalplan.py (98%) rename heron/{ => tools}/explorer/src/python/topologies.py (96%) rename heron/{ => tools}/explorer/src/python/version.py (91%) rename heron/{ => tools}/explorer/tests/python/BUILD (64%) rename heron/{ => tools}/explorer/tests/python/explorer_unittest.py (95%) rename heron/{ => tools}/explorer/tests/python/info.json (100%) rename heron/{ => tools}/explorer/tests/python/logicalplan.json (100%) rename heron/{ => tools}/explorer/tests/python/metrics.json (100%) rename heron/{ => tools}/explorer/tests/python/physicalplan.json (100%) rename heron/{ => tools}/explorer/tests/python/topologies.json (100%) rename heron/{ => tools}/tracker/src/python/BUILD (81%) rename heron/{ => tools}/tracker/src/python/config.py (100%) rename heron/{ => tools}/tracker/src/python/constants.py (100%) rename heron/{ => tools}/tracker/src/python/handlers/__init__.py (100%) rename heron/{ => tools}/tracker/src/python/handlers/basehandler.py (99%) rename heron/{ => tools}/tracker/src/python/handlers/clustershandler.py (94%) rename heron/{ => tools}/tracker/src/python/handlers/containerfilehandler.py (96%) rename heron/{ => tools}/tracker/src/python/handlers/defaulthandler.py (94%) rename heron/{ => tools}/tracker/src/python/handlers/exceptionhandler.py (97%) rename heron/{ => tools}/tracker/src/python/handlers/exceptionsummaryhandler.py (97%) rename heron/{ => tools}/tracker/src/python/handlers/executionstatehandler.py (96%) rename heron/{ => tools}/tracker/src/python/handlers/jmaphandler.py (93%) rename heron/{ => tools}/tracker/src/python/handlers/jstackhandler.py (93%) rename heron/{ => tools}/tracker/src/python/handlers/logicalplanhandler.py (96%) rename heron/{ => tools}/tracker/src/python/handlers/machineshandler.py (95%) rename heron/{ => tools}/tracker/src/python/handlers/mainhandler.py (92%) rename heron/{ => tools}/tracker/src/python/handlers/memoryhistogramhandler.py (93%) rename heron/{ => tools}/tracker/src/python/handlers/metricshandler.py (97%) rename heron/{ => tools}/tracker/src/python/handlers/metricsqueryhandler.py (96%) rename heron/{ => tools}/tracker/src/python/handlers/metricstimelinehandler.py (93%) rename heron/{ => tools}/tracker/src/python/handlers/physicalplanhandler.py (96%) rename heron/{ => tools}/tracker/src/python/handlers/pidhandler.py (96%) rename heron/{ => tools}/tracker/src/python/handlers/schedulerlocationhandler.py (96%) rename heron/{ => tools}/tracker/src/python/handlers/stateshandler.py (95%) rename heron/{ => tools}/tracker/src/python/handlers/topologieshandler.py (95%) rename heron/{ => tools}/tracker/src/python/handlers/topologyhandler.py (96%) rename heron/{ => tools}/tracker/src/python/javaobj.py (100%) rename heron/{ => tools}/tracker/src/python/main.py (96%) rename heron/{ => tools}/tracker/src/python/metricstimeline.py (100%) rename heron/{ => tools}/tracker/src/python/query.py (98%) rename heron/{ => tools}/tracker/src/python/query_operators.py (99%) rename heron/{ => tools}/tracker/src/python/topology.py (100%) rename heron/{ => tools}/tracker/src/python/topology_helpers.py (100%) rename heron/{ => tools}/tracker/src/python/tracker.py (99%) rename heron/{ => tools}/tracker/src/python/utils.py (100%) rename heron/{ => tools}/tracker/tests/python/BUILD (83%) rename heron/{ => tools}/tracker/tests/python/mock_proto.py (99%) rename heron/{ => tools}/tracker/tests/python/query_operator_unittest.py (99%) rename heron/{ => tools}/tracker/tests/python/query_unittest.py (99%) rename heron/{ => tools}/tracker/tests/python/topology_helpers_unittest.py (99%) rename heron/{ => tools}/tracker/tests/python/topology_unittest.py (98%) rename heron/{ => tools}/tracker/tests/python/tracker_unittest.py (98%) rename heron/{ => tools}/ui/resources/BUILD (100%) rename heron/{ => tools}/ui/resources/static/css/bootstrap.css (100%) rename heron/{ => tools}/ui/resources/static/css/bootstrap.min.css (100%) rename heron/{ => tools}/ui/resources/static/css/main.css (100%) rename heron/{ => tools}/ui/resources/static/css/visstyle.css (100%) rename heron/{ => tools}/ui/resources/static/fonts/glyphicons-halflings-regular.eot (100%) rename heron/{ => tools}/ui/resources/static/fonts/glyphicons-halflings-regular.svg (100%) rename heron/{ => tools}/ui/resources/static/fonts/glyphicons-halflings-regular.ttf (100%) rename heron/{ => tools}/ui/resources/static/fonts/glyphicons-halflings-regular.woff (100%) rename heron/{ => tools}/ui/resources/static/icomoon/fonts/icomoon.dev.svg (100%) rename heron/{ => tools}/ui/resources/static/icomoon/fonts/icomoon.eot (100%) rename heron/{ => tools}/ui/resources/static/icomoon/fonts/icomoon.svg (100%) rename heron/{ => tools}/ui/resources/static/icomoon/fonts/icomoon.ttf (100%) rename heron/{ => tools}/ui/resources/static/icomoon/fonts/icomoon.woff (100%) rename heron/{ => tools}/ui/resources/static/icomoon/index.html (100%) rename heron/{ => tools}/ui/resources/static/icomoon/license.txt (100%) rename heron/{ => tools}/ui/resources/static/icomoon/lte-ie7.js (100%) rename heron/{ => tools}/ui/resources/static/icomoon/style.css (100%) rename heron/{ => tools}/ui/resources/static/img/edit-icon.png (100%) rename heron/{ => tools}/ui/resources/static/img/glyphicons-halflings-white.png (100%) rename heron/{ => tools}/ui/resources/static/img/glyphicons-halflings.png (100%) rename heron/{ => tools}/ui/resources/static/img/hue.png (100%) rename heron/{ => tools}/ui/resources/static/img/icn-green.png (100%) rename heron/{ => tools}/ui/resources/static/img/icn-red.png (100%) rename heron/{ => tools}/ui/resources/static/img/logo54x54.png (100%) rename heron/{ => tools}/ui/resources/static/img/trash-icon.png (100%) rename heron/{ => tools}/ui/resources/static/js/alltopologies.js (100%) rename heron/{ => tools}/ui/resources/static/js/bootstrap.js (100%) rename heron/{ => tools}/ui/resources/static/js/bootstrap.min.js (100%) rename heron/{ => tools}/ui/resources/static/js/colors.js (100%) rename heron/{ => tools}/ui/resources/static/js/common.js (100%) rename heron/{ => tools}/ui/resources/static/js/config.js (100%) rename heron/{ => tools}/ui/resources/static/js/exceptions.js (100%) rename heron/{ => tools}/ui/resources/static/js/graphic.js (100%) rename heron/{ => tools}/ui/resources/static/js/html5-trunk.js (100%) rename heron/{ => tools}/ui/resources/static/js/jquery-ui-1.8.23.custom.min.js (100%) rename heron/{ => tools}/ui/resources/static/js/jquery.min.js (100%) rename heron/{ => tools}/ui/resources/static/js/jquery.pailer.js (100%) rename heron/{ => tools}/ui/resources/static/js/logical-plan.js (100%) rename heron/{ => tools}/ui/resources/static/js/moment.min.2.8.3.js (100%) rename heron/{ => tools}/ui/resources/static/js/physical-plan.js (100%) rename heron/{ => tools}/ui/resources/static/js/plan-controller.js (100%) rename heron/{ => tools}/ui/resources/static/js/plan-stats.js (100%) rename heron/{ => tools}/ui/resources/static/js/stat-trendlines.js (100%) rename heron/{ => tools}/ui/resources/static/js/topologies.js (100%) rename heron/{ => tools}/ui/resources/static/js/underscore-min.1.6.0.js (100%) rename heron/{ => tools}/ui/resources/templates/application.html (100%) rename heron/{ => tools}/ui/resources/templates/browse.html (100%) rename heron/{ => tools}/ui/resources/templates/config.html (100%) rename heron/{ => tools}/ui/resources/templates/error.html (100%) rename heron/{ => tools}/ui/resources/templates/exception.html (100%) rename heron/{ => tools}/ui/resources/templates/file.html (100%) rename heron/{ => tools}/ui/resources/templates/nav.html (100%) rename heron/{ => tools}/ui/resources/templates/topologies.html (100%) rename heron/{ => tools}/ui/resources/templates/topology.html (100%) rename heron/{ => tools}/ui/src/python/BUILD (72%) rename heron/{ => tools}/ui/src/python/args.py (100%) rename heron/{ => tools}/ui/src/python/consts.py (100%) rename heron/{ => tools}/ui/src/python/handlers/__init__.py (100%) rename heron/{ => tools}/ui/src/python/handlers/api/__init__.py (100%) rename heron/{ => tools}/ui/src/python/handlers/api/metrics.py (100%) rename heron/{ => tools}/ui/src/python/handlers/api/topology.py (100%) rename heron/{ => tools}/ui/src/python/handlers/base.py (100%) rename heron/{ => tools}/ui/src/python/handlers/common/__init__.py (100%) rename heron/{ => tools}/ui/src/python/handlers/common/consts.py (100%) rename heron/{ => tools}/ui/src/python/handlers/common/graph.py (100%) rename heron/{ => tools}/ui/src/python/handlers/common/utils.py (100%) rename heron/{ => tools}/ui/src/python/handlers/mainhandler.py (100%) rename heron/{ => tools}/ui/src/python/handlers/notfound.py (100%) rename heron/{ => tools}/ui/src/python/handlers/ranges.py (100%) rename heron/{ => tools}/ui/src/python/handlers/topology.py (100%) rename heron/{ => tools}/ui/src/python/main.py (100%) diff --git a/heron/common/src/python/BUILD b/heron/common/src/python/BUILD index 1733ce20d57..f8057cfb942 100644 --- a/heron/common/src/python/BUILD +++ b/heron/common/src/python/BUILD @@ -3,29 +3,20 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library") pex_library( - name = 'common', - srcs = glob(['**/*.py']), - deps = [ - '//heron/proto:proto-py', - ], - reqs = [ - 'colorlog==2.6.1', - 'tornado==4.0.2', - 'pyyaml==3.10', - ] + name = 'common-py', + srcs = glob(['**/*.py']), + deps = [ + '//heron/proto:proto-py', + ], + reqs = [ + 'colorlog==2.6.1', + ] ) pex_library( - name = 'tracker-access', - srcs = glob(['**/handler/access/*.py']), - deps = [], + name = 'common-log-py', + srcs = ["utils/log.py"], + reqs = [ + "colorlog==2.6.1", + ] ) - -pex_library( - name = 'common_log', - srcs = ["utils/log.py"], - reqs = [ - "colorlog==2.6.1", - ] -) - diff --git a/heron/common/tests/python/BUILD b/heron/common/tests/python/BUILD index 318d79b1d3e..9e4716db032 100644 --- a/heron/common/tests/python/BUILD +++ b/heron/common/tests/python/BUILD @@ -2,14 +2,14 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_library( - name = "pytest-lib", - srcs = ["mock_protobuf.py"], - deps = [ - "//heron/common/src/python:common", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], + name = "pytest-py", + srcs = ["mock_protobuf.py"], + deps = [ + "//heron/common/src/python:common-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], ) diff --git a/heron/common/tests/python/basics/BUILD b/heron/common/tests/python/basics/BUILD index 2beaed7a27c..a6e17b8aff4 100644 --- a/heron/common/tests/python/basics/BUILD +++ b/heron/common/tests/python/basics/BUILD @@ -2,29 +2,29 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_test( - name = "gateway_looper_unittest", - srcs = ["gateway_looper_unittest.py"], - deps = [ - "//heron/common/src/python:common" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "gateway_looper_unittest", + srcs = ["gateway_looper_unittest.py"], + deps = [ + "//heron/common/src/python:common-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "event_looper_unittest", - srcs = ["event_looper_unittest.py"], - deps = [ - "//heron/common/src/python:common" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "event_looper_unittest", + srcs = ["event_looper_unittest.py"], + deps = [ + "//heron/common/src/python:common-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) diff --git a/heron/common/tests/python/network/BUILD b/heron/common/tests/python/network/BUILD index 3d0762be335..7452c689f54 100644 --- a/heron/common/tests/python/network/BUILD +++ b/heron/common/tests/python/network/BUILD @@ -2,42 +2,42 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_library( - name = "pytest-nw-lib", - srcs = ["mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], + name = "pytest-network-py", + srcs = ["mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], ) pex_test( - name = "protocol_unittest", - srcs = ["protocol_unittest.py"], - deps = [ - ":pytest-nw-lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "protocol_unittest", + srcs = ["protocol_unittest.py"], + deps = [ + ":pytest-network-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "heron_client_unittest", - srcs = ["heron_client_unittest.py"], - deps = [ - ":pytest-nw-lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "heron_client_unittest", + srcs = ["heron_client_unittest.py"], + deps = [ + ":pytest-network-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) diff --git a/heron/common/tests/python/pex_loader/BUILD b/heron/common/tests/python/pex_loader/BUILD index d60384d2e91..4b20621f96d 100644 --- a/heron/common/tests/python/pex_loader/BUILD +++ b/heron/common/tests/python/pex_loader/BUILD @@ -2,15 +2,15 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_test( - name = "pex_loader_unittest", - srcs = ["pex_loader_unittest.py", "constants.py"], - deps = [ - "//heron/common/src/python:common", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "pex_loader_unittest", + srcs = ["pex_loader_unittest.py", "constants.py"], + deps = [ + "//heron/common/src/python:common-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) diff --git a/heron/common/tests/python/utils/BUILD b/heron/common/tests/python/utils/BUILD index 6eb9fd6ae8b..2210d2ebacf 100644 --- a/heron/common/tests/python/utils/BUILD +++ b/heron/common/tests/python/utils/BUILD @@ -2,128 +2,128 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_test( - name = "communicator_unittest", - srcs = ["communicator_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "communicator_unittest", + srcs = ["communicator_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "custom_grouping_unittest", - srcs = ["custom_grouping_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "custom_grouping_unittest", + srcs = ["custom_grouping_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "metrics_helper_unittest", - srcs = ["metrics_helper_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "metrics_helper_unittest", + srcs = ["metrics_helper_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "metrics_unittest", - srcs = ["metrics_unittest.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "metrics_unittest", + srcs = ["metrics_unittest.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "outgoing_tuple_helper_unittest", - srcs = ["outgoing_tuple_helper_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "outgoing_tuple_helper_unittest", + srcs = ["outgoing_tuple_helper_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "serializer_unittest", - srcs = ["serializer_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "serializer_unittest", + srcs = ["serializer_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "pplan_helper_unittest", - srcs = ["pplan_helper_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "pplan_helper_unittest", + srcs = ["pplan_helper_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "topology_context_unittest", - srcs = ["topology_context_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "topology_context_unittest", + srcs = ["topology_context_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "tuple_helper_unittest", - srcs = ["tuple_helper_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib" - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "tuple_helper_unittest", + srcs = ["tuple_helper_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py" + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) diff --git a/heron/config/src/yaml/BUILD b/heron/config/src/yaml/BUILD index 01485fac482..b7cf4359e48 100644 --- a/heron/config/src/yaml/BUILD +++ b/heron/config/src/yaml/BUILD @@ -2,11 +2,6 @@ licenses(["notice"]) package(default_visibility = ["//visibility:public"]) -filegroup( - name = "tracker-yaml", - srcs = ["tracker/heron_tracker.yaml"], -) - filegroup( name = "test-config-internals-yaml", srcs = ["conf/test/test_heron_internals.yaml"], diff --git a/heron/examples/src/python/BUILD b/heron/examples/src/python/BUILD index 7ba95451b6f..bf5702c723d 100644 --- a/heron/examples/src/python/BUILD +++ b/heron/examples/src/python/BUILD @@ -3,35 +3,35 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "example_lib", - srcs = glob(['bolt/*.py', 'spout/*.py', 'misc/*.py']), - deps = [ - '//heron/pyheron/src/python:pyheron_lib', - ], + name = "example-py", + srcs = glob(['bolt/*.py', 'spout/*.py', 'misc/*.py']), + deps = [ + '//heron/pyheron/src/python:pyheron-py', + ], ) pex_library( - name = "pyheron_example_pkg", - srcs = glob(['**/*.py']), - deps = ['//heron/pyheron/src/python:pyheron_lib'] + name = "pyheron-examples-py", + srcs = glob(['**/*.py']), + deps = ['//heron/pyheron/src/python:pyheron-py'] ) # with main method pex_binary( - name = "word_count", - srcs = ["word_count_topology.py"], - deps = [":example_lib"], + name = "word_count", + srcs = ["word_count_topology.py"], + deps = [":example-py"], ) # without main method pex_binary( - name = "custom_grouping", - srcs = ["custom_grouping_topology.py"], - deps = [":example_lib"], + name = "custom_grouping", + srcs = ["custom_grouping_topology.py"], + deps = [":example-py"], ) pex_binary( - name = "multi_stream", - srcs = ["multi_stream_topology.py"], - deps = [":example_lib"], + name = "multi_stream", + srcs = ["multi_stream_topology.py"], + deps = [":example-py"], ) diff --git a/heron/executor/src/python/BUILD b/heron/executor/src/python/BUILD index 6705c3c6148..0700c822e03 100644 --- a/heron/executor/src/python/BUILD +++ b/heron/executor/src/python/BUILD @@ -3,10 +3,12 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "heron-executor-lib", + name = "executor-py", srcs = ["heron_executor.py"], - deps = ["//heron/statemgrs/src/python:zk-statemgr-py", - "//heron/common/src/python:common_log"], + deps = [ + "//heron/statemgrs/src/python:zk-statemgr-py", + "//heron/common/src/python:common-log-py", + ], reqs = ["pyyaml==3.10"], ) @@ -14,6 +16,6 @@ pex_binary( name = "heron-executor", srcs = ["heron_executor.py"], deps = [ - ":heron-executor-lib", + ":executor-py", ], ) diff --git a/heron/executor/tests/python/BUILD b/heron/executor/tests/python/BUILD index 9e7485e27d1..5662fdc1c3f 100644 --- a/heron/executor/tests/python/BUILD +++ b/heron/executor/tests/python/BUILD @@ -4,7 +4,7 @@ pex_test( name = "executor_unittest", srcs = ["heron_executor_unittest.py"], deps = [ - "//heron/executor/src/python:heron-executor-lib", + "//heron/executor/src/python:executor-py", ], reqs = [ "py==1.4.27", diff --git a/heron/instance/src/python/basics/BUILD b/heron/instance/src/python/basics/BUILD index 921e0b1b327..e322c595156 100644 --- a/heron/instance/src/python/basics/BUILD +++ b/heron/instance/src/python/basics/BUILD @@ -3,12 +3,12 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "pyheron_basics_lib", - srcs = glob(["**/*.py"]), - deps = [ - "//heron/common/src/python:common", - "//heron/pyheron/src/python:pyheron_lib", - "//heron/proto:proto-py", - ], - reqs = ['colorlog==2.6.1', 'pyyaml==3.10'], + name = "pyheron-basics-py", + srcs = glob(["**/*.py"]), + deps = [ + "//heron/common/src/python:common-py", + "//heron/pyheron/src/python:pyheron-py", + "//heron/proto:proto-py", + ], + reqs = ['colorlog==2.6.1', 'pyyaml==3.10'], ) diff --git a/heron/instance/src/python/instance/BUILD b/heron/instance/src/python/instance/BUILD index 2a87e002b9d..3f72f7929d0 100644 --- a/heron/instance/src/python/instance/BUILD +++ b/heron/instance/src/python/instance/BUILD @@ -2,16 +2,16 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") +# build binary for single thread python heron instance pex_binary( - # build binary for single thread python heron instance - name = "heron-python-instance", - srcs = ["st_heron_instance.py"], - deps = [ - "//heron/pyheron/src/python:pyheron_lib", - "//heron/instance/src/python/basics:pyheron_basics_lib", - "//heron/instance/src/python/network:pyheron_nw_lib", - "//heron/common/src/python:common", - "//heron/proto:proto-py", - ], - reqs = ['colorlog==2.6.1', 'pyyaml==3.10'], + name = "heron-python-instance", + srcs = ["st_heron_instance.py"], + deps = [ + "//heron/pyheron/src/python:pyheron-py", + "//heron/instance/src/python/basics:pyheron-basics-py", + "//heron/instance/src/python/network:pyheron-network-py", + "//heron/common/src/python:common-py", + "//heron/proto:proto-py", + ], + reqs = ['colorlog==2.6.1', 'pyyaml==3.10'], ) diff --git a/heron/instance/src/python/network/BUILD b/heron/instance/src/python/network/BUILD index 4de3bed4872..34a3f49675d 100644 --- a/heron/instance/src/python/network/BUILD +++ b/heron/instance/src/python/network/BUILD @@ -3,10 +3,10 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "pyheron_nw_lib", - srcs = glob(["**/*.py"]), - deps = [ - "//heron/common/src/python:common", - "//heron/proto:proto-py", - ], + name = "pyheron-network-py", + srcs = glob(["**/*.py"]), + deps = [ + "//heron/common/src/python:common-py", + "//heron/proto:proto-py", + ], ) diff --git a/heron/instance/tests/python/basics/BUILD b/heron/instance/tests/python/basics/BUILD index 73fda6d3806..22f568e5a3a 100644 --- a/heron/instance/tests/python/basics/BUILD +++ b/heron/instance/tests/python/basics/BUILD @@ -3,16 +3,16 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_test( - name = "bolt_instance_unittest", - srcs = ["bolt_instance_unittest.py"], - deps = [ - "//heron/common/tests/python:pytest-lib", - "//heron/instance/src/python/basics:pyheron_basics_lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "bolt_instance_unittest", + srcs = ["bolt_instance_unittest.py"], + deps = [ + "//heron/common/tests/python:pytest-py", + "//heron/instance/src/python/basics:pyheron-basics-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) diff --git a/heron/instance/tests/python/network/BUILD b/heron/instance/tests/python/network/BUILD index fac15eaabf1..c7206216a13 100644 --- a/heron/instance/tests/python/network/BUILD +++ b/heron/instance/tests/python/network/BUILD @@ -3,31 +3,31 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_test( - name = "st_stmgrcli_unittest", - srcs = ["st_stmgr_client_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib", - "//heron/instance/src/python/network:pyheron_nw_lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "st_stmgrcli_unittest", + srcs = ["st_stmgr_client_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py", + "//heron/instance/src/python/network:pyheron-network-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "metricsmgr_client_unittest", - srcs = ["metricsmgr_client_unittest.py", "mock_generator.py"], - deps = [ - "//heron/common/tests/python:pytest-lib", - "//heron/instance/src/python/network:pyheron_nw_lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "metricsmgr_client_unittest", + srcs = ["metricsmgr_client_unittest.py", "mock_generator.py"], + deps = [ + "//heron/common/tests/python:pytest-py", + "//heron/instance/src/python/network:pyheron-network-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) diff --git a/heron/pyheron/src/python/BUILD b/heron/pyheron/src/python/BUILD index a0b6509a48c..1d8fdd0f93d 100644 --- a/heron/pyheron/src/python/BUILD +++ b/heron/pyheron/src/python/BUILD @@ -3,11 +3,11 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "pyheron_lib", - srcs = glob(["**/*.py"]), - deps = [ - "//heron/common/src/python:common", - "//heron/proto:proto-py", - ], - reqs = ['colorlog==2.6.1', 'pyyaml==3.10'], + name = "pyheron-py", + srcs = glob(["**/*.py"]), + deps = [ + "//heron/common/src/python:common-py", + "//heron/proto:proto-py", + ], + reqs = ['colorlog==2.6.1', 'pyyaml==3.10'], ) diff --git a/heron/pyheron/tests/python/BUILD b/heron/pyheron/tests/python/BUILD index 56e161fa4f6..641d6b060f8 100644 --- a/heron/pyheron/tests/python/BUILD +++ b/heron/pyheron/tests/python/BUILD @@ -3,46 +3,46 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_test") pex_test( - name = "component_unittest", - srcs = ["component_unittest.py"], - deps = [ - "//heron/common/tests/python:pytest-lib", - "//heron/pyheron/src/python:pyheron_lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "component_unittest", + srcs = ["component_unittest.py"], + deps = [ + "//heron/common/tests/python:pytest-py", + "//heron/pyheron/src/python:pyheron-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "stream_unittest", - srcs = ["stream_unittest.py"], - deps = [ - "//heron/common/tests/python:pytest-lib", - "//heron/pyheron/src/python:pyheron_lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "stream_unittest", + srcs = ["stream_unittest.py"], + deps = [ + "//heron/common/tests/python:pytest-py", + "//heron/pyheron/src/python:pyheron-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) pex_test( - name = "topology_unittest", - srcs = ["topology_unittest.py"], - deps = [ - "//heron/common/tests/python:pytest-lib", - "//heron/pyheron/src/python:pyheron_lib", - ], - reqs = [ - "py==1.4.27", - "pytest==2.6.4", - "unittest2==0.5.1", - ], - size = "small", + name = "topology_unittest", + srcs = ["topology_unittest.py"], + deps = [ + "//heron/common/tests/python:pytest-py", + "//heron/pyheron/src/python:pyheron-py", + ], + reqs = [ + "py==1.4.27", + "pytest==2.6.4", + "unittest2==0.5.1", + ], + size = "small", ) diff --git a/heron/cli/src/python/BUILD b/heron/tools/cli/src/python/BUILD similarity index 71% rename from heron/cli/src/python/BUILD rename to heron/tools/cli/src/python/BUILD index 3ae8b9f9fa9..846b05a60e8 100644 --- a/heron/cli/src/python/BUILD +++ b/heron/tools/cli/src/python/BUILD @@ -3,13 +3,14 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "heron-lib", + name = "cli-py", srcs = glob( ["**/*.py"], exclude = ["main.py"], ), deps = [ - "//heron/common/src/python:common", + "//heron/common/src/python:common-py", + "//heron/tools/common/src/python:common-py", "//heron/proto:proto-py", ], reqs = ["pyyaml==3.10"], @@ -20,7 +21,5 @@ pex_binary( srcs = [ "main.py", ], - deps = [ - ":heron-lib", - ], + deps = [":cli-py"], ) diff --git a/heron/cli/src/python/README.md b/heron/tools/cli/src/python/README.md similarity index 100% rename from heron/cli/src/python/README.md rename to heron/tools/cli/src/python/README.md diff --git a/heron/cli/src/python/activate.py b/heron/tools/cli/src/python/activate.py similarity index 94% rename from heron/cli/src/python/activate.py rename to heron/tools/cli/src/python/activate.py index 87c1cb37ef8..64fbe33312c 100644 --- a/heron/cli/src/python/activate.py +++ b/heron/tools/cli/src/python/activate.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' activate ''' -import heron.cli.src.python.cli_helper as cli_helper +import heron.tools.cli.src.python.cli_helper as cli_helper def create_parser(subparsers): ''' diff --git a/heron/cli/src/python/args.py b/heron/tools/cli/src/python/args.py similarity index 98% rename from heron/cli/src/python/args.py rename to heron/tools/cli/src/python/args.py index 717c1fdbfd4..f49d7d9adcb 100644 --- a/heron/cli/src/python/args.py +++ b/heron/tools/cli/src/python/args.py @@ -14,7 +14,7 @@ ''' args.py ''' import os -import heron.common.src.python.utils.config as config +import heron.tools.common.src.python.utils.config as config def add_titles(parser): diff --git a/heron/cli/src/python/cli_helper.py b/heron/tools/cli/src/python/cli_helper.py similarity index 92% rename from heron/cli/src/python/cli_helper.py rename to heron/tools/cli/src/python/cli_helper.py index dfdd9ed576c..c74765ddea0 100644 --- a/heron/cli/src/python/cli_helper.py +++ b/heron/tools/cli/src/python/cli_helper.py @@ -13,10 +13,10 @@ # limitations under the License. ''' cli_helper.py ''' import logging -import heron.common.src.python.utils.config as config -import heron.cli.src.python.execute as execute -import heron.cli.src.python.jars as jars -import heron.cli.src.python.args as args +import heron.tools.common.src.python.utils.config as config +import heron.tools.cli.src.python.execute as execute +import heron.tools.cli.src.python.jars as jars +import heron.tools.cli.src.python.args as args from heron.common.src.python.utils.log import Log diff --git a/heron/cli/src/python/deactivate.py b/heron/tools/cli/src/python/deactivate.py similarity index 94% rename from heron/cli/src/python/deactivate.py rename to heron/tools/cli/src/python/deactivate.py index 79e2d8b9728..7f3f45d3516 100644 --- a/heron/cli/src/python/deactivate.py +++ b/heron/tools/cli/src/python/deactivate.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' deactivate.py ''' -import heron.cli.src.python.cli_helper as cli_helper +import heron.tools.cli.src.python.cli_helper as cli_helper def create_parser(subparsers): diff --git a/heron/cli/src/python/execute.py b/heron/tools/cli/src/python/execute.py similarity index 97% rename from heron/cli/src/python/execute.py rename to heron/tools/cli/src/python/execute.py index bab6abde98d..fe42e45f60c 100644 --- a/heron/cli/src/python/execute.py +++ b/heron/tools/cli/src/python/execute.py @@ -19,12 +19,12 @@ import tempfile import traceback -import heron.cli.src.python.opts as opts -import heron.common.src.python.utils.config as config from heron.common.src.python.utils.log import Log -import heron.cli.src.python.jars as jars import heron.common.src.python.pex_loader as pex_loader +import heron.tools.cli.src.python.opts as opts +import heron.tools.common.src.python.utils.config as config +import heron.tools.cli.src.python.jars as jars ################################################################################ def heron_class(class_name, lib_jars, extra_jars=None, args=None, java_defines=None): diff --git a/heron/cli/src/python/help.py b/heron/tools/cli/src/python/help.py similarity index 96% rename from heron/cli/src/python/help.py rename to heron/tools/cli/src/python/help.py index 2f50eeaa798..c681b69706b 100644 --- a/heron/cli/src/python/help.py +++ b/heron/tools/cli/src/python/help.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' help.py ''' -import heron.common.src.python.utils.config as config from heron.common.src.python.utils.log import Log - +import heron.tools.common.src.python.utils.config as config def create_parser(subparsers): ''' diff --git a/heron/cli/src/python/heronrc.sample b/heron/tools/cli/src/python/heronrc.sample similarity index 100% rename from heron/cli/src/python/heronrc.sample rename to heron/tools/cli/src/python/heronrc.sample diff --git a/heron/cli/src/python/jars.py b/heron/tools/cli/src/python/jars.py similarity index 96% rename from heron/cli/src/python/jars.py rename to heron/tools/cli/src/python/jars.py index 6bcfad7d25c..f5658e7a07b 100644 --- a/heron/cli/src/python/jars.py +++ b/heron/tools/cli/src/python/jars.py @@ -15,7 +15,7 @@ import os import fnmatch -import heron.common.src.python.utils.config as config +import heron.tools.common.src.python.utils.config as config def pick(dirname, pattern): diff --git a/heron/cli/src/python/kill.py b/heron/tools/cli/src/python/kill.py similarity index 94% rename from heron/cli/src/python/kill.py rename to heron/tools/cli/src/python/kill.py index a5d3861e582..834ce731fd2 100644 --- a/heron/cli/src/python/kill.py +++ b/heron/tools/cli/src/python/kill.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' kill.py ''' -import heron.cli.src.python.cli_helper as cli_helper +import heron.tools.cli.src.python.cli_helper as cli_helper def create_parser(subparsers): diff --git a/heron/cli/src/python/main.py b/heron/tools/cli/src/python/main.py similarity index 92% rename from heron/cli/src/python/main.py rename to heron/tools/cli/src/python/main.py index f6958ccc848..3ab4c641184 100644 --- a/heron/cli/src/python/main.py +++ b/heron/tools/cli/src/python/main.py @@ -22,16 +22,16 @@ import time import traceback -import heron.cli.src.python.help as cli_help -import heron.common.src.python.heronparser as hrc_parse -import heron.cli.src.python.activate as activate -import heron.cli.src.python.deactivate as deactivate -import heron.cli.src.python.kill as kill -import heron.cli.src.python.restart as restart -import heron.cli.src.python.submit as submit -import heron.common.src.python.utils.config as config -import heron.cli.src.python.version as version import heron.common.src.python.utils.log as log +import heron.tools.common.src.python.utils.heronparser as hrc_parse +import heron.tools.common.src.python.utils.config as config +import heron.tools.cli.src.python.help as cli_help +import heron.tools.cli.src.python.activate as activate +import heron.tools.cli.src.python.deactivate as deactivate +import heron.tools.cli.src.python.kill as kill +import heron.tools.cli.src.python.restart as restart +import heron.tools.cli.src.python.submit as submit +import heron.tools.cli.src.python.version as version Log = log.Log diff --git a/heron/cli/src/python/opts.py b/heron/tools/cli/src/python/opts.py similarity index 100% rename from heron/cli/src/python/opts.py rename to heron/tools/cli/src/python/opts.py diff --git a/heron/cli/src/python/restart.py b/heron/tools/cli/src/python/restart.py similarity index 92% rename from heron/cli/src/python/restart.py rename to heron/tools/cli/src/python/restart.py index 5ee46db82cc..b41e924fffb 100644 --- a/heron/cli/src/python/restart.py +++ b/heron/tools/cli/src/python/restart.py @@ -14,10 +14,10 @@ ''' restart.py ''' import traceback from heron.common.src.python.utils.log import Log -import heron.cli.src.python.args as args -import heron.cli.src.python.execute as execute -import heron.cli.src.python.jars as jars -import heron.common.src.python.utils.config as config +import heron.tools.cli.src.python.args as args +import heron.tools.cli.src.python.execute as execute +import heron.tools.cli.src.python.jars as jars +import heron.tools.common.src.python.utils.config as config def create_parser(subparsers): diff --git a/heron/cli/src/python/submit.py b/heron/tools/cli/src/python/submit.py similarity index 97% rename from heron/cli/src/python/submit.py rename to heron/tools/cli/src/python/submit.py index 2c1e32f55ec..096b27ba861 100644 --- a/heron/cli/src/python/submit.py +++ b/heron/tools/cli/src/python/submit.py @@ -22,11 +22,11 @@ from heron.common.src.python.utils.log import Log from heron.proto import topology_pb2 -import heron.cli.src.python.args as cli_args -import heron.cli.src.python.execute as execute -import heron.cli.src.python.jars as jars -import heron.cli.src.python.opts as opts -import heron.common.src.python.utils.config as config +import heron.tools.cli.src.python.args as cli_args +import heron.tools.cli.src.python.execute as execute +import heron.tools.cli.src.python.jars as jars +import heron.tools.cli.src.python.opts as opts +import heron.tools.common.src.python.utils.config as config ################################################################################ diff --git a/heron/cli/src/python/version.py b/heron/tools/cli/src/python/version.py similarity index 91% rename from heron/cli/src/python/version.py rename to heron/tools/cli/src/python/version.py index 8f654979ce5..5ee2c81f01a 100644 --- a/heron/cli/src/python/version.py +++ b/heron/tools/cli/src/python/version.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' version.py ''' -import heron.cli.src.python.args as cli_args -import heron.common.src.python.utils.config as config +import heron.tools.cli.src.python.args as cli_args +import heron.tools.common.src.python.utils.config as config def create_parser(subparsers): diff --git a/heron/cli/tests/python/BUILD b/heron/tools/cli/tests/python/BUILD similarity index 83% rename from heron/cli/tests/python/BUILD rename to heron/tools/cli/tests/python/BUILD index 833ff7ae785..440a9693565 100644 --- a/heron/cli/tests/python/BUILD +++ b/heron/tools/cli/tests/python/BUILD @@ -4,7 +4,7 @@ pex_test( name = "opts_unittest", srcs = ["opts_unittest.py"], deps = [ - "//heron/cli/src/python:heron-lib", + "//heron/tools/cli/src/python:cli-py", ], reqs = [ "py==1.4.27", @@ -18,7 +18,7 @@ pex_test( name = "heronparser_unittest", srcs = [ "heronparser_unittest.py"], deps = [ - "//heron/cli/src/python:heron-lib", + "//heron/tools/cli/src/python:cli-py", ], reqs = [ "py==1.4.27", diff --git a/heron/cli/tests/python/heronparser_unittest.py b/heron/tools/cli/tests/python/heronparser_unittest.py similarity index 96% rename from heron/cli/tests/python/heronparser_unittest.py rename to heron/tools/cli/tests/python/heronparser_unittest.py index ff638f4b0a0..6d38f5d23a2 100644 --- a/heron/cli/tests/python/heronparser_unittest.py +++ b/heron/tools/cli/tests/python/heronparser_unittest.py @@ -17,10 +17,10 @@ import os import sys import unittest2 as unittest -import heron.cli.src.python.activate as activate -import heron.common.src.python.heronparser as hr_argparser -import heron.common.src.python.utils.config as config -import heron.cli.src.python.submit as submit +import heron.tools.common.src.python.utils.heronparser as hr_argparser +import heron.tools.common.src.python.utils.config as config +import heron.tools.cli.src.python.activate as activate +import heron.tools.cli.src.python.submit as submit logging.basicConfig(level=logging.INFO) diff --git a/heron/cli/tests/python/heronrc.test b/heron/tools/cli/tests/python/heronrc.test similarity index 100% rename from heron/cli/tests/python/heronrc.test rename to heron/tools/cli/tests/python/heronrc.test diff --git a/heron/cli/tests/python/opts_unittest.py b/heron/tools/cli/tests/python/opts_unittest.py similarity index 97% rename from heron/cli/tests/python/opts_unittest.py rename to heron/tools/cli/tests/python/opts_unittest.py index 4b3893bf244..0be2eff08e8 100644 --- a/heron/cli/tests/python/opts_unittest.py +++ b/heron/tools/cli/tests/python/opts_unittest.py @@ -13,7 +13,7 @@ # limitations under the License. ''' opts_unittest.py ''' import unittest2 as unittest -import heron.cli.src.python.opts as opts +import heron.tools.cli.src.python.opts as opts #pylint: disable=missing-docstring, no-self-use diff --git a/heron/tools/common/src/python/BUILD b/heron/tools/common/src/python/BUILD new file mode 100644 index 00000000000..9e9262d487c --- /dev/null +++ b/heron/tools/common/src/python/BUILD @@ -0,0 +1,20 @@ +package(default_visibility = ["//visibility:public"]) + +load("/tools/rules/pex_rules", "pex_library") + +pex_library( + name = "tracker-py", + srcs = glob(["access/*.py"]), +) + +pex_library( + name = "common-py", + srcs = glob( + ["**/*.py"], + exclude = ["access"], + exclude_directories = 1, + ), + deps = [ + "//heron/common/src/python:common-py", + ] +) diff --git a/heron/common/src/python/handler/access/__init__.py b/heron/tools/common/src/python/access/__init__.py similarity index 100% rename from heron/common/src/python/handler/access/__init__.py rename to heron/tools/common/src/python/access/__init__.py diff --git a/heron/common/src/python/handler/access/fetch.py b/heron/tools/common/src/python/access/fetch.py similarity index 97% rename from heron/common/src/python/handler/access/fetch.py rename to heron/tools/common/src/python/access/fetch.py index 2e3a0edf816..c5cf74d0b20 100644 --- a/heron/common/src/python/handler/access/fetch.py +++ b/heron/tools/common/src/python/access/fetch.py @@ -18,7 +18,7 @@ import tornado.httpclient import tornado.gen -from ...utils import log +from heron.common.src.python.utils.log import log Log = log.Log diff --git a/heron/common/src/python/handler/access/heron.py b/heron/tools/common/src/python/access/heron.py similarity index 100% rename from heron/common/src/python/handler/access/heron.py rename to heron/tools/common/src/python/access/heron.py diff --git a/heron/common/src/python/handler/access/query.py b/heron/tools/common/src/python/access/query.py similarity index 100% rename from heron/common/src/python/handler/access/query.py rename to heron/tools/common/src/python/access/query.py diff --git a/heron/common/src/python/utils/tracker_access.py b/heron/tools/common/src/python/access/tracker_access.py similarity index 98% rename from heron/common/src/python/utils/tracker_access.py rename to heron/tools/common/src/python/access/tracker_access.py index fec7882bda7..affdd2ff289 100644 --- a/heron/common/src/python/utils/tracker_access.py +++ b/heron/tools/common/src/python/access/tracker_access.py @@ -17,7 +17,7 @@ import tornado.ioloop from heron.common.src.python.handler.access import heron as API -from .log import Log +from heron.common.src.python.utils.log import Log def _all_metric_queries(): queries_normal = ['complete-latency', diff --git a/heron/common/src/python/utils/config.py b/heron/tools/common/src/python/utils/config.py similarity index 99% rename from heron/common/src/python/utils/config.py rename to heron/tools/common/src/python/utils/config.py index ca1e5f3feea..0d992e39985 100644 --- a/heron/common/src/python/utils/config.py +++ b/heron/tools/common/src/python/utils/config.py @@ -23,7 +23,7 @@ import tempfile import yaml -from .log import Log +from heron.common.src.python.utils.log import Log # pylint: disable=logging-not-lazy diff --git a/heron/common/src/python/heronparser.py b/heron/tools/common/src/python/utils/heronparser.py similarity index 99% rename from heron/common/src/python/heronparser.py rename to heron/tools/common/src/python/utils/heronparser.py index 517023084c1..fdebd520195 100755 --- a/heron/common/src/python/heronparser.py +++ b/heron/tools/common/src/python/utils/heronparser.py @@ -18,8 +18,10 @@ import os import re import sys -import heron.common.src.python.utils.config as config + from heron.common.src.python.utils.log import Log +import heron.tools.common.src.python.utils.config as config + ########################################################################## # Run the command ########################################################################## diff --git a/heron/tools/config/src/yaml/BUILD b/heron/tools/config/src/yaml/BUILD new file mode 100644 index 00000000000..b8e8cd6d107 --- /dev/null +++ b/heron/tools/config/src/yaml/BUILD @@ -0,0 +1,8 @@ +licenses(["notice"]) + +package(default_visibility = ["//visibility:public"]) + +filegroup( + name = "tracker-yaml", + srcs = ["tracker/heron_tracker.yaml"], +) diff --git a/heron/config/src/yaml/tracker/heron_tracker.yaml b/heron/tools/config/src/yaml/tracker/heron_tracker.yaml similarity index 100% rename from heron/config/src/yaml/tracker/heron_tracker.yaml rename to heron/tools/config/src/yaml/tracker/heron_tracker.yaml diff --git a/heron/explorer/src/python/BUILD b/heron/tools/explorer/src/python/BUILD similarity index 67% rename from heron/explorer/src/python/BUILD rename to heron/tools/explorer/src/python/BUILD index dd0c0a527c5..399d19e2f0e 100644 --- a/heron/explorer/src/python/BUILD +++ b/heron/tools/explorer/src/python/BUILD @@ -3,11 +3,12 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "heron-explorer-lib", + name = "explorer-py", srcs = glob(["**/*.py"],), deps = [ - "//heron/common/src/python:tracker-access", - "//heron/common/src/python:common", + "//heron/common/src/python:common-py", + "//heron/tools/common/src/python:common-py", + "//heron/tools/common/src/python:tracker-py", "//heron/statemgrs/src/python:zk-statemgr-py", "//heron/proto:proto-py", ], @@ -21,6 +22,6 @@ pex_binary( name = "heron-explorer", srcs = ["main.py"], deps = [ - ":heron-explorer-lib", + ":explorer-py", ], ) diff --git a/heron/explorer/src/python/args.py b/heron/tools/explorer/src/python/args.py similarity index 100% rename from heron/explorer/src/python/args.py rename to heron/tools/explorer/src/python/args.py diff --git a/heron/explorer/src/python/clusters.py b/heron/tools/explorer/src/python/clusters.py similarity index 94% rename from heron/explorer/src/python/clusters.py rename to heron/tools/explorer/src/python/clusters.py index 969656db26b..0457420c3de 100644 --- a/heron/explorer/src/python/clusters.py +++ b/heron/tools/explorer/src/python/clusters.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' clusters.py ''' -import heron.explorer.src.python.args as args -import heron.common.src.python.utils.tracker_access as tracker_access from heron.common.src.python.utils.log import Log +import heron.explorer.src.python.args as args +import heron.tools.common.src.python.access.tracker_access as tracker_access def create_parser(subparsers): diff --git a/heron/explorer/src/python/help.py b/heron/tools/explorer/src/python/help.py similarity index 96% rename from heron/explorer/src/python/help.py rename to heron/tools/explorer/src/python/help.py index 8b2a7262c50..0baa91527ac 100644 --- a/heron/explorer/src/python/help.py +++ b/heron/tools/explorer/src/python/help.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' help.py ''' -import heron.common.src.python.utils.config as config from heron.common.src.python.utils.log import Log +import heron.tools.common.src.python.utils.config as config # pylint: disable=protected-access diff --git a/heron/explorer/src/python/logicalplan.py b/heron/tools/explorer/src/python/logicalplan.py similarity index 97% rename from heron/explorer/src/python/logicalplan.py rename to heron/tools/explorer/src/python/logicalplan.py index f5b87e4e17a..342fdb05b14 100644 --- a/heron/explorer/src/python/logicalplan.py +++ b/heron/tools/explorer/src/python/logicalplan.py @@ -13,9 +13,9 @@ # limitations under the License. ''' logicalplan.py ''' from collections import defaultdict -import heron.explorer.src.python.args as args from heron.common.src.python.utils.log import Log -import heron.common.src.python.utils.tracker_access as tracker_access +import heron.tools.explorer.src.python.args as args +import heron.tools.common.src.python.access.tracker_access as tracker_access from tabulate import tabulate diff --git a/heron/explorer/src/python/main.py b/heron/tools/explorer/src/python/main.py similarity index 91% rename from heron/explorer/src/python/main.py rename to heron/tools/explorer/src/python/main.py index d93ef9409f2..b60231447db 100644 --- a/heron/explorer/src/python/main.py +++ b/heron/tools/explorer/src/python/main.py @@ -18,17 +18,17 @@ import sys import time -import heron.explorer.src.python.args as parse -import heron.explorer.src.python.clusters as clusters -# pylint: disable=redefined-builtin -import heron.explorer.src.python.help as help -import heron.explorer.src.python.logicalplan as logicalplan -import heron.explorer.src.python.opts as opts -import heron.explorer.src.python.physicalplan as physicalplan -import heron.explorer.src.python.topologies as topologies -import heron.common.src.python.utils.config as config -import heron.explorer.src.python.version as version import heron.common.src.python.utils.log as log +import heron.tools.common.src.python.utils.config as config +import heron.tools.explorer.src.python.args as parse +import heron.tools.explorer.src.python.clusters as clusters +# pylint: disable=redefined-builtin +import heron.tools.explorer.src.python.help as help +import heron.tools.explorer.src.python.logicalplan as logicalplan +import heron.tools.explorer.src.python.opts as opts +import heron.tools.explorer.src.python.physicalplan as physicalplan +import heron.tools.explorer.src.python.topologies as topologies +import heron.tools.explorer.src.python.version as version Log = log.Log diff --git a/heron/explorer/src/python/opts.py b/heron/tools/explorer/src/python/opts.py similarity index 100% rename from heron/explorer/src/python/opts.py rename to heron/tools/explorer/src/python/opts.py diff --git a/heron/explorer/src/python/physicalplan.py b/heron/tools/explorer/src/python/physicalplan.py similarity index 98% rename from heron/explorer/src/python/physicalplan.py rename to heron/tools/explorer/src/python/physicalplan.py index c37fb20bd42..d7874964db8 100644 --- a/heron/explorer/src/python/physicalplan.py +++ b/heron/tools/explorer/src/python/physicalplan.py @@ -13,9 +13,9 @@ # limitations under the License. ''' physicalplan.py ''' import sys -import heron.explorer.src.python.args as args -import heron.common.src.python.utils.tracker_access as tracker_access from heron.common.src.python.utils.log import Log +import heron.tools.common.src.python.access.tracker_access as tracker_access +import heron.tools.explorer.src.python.args as args from tabulate import tabulate diff --git a/heron/explorer/src/python/topologies.py b/heron/tools/explorer/src/python/topologies.py similarity index 96% rename from heron/explorer/src/python/topologies.py rename to heron/tools/explorer/src/python/topologies.py index feff6721bfd..9f540373415 100644 --- a/heron/explorer/src/python/topologies.py +++ b/heron/tools/explorer/src/python/topologies.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' topologies.py ''' -import heron.explorer.src.python.args as args from heron.common.src.python.utils.log import Log -import heron.common.src.python.utils.tracker_access as tracker_access +import heron.tools.explorer.src.python.args as args +import heron.tools.common.src.python.access.tracker_access as tracker_access from tabulate import tabulate diff --git a/heron/explorer/src/python/version.py b/heron/tools/explorer/src/python/version.py similarity index 91% rename from heron/explorer/src/python/version.py rename to heron/tools/explorer/src/python/version.py index aa68f725e3d..0ee726c622c 100644 --- a/heron/explorer/src/python/version.py +++ b/heron/tools/explorer/src/python/version.py @@ -12,8 +12,8 @@ # see the license for the specific language governing permissions and # limitations under the license. ''' version.py ''' -import heron.explorer.src.python.args as args -import heron.common.src.python.utils.config as config +import heron.tools.common.src.python.utils.config as config +import heron.tools.explorer.src.python.args as args def create_parser(subparsers): diff --git a/heron/explorer/tests/python/BUILD b/heron/tools/explorer/tests/python/BUILD similarity index 64% rename from heron/explorer/tests/python/BUILD rename to heron/tools/explorer/tests/python/BUILD index f33b7ed92ec..1f99185c539 100644 --- a/heron/explorer/tests/python/BUILD +++ b/heron/tools/explorer/tests/python/BUILD @@ -4,8 +4,9 @@ pex_test( name = "explorer_unittest", srcs = ["explorer_unittest.py"], deps = [ - "//heron/explorer/src/python:heron-explorer-lib", - "//heron/common/src/python:common", + "//heron/tools/explorer/src/python:explorer-py", + "//heron/tools/common/src/python:common-py", + "//heron/common/src/python:common-py", ], reqs = [ "mock==1.0.1", diff --git a/heron/explorer/tests/python/explorer_unittest.py b/heron/tools/explorer/tests/python/explorer_unittest.py similarity index 95% rename from heron/explorer/tests/python/explorer_unittest.py rename to heron/tools/explorer/tests/python/explorer_unittest.py index 61be4238542..d714184f492 100644 --- a/heron/explorer/tests/python/explorer_unittest.py +++ b/heron/tools/explorer/tests/python/explorer_unittest.py @@ -17,10 +17,10 @@ import unittest2 as unittest from mock import Mock -import heron.explorer.src.python.topologies as topologies -import heron.explorer.src.python.main as main -import heron.explorer.src.python.args as args -import heron.common.src.python.utils.tracker_access as tracker_access +import heron.tools.common.src.python.access.tracker_access as tracker_access +import heron.tools.explorer.src.python.topologies as topologies +import heron.tools.explorer.src.python.main as main +import heron.tools.explorer.src.python.args as args # pylint: disable=missing-docstring, no-self-use diff --git a/heron/explorer/tests/python/info.json b/heron/tools/explorer/tests/python/info.json similarity index 100% rename from heron/explorer/tests/python/info.json rename to heron/tools/explorer/tests/python/info.json diff --git a/heron/explorer/tests/python/logicalplan.json b/heron/tools/explorer/tests/python/logicalplan.json similarity index 100% rename from heron/explorer/tests/python/logicalplan.json rename to heron/tools/explorer/tests/python/logicalplan.json diff --git a/heron/explorer/tests/python/metrics.json b/heron/tools/explorer/tests/python/metrics.json similarity index 100% rename from heron/explorer/tests/python/metrics.json rename to heron/tools/explorer/tests/python/metrics.json diff --git a/heron/explorer/tests/python/physicalplan.json b/heron/tools/explorer/tests/python/physicalplan.json similarity index 100% rename from heron/explorer/tests/python/physicalplan.json rename to heron/tools/explorer/tests/python/physicalplan.json diff --git a/heron/explorer/tests/python/topologies.json b/heron/tools/explorer/tests/python/topologies.json similarity index 100% rename from heron/explorer/tests/python/topologies.json rename to heron/tools/explorer/tests/python/topologies.json diff --git a/heron/tracker/src/python/BUILD b/heron/tools/tracker/src/python/BUILD similarity index 81% rename from heron/tracker/src/python/BUILD rename to heron/tools/tracker/src/python/BUILD index b748045026b..bb41da546c3 100644 --- a/heron/tracker/src/python/BUILD +++ b/heron/tools/tracker/src/python/BUILD @@ -3,13 +3,13 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "heron-tracker-lib", + name = "tracker-py", srcs = glob( ["**/*.py"], exclude = ["main.py"], ), deps = [ - "//heron/common/src/python:common", + "//heron/common/src/python:common-py", "//heron/statemgrs/src/python:zk-statemgr-py", "//heron/proto:proto-py", ], @@ -23,6 +23,6 @@ pex_binary( name = "heron-tracker", srcs = ["main.py"], deps = [ - ":heron-tracker-lib", + ":tracker-py", ], ) diff --git a/heron/tracker/src/python/config.py b/heron/tools/tracker/src/python/config.py similarity index 100% rename from heron/tracker/src/python/config.py rename to heron/tools/tracker/src/python/config.py diff --git a/heron/tracker/src/python/constants.py b/heron/tools/tracker/src/python/constants.py similarity index 100% rename from heron/tracker/src/python/constants.py rename to heron/tools/tracker/src/python/constants.py diff --git a/heron/tracker/src/python/handlers/__init__.py b/heron/tools/tracker/src/python/handlers/__init__.py similarity index 100% rename from heron/tracker/src/python/handlers/__init__.py rename to heron/tools/tracker/src/python/handlers/__init__.py diff --git a/heron/tracker/src/python/handlers/basehandler.py b/heron/tools/tracker/src/python/handlers/basehandler.py similarity index 99% rename from heron/tracker/src/python/handlers/basehandler.py rename to heron/tools/tracker/src/python/handlers/basehandler.py index b7dde08504b..91953add3af 100644 --- a/heron/tracker/src/python/handlers/basehandler.py +++ b/heron/tools/tracker/src/python/handlers/basehandler.py @@ -16,7 +16,7 @@ import tornado.escape import tornado.web -from heron.tracker.src.python import constants +from heron.tools.tracker.src.python import constants # pylint: disable=too-many-public-methods class BaseHandler(tornado.web.RequestHandler): diff --git a/heron/tracker/src/python/handlers/clustershandler.py b/heron/tools/tracker/src/python/handlers/clustershandler.py similarity index 94% rename from heron/tracker/src/python/handlers/clustershandler.py rename to heron/tools/tracker/src/python/handlers/clustershandler.py index 80a2fd48113..1aeb80795f1 100644 --- a/heron/tracker/src/python/handlers/clustershandler.py +++ b/heron/tools/tracker/src/python/handlers/clustershandler.py @@ -14,7 +14,7 @@ ''' clustershandler.py ''' import tornado.gen -from heron.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python.handlers import BaseHandler # pylint: disable=attribute-defined-outside-init class ClustersHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/containerfilehandler.py b/heron/tools/tracker/src/python/handlers/containerfilehandler.py similarity index 96% rename from heron/tracker/src/python/handlers/containerfilehandler.py rename to heron/tools/tracker/src/python/handlers/containerfilehandler.py index fe7edc04b49..03b1bee8559 100644 --- a/heron/tracker/src/python/handlers/containerfilehandler.py +++ b/heron/tools/tracker/src/python/handlers/containerfilehandler.py @@ -15,10 +15,11 @@ import json import traceback import tornado.gen -from heron.tracker.src.python.handlers import BaseHandler -from heron.tracker.src.python import constants -from heron.tracker.src.python import utils + from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python import utils # pylint: disable=attribute-defined-outside-init diff --git a/heron/tracker/src/python/handlers/defaulthandler.py b/heron/tools/tracker/src/python/handlers/defaulthandler.py similarity index 94% rename from heron/tracker/src/python/handlers/defaulthandler.py rename to heron/tools/tracker/src/python/handlers/defaulthandler.py index 96a84ca2578..fa3a930e2ec 100644 --- a/heron/tracker/src/python/handlers/defaulthandler.py +++ b/heron/tools/tracker/src/python/handlers/defaulthandler.py @@ -14,7 +14,7 @@ """ defaulthandler.py """ import tornado.gen -from heron.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python.handlers import BaseHandler class DefaultHandler(BaseHandler): """ diff --git a/heron/tracker/src/python/handlers/exceptionhandler.py b/heron/tools/tracker/src/python/handlers/exceptionhandler.py similarity index 97% rename from heron/tracker/src/python/handlers/exceptionhandler.py rename to heron/tools/tracker/src/python/handlers/exceptionhandler.py index b457815b0ad..e46700376be 100644 --- a/heron/tracker/src/python/handlers/exceptionhandler.py +++ b/heron/tools/tracker/src/python/handlers/exceptionhandler.py @@ -16,11 +16,11 @@ import tornado.gen import tornado.web +from heron.common.src.python.utils.log import Log from heron.proto import common_pb2 from heron.proto import tmaster_pb2 -from heron.tracker.src.python import constants -from heron.tracker.src.python.handlers import BaseHandler -from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python.handlers import BaseHandler # pylint: disable=attribute-defined-outside-init diff --git a/heron/tracker/src/python/handlers/exceptionsummaryhandler.py b/heron/tools/tracker/src/python/handlers/exceptionsummaryhandler.py similarity index 97% rename from heron/tracker/src/python/handlers/exceptionsummaryhandler.py rename to heron/tools/tracker/src/python/handlers/exceptionsummaryhandler.py index 1929796ba30..1c709a5da2b 100644 --- a/heron/tracker/src/python/handlers/exceptionsummaryhandler.py +++ b/heron/tools/tracker/src/python/handlers/exceptionsummaryhandler.py @@ -16,11 +16,11 @@ import tornado.gen import tornado.web +from heron.common.src.python.utils.log import Log from heron.proto import common_pb2 from heron.proto import tmaster_pb2 -from heron.tracker.src.python import constants -from heron.tracker.src.python.handlers import BaseHandler -from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python.handlers import BaseHandler # pylint: disable=attribute-defined-outside-init class ExceptionSummaryHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/executionstatehandler.py b/heron/tools/tracker/src/python/handlers/executionstatehandler.py similarity index 96% rename from heron/tracker/src/python/handlers/executionstatehandler.py rename to heron/tools/tracker/src/python/handlers/executionstatehandler.py index e4f07b4627f..43ad5cc3add 100644 --- a/heron/tracker/src/python/handlers/executionstatehandler.py +++ b/heron/tools/tracker/src/python/handlers/executionstatehandler.py @@ -16,8 +16,8 @@ import tornado.gen import tornado.web -from heron.tracker.src.python.handlers import BaseHandler from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.handlers import BaseHandler # pylint: disable=attribute-defined-outside-init class ExecutionStateHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/jmaphandler.py b/heron/tools/tracker/src/python/handlers/jmaphandler.py similarity index 93% rename from heron/tracker/src/python/handlers/jmaphandler.py rename to heron/tools/tracker/src/python/handlers/jmaphandler.py index 0fc42ec8502..5fea4fea766 100644 --- a/heron/tracker/src/python/handlers/jmaphandler.py +++ b/heron/tools/tracker/src/python/handlers/jmaphandler.py @@ -17,11 +17,10 @@ import tornado.gen import tornado.web -from heron.tracker.src.python import utils -from heron.tracker.src.python.handlers import BaseHandler -from heron.tracker.src.python.handlers.pidhandler import getInstancePid - from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python import utils +from heron.tools.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python.handlers.pidhandler import getInstancePid class JmapHandler(BaseHandler): """ diff --git a/heron/tracker/src/python/handlers/jstackhandler.py b/heron/tools/tracker/src/python/handlers/jstackhandler.py similarity index 93% rename from heron/tracker/src/python/handlers/jstackhandler.py rename to heron/tools/tracker/src/python/handlers/jstackhandler.py index 307d99bebc0..181e0fa37f1 100644 --- a/heron/tracker/src/python/handlers/jstackhandler.py +++ b/heron/tools/tracker/src/python/handlers/jstackhandler.py @@ -17,12 +17,10 @@ import tornado.gen import tornado.web -from heron.tracker.src.python import utils -from heron.tracker.src.python.handlers import BaseHandler -from heron.tracker.src.python.handlers.pidhandler import getInstancePid - from heron.common.src.python.utils.log import Log - +from heron.tools.tracker.src.python import utils +from heron.tools.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python.handlers.pidhandler import getInstancePid # pylint: disable=attribute-defined-outside-init class JstackHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/logicalplanhandler.py b/heron/tools/tracker/src/python/handlers/logicalplanhandler.py similarity index 96% rename from heron/tracker/src/python/handlers/logicalplanhandler.py rename to heron/tools/tracker/src/python/handlers/logicalplanhandler.py index 567819bad4b..84daa870590 100644 --- a/heron/tracker/src/python/handlers/logicalplanhandler.py +++ b/heron/tools/tracker/src/python/handlers/logicalplanhandler.py @@ -16,8 +16,8 @@ import tornado.gen import tornado.web -from heron.tracker.src.python.handlers import BaseHandler from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.handlers import BaseHandler class LogicalPlanHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/machineshandler.py b/heron/tools/tracker/src/python/handlers/machineshandler.py similarity index 95% rename from heron/tracker/src/python/handlers/machineshandler.py rename to heron/tools/tracker/src/python/handlers/machineshandler.py index c3f3d632a7a..f2c9bf215aa 100644 --- a/heron/tracker/src/python/handlers/machineshandler.py +++ b/heron/tools/tracker/src/python/handlers/machineshandler.py @@ -14,8 +14,8 @@ """ machienshandler.py """ import tornado.gen -from heron.tracker.src.python import constants -from heron.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python.handlers import BaseHandler class MachinesHandler(BaseHandler): """ diff --git a/heron/tracker/src/python/handlers/mainhandler.py b/heron/tools/tracker/src/python/handlers/mainhandler.py similarity index 92% rename from heron/tracker/src/python/handlers/mainhandler.py rename to heron/tools/tracker/src/python/handlers/mainhandler.py index 5d80daf31c4..3c243d077b8 100644 --- a/heron/tracker/src/python/handlers/mainhandler.py +++ b/heron/tools/tracker/src/python/handlers/mainhandler.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. """ mainhandler.py """ -from heron.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python.handlers import BaseHandler class MainHandler(BaseHandler): """ diff --git a/heron/tracker/src/python/handlers/memoryhistogramhandler.py b/heron/tools/tracker/src/python/handlers/memoryhistogramhandler.py similarity index 93% rename from heron/tracker/src/python/handlers/memoryhistogramhandler.py rename to heron/tools/tracker/src/python/handlers/memoryhistogramhandler.py index 7ed527142a8..8a60ebeed87 100644 --- a/heron/tracker/src/python/handlers/memoryhistogramhandler.py +++ b/heron/tools/tracker/src/python/handlers/memoryhistogramhandler.py @@ -17,11 +17,10 @@ import tornado.gen import tornado.web -from heron.tracker.src.python import utils -from heron.tracker.src.python.handlers import BaseHandler -from heron.tracker.src.python.handlers.pidhandler import getInstancePid - from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python import utils +from heron.tools.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python.handlers.pidhandler import getInstancePid class MemoryHistogramHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/metricshandler.py b/heron/tools/tracker/src/python/handlers/metricshandler.py similarity index 97% rename from heron/tracker/src/python/handlers/metricshandler.py rename to heron/tools/tracker/src/python/handlers/metricshandler.py index 03d547b8a5b..b8e63f00d69 100644 --- a/heron/tracker/src/python/handlers/metricshandler.py +++ b/heron/tools/tracker/src/python/handlers/metricshandler.py @@ -16,13 +16,11 @@ import tornado.gen import tornado.web +from heron.common.src.python.utils.log import Log from heron.proto import common_pb2 from heron.proto import tmaster_pb2 -from heron.tracker.src.python import constants -from heron.tracker.src.python.handlers import BaseHandler - -from heron.common.src.python.utils.log import Log - +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python.handlers import BaseHandler class MetricsHandler(BaseHandler): """ diff --git a/heron/tracker/src/python/handlers/metricsqueryhandler.py b/heron/tools/tracker/src/python/handlers/metricsqueryhandler.py similarity index 96% rename from heron/tracker/src/python/handlers/metricsqueryhandler.py rename to heron/tools/tracker/src/python/handlers/metricsqueryhandler.py index 2ef519828eb..b261cec3091 100644 --- a/heron/tracker/src/python/handlers/metricsqueryhandler.py +++ b/heron/tools/tracker/src/python/handlers/metricsqueryhandler.py @@ -16,9 +16,9 @@ import tornado.gen import tornado.web -from heron.tracker.src.python.handlers import BaseHandler -from heron.tracker.src.python.query import Query from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python.query import Query class MetricsQueryHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/metricstimelinehandler.py b/heron/tools/tracker/src/python/handlers/metricstimelinehandler.py similarity index 93% rename from heron/tracker/src/python/handlers/metricstimelinehandler.py rename to heron/tools/tracker/src/python/handlers/metricstimelinehandler.py index fa94f67f485..271ad96df4a 100644 --- a/heron/tracker/src/python/handlers/metricstimelinehandler.py +++ b/heron/tools/tracker/src/python/handlers/metricstimelinehandler.py @@ -16,11 +16,10 @@ import tornado.gen import tornado.web -from heron.tracker.src.python import constants -from heron.tracker.src.python import metricstimeline -from heron.tracker.src.python.handlers import BaseHandler - from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python import metricstimeline +from heron.tools.tracker.src.python.handlers import BaseHandler class MetricsTimelineHandler(BaseHandler): """ diff --git a/heron/tracker/src/python/handlers/physicalplanhandler.py b/heron/tools/tracker/src/python/handlers/physicalplanhandler.py similarity index 96% rename from heron/tracker/src/python/handlers/physicalplanhandler.py rename to heron/tools/tracker/src/python/handlers/physicalplanhandler.py index f1380a7648b..b58d6263034 100644 --- a/heron/tracker/src/python/handlers/physicalplanhandler.py +++ b/heron/tools/tracker/src/python/handlers/physicalplanhandler.py @@ -16,8 +16,8 @@ import tornado.gen import tornado.web -from heron.tracker.src.python.handlers import BaseHandler from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.handlers import BaseHandler class PhysicalPlanHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/pidhandler.py b/heron/tools/tracker/src/python/handlers/pidhandler.py similarity index 96% rename from heron/tracker/src/python/handlers/pidhandler.py rename to heron/tools/tracker/src/python/handlers/pidhandler.py index f1329366f4c..6bcc984908e 100644 --- a/heron/tracker/src/python/handlers/pidhandler.py +++ b/heron/tools/tracker/src/python/handlers/pidhandler.py @@ -16,10 +16,9 @@ import tornado.gen import tornado.web -from heron.tracker.src.python import utils -from heron.tracker.src.python.handlers import BaseHandler - from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python import utils +from heron.tools.tracker.src.python.handlers import BaseHandler @tornado.gen.coroutine diff --git a/heron/tracker/src/python/handlers/schedulerlocationhandler.py b/heron/tools/tracker/src/python/handlers/schedulerlocationhandler.py similarity index 96% rename from heron/tracker/src/python/handlers/schedulerlocationhandler.py rename to heron/tools/tracker/src/python/handlers/schedulerlocationhandler.py index d6aab9b3c8d..5f01bcc01e9 100644 --- a/heron/tracker/src/python/handlers/schedulerlocationhandler.py +++ b/heron/tools/tracker/src/python/handlers/schedulerlocationhandler.py @@ -16,8 +16,8 @@ import tornado.gen import tornado.web -from heron.tracker.src.python.handlers import BaseHandler from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.handlers import BaseHandler class SchedulerLocationHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/stateshandler.py b/heron/tools/tracker/src/python/handlers/stateshandler.py similarity index 95% rename from heron/tracker/src/python/handlers/stateshandler.py rename to heron/tools/tracker/src/python/handlers/stateshandler.py index 714a1770b79..cbd8735bcdf 100644 --- a/heron/tracker/src/python/handlers/stateshandler.py +++ b/heron/tools/tracker/src/python/handlers/stateshandler.py @@ -14,8 +14,8 @@ ''' statehandler.py ''' import tornado.gen -from heron.tracker.src.python import constants -from heron.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python.handlers import BaseHandler class StatesHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/topologieshandler.py b/heron/tools/tracker/src/python/handlers/topologieshandler.py similarity index 95% rename from heron/tracker/src/python/handlers/topologieshandler.py rename to heron/tools/tracker/src/python/handlers/topologieshandler.py index e8c96b66dc3..1d312549a1a 100644 --- a/heron/tracker/src/python/handlers/topologieshandler.py +++ b/heron/tools/tracker/src/python/handlers/topologieshandler.py @@ -14,8 +14,8 @@ ''' topologieshandler.py ''' import tornado.gen -from heron.tracker.src.python import constants -from heron.tracker.src.python.handlers import BaseHandler +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python.handlers import BaseHandler class TopologiesHandler(BaseHandler): diff --git a/heron/tracker/src/python/handlers/topologyhandler.py b/heron/tools/tracker/src/python/handlers/topologyhandler.py similarity index 96% rename from heron/tracker/src/python/handlers/topologyhandler.py rename to heron/tools/tracker/src/python/handlers/topologyhandler.py index 085deb824e4..af45b27423b 100644 --- a/heron/tracker/src/python/handlers/topologyhandler.py +++ b/heron/tools/tracker/src/python/handlers/topologyhandler.py @@ -16,8 +16,8 @@ import tornado.gen import tornado.web -from heron.tracker.src.python.handlers import BaseHandler from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.handlers import BaseHandler class TopologyHandler(BaseHandler): diff --git a/heron/tracker/src/python/javaobj.py b/heron/tools/tracker/src/python/javaobj.py similarity index 100% rename from heron/tracker/src/python/javaobj.py rename to heron/tools/tracker/src/python/javaobj.py diff --git a/heron/tracker/src/python/main.py b/heron/tools/tracker/src/python/main.py similarity index 96% rename from heron/tracker/src/python/main.py rename to heron/tools/tracker/src/python/main.py index fa2abaa2bd9..6f878fdab8a 100644 --- a/heron/tracker/src/python/main.py +++ b/heron/tools/tracker/src/python/main.py @@ -23,14 +23,13 @@ import tornado.web from tornado.options import define, options -from heron.tracker.src.python import constants -from heron.tracker.src.python import handlers -from heron.tracker.src.python import utils -from heron.tracker.src.python.config import Config -from heron.tracker.src.python.tracker import Tracker import heron.common.src.python.utils.config as common_config - import heron.common.src.python.utils.log as log +from heron.tools.tracker.src.python import constants +from heron.tools.tracker.src.python import handlers +from heron.tools.tracker.src.python import utils +from heron.tools.tracker.src.python.config import Config +from heron.tools.tracker.src.python.tracker import Tracker Log = log.Log diff --git a/heron/tracker/src/python/metricstimeline.py b/heron/tools/tracker/src/python/metricstimeline.py similarity index 100% rename from heron/tracker/src/python/metricstimeline.py rename to heron/tools/tracker/src/python/metricstimeline.py index 6e2adca2c1e..a473511c95b 100644 --- a/heron/tracker/src/python/metricstimeline.py +++ b/heron/tools/tracker/src/python/metricstimeline.py @@ -14,9 +14,9 @@ """ metricstimeline.py """ import tornado.gen +from heron.common.src.python.utils.log import Log from heron.proto import common_pb2 from heron.proto import tmaster_pb2 -from heron.common.src.python.utils.log import Log # pylint: disable=too-many-locals, too-many-branches, unused-argument @tornado.gen.coroutine diff --git a/heron/tracker/src/python/query.py b/heron/tools/tracker/src/python/query.py similarity index 98% rename from heron/tracker/src/python/query.py rename to heron/tools/tracker/src/python/query.py index c337c34771d..e12d32ad643 100644 --- a/heron/tracker/src/python/query.py +++ b/heron/tools/tracker/src/python/query.py @@ -15,7 +15,7 @@ import tornado.httpclient import tornado.gen -from heron.tracker.src.python.query_operators import * +from heron.tools.tracker.src.python.query_operators import * #################################################################### diff --git a/heron/tracker/src/python/query_operators.py b/heron/tools/tracker/src/python/query_operators.py similarity index 99% rename from heron/tracker/src/python/query_operators.py rename to heron/tools/tracker/src/python/query_operators.py index e1978b33d08..86bc371d4f8 100644 --- a/heron/tracker/src/python/query_operators.py +++ b/heron/tools/tracker/src/python/query_operators.py @@ -16,7 +16,7 @@ import tornado.httpclient import tornado.gen -from heron.tracker.src.python.metricstimeline import getMetricsTimeline +from heron.tools.tracker.src.python.metricstimeline import getMetricsTimeline ##################################################################### # Data Structure for fetched Metrics diff --git a/heron/tracker/src/python/topology.py b/heron/tools/tracker/src/python/topology.py similarity index 100% rename from heron/tracker/src/python/topology.py rename to heron/tools/tracker/src/python/topology.py diff --git a/heron/tracker/src/python/topology_helpers.py b/heron/tools/tracker/src/python/topology_helpers.py similarity index 100% rename from heron/tracker/src/python/topology_helpers.py rename to heron/tools/tracker/src/python/topology_helpers.py index c45b464aa9f..2a388c8988f 100644 --- a/heron/tracker/src/python/topology_helpers.py +++ b/heron/tools/tracker/src/python/topology_helpers.py @@ -19,8 +19,8 @@ import sets -from heron.proto import topology_pb2 from heron.common.src.python import constants +from heron.proto import topology_pb2 def get_topology_config(topology, key): """ diff --git a/heron/tracker/src/python/tracker.py b/heron/tools/tracker/src/python/tracker.py similarity index 99% rename from heron/tracker/src/python/tracker.py rename to heron/tools/tracker/src/python/tracker.py index a30fd003142..7a05e5b230d 100644 --- a/heron/tracker/src/python/tracker.py +++ b/heron/tools/tracker/src/python/tracker.py @@ -16,12 +16,12 @@ from functools import partial +from heron.common.src.python.utils.log import Log from heron.proto import topology_pb2 from heron.statemgrs.src.python import statemanagerfactory -from heron.tracker.src.python.topology import Topology -from heron.tracker.src.python import javaobj -from heron.tracker.src.python import utils -from heron.common.src.python.utils.log import Log +from heron.tools.tracker.src.python.topology import Topology +from heron.tools.tracker.src.python import javaobj +from heron.tools.tracker.src.python import utils class Tracker(object): diff --git a/heron/tracker/src/python/utils.py b/heron/tools/tracker/src/python/utils.py similarity index 100% rename from heron/tracker/src/python/utils.py rename to heron/tools/tracker/src/python/utils.py diff --git a/heron/tracker/tests/python/BUILD b/heron/tools/tracker/tests/python/BUILD similarity index 83% rename from heron/tracker/tests/python/BUILD rename to heron/tools/tracker/tests/python/BUILD index 93670e5ae53..afe44ec5411 100644 --- a/heron/tracker/tests/python/BUILD +++ b/heron/tools/tracker/tests/python/BUILD @@ -13,7 +13,7 @@ pex_test( name = "topology_helpers_unittest", srcs = ["topology_helpers_unittest.py"], deps = [ - "//heron/tracker/src/python:heron-tracker-lib", + "//heron/tools/tracker/src/python:tracker-py", ], reqs = [ "mock==1.0.1", @@ -28,7 +28,7 @@ pex_test( name = "topology_unittest", srcs = ["topology_unittest.py"], deps = [ - "//heron/tracker/src/python:heron-tracker-lib", + "//heron/tools/tracker/src/python:tracker-py", ], reqs = [ "mock==1.0.1", @@ -43,7 +43,7 @@ pex_test( name = "query_operator_unittest", srcs = ["query_operator_unittest.py"], deps = [ - "//heron/tracker/src/python:heron-tracker-lib", + "//heron/tools/tracker/src/python:tracker-py", ], reqs = [ "mock==1.0.1", @@ -58,7 +58,7 @@ pex_test( name = "query_unittest", srcs = ["query_unittest.py"], deps = [ - "//heron/tracker/src/python:heron-tracker-lib", + "//heron/tools/tracker/src/python:tracker-py", ], reqs = [ "mock==1.0.1", @@ -73,7 +73,7 @@ pex_test( name = "tracker_unittest", srcs = ["tracker_unittest.py"], deps = [ - "//heron/tracker/src/python:heron-tracker-lib", + "//heron/tools/tracker/src/python:tracker-py", "//heron/proto:proto-py", ], reqs = [ diff --git a/heron/tracker/tests/python/mock_proto.py b/heron/tools/tracker/tests/python/mock_proto.py similarity index 99% rename from heron/tracker/tests/python/mock_proto.py rename to heron/tools/tracker/tests/python/mock_proto.py index 1c1ae18d31b..4ad3ddb85a1 100644 --- a/heron/tracker/tests/python/mock_proto.py +++ b/heron/tools/tracker/tests/python/mock_proto.py @@ -1,11 +1,10 @@ ''' mock_proto.py ''' +from heron.common.src.python import constants import heron.proto.execution_state_pb2 as protoEState import heron.proto.physical_plan_pb2 as protoPPlan import heron.proto.tmaster_pb2 as protoTmaster import heron.proto.topology_pb2 as protoTopology -from heron.common.src.python import constants - # pylint: disable=no-self-use, missing-docstring class MockProto(object): ''' Mocking Proto''' diff --git a/heron/tracker/tests/python/query_operator_unittest.py b/heron/tools/tracker/tests/python/query_operator_unittest.py similarity index 99% rename from heron/tracker/tests/python/query_operator_unittest.py rename to heron/tools/tracker/tests/python/query_operator_unittest.py index d8638d0e353..6c15afaebf2 100644 --- a/heron/tracker/tests/python/query_operator_unittest.py +++ b/heron/tools/tracker/tests/python/query_operator_unittest.py @@ -9,7 +9,7 @@ from mock import patch, Mock -from heron.tracker.src.python.query_operators import * +from heron.tools.tracker.src.python.query_operators import * class QueryOperatorTests(tornado.testing.AsyncTestCase): @tornado.testing.gen_test @@ -42,7 +42,7 @@ def getMetricTimelineSideEffect(*args): } }) - with patch("heron.tracker.src.python.query_operators.getMetricsTimeline", + with patch("heron.tools.tracker.src.python.query_operators.getMetricsTimeline", side_effect=getMetricTimelineSideEffect): metrics = yield ts.execute(tracker, tmaster, start, end) self.assertEqual(1, len(metrics)) @@ -74,7 +74,7 @@ def getMetricTimelineSideEffect(*args): # pylint: disable=unused-variable with self.assertRaises(Exception): - with patch("heron.tracker.src.python.query_operators.getMetricsTimeline", + with patch("heron.tools.tracker.src.python.query_operators.getMetricsTimeline", side_effect=getMetricTimelineSideEffect): metrics = yield ts.execute(tracker, tmaster, start, end) @@ -117,7 +117,7 @@ def getMetricTimelineSideEffect(*args): }) # pylint: disable=unused-variable - with patch("heron.tracker.src.python.query_operators.getMetricsTimeline", + with patch("heron.tools.tracker.src.python.query_operators.getMetricsTimeline", side_effect=getMetricTimelineSideEffect): ts = TS(["a", "*", "c"]) metrics = yield ts.execute(tracker, tmaster, start, end) diff --git a/heron/tracker/tests/python/query_unittest.py b/heron/tools/tracker/tests/python/query_unittest.py similarity index 99% rename from heron/tracker/tests/python/query_unittest.py rename to heron/tools/tracker/tests/python/query_unittest.py index 973ef4a73dd..686d76ec490 100644 --- a/heron/tracker/tests/python/query_unittest.py +++ b/heron/tools/tracker/tests/python/query_unittest.py @@ -3,7 +3,7 @@ import unittest2 as unittest from mock import Mock -from heron.tracker.src.python.query import * +from heron.tools.tracker.src.python.query import * class QueryTest(unittest.TestCase): def setUp(self): diff --git a/heron/tracker/tests/python/topology_helpers_unittest.py b/heron/tools/tracker/tests/python/topology_helpers_unittest.py similarity index 99% rename from heron/tracker/tests/python/topology_helpers_unittest.py rename to heron/tools/tracker/tests/python/topology_helpers_unittest.py index 05d95defdb8..1c4dec81cf8 100644 --- a/heron/tracker/tests/python/topology_helpers_unittest.py +++ b/heron/tools/tracker/tests/python/topology_helpers_unittest.py @@ -3,7 +3,7 @@ import unittest2 as unittest from heron.common.src.python import constants -from heron.tracker.src.python import topology_helpers +from heron.tools.tracker.src.python import topology_helpers from mock_proto import MockProto class TopologyHelpersTest(unittest.TestCase): diff --git a/heron/tracker/tests/python/topology_unittest.py b/heron/tools/tracker/tests/python/topology_unittest.py similarity index 98% rename from heron/tracker/tests/python/topology_unittest.py rename to heron/tools/tracker/tests/python/topology_unittest.py index 05e0accce1c..5e1a190d453 100644 --- a/heron/tracker/tests/python/topology_unittest.py +++ b/heron/tools/tracker/tests/python/topology_unittest.py @@ -2,8 +2,8 @@ # pylint: disable=missing-docstring import unittest2 as unittest +from heron.tools.tracker.src.python.topology import Topology from mock_proto import MockProto -from heron.tracker.src.python.topology import Topology class TopologyTest(unittest.TestCase): def setUp(self): diff --git a/heron/tracker/tests/python/tracker_unittest.py b/heron/tools/tracker/tests/python/tracker_unittest.py similarity index 98% rename from heron/tracker/tests/python/tracker_unittest.py rename to heron/tools/tracker/tests/python/tracker_unittest.py index 2f19eb10f2a..4a4ba67eaa2 100644 --- a/heron/tracker/tests/python/tracker_unittest.py +++ b/heron/tools/tracker/tests/python/tracker_unittest.py @@ -6,8 +6,8 @@ import heron.proto.execution_state_pb2 as protoEState from heron.statemgrs.src.python import statemanagerfactory -from heron.tracker.src.python.topology import Topology -from heron.tracker.src.python.tracker import Tracker +from heron.tools.tracker.src.python.topology import Topology +from heron.tools.tracker.src.python.tracker import Tracker class TrackerTest(unittest.TestCase): def setUp(self): diff --git a/heron/ui/resources/BUILD b/heron/tools/ui/resources/BUILD similarity index 100% rename from heron/ui/resources/BUILD rename to heron/tools/ui/resources/BUILD diff --git a/heron/ui/resources/static/css/bootstrap.css b/heron/tools/ui/resources/static/css/bootstrap.css similarity index 100% rename from heron/ui/resources/static/css/bootstrap.css rename to heron/tools/ui/resources/static/css/bootstrap.css diff --git a/heron/ui/resources/static/css/bootstrap.min.css b/heron/tools/ui/resources/static/css/bootstrap.min.css similarity index 100% rename from heron/ui/resources/static/css/bootstrap.min.css rename to heron/tools/ui/resources/static/css/bootstrap.min.css diff --git a/heron/ui/resources/static/css/main.css b/heron/tools/ui/resources/static/css/main.css similarity index 100% rename from heron/ui/resources/static/css/main.css rename to heron/tools/ui/resources/static/css/main.css diff --git a/heron/ui/resources/static/css/visstyle.css b/heron/tools/ui/resources/static/css/visstyle.css similarity index 100% rename from heron/ui/resources/static/css/visstyle.css rename to heron/tools/ui/resources/static/css/visstyle.css diff --git a/heron/ui/resources/static/fonts/glyphicons-halflings-regular.eot b/heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from heron/ui/resources/static/fonts/glyphicons-halflings-regular.eot rename to heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.eot diff --git a/heron/ui/resources/static/fonts/glyphicons-halflings-regular.svg b/heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from heron/ui/resources/static/fonts/glyphicons-halflings-regular.svg rename to heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.svg diff --git a/heron/ui/resources/static/fonts/glyphicons-halflings-regular.ttf b/heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from heron/ui/resources/static/fonts/glyphicons-halflings-regular.ttf rename to heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.ttf diff --git a/heron/ui/resources/static/fonts/glyphicons-halflings-regular.woff b/heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from heron/ui/resources/static/fonts/glyphicons-halflings-regular.woff rename to heron/tools/ui/resources/static/fonts/glyphicons-halflings-regular.woff diff --git a/heron/ui/resources/static/icomoon/fonts/icomoon.dev.svg b/heron/tools/ui/resources/static/icomoon/fonts/icomoon.dev.svg similarity index 100% rename from heron/ui/resources/static/icomoon/fonts/icomoon.dev.svg rename to heron/tools/ui/resources/static/icomoon/fonts/icomoon.dev.svg diff --git a/heron/ui/resources/static/icomoon/fonts/icomoon.eot b/heron/tools/ui/resources/static/icomoon/fonts/icomoon.eot similarity index 100% rename from heron/ui/resources/static/icomoon/fonts/icomoon.eot rename to heron/tools/ui/resources/static/icomoon/fonts/icomoon.eot diff --git a/heron/ui/resources/static/icomoon/fonts/icomoon.svg b/heron/tools/ui/resources/static/icomoon/fonts/icomoon.svg similarity index 100% rename from heron/ui/resources/static/icomoon/fonts/icomoon.svg rename to heron/tools/ui/resources/static/icomoon/fonts/icomoon.svg diff --git a/heron/ui/resources/static/icomoon/fonts/icomoon.ttf b/heron/tools/ui/resources/static/icomoon/fonts/icomoon.ttf similarity index 100% rename from heron/ui/resources/static/icomoon/fonts/icomoon.ttf rename to heron/tools/ui/resources/static/icomoon/fonts/icomoon.ttf diff --git a/heron/ui/resources/static/icomoon/fonts/icomoon.woff b/heron/tools/ui/resources/static/icomoon/fonts/icomoon.woff similarity index 100% rename from heron/ui/resources/static/icomoon/fonts/icomoon.woff rename to heron/tools/ui/resources/static/icomoon/fonts/icomoon.woff diff --git a/heron/ui/resources/static/icomoon/index.html b/heron/tools/ui/resources/static/icomoon/index.html similarity index 100% rename from heron/ui/resources/static/icomoon/index.html rename to heron/tools/ui/resources/static/icomoon/index.html diff --git a/heron/ui/resources/static/icomoon/license.txt b/heron/tools/ui/resources/static/icomoon/license.txt similarity index 100% rename from heron/ui/resources/static/icomoon/license.txt rename to heron/tools/ui/resources/static/icomoon/license.txt diff --git a/heron/ui/resources/static/icomoon/lte-ie7.js b/heron/tools/ui/resources/static/icomoon/lte-ie7.js similarity index 100% rename from heron/ui/resources/static/icomoon/lte-ie7.js rename to heron/tools/ui/resources/static/icomoon/lte-ie7.js diff --git a/heron/ui/resources/static/icomoon/style.css b/heron/tools/ui/resources/static/icomoon/style.css similarity index 100% rename from heron/ui/resources/static/icomoon/style.css rename to heron/tools/ui/resources/static/icomoon/style.css diff --git a/heron/ui/resources/static/img/edit-icon.png b/heron/tools/ui/resources/static/img/edit-icon.png similarity index 100% rename from heron/ui/resources/static/img/edit-icon.png rename to heron/tools/ui/resources/static/img/edit-icon.png diff --git a/heron/ui/resources/static/img/glyphicons-halflings-white.png b/heron/tools/ui/resources/static/img/glyphicons-halflings-white.png similarity index 100% rename from heron/ui/resources/static/img/glyphicons-halflings-white.png rename to heron/tools/ui/resources/static/img/glyphicons-halflings-white.png diff --git a/heron/ui/resources/static/img/glyphicons-halflings.png b/heron/tools/ui/resources/static/img/glyphicons-halflings.png similarity index 100% rename from heron/ui/resources/static/img/glyphicons-halflings.png rename to heron/tools/ui/resources/static/img/glyphicons-halflings.png diff --git a/heron/ui/resources/static/img/hue.png b/heron/tools/ui/resources/static/img/hue.png similarity index 100% rename from heron/ui/resources/static/img/hue.png rename to heron/tools/ui/resources/static/img/hue.png diff --git a/heron/ui/resources/static/img/icn-green.png b/heron/tools/ui/resources/static/img/icn-green.png similarity index 100% rename from heron/ui/resources/static/img/icn-green.png rename to heron/tools/ui/resources/static/img/icn-green.png diff --git a/heron/ui/resources/static/img/icn-red.png b/heron/tools/ui/resources/static/img/icn-red.png similarity index 100% rename from heron/ui/resources/static/img/icn-red.png rename to heron/tools/ui/resources/static/img/icn-red.png diff --git a/heron/ui/resources/static/img/logo54x54.png b/heron/tools/ui/resources/static/img/logo54x54.png similarity index 100% rename from heron/ui/resources/static/img/logo54x54.png rename to heron/tools/ui/resources/static/img/logo54x54.png diff --git a/heron/ui/resources/static/img/trash-icon.png b/heron/tools/ui/resources/static/img/trash-icon.png similarity index 100% rename from heron/ui/resources/static/img/trash-icon.png rename to heron/tools/ui/resources/static/img/trash-icon.png diff --git a/heron/ui/resources/static/js/alltopologies.js b/heron/tools/ui/resources/static/js/alltopologies.js similarity index 100% rename from heron/ui/resources/static/js/alltopologies.js rename to heron/tools/ui/resources/static/js/alltopologies.js diff --git a/heron/ui/resources/static/js/bootstrap.js b/heron/tools/ui/resources/static/js/bootstrap.js similarity index 100% rename from heron/ui/resources/static/js/bootstrap.js rename to heron/tools/ui/resources/static/js/bootstrap.js diff --git a/heron/ui/resources/static/js/bootstrap.min.js b/heron/tools/ui/resources/static/js/bootstrap.min.js similarity index 100% rename from heron/ui/resources/static/js/bootstrap.min.js rename to heron/tools/ui/resources/static/js/bootstrap.min.js diff --git a/heron/ui/resources/static/js/colors.js b/heron/tools/ui/resources/static/js/colors.js similarity index 100% rename from heron/ui/resources/static/js/colors.js rename to heron/tools/ui/resources/static/js/colors.js diff --git a/heron/ui/resources/static/js/common.js b/heron/tools/ui/resources/static/js/common.js similarity index 100% rename from heron/ui/resources/static/js/common.js rename to heron/tools/ui/resources/static/js/common.js diff --git a/heron/ui/resources/static/js/config.js b/heron/tools/ui/resources/static/js/config.js similarity index 100% rename from heron/ui/resources/static/js/config.js rename to heron/tools/ui/resources/static/js/config.js diff --git a/heron/ui/resources/static/js/exceptions.js b/heron/tools/ui/resources/static/js/exceptions.js similarity index 100% rename from heron/ui/resources/static/js/exceptions.js rename to heron/tools/ui/resources/static/js/exceptions.js diff --git a/heron/ui/resources/static/js/graphic.js b/heron/tools/ui/resources/static/js/graphic.js similarity index 100% rename from heron/ui/resources/static/js/graphic.js rename to heron/tools/ui/resources/static/js/graphic.js diff --git a/heron/ui/resources/static/js/html5-trunk.js b/heron/tools/ui/resources/static/js/html5-trunk.js similarity index 100% rename from heron/ui/resources/static/js/html5-trunk.js rename to heron/tools/ui/resources/static/js/html5-trunk.js diff --git a/heron/ui/resources/static/js/jquery-ui-1.8.23.custom.min.js b/heron/tools/ui/resources/static/js/jquery-ui-1.8.23.custom.min.js similarity index 100% rename from heron/ui/resources/static/js/jquery-ui-1.8.23.custom.min.js rename to heron/tools/ui/resources/static/js/jquery-ui-1.8.23.custom.min.js diff --git a/heron/ui/resources/static/js/jquery.min.js b/heron/tools/ui/resources/static/js/jquery.min.js similarity index 100% rename from heron/ui/resources/static/js/jquery.min.js rename to heron/tools/ui/resources/static/js/jquery.min.js diff --git a/heron/ui/resources/static/js/jquery.pailer.js b/heron/tools/ui/resources/static/js/jquery.pailer.js similarity index 100% rename from heron/ui/resources/static/js/jquery.pailer.js rename to heron/tools/ui/resources/static/js/jquery.pailer.js diff --git a/heron/ui/resources/static/js/logical-plan.js b/heron/tools/ui/resources/static/js/logical-plan.js similarity index 100% rename from heron/ui/resources/static/js/logical-plan.js rename to heron/tools/ui/resources/static/js/logical-plan.js diff --git a/heron/ui/resources/static/js/moment.min.2.8.3.js b/heron/tools/ui/resources/static/js/moment.min.2.8.3.js similarity index 100% rename from heron/ui/resources/static/js/moment.min.2.8.3.js rename to heron/tools/ui/resources/static/js/moment.min.2.8.3.js diff --git a/heron/ui/resources/static/js/physical-plan.js b/heron/tools/ui/resources/static/js/physical-plan.js similarity index 100% rename from heron/ui/resources/static/js/physical-plan.js rename to heron/tools/ui/resources/static/js/physical-plan.js diff --git a/heron/ui/resources/static/js/plan-controller.js b/heron/tools/ui/resources/static/js/plan-controller.js similarity index 100% rename from heron/ui/resources/static/js/plan-controller.js rename to heron/tools/ui/resources/static/js/plan-controller.js diff --git a/heron/ui/resources/static/js/plan-stats.js b/heron/tools/ui/resources/static/js/plan-stats.js similarity index 100% rename from heron/ui/resources/static/js/plan-stats.js rename to heron/tools/ui/resources/static/js/plan-stats.js diff --git a/heron/ui/resources/static/js/stat-trendlines.js b/heron/tools/ui/resources/static/js/stat-trendlines.js similarity index 100% rename from heron/ui/resources/static/js/stat-trendlines.js rename to heron/tools/ui/resources/static/js/stat-trendlines.js diff --git a/heron/ui/resources/static/js/topologies.js b/heron/tools/ui/resources/static/js/topologies.js similarity index 100% rename from heron/ui/resources/static/js/topologies.js rename to heron/tools/ui/resources/static/js/topologies.js diff --git a/heron/ui/resources/static/js/underscore-min.1.6.0.js b/heron/tools/ui/resources/static/js/underscore-min.1.6.0.js similarity index 100% rename from heron/ui/resources/static/js/underscore-min.1.6.0.js rename to heron/tools/ui/resources/static/js/underscore-min.1.6.0.js diff --git a/heron/ui/resources/templates/application.html b/heron/tools/ui/resources/templates/application.html similarity index 100% rename from heron/ui/resources/templates/application.html rename to heron/tools/ui/resources/templates/application.html diff --git a/heron/ui/resources/templates/browse.html b/heron/tools/ui/resources/templates/browse.html similarity index 100% rename from heron/ui/resources/templates/browse.html rename to heron/tools/ui/resources/templates/browse.html diff --git a/heron/ui/resources/templates/config.html b/heron/tools/ui/resources/templates/config.html similarity index 100% rename from heron/ui/resources/templates/config.html rename to heron/tools/ui/resources/templates/config.html diff --git a/heron/ui/resources/templates/error.html b/heron/tools/ui/resources/templates/error.html similarity index 100% rename from heron/ui/resources/templates/error.html rename to heron/tools/ui/resources/templates/error.html diff --git a/heron/ui/resources/templates/exception.html b/heron/tools/ui/resources/templates/exception.html similarity index 100% rename from heron/ui/resources/templates/exception.html rename to heron/tools/ui/resources/templates/exception.html diff --git a/heron/ui/resources/templates/file.html b/heron/tools/ui/resources/templates/file.html similarity index 100% rename from heron/ui/resources/templates/file.html rename to heron/tools/ui/resources/templates/file.html diff --git a/heron/ui/resources/templates/nav.html b/heron/tools/ui/resources/templates/nav.html similarity index 100% rename from heron/ui/resources/templates/nav.html rename to heron/tools/ui/resources/templates/nav.html diff --git a/heron/ui/resources/templates/topologies.html b/heron/tools/ui/resources/templates/topologies.html similarity index 100% rename from heron/ui/resources/templates/topologies.html rename to heron/tools/ui/resources/templates/topologies.html diff --git a/heron/ui/resources/templates/topology.html b/heron/tools/ui/resources/templates/topology.html similarity index 100% rename from heron/ui/resources/templates/topology.html rename to heron/tools/ui/resources/templates/topology.html diff --git a/heron/ui/src/python/BUILD b/heron/tools/ui/src/python/BUILD similarity index 72% rename from heron/ui/src/python/BUILD rename to heron/tools/ui/src/python/BUILD index 641456cd222..1b374036543 100644 --- a/heron/ui/src/python/BUILD +++ b/heron/tools/ui/src/python/BUILD @@ -14,8 +14,8 @@ pex_library( "tornado==4.0.2", ], deps = [ - "//heron/common/src/python:common", - "//heron/common/src/python:tracker-access", + "//heron/common/src/python:common-py", + "//heron/tools/common/src/python:tracker-py", ] ) @@ -26,8 +26,8 @@ pex_binary( ":heron-ui-lib", ], resources = [ - "//heron/ui/resources:templates", - "//heron/ui/resources:static", + "//heron/tools/ui/resources:templates", + "//heron/tools/ui/resources:static", ], zip_safe = False, ) diff --git a/heron/ui/src/python/args.py b/heron/tools/ui/src/python/args.py similarity index 100% rename from heron/ui/src/python/args.py rename to heron/tools/ui/src/python/args.py diff --git a/heron/ui/src/python/consts.py b/heron/tools/ui/src/python/consts.py similarity index 100% rename from heron/ui/src/python/consts.py rename to heron/tools/ui/src/python/consts.py diff --git a/heron/ui/src/python/handlers/__init__.py b/heron/tools/ui/src/python/handlers/__init__.py similarity index 100% rename from heron/ui/src/python/handlers/__init__.py rename to heron/tools/ui/src/python/handlers/__init__.py diff --git a/heron/ui/src/python/handlers/api/__init__.py b/heron/tools/ui/src/python/handlers/api/__init__.py similarity index 100% rename from heron/ui/src/python/handlers/api/__init__.py rename to heron/tools/ui/src/python/handlers/api/__init__.py diff --git a/heron/ui/src/python/handlers/api/metrics.py b/heron/tools/ui/src/python/handlers/api/metrics.py similarity index 100% rename from heron/ui/src/python/handlers/api/metrics.py rename to heron/tools/ui/src/python/handlers/api/metrics.py diff --git a/heron/ui/src/python/handlers/api/topology.py b/heron/tools/ui/src/python/handlers/api/topology.py similarity index 100% rename from heron/ui/src/python/handlers/api/topology.py rename to heron/tools/ui/src/python/handlers/api/topology.py diff --git a/heron/ui/src/python/handlers/base.py b/heron/tools/ui/src/python/handlers/base.py similarity index 100% rename from heron/ui/src/python/handlers/base.py rename to heron/tools/ui/src/python/handlers/base.py diff --git a/heron/ui/src/python/handlers/common/__init__.py b/heron/tools/ui/src/python/handlers/common/__init__.py similarity index 100% rename from heron/ui/src/python/handlers/common/__init__.py rename to heron/tools/ui/src/python/handlers/common/__init__.py diff --git a/heron/ui/src/python/handlers/common/consts.py b/heron/tools/ui/src/python/handlers/common/consts.py similarity index 100% rename from heron/ui/src/python/handlers/common/consts.py rename to heron/tools/ui/src/python/handlers/common/consts.py diff --git a/heron/ui/src/python/handlers/common/graph.py b/heron/tools/ui/src/python/handlers/common/graph.py similarity index 100% rename from heron/ui/src/python/handlers/common/graph.py rename to heron/tools/ui/src/python/handlers/common/graph.py diff --git a/heron/ui/src/python/handlers/common/utils.py b/heron/tools/ui/src/python/handlers/common/utils.py similarity index 100% rename from heron/ui/src/python/handlers/common/utils.py rename to heron/tools/ui/src/python/handlers/common/utils.py diff --git a/heron/ui/src/python/handlers/mainhandler.py b/heron/tools/ui/src/python/handlers/mainhandler.py similarity index 100% rename from heron/ui/src/python/handlers/mainhandler.py rename to heron/tools/ui/src/python/handlers/mainhandler.py diff --git a/heron/ui/src/python/handlers/notfound.py b/heron/tools/ui/src/python/handlers/notfound.py similarity index 100% rename from heron/ui/src/python/handlers/notfound.py rename to heron/tools/ui/src/python/handlers/notfound.py diff --git a/heron/ui/src/python/handlers/ranges.py b/heron/tools/ui/src/python/handlers/ranges.py similarity index 100% rename from heron/ui/src/python/handlers/ranges.py rename to heron/tools/ui/src/python/handlers/ranges.py diff --git a/heron/ui/src/python/handlers/topology.py b/heron/tools/ui/src/python/handlers/topology.py similarity index 100% rename from heron/ui/src/python/handlers/topology.py rename to heron/tools/ui/src/python/handlers/topology.py diff --git a/heron/ui/src/python/main.py b/heron/tools/ui/src/python/main.py similarity index 100% rename from heron/ui/src/python/main.py rename to heron/tools/ui/src/python/main.py diff --git a/integration-test/src/python/integration_test/common/BUILD b/integration-test/src/python/integration_test/common/BUILD index 74515ef29f4..c923e7f8178 100644 --- a/integration-test/src/python/integration_test/common/BUILD +++ b/integration-test/src/python/integration_test/common/BUILD @@ -3,9 +3,9 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "pyheron_integration_common", - srcs = glob(["**/*.py"]), - deps = [ - "//heron/pyheron/src/python:pyheron_lib" - ], + name = "pyheron-integration-common-py", + srcs = glob(["**/*.py"]), + deps = [ + "//heron/pyheron/src/python:pyheron-py" + ], ) diff --git a/integration-test/src/python/integration_test/core/BUILD b/integration-test/src/python/integration_test/core/BUILD index 888044dbe24..2a58e5ab10e 100644 --- a/integration-test/src/python/integration_test/core/BUILD +++ b/integration-test/src/python/integration_test/core/BUILD @@ -3,9 +3,9 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "pyheron_integration_core", - srcs = glob(["**/*.py"]), - deps = [ - "//heron/pyheron/src/python:pyheron_lib" - ], + name = "pyheron-integration-core-py", + srcs = glob(["**/*.py"]), + deps = [ + "//heron/pyheron/src/python:pyheron-py" + ], ) diff --git a/integration-test/src/python/integration_test/topology/BUILD b/integration-test/src/python/integration_test/topology/BUILD index c5a35058186..3ead8aca830 100644 --- a/integration-test/src/python/integration_test/topology/BUILD +++ b/integration-test/src/python/integration_test/topology/BUILD @@ -3,21 +3,21 @@ package(default_visibility = ["//visibility:public"]) load("/tools/rules/pex_rules", "pex_library", "pex_binary") pex_library( - name = "integ_topology_lib", - srcs = glob(["**/*.py"]), - deps = [ - "//heron/pyheron/src/python:pyheron_lib", - "//integration-test/src/python/integration_test/common:pyheron_integration_common", - "//integration-test/src/python/integration_test/core:pyheron_integration_core", - ], + name = "integration-topologies-py", + srcs = glob(["**/*.py"]), + deps = [ + "//heron/pyheron/src/python:pyheron-py", + "//integration-test/src/python/integration_test/common:pyheron-integration-common-py", + "//integration-test/src/python/integration_test/core:pyheron-integration-core-py", + ], ) pex_binary( - name = "pyheron_integ_topology", - srcs = ["test_topology_main.py"], - main = "test_topology_main.py", - resources = glob(["**/resources/*.json"]), - deps = [ - ":integ_topology_lib", - ], + name = "pyheron_integ_topology", + srcs = ["test_topology_main.py"], + main = "test_topology_main.py", + resources = glob(["**/resources/*.json"]), + deps = [ + ":integration-topologies-py", + ], ) diff --git a/tools/rules/heron_client.bzl b/tools/rules/heron_client.bzl index fb056926196..f458a050e60 100644 --- a/tools/rules/heron_client.bzl +++ b/tools/rules/heron_client.bzl @@ -3,8 +3,8 @@ ################################################################################ def heron_client_bin_files(): return [ - "//heron/cli/src/python:heron", - "//heron/explorer/src/python:heron-explorer", + "//heron/tools/cli/src/python:heron", + "//heron/tools/explorer/src/python:heron-explorer", ] def heron_client_conf_files(): diff --git a/tools/rules/heron_tools.bzl b/tools/rules/heron_tools.bzl index aed6f4d48ae..dfb79aad826 100644 --- a/tools/rules/heron_tools.bzl +++ b/tools/rules/heron_tools.bzl @@ -6,13 +6,13 @@ def heron_tools_files(): def heron_tools_bin_files(): return [ - "//heron/tracker/src/python:heron-tracker", - "//heron/ui/src/python:heron-ui", + "//heron/tools/tracker/src/python:heron-tracker", + "//heron/tools/ui/src/python:heron-ui", ] def heron_tools_conf_files(): return [ - "//heron/config/src/yaml:tracker-yaml", + "//heron/tools/config/src/yaml:tracker-yaml", ] def heron_tools_lib_files(): From 2ee0cd5bb23eb4b6244fbdc15e970bc78d5af48a Mon Sep 17 00:00:00 2001 From: Taishi Nojima Date: Wed, 17 Aug 2016 22:27:33 -0700 Subject: [PATCH 02/10] debug --- heron/tools/common/src/python/access/fetch.py | 2 +- heron/tools/common/src/python/access/{heron.py => heron_api.py} | 0 heron/tools/common/src/python/access/tracker_access.py | 2 +- heron/tools/explorer/src/python/args.py | 2 +- heron/tools/explorer/src/python/clusters.py | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename heron/tools/common/src/python/access/{heron.py => heron_api.py} (100%) diff --git a/heron/tools/common/src/python/access/fetch.py b/heron/tools/common/src/python/access/fetch.py index c5cf74d0b20..d1f473cfdf6 100644 --- a/heron/tools/common/src/python/access/fetch.py +++ b/heron/tools/common/src/python/access/fetch.py @@ -18,7 +18,7 @@ import tornado.httpclient import tornado.gen -from heron.common.src.python.utils.log import log +from heron.common.src.python.utils import log Log = log.Log diff --git a/heron/tools/common/src/python/access/heron.py b/heron/tools/common/src/python/access/heron_api.py similarity index 100% rename from heron/tools/common/src/python/access/heron.py rename to heron/tools/common/src/python/access/heron_api.py diff --git a/heron/tools/common/src/python/access/tracker_access.py b/heron/tools/common/src/python/access/tracker_access.py index affdd2ff289..a05e5f3b6f8 100644 --- a/heron/tools/common/src/python/access/tracker_access.py +++ b/heron/tools/common/src/python/access/tracker_access.py @@ -16,7 +16,7 @@ import tornado.gen import tornado.ioloop -from heron.common.src.python.handler.access import heron as API +from heron.tools.common.src.python.access import heron_api as API from heron.common.src.python.utils.log import Log def _all_metric_queries(): diff --git a/heron/tools/explorer/src/python/args.py b/heron/tools/explorer/src/python/args.py index 6ed2cf608dd..d09c5f98dc4 100644 --- a/heron/tools/explorer/src/python/args.py +++ b/heron/tools/explorer/src/python/args.py @@ -13,7 +13,7 @@ # limitations under the License. ''' args.py ''' import os -import heron.common.src.python.utils.config as config +import heron.tools.common.src.python.utils.config as config # default parameter - url to connect to heron tracker DEFAULT_TRACKER_URL = "http://localhost:8888" diff --git a/heron/tools/explorer/src/python/clusters.py b/heron/tools/explorer/src/python/clusters.py index 0457420c3de..77b942088ac 100644 --- a/heron/tools/explorer/src/python/clusters.py +++ b/heron/tools/explorer/src/python/clusters.py @@ -13,7 +13,7 @@ # limitations under the License. ''' clusters.py ''' from heron.common.src.python.utils.log import Log -import heron.explorer.src.python.args as args +import heron.tools.explorer.src.python.args as args import heron.tools.common.src.python.access.tracker_access as tracker_access From 9bd5b9efce90f1c176a63e5a8e119b0c0c47298e Mon Sep 17 00:00:00 2001 From: Taishi Nojima Date: Wed, 17 Aug 2016 22:39:42 -0700 Subject: [PATCH 03/10] updated get_heron_path() --- heron/tools/common/src/python/utils/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/heron/tools/common/src/python/utils/config.py b/heron/tools/common/src/python/utils/config.py index 0d992e39985..78a46f008fa 100644 --- a/heron/tools/common/src/python/utils/config.py +++ b/heron/tools/common/src/python/utils/config.py @@ -132,13 +132,13 @@ def get_heron_dir(): This will extract heron directory from .pex file. For example, - when __file__ is '/Users/heron-user/bin/heron/heron/common/src/python/utils/config.pyc', and - its real path is '/Users/heron-user/.heron/bin/heron/common/src/python/utils/config.pyc', + when __file__ is '/Users/heron-user/bin/heron/heron/tools/common/src/python/utils/config.pyc', and + its real path is '/Users/heron-user/.heron/bin/heron/tools/common/src/python/utils/config.pyc', the internal variable ``path`` would be '/Users/heron-user/.heron', which is the heron directory :return: root location for heron-cli. """ - path = "/".join(os.path.realpath(__file__).split('/')[:-8]) + path = "/".join(os.path.realpath(__file__).split('/')[:-9]) return normalized_class_path(path) @@ -151,7 +151,7 @@ def get_heron_dir_explorer(): From heron-cli with modification since we need to reuse cli's conf :return: root location for heron-cli. """ - path_list = os.path.realpath(__file__).split('/')[:-9] + path_list = os.path.realpath(__file__).split('/')[:-10] path_list.append(CLI_DIR) path = "/".join(path_list) return normalized_class_path(path) From f91399cf50dd59ae5839050bf8333b4c1bb69c50 Mon Sep 17 00:00:00 2001 From: Runhang Li Date: Wed, 17 Aug 2016 23:30:24 -0700 Subject: [PATCH 04/10] Partial fix for tracker and UI. --- heron/common/src/python/utils/log.py | 1 + heron/tools/tracker/src/python/BUILD | 1 + heron/tools/tracker/src/python/main.py | 2 +- heron/tools/tracker/src/python/utils.py | 2 +- .../tools/ui/src/python/handlers/__init__.py | 24 +++++++++---------- .../ui/src/python/handlers/api/metrics.py | 4 ++-- .../ui/src/python/handlers/api/topology.py | 6 ++--- .../ui/src/python/handlers/common/__init__.py | 6 ++--- .../ui/src/python/handlers/mainhandler.py | 2 +- .../tools/ui/src/python/handlers/notfound.py | 2 +- heron/tools/ui/src/python/main.py | 4 ++-- 11 files changed, 28 insertions(+), 26 deletions(-) diff --git a/heron/common/src/python/utils/log.py b/heron/common/src/python/utils/log.py index 78160fd5438..6b62389bcce 100644 --- a/heron/common/src/python/utils/log.py +++ b/heron/common/src/python/utils/log.py @@ -19,6 +19,7 @@ # Create the logger # pylint: disable=invalid-name Log = logging.getLogger() +logging.basicConfig() # time formatter - date - time - UTC offset # e.g. "08/16/1988 21:30:00 +1030" diff --git a/heron/tools/tracker/src/python/BUILD b/heron/tools/tracker/src/python/BUILD index bb41da546c3..d0cd25ff297 100644 --- a/heron/tools/tracker/src/python/BUILD +++ b/heron/tools/tracker/src/python/BUILD @@ -10,6 +10,7 @@ pex_library( ), deps = [ "//heron/common/src/python:common-py", + "//heron/tools/common/src/python:common-py", "//heron/statemgrs/src/python:zk-statemgr-py", "//heron/proto:proto-py", ], diff --git a/heron/tools/tracker/src/python/main.py b/heron/tools/tracker/src/python/main.py index 6f878fdab8a..7e5c1f681fe 100644 --- a/heron/tools/tracker/src/python/main.py +++ b/heron/tools/tracker/src/python/main.py @@ -23,7 +23,7 @@ import tornado.web from tornado.options import define, options -import heron.common.src.python.utils.config as common_config +import heron.tools.common.src.python.utils.config as common_config import heron.common.src.python.utils.log as log from heron.tools.tracker.src.python import constants from heron.tools.tracker.src.python import handlers diff --git a/heron/tools/tracker/src/python/utils.py b/heron/tools/tracker/src/python/utils.py index 35c2968097e..34ebb8b37fb 100644 --- a/heron/tools/tracker/src/python/utils.py +++ b/heron/tools/tracker/src/python/utils.py @@ -131,7 +131,7 @@ def get_heron_tracker_dir(): This will extract heron tracker directory from .pex file. :return: root location for heron-tools. """ - path = "/".join(os.path.realpath(__file__).split('/')[:-7]) + path = "/".join(os.path.realpath(__file__).split('/')[:-8]) return normalized_class_path(path) def get_heron_tracker_bin_dir(): diff --git a/heron/tools/ui/src/python/handlers/__init__.py b/heron/tools/ui/src/python/handlers/__init__.py index 60da8dbaa19..f1a9a7de230 100644 --- a/heron/tools/ui/src/python/handlers/__init__.py +++ b/heron/tools/ui/src/python/handlers/__init__.py @@ -1,20 +1,20 @@ ''' handler module ''' __all__ = ['handlers'] -from heron.ui.src.python.handlers import api +from heron.tools.ui.src.python.handlers import api -from heron.ui.src.python.handlers.base import BaseHandler -from heron.ui.src.python.handlers.mainhandler import MainHandler -from heron.ui.src.python.handlers.notfound import NotFoundHandler +from heron.tools.ui.src.python.handlers.base import BaseHandler +from heron.tools.ui.src.python.handlers.mainhandler import MainHandler +from heron.tools.ui.src.python.handlers.notfound import NotFoundHandler ################################################################################ # Handlers for topology related requests ################################################################################ -from heron.ui.src.python.handlers.topology import ContainerFileDataHandler -from heron.ui.src.python.handlers.topology import ContainerFileDownloadHandler -from heron.ui.src.python.handlers.topology import ContainerFileHandler -from heron.ui.src.python.handlers.topology import ContainerFileStatsHandler -from heron.ui.src.python.handlers.topology import ListTopologiesHandler -from heron.ui.src.python.handlers.topology import TopologyPlanHandler -from heron.ui.src.python.handlers.topology import TopologyConfigHandler -from heron.ui.src.python.handlers.topology import TopologyExceptionsPageHandler +from heron.tools.ui.src.python.handlers.topology import ContainerFileDataHandler +from heron.tools.ui.src.python.handlers.topology import ContainerFileDownloadHandler +from heron.tools.ui.src.python.handlers.topology import ContainerFileHandler +from heron.tools.ui.src.python.handlers.topology import ContainerFileStatsHandler +from heron.tools.ui.src.python.handlers.topology import ListTopologiesHandler +from heron.tools.ui.src.python.handlers.topology import TopologyPlanHandler +from heron.tools.ui.src.python.handlers.topology import TopologyConfigHandler +from heron.tools.ui.src.python.handlers.topology import TopologyExceptionsPageHandler diff --git a/heron/tools/ui/src/python/handlers/api/metrics.py b/heron/tools/ui/src/python/handlers/api/metrics.py index f69475bcb32..e3af8307d54 100644 --- a/heron/tools/ui/src/python/handlers/api/metrics.py +++ b/heron/tools/ui/src/python/handlers/api/metrics.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' metrics.py ''' -from heron.ui.src.python.handlers import base -import heron.common.src.python.handler.access as access +from heron.tools.ui.src.python.handlers import base +import heron.tools.common.src.python.handler.access as access import tornado.gen diff --git a/heron/tools/ui/src/python/handlers/api/topology.py b/heron/tools/ui/src/python/handlers/api/topology.py index 7e744f49534..9053341e095 100644 --- a/heron/tools/ui/src/python/handlers/api/topology.py +++ b/heron/tools/ui/src/python/handlers/api/topology.py @@ -18,9 +18,9 @@ import tornado.web import tornado.gen -from heron.ui.src.python.handlers import base -import heron.common.src.python.handler.access as access -from heron.ui.src.python.handlers import common +from heron.tools.ui.src.python.handlers import base +import heron.tools.common.src.python.handler.access as access +from heron.tools.ui.src.python.handlers import common class TopologyExceptionSummaryHandler(base.BaseHandler): diff --git a/heron/tools/ui/src/python/handlers/common/__init__.py b/heron/tools/ui/src/python/handlers/common/__init__.py index 14f4c17334a..00419cf4e1b 100644 --- a/heron/tools/ui/src/python/handlers/common/__init__.py +++ b/heron/tools/ui/src/python/handlers/common/__init__.py @@ -1,6 +1,6 @@ ''' common module ''' __all__ = ['common'] -from heron.ui.src.python.handlers.common.consts import * -from heron.ui.src.python.handlers.common.utils import * -from heron.ui.src.python.handlers.common.graph import * +from heron.tools.ui.src.python.handlers.common.consts import * +from heron.tools.ui.src.python.handlers.common.utils import * +from heron.tools.ui.src.python.handlers.common.graph import * diff --git a/heron/tools/ui/src/python/handlers/mainhandler.py b/heron/tools/ui/src/python/handlers/mainhandler.py index 8bc02a8a06c..9b27e5128d5 100644 --- a/heron/tools/ui/src/python/handlers/mainhandler.py +++ b/heron/tools/ui/src/python/handlers/mainhandler.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' mainhandler.py ''' -from heron.ui.src.python.handlers import base +from heron.tools.ui.src.python.handlers import base class MainHandler(base.BaseHandler): diff --git a/heron/tools/ui/src/python/handlers/notfound.py b/heron/tools/ui/src/python/handlers/notfound.py index f5b8abb51cd..9acf15bb936 100644 --- a/heron/tools/ui/src/python/handlers/notfound.py +++ b/heron/tools/ui/src/python/handlers/notfound.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ''' notfound.py ''' -from heron.ui.src.python.handlers import base +from heron.tools.ui.src.python.handlers import base class NotFoundHandler(base.BaseHandler): diff --git a/heron/tools/ui/src/python/main.py b/heron/tools/ui/src/python/main.py index 827c3a4fc44..6b8ce3fac6d 100644 --- a/heron/tools/ui/src/python/main.py +++ b/heron/tools/ui/src/python/main.py @@ -25,8 +25,8 @@ import tornado.template from tornado.options import define -from heron.ui.src.python import handlers -from heron.ui.src.python import args +from heron.tools.ui.src.python import handlers +from heron.tools.ui.src.python import args import heron.common.src.python.utils.log as log Log = log.Log From bc99920b3706ac90d752d3f4935fdb70ffb1fa6b Mon Sep 17 00:00:00 2001 From: Runhang Li Date: Wed, 17 Aug 2016 23:32:17 -0700 Subject: [PATCH 05/10] Remove temp basic logging config. --- heron/common/src/python/utils/log.py | 1 - 1 file changed, 1 deletion(-) diff --git a/heron/common/src/python/utils/log.py b/heron/common/src/python/utils/log.py index 6b62389bcce..78160fd5438 100644 --- a/heron/common/src/python/utils/log.py +++ b/heron/common/src/python/utils/log.py @@ -19,7 +19,6 @@ # Create the logger # pylint: disable=invalid-name Log = logging.getLogger() -logging.basicConfig() # time formatter - date - time - UTC offset # e.g. "08/16/1988 21:30:00 +1030" From 9139b77623337136daf70b5afde8861c5cd9738d Mon Sep 17 00:00:00 2001 From: Taishi Nojima Date: Wed, 17 Aug 2016 23:47:41 -0700 Subject: [PATCH 06/10] Add logging.basicConfig back and a hack to remove handlers to avoid dup --- heron/common/src/python/utils/log.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/heron/common/src/python/utils/log.py b/heron/common/src/python/utils/log.py index 78160fd5438..01c5a9666cf 100644 --- a/heron/common/src/python/utils/log.py +++ b/heron/common/src/python/utils/log.py @@ -18,6 +18,7 @@ # Create the logger # pylint: disable=invalid-name +logging.basicConfig() Log = logging.getLogger() # time formatter - date - time - UTC offset @@ -35,6 +36,12 @@ def configure(level=logging.INFO, logfile=None, with_time=False): :return: None :rtype: None """ + + # Remove all the existing StreamHandlers to avoid duplicate + for handler in Log.handlers: + if isinstance(handler, logging.StreamHandler): + Log.handlers.remove(handler) + Log.setLevel(level) # if logfile is specified, FileHandler is used From a3b5ccd4279c92309a3c15ecfdb2a475945fdb6d Mon Sep 17 00:00:00 2001 From: kramasamy Date: Thu, 18 Aug 2016 00:17:20 -0700 Subject: [PATCH 07/10] changes to fix ui errors --- heron/tools/common/src/python/access/__init__.py | 2 +- heron/tools/tracker/src/python/main.py | 2 +- heron/tools/ui/src/python/args.py | 2 +- heron/tools/ui/src/python/handlers/api/metrics.py | 2 +- heron/tools/ui/src/python/handlers/api/topology.py | 2 +- heron/tools/ui/src/python/handlers/topology.py | 3 ++- heron/tools/ui/src/python/main.py | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/heron/tools/common/src/python/access/__init__.py b/heron/tools/common/src/python/access/__init__.py index c20a3847f03..64c89a9b212 100644 --- a/heron/tools/common/src/python/access/__init__.py +++ b/heron/tools/common/src/python/access/__init__.py @@ -1,5 +1,5 @@ ''' access module ''' __all__ = ['access'] -from heron import * +from heron_api import * from query import * diff --git a/heron/tools/tracker/src/python/main.py b/heron/tools/tracker/src/python/main.py index 7e5c1f681fe..23d1676d40b 100644 --- a/heron/tools/tracker/src/python/main.py +++ b/heron/tools/tracker/src/python/main.py @@ -21,8 +21,8 @@ import tornado.httpserver import tornado.ioloop import tornado.web - from tornado.options import define, options + import heron.tools.common.src.python.utils.config as common_config import heron.common.src.python.utils.log as log from heron.tools.tracker.src.python import constants diff --git a/heron/tools/ui/src/python/args.py b/heron/tools/ui/src/python/args.py index 4612473f0a4..4dd0022c28a 100644 --- a/heron/tools/ui/src/python/args.py +++ b/heron/tools/ui/src/python/args.py @@ -14,7 +14,7 @@ ''' args.py ''' import argparse -import heron.ui.src.python.consts as consts +import heron.tools.ui.src.python.consts as consts # pylint: disable=protected-access diff --git a/heron/tools/ui/src/python/handlers/api/metrics.py b/heron/tools/ui/src/python/handlers/api/metrics.py index e3af8307d54..3ac3f65ec29 100644 --- a/heron/tools/ui/src/python/handlers/api/metrics.py +++ b/heron/tools/ui/src/python/handlers/api/metrics.py @@ -13,7 +13,7 @@ # limitations under the License. ''' metrics.py ''' from heron.tools.ui.src.python.handlers import base -import heron.tools.common.src.python.handler.access as access +import heron.tools.common.src.python.access as access import tornado.gen diff --git a/heron/tools/ui/src/python/handlers/api/topology.py b/heron/tools/ui/src/python/handlers/api/topology.py index 9053341e095..2be4f2eb326 100644 --- a/heron/tools/ui/src/python/handlers/api/topology.py +++ b/heron/tools/ui/src/python/handlers/api/topology.py @@ -19,7 +19,7 @@ import tornado.gen from heron.tools.ui.src.python.handlers import base -import heron.tools.common.src.python.handler.access as access +import heron.tools.common.src.python.access as access from heron.tools.ui.src.python.handlers import common diff --git a/heron/tools/ui/src/python/handlers/topology.py b/heron/tools/ui/src/python/handlers/topology.py index 6f6b0cab74f..f9e69cd142a 100644 --- a/heron/tools/ui/src/python/handlers/topology.py +++ b/heron/tools/ui/src/python/handlers/topology.py @@ -17,9 +17,10 @@ import tornado.escape import tornado.web import tornado.gen -import heron.common.src.python.handler.access as access + import base import common +import heron.tools.common.src.python.access as access ################################################################################ diff --git a/heron/tools/ui/src/python/main.py b/heron/tools/ui/src/python/main.py index 6b8ce3fac6d..9f68d77cf37 100644 --- a/heron/tools/ui/src/python/main.py +++ b/heron/tools/ui/src/python/main.py @@ -25,9 +25,9 @@ import tornado.template from tornado.options import define +import heron.common.src.python.utils.log as log from heron.tools.ui.src.python import handlers from heron.tools.ui.src.python import args -import heron.common.src.python.utils.log as log Log = log.Log From 65caf483c5de4e4bfb4466e2fa480ebf34294301 Mon Sep 17 00:00:00 2001 From: Taishi Nojima Date: Thu, 18 Aug 2016 16:58:00 -0700 Subject: [PATCH 08/10] try pkg_resources --- heron/tools/ui/src/python/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/heron/tools/ui/src/python/main.py b/heron/tools/ui/src/python/main.py index 9f68d77cf37..9fa14feda05 100644 --- a/heron/tools/ui/src/python/main.py +++ b/heron/tools/ui/src/python/main.py @@ -24,6 +24,7 @@ import tornado.log import tornado.template from tornado.options import define +from pkg_resources import resource_filename import heron.common.src.python.utils.log as log from heron.tools.ui.src.python import handlers @@ -92,6 +93,8 @@ def __init__(self): handlers.api.MemoryHistogramHandler), ] + print os.path.abspath(resource_filename('heron.tools.ui', 'resources/templates')) + settings = dict( template_path=os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../resources/templates"), From 4eb2c5e43741a42a484212763a73bf9b4d9cfd22 Mon Sep 17 00:00:00 2001 From: Taishi Nojima Date: Thu, 18 Aug 2016 19:29:46 -0700 Subject: [PATCH 09/10] UI works with a hacky solution --- heron/tools/ui/src/python/main.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/heron/tools/ui/src/python/main.py b/heron/tools/ui/src/python/main.py index 9fa14feda05..2ca51b0f9e2 100644 --- a/heron/tools/ui/src/python/main.py +++ b/heron/tools/ui/src/python/main.py @@ -18,6 +18,7 @@ import os import signal +import sys import tornado.ioloop import tornado.options import tornado.web @@ -93,13 +94,13 @@ def __init__(self): handlers.api.MemoryHistogramHandler), ] - print os.path.abspath(resource_filename('heron.tools.ui', 'resources/templates')) - + # pylint: disable=fixme + # TODO: hacky solution + # sys.path[0] should be the path to the extracted files for heron-ui, as it is added + # when bootstrapping the pex file settings = dict( - template_path=os.path.join(os.path.dirname(os.path.abspath(__file__)), - "../../resources/templates"), - static_path=os.path.join(os.path.dirname(os.path.abspath(__file__)), - "../../resources/static"), + template_path=os.path.join(sys.path[0], "heron/tools/ui/resources/templates"), + static_path=os.path.join(sys.path[0], "heron/tools/ui/resources/static"), gzip=True, debug=True, default_handler_class=handlers.NotFoundHandler, From f23de0ff7ccda8ac8ee497e82b8c2325aec79476 Mon Sep 17 00:00:00 2001 From: Taishi Nojima Date: Thu, 18 Aug 2016 22:31:43 -0700 Subject: [PATCH 10/10] Style fix --- heron/tools/common/src/python/utils/config.py | 1 - heron/tools/tracker/src/python/handlers/basehandler.py | 1 + heron/tools/tracker/tests/python/query_operator_unittest.py | 4 ++-- heron/tools/ui/src/python/handlers/base.py | 1 + heron/tools/ui/src/python/handlers/topology.py | 2 ++ heron/tools/ui/src/python/main.py | 1 - 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/heron/tools/common/src/python/utils/config.py b/heron/tools/common/src/python/utils/config.py index 78a46f008fa..127210d43f7 100644 --- a/heron/tools/common/src/python/utils/config.py +++ b/heron/tools/common/src/python/utils/config.py @@ -367,4 +367,3 @@ def _format_action(self, action): if action.nargs == argparse.PARSER: parts = "\n".join(parts.split("\n")[1:]) return parts - diff --git a/heron/tools/tracker/src/python/handlers/basehandler.py b/heron/tools/tracker/src/python/handlers/basehandler.py index 91953add3af..1c22d618703 100644 --- a/heron/tools/tracker/src/python/handlers/basehandler.py +++ b/heron/tools/tracker/src/python/handlers/basehandler.py @@ -19,6 +19,7 @@ from heron.tools.tracker.src.python import constants # pylint: disable=too-many-public-methods +# pylint: disable=abstract-method class BaseHandler(tornado.web.RequestHandler): """ Base Handler. All the other handlers derive from diff --git a/heron/tools/tracker/tests/python/query_operator_unittest.py b/heron/tools/tracker/tests/python/query_operator_unittest.py index 6c15afaebf2..5ea703f73d3 100644 --- a/heron/tools/tracker/tests/python/query_operator_unittest.py +++ b/heron/tools/tracker/tests/python/query_operator_unittest.py @@ -144,7 +144,7 @@ def getMetricTimelineSideEffect(*args): 300: 2.0 }, metric.timeline) else: - self.assertTrue(False, "Wrong metrics generated by TS.execute") + self.fail("Wrong metrics generated by TS.execute") @tornado.testing.gen_test def test_DEFAULT_execute(self): @@ -286,7 +286,7 @@ def ts_side_effect3(*args): 300: 0 # Filled }, metric.timeline) else: - self.assertTrue(False, "Wrong metrics generated by TS.execute") + self.fail("Wrong metrics generated by TS.execute") @tornado.testing.gen_test def test_SUM_execute(self): diff --git a/heron/tools/ui/src/python/handlers/base.py b/heron/tools/ui/src/python/handlers/base.py index be5ffe7ce02..62c5cbbffa5 100644 --- a/heron/tools/ui/src/python/handlers/base.py +++ b/heron/tools/ui/src/python/handlers/base.py @@ -17,6 +17,7 @@ import tornado.httpserver +# pylint: disable=abstract-method class BaseHandler(tornado.web.RequestHandler): ''' BaseHandler ''' diff --git a/heron/tools/ui/src/python/handlers/topology.py b/heron/tools/ui/src/python/handlers/topology.py index f9e69cd142a..62a4fdf8272 100644 --- a/heron/tools/ui/src/python/handlers/topology.py +++ b/heron/tools/ui/src/python/handlers/topology.py @@ -24,6 +24,8 @@ ################################################################################ +# pylint: disable=abstract-method +# pylint: disable=arguments-differ class TopologyConfigHandler(base.BaseHandler): ''' Handler for displaying the config for a topology ''' diff --git a/heron/tools/ui/src/python/main.py b/heron/tools/ui/src/python/main.py index 2ca51b0f9e2..ba808072038 100644 --- a/heron/tools/ui/src/python/main.py +++ b/heron/tools/ui/src/python/main.py @@ -25,7 +25,6 @@ import tornado.log import tornado.template from tornado.options import define -from pkg_resources import resource_filename import heron.common.src.python.utils.log as log from heron.tools.ui.src.python import handlers