Skip to content

Commit e77743a

Browse files
committed
Read the TensorRT pin without pip
The version step calls versions.tensorrt_version(), which imports pyyaml, so it began with `python3 -m pip install pyyaml`. That worked on the old VM runner. The job now runs in a container, and the image it has to use ships python3 without pip: /usr/bin/python3: No module named pip Swapping to the manylinux builder image, which does have pip, is not open to us: docker/login-action shells out to the docker CLI, and docker-build-remote-buildkit runs `docker buildx build`, so the container needs docker. The builder images have python and pip but no docker; actions-runner has docker but no pip. No single image has both. So drop the dependency instead of trying to satisfy it. versions.py wants pyyaml only to read dev_dep_versions.yml, and that file is flat `key: "value"`, so one sed reads the pin with nothing installed. It fails loudly if the key ever moves, rather than passing an empty build arg. Authored with Claude Code.
1 parent 88792ab commit e77743a

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎.github/workflows/docker_builder.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ jobs:
3232
# streams the build context and waits.
3333
runs-on: mt-l-x86iavx512-16-128
3434
container:
35+
# Needs the docker CLI: docker/login-action shells out to it, and
36+
# docker-build-remote-buildkit runs `docker buildx build`. The
37+
# manylinux builder images have python and pip but no docker, so they
38+
# cannot host this job.
3539
image: ghcr.io/actions/actions-runner:latest
3640

3741
# Define key environment variables
@@ -60,10 +64,10 @@ jobs:
6064
# Automatically detect TensorRT default versions for Torch-TRT build
6165
- name: Detect the TensorRT version
6266
id: trt
63-
# Read the pin straight out of the yaml rather than through versions.py.
64-
# That module imports pyyaml, and the runner image has python3 but no
65-
# pip, so `python3 -m pip install pyyaml` fails with "No module named
66-
# pip". The file is flat `key: "value"`, so one sed needs nothing at all.
67+
# Read the pin out of the yaml rather than through versions.py, which
68+
# imports pyyaml: this image has python3 but no pip, and it is the one
69+
# image that has the docker CLI the build needs. The file is flat
70+
# `key: "value"`, so sed needs nothing installed.
6771
run: |
6872
set -euo pipefail
6973
TRT_VERSION=$(sed -n 's/^__tensorrt_version__: *"\{0,1\}\([^"]*\)"\{0,1\}.*/\1/p' dev_dep_versions.yml)

0 commit comments

Comments
 (0)