Skip to content

refactor(clp-package)!: Move query-engine config to webui (fixes #2088).#2349

Merged
Nathan903 merged 32 commits into
y-scope:mainfrom
Nathan903:2088-decouple-query_engine-from-deployment-gating-to-allow-running-multiple-query-engines-simultaneously
Jul 2, 2026
Merged

refactor(clp-package)!: Move query-engine config to webui (fixes #2088).#2349
Nathan903 merged 32 commits into
y-scope:mainfrom
Nathan903:2088-decouple-query_engine-from-deployment-gating-to-allow-running-multiple-query-engines-simultaneously

Conversation

@Nathan903

@Nathan903 Nathan903 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #2088

  • Moved query_engine from package to webui (webui.query_engine).
  • Docker Compose Consolidation: Removed the base stack overrides (docker-compose-base.yaml and docker-compose-spider-base.yaml). Components like query-scheduler, query-worker, and reducer are now dynamically turned on/off inside the primary Compose file using replica counts (deploy: replicas: 0), controlled by environment variables injected by the controller.
  • Null-safe Presto Support: When deploying Presto, users can now omit query_scheduler, query_worker, and reducer (or set them to None) in their configuration. The controller handles this gracefully and spins up 0 replicas of those services to save resources.
  • Logging Cleanup: Fixed eager f-strings in the controller's logger setup flows to adhere to G004 logging rules.

Breaking Changes

  • The package.query_engine configuration key has been removed. Users must update their clp-config.yaml and Helm values.yaml files to use webui.query_engine instead.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  1. Default config
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ ./sbin/start-clp.sh
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ docker ps | grep -oE "query-scheduler|query-worker|reducer|api-server|webui|spider-scheduler"
reducer
webui
api-server
query-scheduler
query-worker
  1. Presto without pipeline
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cp etc/clp-config.yaml.orig etc/clp-config.yaml
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cat <<EOF >> etc/clp-config.yaml
>
> webui:
>   query_engine: "presto"
> presto:
>   host: "localhost"
>   port: 30889
> query_scheduler: null
> query_worker: null
> reducer: null
> results_cache:
>   retention_period: null
> EOF
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ ./sbin/start-clp.sh
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ docker ps | grep -oE "query-scheduler|query-worker|reducer|api-server|webui|spider-scheduler"
webui
api-server
  1. Presto with pipeline
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cp etc/clp-config.yaml.orig etc/clp-config.yaml
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cat <<EOF >> etc/clp-config.yaml
>
> webui:
>   query_engine: "presto"
> presto:
>   host: "localhost"
>   port: 30889
> results_cache:
>   retention_period: null
> EOF
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ ./sbin/start-clp.sh
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ docker ps | grep -oE "query-scheduler|query-worker|reducer|api-server|webui|spider-scheduler"
reducer
webui
api-server
query-scheduler
query-worker
  1. clp-s without query_worker
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cp etc/clp-config.yaml.orig etc/clp-config.yaml
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cat <<EOF >> etc/clp-config.yaml
>
> query_worker: null
> EOF
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ ./sbin/start-clp.sh
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ docker ps | grep -oE "query-scheduler|query-worker|reducer|api-server|webui|spider-scheduler"
reducer
webui
api-server
query-scheduler
  1. Validation: presto without presto config
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cp etc/clp-config.yaml.orig etc/clp-config.yaml
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ cat <<EOF >> etc/clp-config.yaml
>
> webui:
>   query_engine: "presto"
> results_cache:
>   retention_period: null
> EOF
nathanhung@baker18:/home/nathanhung/clp/build/clp-package$ ./sbin/start-clp.sh
Container clp-package-clp-runtime-run-1a3a43477e3a Creating
Container clp-package-clp-runtime-run-1a3a43477e3a Created
2026-06-25T04:59:55.444 ERROR [start_clp] Failed to load config.
Traceback (most recent call last):
  File "/opt/clp/lib/python3/site-packages/clp_package_utils/scripts/start_clp.py", line 89, in main
    clp_config = load_config_file(resolved_config_path)
  File "/opt/clp/lib/python3/site-packages/clp_package_utils/general.py", line 495, in load_config_file
    clp_config = ClpConfig.model_validate(raw_clp_config)
  File "/opt/clp/lib/python3/site-packages/pydantic/main.py", line 732, in model_validate
    return cls.__pydantic_validator__.validate_python(
pydantic_core._pydantic_core.ValidationError: 1 validation error for ClpConfig
  Value error, `presto` config must be non-null when query_engine is `presto` [type=value_error, input_value={'telemetry': {'disable':...etention_period': None}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.13/v/value_error

Summary by CodeRabbit

  • New Features

    • Updated deployment configuration so the Web UI selects the query engine via webui.query_engine.
    • Added enablement gating for query-related services (query-scheduler, query-worker, reducer) using CLP_*_ENABLED.
  • Bug Fixes

    • Docker Compose orchestration and compose-file selection now follow the Spider orchestration mode.
    • Topology metrics now correctly show 0 replicas/concurrency when query-worker/reducer services are disabled or omitted.
  • Documentation

    • Updated Docker Compose, Presto, quick-start, and build guides to reference webui.query_engine (instead of package.query_engine).

@Nathan903 Nathan903 requested a review from a team as a code owner June 24, 2026 08:08
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

query_engine moves from package to webui. DeploymentType and ClpConfig.get_deployment_type() are removed. reducer, query_scheduler, and query_worker become optional in ClpConfig. Controller, Docker Compose, templates, Helm, docs, and tests are updated for the new config shape.

Changes

query_engine Scope Migration and Optional Query Components

Layer / File(s) Summary
ClpConfig model and test config shape
components/clp-py-utils/clp_py_utils/clp_config.py, integration-tests/tests/package_tests/clp_json/utils/mode.py, integration-tests/tests/package_tests/clp_text/utils/mode.py
Removes DeploymentType and the package-scoped query-engine validator, adds WebUi.query_engine, makes reducer, query_scheduler, and query_worker optional, updates query-engine validation and container transformation to use webui.query_engine, and updates package test modes to construct WebUi blocks.
Controller env setup and orchestration selection
components/clp-package-utils/clp_package_utils/controller.py, components/clp-package-utils/clp_package_utils/general.py
Adds CLP_*_ENABLED handling for query-scheduler, query-worker, and reducer, updates Web UI settings generation and retention validation to read webui.query_engine, removes deployment-type compose mapping, switches startup logging and compose-file selection to compression_scheduler.type, and emits zero topology metrics when query components are absent.
Compose, templates, and Helm config wiring
tools/deployment/package/docker-compose-all.yaml, tools/deployment/package/docker-compose-base.yaml, tools/deployment/package/docker-compose-spider-base.yaml, components/package-template/src/etc/clp-config.template.*.yaml, tools/deployment/package-helm/templates/configmap.yaml, tools/deployment/package-helm/Chart.yaml
Adds replica gating for query services, removes the compose base files, moves query_engine from the package block to the webui block in config templates and the Helm ConfigMap, and bumps the Helm chart version.
Docs for webui query_engine
docs/src/user-docs/guides-*.md, docs/src/dev-docs/building-package.md, docs/src/user-docs/quick-start/clp-text.md
Updates the Docker Compose deployment, Presto setup, build, and clp-text quick-start docs to reference webui.query_engine and show the updated configuration snippets.

Sequence Diagram(s)

sequenceDiagram
  participant DockerComposeController
  participant ClpConfig
  participant DockerCompose
  DockerComposeController->>ClpConfig: read optional query service configs
  DockerComposeController->>DockerCompose: set CLP_QUERY_SCHEDULER_ENABLED
  DockerComposeController->>DockerCompose: set CLP_QUERY_WORKER_ENABLED
  DockerComposeController->>DockerCompose: set CLP_REDUCER_ENABLED
  DockerComposeController->>ClpConfig: read compression_scheduler.type
  DockerComposeController->>DockerCompose: choose compose file
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • junhaoliao
  • hoophalab
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.37% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: moving query-engine configuration from package to webui.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/package-template/src/etc/clp-config.template.text.yaml (1)

9-11: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Default template can become invalid due to engine mismatch.

With package.storage_engine: "clp" left active and webui.query_engine commented out, the config can fail validation when webui.query_engine falls back to its default (clp-s). Keep these defaults aligned in the template.

Proposed fix
 webui:
-#  query_engine: "clp"
+  query_engine: "clp"

Also applies to: 107-107

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/package-template/src/etc/clp-config.template.text.yaml` around
lines 9 - 11, The template defaults are out of sync: package.storage_engine is
set to clp while webui.query_engine is left unset, which can cause validation to
fail when the query engine defaults to clp-s. Update the
clp-config.template.text.yaml defaults so the package and webui settings stay
aligned in the template, and verify the relevant config template entries around
package and webui are consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/clp-package-utils/clp_package_utils/controller.py`:
- Around line 1235-1236: The topology metrics emitted by
_emit_topology_metrics() are still hardcoded to report one query worker and one
reducer even when CLP_QUERY_WORKER_ENABLED or CLP_REDUCER_ENABLED disables those
services and Compose starts zero replicas. Update _emit_topology_metrics() in
Controller to derive the query worker and reducer gauges from the same optional
config state used by the Compose setup, so the reported replica counts match
whether the corresponding config objects are present or None.

In `@components/clp-py-utils/clp_py_utils/clp_config.py`:
- Line 821: The new optional default for query_scheduler can still crash WebUI
setup because BaseController._set_up_env_for_webui() dereferences
query_scheduler.max_datasets_per_query without handling None. Update the WebUI
config path in BaseController._set_up_env_for_webui() to explicitly handle a
missing query_scheduler, or add validation in the clp_config QueryScheduler/CLP
config setup so WebUI cannot reach this path when the scheduler is omitted.
- Line 733: Finish migrating `BaseController._set_up_env_for_webui()` off
`package.query_engine`; it still reads the removed
`self._clp_config.package.query_engine` for client/server settings and Presto
branching, which will break env setup. Update that controller logic to
consistently use `self._clp_config.webui.query_engine` everywhere the query
engine is checked, so all branches and settings derive from the new webui config
path.

---

Outside diff comments:
In `@components/package-template/src/etc/clp-config.template.text.yaml`:
- Around line 9-11: The template defaults are out of sync:
package.storage_engine is set to clp while webui.query_engine is left unset,
which can cause validation to fail when the query engine defaults to clp-s.
Update the clp-config.template.text.yaml defaults so the package and webui
settings stay aligned in the template, and verify the relevant config template
entries around package and webui are consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 38239b59-8a5a-4175-916d-1c572a7f10d4

📥 Commits

Reviewing files that changed from the base of the PR and between 120f630 and 98dc381.

📒 Files selected for processing (10)
  • components/clp-package-utils/clp_package_utils/controller.py
  • components/clp-py-utils/clp_py_utils/clp_config.py
  • components/package-template/src/etc/clp-config.template.json.yaml
  • components/package-template/src/etc/clp-config.template.text.yaml
  • docs/src/user-docs/guides-docker-compose-deployment.md
  • docs/src/user-docs/guides-using-presto.md
  • tools/deployment/package-helm/templates/configmap.yaml
  • tools/deployment/package/docker-compose-all.yaml
  • tools/deployment/package/docker-compose-base.yaml
  • tools/deployment/package/docker-compose-spider-base.yaml
💤 Files with no reviewable changes (2)
  • tools/deployment/package/docker-compose-spider-base.yaml
  • tools/deployment/package/docker-compose-base.yaml

Comment thread components/clp-package-utils/clp_package_utils/controller.py Outdated
Comment thread components/clp-py-utils/clp_py_utils/clp_config.py
Comment thread components/clp-py-utils/clp_py_utils/clp_config.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/clp-package-utils/clp_package_utils/controller.py`:
- Line 526: The logger calls in controller.py use eager f-strings, which
violates the G004 logging rule; update the affected statements in the
environment setup flow to use deferred "%s" formatting with logger.info/logger
calls instead of interpolating directly. Locate the messages around the existing
logger.info uses in the controller methods handling environment setup and make
the same formatting change for each mentioned occurrence so logging arguments
are passed separately from the message string.
- Around line 752-757: The client settings assembly in controller.py
unconditionally reads self._clp_config.query_scheduler.max_datasets_per_query,
which can fail when query_scheduler is absent. Update the settings update logic
in the setup path to check for a present query_scheduler before accessing
max_datasets_per_query, and only include MaxDatasetsPerQuery when that component
exists. Use the existing controller method that builds
client_settings_json_updates as the place to add the guard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6a92482c-d70d-4b16-bea1-6292267c496a

📥 Commits

Reviewing files that changed from the base of the PR and between 98dc381 and 73133a6.

📒 Files selected for processing (7)
  • components/clp-package-utils/clp_package_utils/controller.py
  • components/clp-package-utils/clp_package_utils/general.py
  • docs/src/dev-docs/building-package.md
  • docs/src/user-docs/quick-start/clp-text.md
  • integration-tests/tests/package_tests/clp_json/utils/mode.py
  • integration-tests/tests/package_tests/clp_text/utils/mode.py
  • tools/deployment/package-helm/Chart.yaml

Comment thread components/clp-package-utils/clp_package_utils/controller.py Outdated
Comment thread components/clp-package-utils/clp_package_utils/controller.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/package-template/src/etc/clp-config.template.text.yaml (1)

9-11: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the text template’s query engine explicit.

After removing the active query-engine setting, this template now falls back to webui.query_engine = "clp-s", while Line 10 still pins package.storage_engine: "clp". validate_query_engine_package_compatibility() rejects that pair, so the default clp-text template no longer loads. Re-enable the active webui.query_engine: "clp" entry or switch this template to storage_engine: "clp-s".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/package-template/src/etc/clp-config.template.text.yaml` around
lines 9 - 11, The clp text template is missing an explicit active query engine,
so it falls back to a mismatched default that fails compatibility validation. In
the template that defines package.storage_engine, restore the webui.query_engine
setting to "clp" so validate_query_engine_package_compatibility() accepts the
default combination, or change the template’s storage_engine to "clp-s" if that
is the intended pairing. Use the clp-config.template.text.yaml template entry
and the query-engine/package compatibility check as the reference points.
components/clp-py-utils/clp_py_utils/clp_config.py (1)

1042-1059: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Reject webui.query_engine: presto when presto is missing.

The PRESTO branch only validates storage_engine. If presto is omitted, WebUI setup later dereferences container_clp_config.presto.host / port, so startup crashes instead of failing config validation.

Proposed fix
         elif query_engine == QueryEngine.PRESTO:
+            if self.presto is None:
+                raise ValueError(
+                    f"'presto' must be configured when query_engine is '{QueryEngine.PRESTO}'."
+                )
             if storage_engine != StorageEngine.CLP_S:
                 raise ValueError(
                     f"query_engine '{QueryEngine.PRESTO}' is only compatible with "
                     f"storage_engine '{StorageEngine.CLP_S}'."
                 )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-py-utils/clp_py_utils/clp_config.py` around lines 1042 - 1059,
The validate_query_engine_package_compatibility method only checks
storage_engine for QueryEngine.PRESTO, so add a validation that rejects
webui.query_engine set to PRESTO when the presto config is missing. Update the
PRESTO branch in clp_config.py to verify the package/webui presto settings exist
before allowing startup, so later WebUI code that reads
container_clp_config.presto.host and port cannot crash. Keep the fix localized
to validate_query_engine_package_compatibility and reference the existing
QueryEngine.PRESTO and StorageEngine.CLP_S checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@components/clp-py-utils/clp_py_utils/clp_config.py`:
- Around line 1042-1059: The validate_query_engine_package_compatibility method
only checks storage_engine for QueryEngine.PRESTO, so add a validation that
rejects webui.query_engine set to PRESTO when the presto config is missing.
Update the PRESTO branch in clp_config.py to verify the package/webui presto
settings exist before allowing startup, so later WebUI code that reads
container_clp_config.presto.host and port cannot crash. Keep the fix localized
to validate_query_engine_package_compatibility and reference the existing
QueryEngine.PRESTO and StorageEngine.CLP_S checks.

In `@components/package-template/src/etc/clp-config.template.text.yaml`:
- Around line 9-11: The clp text template is missing an explicit active query
engine, so it falls back to a mismatched default that fails compatibility
validation. In the template that defines package.storage_engine, restore the
webui.query_engine setting to "clp" so
validate_query_engine_package_compatibility() accepts the default combination,
or change the template’s storage_engine to "clp-s" if that is the intended
pairing. Use the clp-config.template.text.yaml template entry and the
query-engine/package compatibility check as the reference points.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 77fc4a09-b93e-4c83-9ee9-2c0134e096dc

📥 Commits

Reviewing files that changed from the base of the PR and between 73133a6 and b77a07a.

📒 Files selected for processing (7)
  • components/clp-package-utils/clp_package_utils/controller.py
  • components/clp-py-utils/clp_py_utils/clp_config.py
  • components/package-template/src/etc/clp-config.template.json.yaml
  • components/package-template/src/etc/clp-config.template.text.yaml
  • tools/deployment/package-helm/Chart.yaml
  • tools/deployment/package-helm/templates/configmap.yaml
  • tools/deployment/package/docker-compose-all.yaml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/clp-py-utils/clp_py_utils/clp_config.py (1)

735-735: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep the default CLP query stack internally consistent.

webui.query_engine still defaults to clp_s, but query_scheduler now defaults to None and this validator rejects that combination. Even if a caller restores only query_scheduler, the controller now treats query_worker=None and reducer=None as disabled services, so a CLP-backed WebUI can still come up with no workers to execute queries. Please either keep the CLP query components defaulted on, or validate query_worker and reducer alongside query_scheduler whenever webui.query_engine is clp/clp_s.

Also applies to: 818-825, 1041-1049

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-py-utils/clp_py_utils/clp_config.py` at line 735, The CLP
WebUI defaults are inconsistent: `webui.query_engine` remains set to `CLP_S`,
but the related defaults/validation in `clp_config.py` allow `query_scheduler`
to be `None` while `query_worker` and `reducer` can still be treated as
disabled. Update the CLP query-stack defaults or extend the existing validator
so that when `webui.query_engine` is `clp`/`clp_s`, `query_scheduler`,
`query_worker`, and `reducer` are validated together and stay enabled
consistently. Use the `QueryEngine`/`QueryEngineStr` handling in the affected
config sections to locate and adjust the defaulting logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/clp-package-utils/clp_package_utils/controller.py`:
- Around line 794-797: When query_scheduler is disabled,
_read_and_update_settings_json() currently leaves MaxDatasetsPerQuery unchanged
because client_settings_json_updates only sets it inside the non-None branch.
Update the logic around self._clp_config.query_scheduler in controller.py so
MaxDatasetsPerQuery is explicitly cleared when query_scheduler is None, either
by setting the update value to null or by removing the key from
client_settings_json_updates before settings.json is written.

---

Outside diff comments:
In `@components/clp-py-utils/clp_py_utils/clp_config.py`:
- Line 735: The CLP WebUI defaults are inconsistent: `webui.query_engine`
remains set to `CLP_S`, but the related defaults/validation in `clp_config.py`
allow `query_scheduler` to be `None` while `query_worker` and `reducer` can
still be treated as disabled. Update the CLP query-stack defaults or extend the
existing validator so that when `webui.query_engine` is `clp`/`clp_s`,
`query_scheduler`, `query_worker`, and `reducer` are validated together and stay
enabled consistently. Use the `QueryEngine`/`QueryEngineStr` handling in the
affected config sections to locate and adjust the defaulting logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2cee5125-146f-40f1-8a88-bdeb2e910901

📥 Commits

Reviewing files that changed from the base of the PR and between b77a07a and d29cd5f.

📒 Files selected for processing (2)
  • components/clp-package-utils/clp_package_utils/controller.py
  • components/clp-py-utils/clp_py_utils/clp_config.py

Comment thread components/clp-package-utils/clp_package_utils/controller.py Outdated
@Nathan903 Nathan903 changed the title draft: (fixes #2088). refactor(clp-package)!: Move query-engine config to webui (fixes #2088). Jun 24, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/clp-py-utils/clp_py_utils/clp_config.py (1)

818-826: 🩺 Stability & Availability | 🔴 Critical

Restore a non-null query_scheduler default or stop constructing ClpConfig() at class definition time. query_engine still defaults to QueryEngine.CLP_S, so ClpConfig() now fails validation because query_scheduler is None. That also breaks WorkerConfig.tmp_directory = ClpConfig().tmp_directory at import time. components/clp-py-utils/clp_py_utils/clp_config.py:818-826, 1128

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/clp-py-utils/clp_py_utils/clp_config.py` around lines 818 - 826,
The ClpConfig defaults are inconsistent because query_engine still points to
QueryEngine.CLP_S while query_scheduler is now None, causing ClpConfig()
validation to fail and breaking WorkerConfig.tmp_directory initialization at
import time. Restore a non-null default for query_scheduler in ClpConfig, or
refactor the class so ClpConfig() is not instantiated during class definition in
WorkerConfig; update the relevant defaults in ClpConfig and any dependent
initialization paths so the config can be constructed safely.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@components/clp-py-utils/clp_py_utils/clp_config.py`:
- Around line 818-826: The ClpConfig defaults are inconsistent because
query_engine still points to QueryEngine.CLP_S while query_scheduler is now
None, causing ClpConfig() validation to fail and breaking
WorkerConfig.tmp_directory initialization at import time. Restore a non-null
default for query_scheduler in ClpConfig, or refactor the class so ClpConfig()
is not instantiated during class definition in WorkerConfig; update the relevant
defaults in ClpConfig and any dependent initialization paths so the config can
be constructed safely.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 78f6738b-0cd5-487a-8e7a-c92c24e0d809

📥 Commits

Reviewing files that changed from the base of the PR and between d29cd5f and aeb29bb.

📒 Files selected for processing (3)
  • components/clp-package-utils/clp_package_utils/controller.py
  • components/clp-py-utils/clp_py_utils/clp_config.py
  • components/package-template/src/etc/clp-config.template.text.yaml
💤 Files with no reviewable changes (1)
  • components/clp-package-utils/clp_package_utils/controller.py

…ating-to-allow-running-multiple-query-engines-simultaneously
@junhaoliao junhaoliao self-requested a review June 25, 2026 03:12
@Nathan903 Nathan903 force-pushed the 2088-decouple-query_engine-from-deployment-gating-to-allow-running-multiple-query-engines-simultaneously branch from 276ced3 to 8eb5d65 Compare June 25, 2026 20:44
@Nathan903 Nathan903 requested review from junhaoliao and removed request for junhaoliao June 26, 2026 02:03
@Nathan903 Nathan903 requested review from junhaoliao and removed request for junhaoliao June 27, 2026 05:20
…ating-to-allow-running-multiple-query-engines-simultaneously

# Conflicts:
#	components/clp-package-utils/clp_package_utils/controller.py
#	components/package-template/src/etc/clp-config.template.text.yaml
#	tools/deployment/package-helm/templates/configmap.yaml

@junhaoliao junhaoliao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks very good

Comment thread components/clp-package-utils/clp_package_utils/controller.py
Comment thread components/clp-py-utils/clp_py_utils/clp_config.py
Comment thread components/clp-py-utils/clp_py_utils/clp_config.py Outdated
Comment thread components/package-template/src/etc/clp-config.template.text.yaml
Comment on lines +278 to +286
{{- if .Values.clpConfig.query_scheduler }}
{{- with .Values.clpConfig.query_scheduler.max_datasets_per_query }}
"MaxDatasetsPerQuery": {{ . | int }},
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the with-else syntax should already be achieving the same behaviour?

Suggested change
{{- if .Values.clpConfig.query_scheduler }}
{{- with .Values.clpConfig.query_scheduler.max_datasets_per_query }}
"MaxDatasetsPerQuery": {{ . | int }},
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}
{{- with .Values.clpConfig.query_scheduler.max_datasets_per_query }}
"MaxDatasetsPerQuery": {{ . | int }},
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the if check prevents Helm from crashing from this kind of error if the config does not have query_scheduler

executing "test-chart/templates/configmap.yaml" at <.Values.clpConfig.query_scheduler.max_datasets_per_query>:
    nil pointer evaluating interface {}.max_datasets_per_query

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see what you mean. let's write this instead

Suggested change
{{- if .Values.clpConfig.query_scheduler }}
{{- with .Values.clpConfig.query_scheduler.max_datasets_per_query }}
"MaxDatasetsPerQuery": {{ . | int }},
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}
{{- with .Values.clpConfig.query_scheduler }}
"MaxDatasetsPerQuery": {{ .max_datasets_per_query | int }},
{{- else }}
"MaxDatasetsPerQuery": null,
{{- end }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would cause issue with max_datasets_per_query: null since it would convert null to a 0. In tools\deployment\package-helm\values.yaml:200 it writes

    max_datasets_per_query: 10  # Set to null to disable the limit

Comment thread tools/deployment/package-helm/templates/configmap.yaml
Comment thread docs/src/user-docs/guides-using-presto.md Outdated
Nathan903 and others added 3 commits June 29, 2026 22:01
…ating-to-allow-running-multiple-query-engines-simultaneously
Co-authored-by: Junhao Liao <junhao@junhao.ca>
@Nathan903 Nathan903 requested a review from junhaoliao June 30, 2026 07:03
…ating-to-allow-running-multiple-query-engines-simultaneously
@Nathan903 Nathan903 merged commit f54f68d into y-scope:main Jul 2, 2026
27 checks passed
@Nathan903 Nathan903 deleted the 2088-decouple-query_engine-from-deployment-gating-to-allow-running-multiple-query-engines-simultaneously branch July 2, 2026 16:03
@junhaoliao junhaoliao added this to the June 2026 milestone Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decouple query_engine from deployment gating to allow running multiple query engines simultaneously

2 participants