From 30bff67b290c481300741a94852644051645f4dd Mon Sep 17 00:00:00 2001 From: gs-olive <113141689+gs-olive@users.noreply.github.com> Date: Fri, 7 Jul 2023 10:38:56 -0700 Subject: [PATCH] fix: Add python3 symlink in final container - Enable libtorch finding from WORKSPACE file in Docker container --- docker/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 612fe042a4..d16dfc1887 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -94,6 +94,11 @@ RUN bash ./docker/dist-build.sh FROM base as torch-tensorrt COPY . /opt/torch_tensorrt + +# Symlink the path pyenv is using for python with the /opt directory for package sourcing +RUN mkdir -p "/opt/python3/" &&\ + ln -s "`pyenv which python | xargs dirname | xargs dirname`/lib/python$PYTHON_VERSION/site-packages" "/opt/python3/" + COPY --from=torch-tensorrt-builder /workspace/torch_tensorrt/src/py/dist/ . RUN cp /opt/torch_tensorrt/docker/WORKSPACE.docker /opt/torch_tensorrt/WORKSPACE