From ae2af637adff27cbe5b56628c8c43b38f48a39f4 Mon Sep 17 00:00:00 2001 From: EJClaw Date: Thu, 15 Oct 2026 03:46:49 +0900 Subject: [PATCH] =?UTF-8?q?M5:=20Windows=20=EC=97=90=EC=84=9C=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=B8=ED=8A=9C=EB=8B=9D=20=EC=9E=90=EC=8B=9D=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=EC=84=B8=EC=8A=A4=EA=B0=80=20=EB=A9=88=EC=B6=94?= =?UTF-8?q?=EB=8D=98=20=EB=AC=B8=EC=A0=9C,=20win-ci=20npm=20=ED=98=B8?= =?UTF-8?q?=EC=B6=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 워커가 띄우는 자식(finetune/run.py, nvidia-smi)에 stdin 을 물려주지 않는다 (요청 파이프 상속 → 시작 단계에서 멈춤) - win-ci: PowerShell 파이프라인 안에서 npm.ps1 이 인자를 잘못 읽어 'Unknown command: pm' → npm.cmd 로 호출 Co-Authored-By: Claude Opus 5.5 --- tools/win-ci/gvr.ps1 | 4 ++-- worker/gvr_worker/gpu.py | 3 ++- worker/gvr_worker/main.py | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/win-ci/gvr.ps1 b/tools/win-ci/gvr.ps1 index 1e8f5bb..10e91ac 100644 --- a/tools/win-ci/gvr.ps1 +++ b/tools/win-ci/gvr.ps1 @@ -129,9 +129,9 @@ try { if ($Phase -eq 'full') { $r['app_build'] = Step 'app_build' { Push-Location (Join-Path $Repo 'app') - & npm ci --no-audit --no-fund + & npm.cmd ci --no-audit --no-fund if ($LASTEXITCODE -ne 0) { Pop-Location; throw "npm ci exit $LASTEXITCODE" } - & npm run dist:win + & npm.cmd run dist:win $c = $LASTEXITCODE Pop-Location if ($c -ne 0) { throw "electron-builder exit $c" } diff --git a/worker/gvr_worker/gpu.py b/worker/gvr_worker/gpu.py index b519166..455cf3d 100644 --- a/worker/gvr_worker/gpu.py +++ b/worker/gvr_worker/gpu.py @@ -68,7 +68,8 @@ def _run_smi(args: list[str]) -> str | None: return None try: flags = getattr(subprocess, "CREATE_NO_WINDOW", 0) - out = subprocess.run([exe, *args], capture_output=True, text=True, timeout=10, creationflags=flags) + out = subprocess.run([exe, *args], stdin=subprocess.DEVNULL, capture_output=True, text=True, timeout=10, + creationflags=flags) # stdin 을 물려주지 않는다 (main.run_finetune 참고) except (OSError, subprocess.TimeoutExpired) as e: log.info("nvidia-smi 실행 실패: %s", e) return None diff --git a/worker/gvr_worker/main.py b/worker/gvr_worker/main.py index ba6dcf0..5c371e8 100644 --- a/worker/gvr_worker/main.py +++ b/worker/gvr_worker/main.py @@ -148,7 +148,9 @@ def run_finetune(req: dict[str, Any], ctx: Context) -> dict[str, Any]: elif v not in (None, False): cmd += [flag, str(v)] flags = getattr(subprocess, "CREATE_NO_WINDOW", 0) - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="utf-8", + # stdin 은 꼭 끊는다. 워커 stdin(요청 파이프)을 물려받으면 Windows 에서 자식의 런타임 초기화(GetFileType)가 + # 주 스레드의 읽기 대기와 엉켜 자식이 시작조차 못 하고 멈춘다 (win-ci: train 요청 120초 응답 없음). + proc = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="utf-8", errors="replace", creationflags=flags, env={**os.environ, "PYTHONIOENCODING": "utf-8"}) err_tail: deque[str] = deque(maxlen=30)