Skip to content

Commit ed63112

Browse files
authored
Merge branch 'main' into improve-deps-main-taskfile
2 parents 6c64a5b + 0f24600 commit ed63112

File tree

42 files changed

+844
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+844
-283
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "clp-uv-checks"
2+
3+
on:
4+
pull_request:
5+
paths: &monitored_paths
6+
- ".github/workflows/clp-uv-checks.yaml"
7+
- "components/clp-mcp-server/pyproject.toml"
8+
- "components/clp-mcp-server/uv.lock"
9+
- "components/clp-package-utils/pyproject.toml"
10+
- "components/clp-package-utils/uv.lock"
11+
- "components/clp-py-utils/pyproject.toml"
12+
- "components/clp-py-utils/uv.lock"
13+
- "components/job-orchestration/pyproject.toml"
14+
- "components/job-orchestration/uv.lock"
15+
- "integration-tests/pyproject.toml"
16+
- "integration-tests/uv.lock"
17+
push:
18+
paths: *monitored_paths
19+
schedule:
20+
# Run daily at 00:15 UTC (the 15 is to avoid periods of high load)
21+
- cron: "15 0 * * *"
22+
workflow_dispatch:
23+
24+
concurrency:
25+
group: "${{github.workflow}}-${{github.ref}}"
26+
# Cancel in-progress jobs for efficiency
27+
cancel-in-progress: true
28+
29+
jobs:
30+
uv-checks:
31+
strategy:
32+
matrix:
33+
os:
34+
- "macos-15"
35+
- "ubuntu-22.04"
36+
- "ubuntu-24.04"
37+
runs-on: "${{matrix.os}}"
38+
steps:
39+
- uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8" # v5.0.0
40+
with:
41+
submodules: "recursive"
42+
43+
- name: "Install task"
44+
shell: "bash"
45+
run: "npm install -g @go-task/[email protected]"
46+
47+
- name: "Install the latest version of uv"
48+
uses: "astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41" # v7.1.2
49+
50+
- name: "Validate lock files"
51+
shell: "bash"
52+
run: "task deps:lock:check-uv"

Cargo.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/clp-package-utils/clp_package_utils/controller.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,7 @@ def start(self) -> None:
743743
logger.info(f"Starting CLP using Docker Compose ({deployment_type} deployment)...")
744744

745745
cmd = ["docker", "compose", "--project-name", self._project_name]
746-
if deployment_type == DeploymentType.BASE:
747-
cmd += ["--file", "docker-compose.base.yaml"]
746+
cmd += ["--file", self._get_docker_file_name()]
748747
if self._clp_config.mcp_server is not None:
749748
cmd += ["--profile", "mcp"]
750749
cmd += ["up", "--detach", "--wait"]
@@ -795,6 +794,15 @@ def _get_num_workers() -> int:
795794
# This will change when we move from single to multi-container workers. See y-scope/clp#1424
796795
return multiprocessing.cpu_count() // 2
797796

797+
def _get_docker_file_name(self) -> str:
798+
"""
799+
:return: The Docker Compose file name to use based on the config.
800+
"""
801+
deployment_type = self._clp_config.get_deployment_type()
802+
if deployment_type == DeploymentType.BASE:
803+
return "docker-compose-base.yaml"
804+
return "docker-compose.yaml"
805+
798806

