yashash04 commited on
Commit
cffbfce
Β·
1 Parent(s): 85b09ec

Phase M-prep fix: drop --system from uv pip install (UV-venv vs system-Python mismatch)

Browse files

Stage 2 [4/7] failed with ModuleNotFoundError on devops_pipeline_gym
during uvicorn boot. Root cause: --system flag installed the package
into /usr/local/lib/python3.12/site-packages, but the wrapper script
runs inside a UV-managed venv at /root/.cache/uv/environments-v2/.../,
and sys.executable points to the venv Python. Install destination
and runtime Python were different β€” package was 'installed' but not
visible to subprocess calls.

Fix: remove --system. uv pip install (without flag) defaults to the
active venv, which is the UV venv sys.executable belongs to. Install
target = runtime target, package becomes importable.

Affects both phase_m_sft_job.py and phase_m_grpo_job.py.

Note: SFT Stage 1 worked despite this same bug because
training/sft_warmup.py imports from devops_pipeline_gym only AFTER
the model is loaded β€” but server/app.py imports it at module scope,
before any function call, so uvicorn's import machinery hits the
missing package immediately.

scripts/phase_m_grpo_job.py CHANGED
@@ -46,7 +46,7 @@ os.chdir(WORKDIR)
46
  # Step 2: Install package (UV envs don't ship pip β€” use UV's resolver)
47
  print("[2/7] Installing devops-pipeline-gym package...", flush=True)
48
  subprocess.run(
49
- ["uv", "pip", "install", "--system", "-e", ".", "--quiet"],
50
  check=True,
51
  )
52
 
 
46
  # Step 2: Install package (UV envs don't ship pip β€” use UV's resolver)
47
  print("[2/7] Installing devops-pipeline-gym package...", flush=True)
48
  subprocess.run(
49
+ ["uv", "pip", "install", "-e", ".", "--quiet"],
50
  check=True,
51
  )
52
 
scripts/phase_m_sft_job.py CHANGED
@@ -40,7 +40,7 @@ os.chdir(WORKDIR)
40
  # Step 2: Install local package (UV envs don't ship pip β€” use UV's resolver)
41
  print("[2/5] Installing devops-pipeline-gym package...", flush=True)
42
  subprocess.run(
43
- ["uv", "pip", "install", "--system", "-e", ".", "--quiet"],
44
  check=True,
45
  )
46
 
 
40
  # Step 2: Install local package (UV envs don't ship pip β€” use UV's resolver)
41
  print("[2/5] Installing devops-pipeline-gym package...", flush=True)
42
  subprocess.run(
43
+ ["uv", "pip", "install", "-e", ".", "--quiet"],
44
  check=True,
45
  )
46