feat: establish Quant OS production-80 architecture

This commit is contained in:
2026-07-30 22:59:25 +08:00
parent 919c64c679
commit 26cc814f3f
67 changed files with 7005 additions and 142 deletions
+14 -5
View File
@@ -45,8 +45,9 @@
"import shutil\n",
"import subprocess\n",
"import sys\n",
"import tempfile\n",
"\n",
"REPO_URL = \"https://git.gomars.fun/boat/quants-strategies.git\"\n",
"REPO_URL = \"https://git.gomars.fun/boat/quant-os.git\"\n",
"REPO_BRANCH = \"master\"\n",
"\n",
"def run(command, *, env=None):\n",
@@ -54,19 +55,23 @@
" subprocess.run(command, check=True, env=env)\n",
"\n",
"cwd = Path.cwd().resolve()\n",
"if cwd.name == \"quant-os\" and (cwd / \"pyproject.toml\").is_file():\n",
"if (cwd / \"pyproject.toml\").is_file() and (cwd / \"src\" / \"quant60\").is_dir():\n",
" project = cwd\n",
"elif (cwd / \"quant-os\" / \"pyproject.toml\").is_file():\n",
" project = cwd / \"quant-os\"\n",
"else:\n",
" checkout = Path(\"/content/quants-strategies\")\n",
" checkout = Path(\"/content/quant-os\")\n",
" if not checkout.exists():\n",
" run([\"git\", \"clone\", \"--depth\", \"1\", \"--branch\", REPO_BRANCH, REPO_URL, str(checkout)])\n",
" project = checkout / \"quant-os\"\n",
" project = checkout\n",
"\n",
"if not (project / \"pyproject.toml\").is_file():\n",
" raise RuntimeError(f\"Quant OS project not found at {project}\")\n",
"os.chdir(project)\n",
"cache_root = Path(tempfile.gettempdir()) / \"quant-os-notebook-cache\"\n",
"cache_root.mkdir(parents=True, exist_ok=True)\n",
"os.environ.setdefault(\"MPLCONFIGDIR\", str(cache_root / \"matplotlib\"))\n",
"os.environ.setdefault(\"XDG_CACHE_HOME\", str(cache_root / \"xdg\"))\n",
"print({\"project\": str(project), \"python\": sys.version})"
]
},
@@ -114,7 +119,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"optional"
]
},
"outputs": [],
"source": [
"equity = json.loads(Path(\"artifacts/colab-smoke/equity.json\").read_text(encoding=\"utf-8\"))\n",