File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,29 @@ jobs:
114114 echo "${NVIDIA_API_KEY}" | docker login nvcr.io -u '$oauthtoken' --password-stdin
115115 echo "✅ Docker authenticated to nvcr.io"
116116
117+ # Inject NGC_API_KEY for llm-nim (CI only; keeps deploy/compose/docker-compose.dev.yaml unchanged in repo)
118+ - name : " Patch docker-compose.dev.yaml (llm-nim NGC_API_KEY)"
119+ run : |
120+ python3 <<'PY'
121+ from pathlib import Path
122+ path = Path("deploy/compose/docker-compose.dev.yaml")
123+ text = path.read_text()
124+ # Use $$ in workflow YAML so the runner passes a single $ to Python (compose variable syntax)
125+ anchor = " - NVIDIA_API_KEY=$${NVIDIA_API_KEY:-}\n - CUDA_VISIBLE_DEVICES"
126+ insert = (
127+ " - NVIDIA_API_KEY=$${NVIDIA_API_KEY:-}\n"
128+ " - NGC_API_KEY=$${NVIDIA_API_KEY:-}\n"
129+ " - CUDA_VISIBLE_DEVICES"
130+ )
131+ if "NGC_API_KEY" in text:
132+ print("NGC_API_KEY already present; skipping patch")
133+ elif anchor not in text:
134+ raise SystemExit("patch anchor not found in docker-compose.dev.yaml (llm-nim environment)")
135+ else:
136+ path.write_text(text.replace(anchor, insert, 1))
137+ print("Patched llm-nim: NGC_API_KEY=$${NVIDIA_API_KEY:-}")
138+ PY
139+
117140 # Step 5: Start infrastructure services
118141 - name : " Step 5: Start infrastructure services"
119142 run : |
You can’t perform that action at this time.
0 commit comments