diff options
Diffstat (limited to 'python/fatcat_worker.py')
-rwxr-xr-x | python/fatcat_worker.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/python/fatcat_worker.py b/python/fatcat_worker.py index 0e2d03b5..67ea8451 100755 --- a/python/fatcat_worker.py +++ b/python/fatcat_worker.py @@ -10,6 +10,7 @@ from fatcat_tools.workers import ( ChangelogWorker, ElasticsearchChangelogWorker, ElasticsearchContainerWorker, + ElasticsearchFileWorker, ElasticsearchReleaseWorker, EntityUpdatesWorker, ) @@ -70,6 +71,17 @@ def run_elasticsearch_container(args: argparse.Namespace) -> None: worker.run() +def run_elasticsearch_file(args: argparse.Namespace) -> None: + consume_topic = "fatcat-{}.file-updates".format(args.env) + worker = ElasticsearchFileWorker( + args.kafka_hosts, + consume_topic, + elasticsearch_backend=args.elasticsearch_backend, + elasticsearch_index=args.elasticsearch_index, + ) + worker.run() + + def run_elasticsearch_changelog(args: argparse.Namespace) -> None: consume_topic = "fatcat-{}.changelog".format(args.env) worker = ElasticsearchChangelogWorker( @@ -150,6 +162,22 @@ def main() -> None: help="whether to query release search index for container stats", ) + sub_elasticsearch_file = subparsers.add_parser( + "elasticsearch-file", + help="consume kafka feed of new/updated files, transform and push to search", + ) + sub_elasticsearch_file.set_defaults(func=run_elasticsearch_file) + sub_elasticsearch_file.add_argument( + "--elasticsearch-backend", + help="elasticsearch backend to connect to", + default="http://localhost:9200", + ) + sub_elasticsearch_file.add_argument( + "--elasticsearch-index", + help="elasticsearch index to push into", + default="fatcat_file", + ) + sub_elasticsearch_changelog = subparsers.add_parser( "elasticsearch-changelog", help="consume changelog kafka feed, transform and push to search", |