799807
def get_or_create_instance_id(clp_config: CLPConfig) -> str:
800808
"""

components/clp-package-utils/clp_package_utils/scripts/compress.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def _generate_compress_cmd(
9494
if parsed_args.timestamp_key is not None:
9595
compress_cmd.append("--timestamp-key")
9696
compress_cmd.append(parsed_args.timestamp_key)
97+
if parsed_args.unstructured:
98+
compress_cmd.append("--unstructured")
9799
if parsed_args.tags is not None:
98100
compress_cmd.append("--tags")
99101
compress_cmd.append(parsed_args.tags)
@@ -148,6 +150,11 @@ def main(argv):
148150
"--timestamp-key",
149151
help="The path (e.g. x.y) for the field containing the log event's timestamp.",
150152
)
153+
args_parser.add_argument(
154+
"--unstructured",
155+
action="store_true",
156+
help="Treat all inputs as unstructured text logs.",
157+
)
151158
args_parser.add_argument(
152159
"-t", "--tags", help="A comma-separated list of tags to apply to the compressed archives."
153160
)
@@ -198,11 +205,17 @@ def main(argv):
198205
logger.error(e)
199206
return -1
200207

201-
if parsed_args.timestamp_key is None:
208+
if parsed_args.timestamp_key is None and not parsed_args.unstructured:
202209
logger.warning(
203210
"`--timestamp-key` not specified. Events will not have assigned timestamps and can "
204211
"only be searched from the command line without a timestamp filter."
205212
)
213+
if parsed_args.timestamp_key is not None and parsed_args.unstructured:
214+
parsed_args.timestamp_key = None
215+
logger.warning(
216+
"`--timestamp-key` and `--unstructured` are not compatible. The input logs will be "
217+
"treated as unstructured, and the argument to `--timestamp-key` will be ignored."
218+
)
206219
elif dataset is not None:
207220
logger.error(f"Dataset selection is not supported for storage engine: {storage_engine}.")
208221
return -1

components/clp-package-utils/clp_package_utils/scripts/compress_from_s3.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def _generate_compress_cmd(
9797
if parsed_args.timestamp_key is not None:
9898
compress_cmd.append("--timestamp-key")
9999
compress_cmd.append(parsed_args.timestamp_key)
100+
if parsed_args.unstructured:
101+
compress_cmd.append("--unstructured")
100102
if parsed_args.tags is not None:
101103
compress_cmd.append("--tags")
102104
compress_cmd.append(parsed_args.tags)
@@ -178,6 +180,11 @@ def main(argv):
178180
"--timestamp-key",
179181
help="The path (e.g. x.y) for the field containing the log event's timestamp.",
180182
)
183+
args_parser.add_argument(
184+
"--unstructured",
185+
action="store_true",
186+
help="Treat all inputs as unstructured text logs.",
187+
)
181188
args_parser.add_argument(
182189
"-t", "--tags", help="A comma-separated list of tags to apply to the compressed archives."
183190
)
@@ -253,11 +260,17 @@ def main(argv):
253260
logger.error(e)
254261
return -1
255262

256-
if parsed_args.timestamp_key is None:
263+
if parsed_args.timestamp_key is None and not parsed_args.unstructured:
257264
logger.warning(
258265
"`--timestamp-key` not specified. Events will not have assigned timestamps and can"
259266
" only be searched from the command line without a timestamp filter."
260267
)
268+
if parsed_args.timestamp_key is not None and parsed_args.unstructured:
269+
parsed_args.timestamp_key = None
270+
logger.warning(
271+
"`--timestamp-key` and `--unstructured` are not compatible. The input logs will be "
272+
"treated as unstructured, and the argument to `--timestamp-key` will be ignored."
273+
)
261274

262275
if parsed_args.subcommand == S3_OBJECT_COMPRESSION:
263276
_validate_s3_object_args(parsed_args, args_parser)

components/clp-package-utils/clp_package_utils/scripts/native/compress.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def _generate_clp_io_config(
157157
paths_to_compress=logs_to_compress,
158158
timestamp_key=parsed_args.timestamp_key,
159159
path_prefix_to_remove=str(CONTAINER_INPUT_LOGS_ROOT_DIR),
160+
unstructured=parsed_args.unstructured,
160161
)
161162
elif input_type != "s3":
162163
raise ValueError(f"Unsupported input type: `{input_type}`.")
@@ -180,6 +181,7 @@ def _generate_clp_io_config(
180181
keys=keys,
181182
aws_authentication=aws_authentication,
182183
timestamp_key=parsed_args.timestamp_key,
184+
unstructured=parsed_args.unstructured,
183185
)
184186
elif s3_compress_subcommand == S3_KEY_PREFIX_COMPRESSION:
185187
if len(urls) != 1:
@@ -195,6 +197,7 @@ def _generate_clp_io_config(
195197
keys=None,
196198
aws_authentication=aws_authentication,
197199
timestamp_key=parsed_args.timestamp_key,
200+
unstructured=parsed_args.unstructured,
198201
)
199202
else:
200203
raise ValueError(f"Unsupported S3 compress subcommand: `{s3_compress_subcommand}`.")
@@ -337,6 +340,11 @@ def main(argv):
337340
"--timestamp-key",
338341
help="The path (e.g. x.y) for the field containing the log event's timestamp.",
339342
)
343+
args_parser.add_argument(
344+
"--unstructured",
345+
action="store_true",
346+
help="Treat all inputs as unstructured text logs.",
347+
)
340348
args_parser.add_argument(
341349
"-t", "--tags", help="A comma-separated list of tags to apply to the compressed archives."
342350
)

components/clp-package-utils/clp_package_utils/scripts/native/search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def create_and_monitor_job_in_db(
7777

7878
if do_count_aggregation is None and count_by_time_bucket_size is None:
7979
return
80-
with pymongo.MongoClient(results_cache.get_uri()) as client:
80+
with pymongo.MongoClient(results_cache.get_uri(), directConnection=True) as client:
8181
search_results_collection = client[results_cache.db_name][str(job_id)]
8282
if do_count_aggregation is not None:
8383
for document in search_results_collection.find():

components/clp-py-utils/clp_py_utils/clp_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
COMPRESSION_TASKS_TABLE_NAME = "compression_tasks"
4949

5050
# Paths
51-
CONTAINER_AWS_CONFIG_DIRECTORY = pathlib.Path("/") / ".aws"
5251
CONTAINER_CLP_HOME = pathlib.Path("/") / "opt" / "clp"
52+
CONTAINER_AWS_CONFIG_DIRECTORY = CONTAINER_CLP_HOME / ".aws"
5353
CONTAINER_INPUT_LOGS_ROOT_DIR = pathlib.Path("/") / "mnt" / "logs"
5454
CLP_DEFAULT_CONFIG_FILE_RELATIVE_PATH = pathlib.Path("etc") / "clp-config.yml"
5555
CLP_DEFAULT_CREDENTIALS_FILE_PATH = pathlib.Path("etc") / "credentials.yml"

components/clp-rust-utils/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ edition = "2024"
55

66
[dependencies]
77
aws-config = "1.8.8"
8-
aws-sdk-s3 = { version = "1.106.0" }
8+
aws-sdk-s3 = "1.106.0"
9+
aws-sdk-sqs = "1.86.0"
910
secrecy = { version = "0.10.3", features = ["serde"] }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
pub mod s3;
2+
pub mod sqs;

0 commit comments

Comments
 (0)