From 215cbdf7a408384cf0f7db9b7a301dccba282778 Mon Sep 17 00:00:00 2001 From: Simo Lin <25425177+slin1237@users.noreply.github.com> Date: Thu, 11 Jun 2026 09:20:03 -0700 Subject: [PATCH] fix(docker): shadow distro-owned PyYAML on TRT-LLM bases before smg install The SMG+TRTLLM image build fails on the NGC 1.3.0rc18 base: it ships a debian-installed PyYAML 6.0.1 without a pip RECORD file, and the smg wheel install (--force-reinstall, dependency set includes pyyaml) dies with "uninstall-no-record-file" when pip tries to remove it. Pre-install a pip-managed PyYAML with --ignore-installed, scoped to ENGINE=trtllm: the fresh copy shadows the distro one on sys.path and in pip's metadata view, so install-smg.sh can upgrade pyyaml through its normal uninstall/reinstall path. The sglang/vllm/tgl builds keep their exact pip behavior. Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com> --- docker/engine.Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/engine.Dockerfile b/docker/engine.Dockerfile index 412da8ab0e..d531ede9a2 100644 --- a/docker/engine.Dockerfile +++ b/docker/engine.Dockerfile @@ -56,6 +56,16 @@ COPY --from=sources /opt/engine-src /opt/engine-src COPY --from=sources /tmp/smg-src /opt/smg-src COPY --from=sources /tmp/scripts/ /tmp/scripts/ +# NGC TRT-LLM bases (1.3.0rc18) ship a debian-owned PyYAML with no pip RECORD +# file, which pip refuses to uninstall when install-smg.sh resolves smg's +# pyyaml dependency ("uninstall-no-record-file"). Shadow it with a pip-managed +# copy (--ignore-installed leaves the distro files alone); the smg install can +# then upgrade pyyaml normally. Scoped to trtllm so the other engine bases +# keep their exact pip behavior. +RUN if [ "${ENGINE}" = "trtllm" ]; then \ + pip install --no-cache-dir --ignore-installed pyyaml; \ + fi + RUN bash /tmp/scripts/install-smg.sh /opt/smg-src RUN case "${ENGINE}" in \