Skip to content

Commit ec2e271

Browse files
authored
Fix runtime combo registry dependencies (#276)
1 parent f1f9d67 commit ec2e271

4 files changed

Lines changed: 11 additions & 24 deletions

File tree

.github/workflows/runtime-guard.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
RUNTIME_GUARD_FAIL_WORKFLOW_ON_ALERT: ${{ inputs.fail_workflow_on_alert || vars.RUNTIME_GUARD_FAIL_WORKFLOW_ON_ALERT || 'true' }}
6464
RUNTIME_GUARD_SCHEDULER_JOB_PATTERN: ${{ vars.RUNTIME_GUARD_SCHEDULER_JOB_PATTERN || vars.CLOUD_RUN_SERVICE }}
6565
CLOUD_RUN_SERVICE: ${{ vars.CLOUD_RUN_SERVICE }}
66+
CLOUD_RUN_SERVICES: ${{ vars.CLOUD_RUN_SERVICES }}
67+
CLOUD_RUN_SERVICE_TARGETS_JSON: ${{ vars.CLOUD_RUN_SERVICE_TARGETS_JSON }}
6668
GLOBAL_TELEGRAM_CHAT_ID: ${{ vars.GLOBAL_TELEGRAM_CHAT_ID }}
6769
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
6870
TELEGRAM_TOKEN_SECRET_NAME: ${{ vars.TELEGRAM_TOKEN_SECRET_NAME }}

constraints.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Generated: 2026-07-01
44
# Auto-updated by update-qpk-pin.yml on every push to QPK main.
55

6-
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@a9085d6d46147f62b80bbd441d19d85acaa3dda6
7-
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@635f64207a9db8dc7af51e7ad496557a57be5579
8-
hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@5fb48ea102c28deb6dd1c9674553f3c77aba4f2c
6+
quant-platform-kit @ git+https://github.com/QuantStrategyLab/QuantPlatformKit.git@d786c1140967f0e96e35599d057f0655e5a9ba25
7+
us-equity-strategies @ git+https://github.com/QuantStrategyLab/UsEquityStrategies.git@c8df5f9659340965bd7f53998892ed1018ed4254
8+
hk-equity-strategies @ git+https://github.com/QuantStrategyLab/HkEquityStrategies.git@700c8b19c46336d3d8fcba687e58553afcf0235f
99
cn-equity-strategies @ git+https://github.com/QuantStrategyLab/CnEquityStrategies.git@e09fd557c2bd9ae5f4d44228915c4e52c4b0dd21
1010
crypto-strategies @ git+https://github.com/QuantStrategyLab/CryptoStrategies.git@565be005e4186fd6d750884e7b0bc59f779f9549

scripts/cloud_run_runtime_guard.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def main() -> int:
309309
f"no successful Cloud Run request found for {', '.join(services)} in the last {lookback_minutes} minutes"
310310
)
311311

312-
if check_scheduler:
312+
if check_scheduler and scheduler_pattern:
313313
log_filter = f'resource.type="cloud_scheduler_job" AND timestamp >= "{since_text}"'
314314
try:
315315
entries = _run_gcloud_logging(project, log_filter, limit)
@@ -326,6 +326,8 @@ def main() -> int:
326326
details.extend(_summarize(entry) for entry in failures[:5])
327327
except RuntimeError as exc:
328328
issues.append(f"Cloud Scheduler log query failed: {exc}")
329+
elif check_scheduler:
330+
print("Skipping Cloud Scheduler check because no scheduler job pattern could be derived.", file=sys.stderr)
329331

330332
if not issues:
331333
service_text = ", ".join(services) if services else "<none configured>"

strategy_registry.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@
1616
from hk_equity_strategies.runtime_adapters import (
1717
describe_platform_runtime_requirements as describe_hk_platform_runtime_requirements,
1818
)
19-
from quant_us_combo_strategies import (
20-
get_platform_runtime_adapter as get_combo_runtime_adapter,
21-
get_runtime_enabled_profiles as get_combo_runtime_enabled_profiles,
22-
get_strategy_catalog as get_combo_strategy_catalog,
23-
)
24-
from quant_us_combo_strategies.runtime_adapters import (
25-
describe_platform_runtime_requirements as describe_combo_platform_runtime_requirements,
26-
)
2719

