ripe-magazine-21370
04/07/2025, 10:34 PMdeps.pex/srcs.pex and running PEXTOOLS with venv --compile . Is this expected and due to the venv-ification? Compared to our baseline of pip install -r requirements.txt , image sizes are going from ~9gb to ~12gbripe-magazine-21370
04/07/2025, 10:36 PMFROM vllm/vllm-openai:v0.7.3 as deps
COPY xyz/serve-deps.pex /serve-deps.pex
RUN PEX_TOOLS=1 /usr/bin/python3.12 /serve-deps.pex venv --collisions-ok --scope=deps --compile /bin/app
FROM vllm/vllm-openai:v0.7.3 as srcs
COPY xyz/serve-srcs.pex /serve-srcs.pex
RUN PEX_TOOLS=1 /usr/bin/python3.12 /serve-srcs.pex venv --collisions-ok --scope=srcs --compile /bin/app
FROM vllm/vllm-openai:v0.7.3
RUN apt-get update -y && apt-get install -y awscli
COPY --from=deps /bin/app /bin/app
COPY --from=srcs /bin/app /bin/app
COPY xyz/get_ckpt_and_start.sh /bin/app/get_ckpt_and_start.sh
# RUN pip install --no-cache-dir .
EXPOSE 8000
ENTRYPOINT ["/usr/bin/env"]
CMD ["/bin/app/get_ckpt_and_start.sh"]wide-midnight-78598
04/07/2025, 11:33 PMwide-midnight-78598
04/07/2025, 11:58 PMripe-magazine-21370
04/07/2025, 11:59 PMdocker_image(
name="docker",
dependencies=[":get_ckpt_and_start"],
registries=["@aws_ecr"],
repository="xyz",
image_tags=["{build_args.GIT_COMMIT}"]
)wide-midnight-78598
04/08/2025, 12:25 AMcurved-manchester-66006
04/08/2025, 8:26 PMCOPY xyz/serve-deps.pex /serve-deps.pexTo reduce size when all you want is a venv at the end you can do something like
RUN --mount=type=bind,target=/tmp/bound.pex,source=$PEX_FILE,ro instead of copyingwide-midnight-78598
04/08/2025, 8:27 PMbrief-engine-92399
04/09/2025, 4:01 AMbrief-engine-92399
04/09/2025, 4:02 AMripe-magazine-21370
04/09/2025, 3:20 PMbrief-engine-92399
04/09/2025, 3:21 PMbrief-engine-92399
04/09/2025, 3:21 PM