File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,5 +38,5 @@ ORDER_POLL_MAX_ATTEMPTS=36
3838
3939# ── Execution Report ──
4040EXECUTION_REPORT_OUTPUT_DIR = /tmp/quant_runtime_reports
41- EXECUTION_REPORT_GCS_URI = gs://qsl-runtime-logs-shared /execution-reports
41+ EXECUTION_REPORT_GCS_URI = gs://your-bucket /execution-reports
4242QSL_EXECUTION_REPORT_GCS_URI =
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ gh workflow run build-hk-low-vol-snapshot-artifacts.yml \
108108 -f execute_publish=false
109109```
110110
111- 如果生成结果通过校验,并确认目标 bucket 可由 HK Cloud Run runtime service account 读取 ,可以发布到 GCS:
111+ 如果生成结果通过校验,并确认 workflow 使用的 publisher/deploy service account 对自定义目标 bucket 具备所需对象写权限,同时 HK Cloud Run runtime service account 具备读取权限 ,可以发布到 GCS:
112112
113113``` bash
114114gh workflow run build-hk-low-vol-snapshot-artifacts.yml \
@@ -117,7 +117,7 @@ gh workflow run build-hk-low-vol-snapshot-artifacts.yml \
117117 -f profile=hk_low_vol_dividend_quality_snapshot \
118118 -f data_source_mode=public_yfinance_staging \
119119 -f allow_research_defaults=false \
120- -f gcs_prefix=gs://qsl-runtime-logs-shared /strategy-artifacts/hk_equity/hk_low_vol_dividend_quality_snapshot \
120+ -f gcs_prefix=gs://your-bucket /strategy-artifacts/hk_equity/hk_low_vol_dividend_quality_snapshot \
121121 -f execute_publish=true
122122```
123123
@@ -126,8 +126,8 @@ gh workflow run build-hk-low-vol-snapshot-artifacts.yml \
126126``` bash
127127STRATEGY_PROFILE=hk_low_vol_dividend_quality_snapshot
128128LONGBRIDGE_DRY_RUN_ONLY=true
129- LONGBRIDGE_FEATURE_SNAPSHOT_PATH=gs://qsl-runtime-logs-shared /strategy-artifacts/hk_equity/hk_low_vol_dividend_quality_snapshot/hk_low_vol_dividend_quality_snapshot_factor_snapshot_latest.csv
130- LONGBRIDGE_FEATURE_SNAPSHOT_MANIFEST_PATH=gs://qsl-runtime-logs-shared /strategy-artifacts/hk_equity/hk_low_vol_dividend_quality_snapshot/hk_low_vol_dividend_quality_snapshot_factor_snapshot_latest.csv.manifest.json
129+ LONGBRIDGE_FEATURE_SNAPSHOT_PATH=gs://your-bucket /strategy-artifacts/hk_equity/hk_low_vol_dividend_quality_snapshot/hk_low_vol_dividend_quality_snapshot_factor_snapshot_latest.csv
130+ LONGBRIDGE_FEATURE_SNAPSHOT_MANIFEST_PATH=gs://your-bucket /strategy-artifacts/hk_equity/hk_low_vol_dividend_quality_snapshot/hk_low_vol_dividend_quality_snapshot_factor_snapshot_latest.csv.manifest.json
131131```
132132
133133注意:` allow_research_defaults=true ` 只允许做研究 smoke,不允许发布到 GCS,也不能作为 live-enable 证据。public yfinance 数据源用于让 snapshot artifact 生成和券商执行解耦;它仍需要按策略证据包记录数据源、生成时间和 broker dry-run 结果。
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+ import re
3+ from urllib .parse import urlparse
4+
5+
6+ REPOSITORY_ROOT = Path (__file__ ).resolve ().parents [1 ]
7+ PUBLIC_CONFIG_FILES = (
8+ REPOSITORY_ROOT / ".env.example" ,
9+ REPOSITORY_ROOT / "docs" / "hk_equity_runtime.md" ,
10+ )
11+
12+
13+ def test_public_gcs_examples_use_portable_bucket_placeholders ():
14+ observed = 0
15+
16+ for path in PUBLIC_CONFIG_FILES :
17+ for line_number , line in enumerate (
18+ path .read_text (encoding = "utf-8" ).splitlines (), start = 1
19+ ):
20+ for uri in re .findall (r"gs://[^\s`\"']+" , line ):
21+ parsed = urlparse (uri .rstrip ("\\ " ))
22+ observed += 1
23+
24+ assert parsed .scheme == "gs"
25+ assert parsed .path not in {"" , "/" }
26+ assert parsed .netloc == "your-bucket" or (
27+ parsed .netloc .startswith ("<" ) and parsed .netloc .endswith (">" )
28+ ), f"{ path .name } :{ line_number } uses a deployment-specific GCS bucket"
29+
30+ assert observed == 6
31+
32+
33+ def test_snapshot_publish_prerequisites_cover_writer_and_runtime_reader ():
34+ runtime_doc = (
35+ REPOSITORY_ROOT / "docs" / "hk_equity_runtime.md"
36+ ).read_text (encoding = "utf-8" )
37+
38+ assert "publisher/deploy service account 对自定义目标 bucket 具备所需对象写权限" in runtime_doc
39+ assert "runtime service account 具备读取权限" in runtime_doc
You can’t perform that action at this time.
0 commit comments