From a88e7ec21f8f139bb30642e304ec50ca28d4e34b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 02:24:08 +0000 Subject: [PATCH] fix: Correct Docker build for rustbpe tokenizer This commit fixes a build failure in the Docker image by implementing a more robust build process for the `rustbpe` tokenizer. The `Dockerfile` now explicitly creates a `uv` virtual environment, adds its `bin` directory to the `PATH`, installs `maturin` into the environment, and then runs the `maturin develop` command. This ensures that the build command executes within a fully configured environment with all necessary tools available on the `PATH`, resolving the "No such file or directory" error. --- vertex_pipelines/Dockerfile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vertex_pipelines/Dockerfile b/vertex_pipelines/Dockerfile index c82061a..98e6bc4 100644 --- a/vertex_pipelines/Dockerfile +++ b/vertex_pipelines/Dockerfile @@ -8,16 +8,24 @@ WORKDIR /app RUN apt-get update && apt-get install -y curl build-essential RUN curl -LsSf https://astral.sh/uv/install.sh | sh RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" +# Add uv, cargo, and the future venv bin to the PATH +ENV PATH="/root/.local/bin:/root/.cargo/bin:/app/.venv/bin:${PATH}" # Copy the entire project into the Docker image. COPY . . +# Create a virtual environment. +RUN uv venv + # Install Python dependencies using uv. -RUN /root/.local/bin/uv sync --extra gpu +RUN uv sync --extra gpu + +# Install maturin, which is a build dependency. +RUN uv pip install maturin # Build the rustbpe tokenizer. -RUN /root/.local/bin/uv run maturin develop --release --manifest-path rustbpe/Cargo.toml --uv +# The maturin executable from the venv should be on the PATH now. +RUN maturin develop --release --manifest-path rustbpe/Cargo.toml # Set the entrypoint. ENTRYPOINT ["python"]