-
Notifications
You must be signed in to change notification settings - Fork 83
feat(clp-package): Expose dataset selection in package CLI scripts and web UI. (Deprecated) #1004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 91 commits
d18dbda
e43a802
0336d57
0a66aa6
ce8dfe0
00716b2
b790aea
9c0ffcb
c80b4b0
07de9e9
605956d
b7a432f
bb19bf1
1187ea8
1d5d0e3
c003634
85f208a
dc6830f
04457b4
1ef6852
b57e1d8
c7fd28f
e23bb55
19bc9a2
b4d0106
8246abf
8739653
04fe27f
9a09fde
e97b0d0
9dbb594
11b66e0
2bf743a
5a568cb
7c7fb62
059d075
268f2a7
cab0439
6f9b150
4f3a7cc
2e0ba43
5e54353
0f0ecd3
8ed5aff
be82558
313cabd
5edb090
4f3d61c
9297cd3
4f0506e
9440a9d
0383ef8
86a8512
c4895cd
9f5070f
7ffbed5
cf6c6a3
f304bc6
69ddc3e
a132cd6
fd34617
ff40e0f
d79e075
60fb75d
0f4fd74
5e7c20b
7e6447a
84065dd
6ec5ff7
42658d0
499292a
75ba22c
a76ba59
380f16e
316663c
e02b1c3
a655588
944cad5
da3cd23
43b74d2
8ee0f2e
074f7ad
344c0c6
c045d7b
c9c4bfc
a7f4332
ac28463
d0aebd9
1ae6006
549b0ef
02687bd
786e539
848af5b
528dfe2
18ebff6
94a231a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,11 @@ | |
|
|
||
| import msgpack | ||
| import pymongo | ||
| from clp_py_utils.clp_config import Database, ResultsCache | ||
| from clp_py_utils.clp_config import ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For archive manager and decompress, I feel we should validate the dataset argument provided by the users. If they give a dataset that doesn't exist in the database, we should return some error/warning instead of silently not returning results.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in the query scheduler, if user provides a dataset name that is not currently registered, then query scheduler would log an error. But I don't think that error shows up on the user interface yet.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep I am aware that query scheduler will log an error, but archive_manager.sh and decompress.sh doesn't go through the query scheduler iirc. I think we should:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for webui - you can only choose from available datasets. user cannot submit query if there is no dataset. |
||
| CLP_DEFAULT_DATASET_NAME, | ||
| Database, | ||
| ResultsCache, | ||
| ) | ||
| from clp_py_utils.sql_adapter import SQL_Adapter | ||
| from job_orchestration.scheduler.constants import QueryJobStatus, QueryJobType | ||
| from job_orchestration.scheduler.job_config import AggregationConfig, SearchJobConfig | ||
|
|
@@ -32,6 +36,7 @@ | |
| def create_and_monitor_job_in_db( | ||
| db_config: Database, | ||
| results_cache: ResultsCache, | ||
| dataset: str, | ||
| wildcard_query: str, | ||
| tags: str | None, | ||
| begin_timestamp: int | None, | ||
|
|
@@ -43,6 +48,7 @@ def create_and_monitor_job_in_db( | |
| count_by_time_bucket_size: int | None, | ||
| ): | ||
| search_config = SearchJobConfig( | ||
| dataset=dataset, | ||
| query_string=wildcard_query, | ||
| begin_timestamp=begin_timestamp, | ||
| end_timestamp=end_timestamp, | ||
|
|
@@ -113,6 +119,7 @@ async def worker_connection_handler(reader: asyncio.StreamReader, writer: asynci | |
| async def do_search_without_aggregation( | ||
| db_config: Database, | ||
| results_cache: ResultsCache, | ||
| dataset: str, | ||
| wildcard_query: str, | ||
| tags: str | None, | ||
| begin_timestamp: int | None, | ||
|
|
@@ -147,6 +154,7 @@ async def do_search_without_aggregation( | |
| create_and_monitor_job_in_db, | ||
| db_config, | ||
| results_cache, | ||
| dataset, | ||
| wildcard_query, | ||
| tags, | ||
| begin_timestamp, | ||
|
|
@@ -184,6 +192,7 @@ async def do_search_without_aggregation( | |
| async def do_search( | ||
| db_config: Database, | ||
| results_cache: ResultsCache, | ||
| dataset: str, | ||
| wildcard_query: str, | ||
| tags: str | None, | ||
| begin_timestamp: int | None, | ||
|
|
@@ -198,6 +207,7 @@ async def do_search( | |
| await do_search_without_aggregation( | ||
| db_config, | ||
| results_cache, | ||
| dataset, | ||
| wildcard_query, | ||
| tags, | ||
| begin_timestamp, | ||
|
|
@@ -211,6 +221,7 @@ async def do_search( | |
| create_and_monitor_job_in_db, | ||
| db_config, | ||
| results_cache, | ||
| dataset, | ||
| wildcard_query, | ||
| tags, | ||
| begin_timestamp, | ||
|
|
@@ -229,6 +240,11 @@ def main(argv): | |
|
|
||
| args_parser = argparse.ArgumentParser(description="Searches the compressed logs.") | ||
| args_parser.add_argument("--config", "-c", required=True, help="CLP configuration file.") | ||
| args_parser.add_argument( | ||
| "--dataset", | ||
| default=CLP_DEFAULT_DATASET_NAME, | ||
| help="The name of the log category.", | ||
| ) | ||
| args_parser.add_argument("wildcard_query", help="Wildcard query.") | ||
| args_parser.add_argument( | ||
| "-t", "--tags", help="Comma-separated list of tags of archives to search." | ||
|
|
@@ -286,6 +302,7 @@ def main(argv): | |
| do_search( | ||
| clp_config.database, | ||
| clp_config.results_cache, | ||
| parsed_args.dataset, | ||
| parsed_args.wildcard_query, | ||
| parsed_args.tags, | ||
| parsed_args.begin_time, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.