fix(build): 回退qwen3_6_scripts+ex_engine到26e6cb40(能得分版本)
唯一改动: computility-run.yaml max_model_len 80000→100000 26e6cb40是Sub520能在竞赛平台docker build成功并得分的版本 之后所有commit都导致docker build失败 根因: 新增的65个文件(vendor_overrides/prebuilt/*.so/wheels等) 可能触发了竞赛平台docker build的某个限制 本次回退: - qwen3_6_scripts/: 110→45文件(删掉65个新增文件) - ex_engine/: 恢复到26e6cb40完全一致 - Dockerfile: 恢复5个RUN步骤结构(已验证能build) - computility-run.yaml: max_model_len=100000(避免replay 400拒绝)
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import pathlib
|
||||
import shlex
|
||||
from typing import Iterable, Optional, Sequence, Tuple
|
||||
|
||||
|
||||
def package_root(pkg: str) -> pathlib.Path:
|
||||
spec = importlib.util.find_spec(pkg)
|
||||
if spec is None:
|
||||
raise RuntimeError(f"package not found: {pkg}")
|
||||
if not spec.submodule_search_locations:
|
||||
raise RuntimeError(f"package has no package root: {pkg}")
|
||||
return pathlib.Path(next(iter(spec.submodule_search_locations))).resolve()
|
||||
|
||||
|
||||
def ensure_file(path: pathlib.Path) -> pathlib.Path:
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(str(path))
|
||||
return path
|
||||
|
||||
|
||||
def ensure_dir(path: pathlib.Path) -> pathlib.Path:
|
||||
if not path.is_dir():
|
||||
raise FileNotFoundError(str(path))
|
||||
return path
|
||||
|
||||
|
||||
def replace_once(path: pathlib.Path,
|
||||
old: str,
|
||||
new: str,
|
||||
*,
|
||||
required: bool = True,
|
||||
already_contains: Optional[str] = None) -> bool:
|
||||
path = ensure_file(path)
|
||||
text = path.read_text()
|
||||
marker = already_contains if already_contains is not None else new
|
||||
if marker in text:
|
||||
print(f"[skip] already patched: {path}")
|
||||
return False
|
||||
if old not in text:
|
||||
msg = f"anchor not found in {path}: {old[:120]!r}"
|
||||
if required:
|
||||
raise RuntimeError(msg)
|
||||
print(f"[warn] {msg}")
|
||||
return False
|
||||
path.write_text(text.replace(old, new, 1))
|
||||
print(f"[ok] patched: {path}")
|
||||
return True
|
||||
|
||||
|
||||
def replace_one_of(path: pathlib.Path,
|
||||
replacements: Sequence[Tuple[str, str]],
|
||||
*,
|
||||
required: bool = True,
|
||||
already_contains: Optional[str] = None) -> bool:
|
||||
path = ensure_file(path)
|
||||
text = path.read_text()
|
||||
if already_contains is not None and already_contains in text:
|
||||
print(f"[skip] already patched: {path}")
|
||||
return False
|
||||
for _, new in replacements:
|
||||
if new in text:
|
||||
print(f"[skip] already patched: {path}")
|
||||
return False
|
||||
for old, new in replacements:
|
||||
if old in text:
|
||||
path.write_text(text.replace(old, new, 1))
|
||||
print(f"[ok] patched: {path}")
|
||||
return True
|
||||
anchors = ", ".join(repr(old[:80]) for old, _ in replacements)
|
||||
msg = f"anchor not found in {path}; tried: {anchors}"
|
||||
if required:
|
||||
raise RuntimeError(msg)
|
||||
print(f"[warn] {msg}")
|
||||
return False
|
||||
|
||||
|
||||
def shell_env_line(name: str, value: pathlib.Path) -> str:
|
||||
return f"{name}={shlex.quote(str(value))}"
|
||||
Reference in New Issue
Block a user