2820
from quant_platform_kit.common.strategies import (
2921
PlatformCapabilityMatrix,
@@ -43,12 +35,11 @@
4335

4436
LONGBRIDGE_PLATFORM = "longbridge"
4537
HK_EQUITY_DOMAIN = "hk_equity"
46-
COMBOS_DOMAIN = "quant_combo"
4738
TECH_COMMUNICATION_PULLBACK_PROFILE = "tech_communication_pullback_enhancement"
4839
HK_DIVIDEND_GOLD_DEFENSIVE_ROTATION_PROFILE = "hk_dividend_gold_defensive_rotation"
4940

5041
PLATFORM_SUPPORTED_DOMAINS: dict[str, frozenset[str]] = {
51-
LONGBRIDGE_PLATFORM: frozenset({US_EQUITY_DOMAIN, HK_EQUITY_DOMAIN, COMBOS_DOMAIN}),
42+
LONGBRIDGE_PLATFORM: frozenset({US_EQUITY_DOMAIN, HK_EQUITY_DOMAIN}),
5243
}
5344

5445

@@ -87,31 +78,23 @@ def _canonical_profile(profile: str | None) -> str:
8778
return STRATEGY_CATALOG.profile_aliases.get(normalized, normalized)
8879

8980

90-
COMBO_STRATEGY_PROFILES = frozenset(get_combo_strategy_catalog().definitions)
91-
92-
9381
def get_platform_runtime_adapter(profile: str | None, *, platform_id: str):
9482
canonical_profile = _canonical_profile(profile)
9583
if canonical_profile in HK_STRATEGY_PROFILES:
9684
return get_hk_platform_runtime_adapter(canonical_profile, platform_id=platform_id)
97-
if canonical_profile in COMBO_STRATEGY_PROFILES:
98-
return get_combo_runtime_adapter(canonical_profile, platform_id=platform_id)
9985
return get_us_platform_runtime_adapter(canonical_profile, platform_id=platform_id)
10086

10187

10288
def describe_platform_runtime_requirements(profile: str | None, *, platform_id: str) -> dict[str, object]:
10389
canonical_profile = _canonical_profile(profile)
10490
if canonical_profile in HK_STRATEGY_PROFILES:
10591
return describe_hk_platform_runtime_requirements(canonical_profile, platform_id=platform_id)
106-
if canonical_profile in COMBO_STRATEGY_PROFILES:
107-
return describe_combo_platform_runtime_requirements(canonical_profile, platform_id=platform_id)
10892
return describe_us_platform_runtime_requirements(canonical_profile, platform_id=platform_id)
10993

11094

11195
US_STRATEGY_CATALOG = get_us_strategy_catalog()
11296
HK_STRATEGY_CATALOG = get_hk_strategy_catalog()
113-
COMBO_STRATEGY_CATALOG = get_combo_strategy_catalog()
114-
STRATEGY_CATALOG = _merge_strategy_catalogs(US_STRATEGY_CATALOG, HK_STRATEGY_CATALOG, COMBO_STRATEGY_CATALOG)
97+
STRATEGY_CATALOG = _merge_strategy_catalogs(US_STRATEGY_CATALOG, HK_STRATEGY_CATALOG)
11598
US_STRATEGY_PROFILES = frozenset(US_STRATEGY_CATALOG.definitions)
11699
HK_STRATEGY_PROFILES = frozenset(HK_STRATEGY_CATALOG.definitions)
117100
LONGBRIDGE_EXCLUDED_LIVE_PROFILES = frozenset(
@@ -121,7 +104,7 @@ def describe_platform_runtime_requirements(profile: str | None, *, platform_id:
121104
}
122105
)
123106
LONGBRIDGE_ROLLOUT_ALLOWLIST = (
124-
get_us_runtime_enabled_profiles() | get_hk_runtime_enabled_profiles() | get_combo_runtime_enabled_profiles()
107+
get_us_runtime_enabled_profiles() | get_hk_runtime_enabled_profiles()
125108
) - LONGBRIDGE_EXCLUDED_LIVE_PROFILES
126109
PLATFORM_CAPABILITY_MATRIX = PlatformCapabilityMatrix(
127110
platform_id=LONGBRIDGE_PLATFORM,

0 commit comments

Comments
 (0)