[CI/Bugfix] Fix empty vllm_omni stub breaking stage CLI imports after Docker cache (#5338) (#5341)

Signed-off-by: wangyu <410167048@qq.com>
This commit is contained in:
wangyu authored and GitHub committed 2026-07-23 14:15:52 +00:00
1 parent f72b38184b
commit e9a06d5bdc
2 files changed
+15 -15

No files matched your search

+11 -14
View File
@@ -15,10 +15,10 @@ WORKDIR ${APP_DIR}
RUN ln -sf /usr/bin/python3 /usr/bin/python RUN ln -sf /usr/bin/python3 /usr/bin/python
# Create a vllm_omni dir so that we can install the python package # Placeholder package tree so editable install can register APP_DIR.
# without failing to write the version files; we'll copy over it # The final stage COPY --link fills this directory with the real sources;
# after installing # the editable .pth / egg-link keeps resolving imports there — no PYTHONPATH.
RUN mkdir -p vllm_omni RUN mkdir -p vllm_omni && touch vllm_omni/__init__.py
# Install system dependencies # Install system dependencies
RUN apt-get update && \ RUN apt-get update && \
@@ -32,7 +32,11 @@ RUN apt-get update && \
COPY pyproject.toml setup.py ./ COPY pyproject.toml setup.py ./
COPY requirements/ requirements/ COPY requirements/ requirements/
ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 ENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0
RUN uv pip install --system ".[dev]" # Editable install: deps + project metadata are cached in this layer, while
# the package itself is linked to APP_DIR (populated later by COPY --link).
# Do NOT use a non-editable install here — that copies an empty stub into
# site-packages and breaks ``import vllm_omni.entrypoints``.
RUN uv pip install --system -e ".[dev]"
# The final stage just copies the working dir on top of the # The final stage just copies the working dir on top of the
# dependencies image. This uses --link so that we can skip # dependencies image. This uses --link so that we can skip
@@ -40,17 +44,10 @@ RUN uv pip install --system ".[dev]"
# #
# IMPORTANT: Do not make any modifications that depend on the # IMPORTANT: Do not make any modifications that depend on the
# file system after the --link copy, otherwise we'd need to pull # file system after the --link copy, otherwise we'd need to pull
# the heavy base image to build it. This is the reason we copy # the heavy base image to build it. Editable install above already
# link & update the pythonpath to point at the copied code instead # registered APP_DIR, so we must not re-pip-install after COPY.
# of running a new pip install on it.
FROM deps FROM deps
ARG APP_DIR=/workspace/vllm-omni ARG APP_DIR=/workspace/vllm-omni
# Add APP_DIR to the pythonpath, since the entrypoint stub
# that was installed in the earlier step must point at the copied code.
#
# NOTE: this will probably warn about undefined vars, but is expected.
# See: https://github.com/docker/buildx/issues/2751
ENV PYTHONPATH=${APP_DIR}${PYTHONPATH:+:${PYTHONPATH}}
WORKDIR ${APP_DIR} WORKDIR ${APP_DIR}
COPY --link . . COPY --link . .
+4 -1
View File
@@ -638,7 +638,10 @@ class OmniServerStageCli(OmniServer):
proc = subprocess.Popen( proc = subprocess.Popen(
cmd, cmd,
env=env, env=env,
cwd=os.path.dirname(os.path.dirname(os.path.abspath(__file__))), # Must be repo root (not tests/): after Docker deps-cache installs an empty
# vllm_omni stub into site-packages, cwd on sys.path[0] is what makes
# ``python -m vllm_omni.entrypoints...`` resolve the real package.
cwd=_omni_subprocess_cwd(),
stdout=log_fh, stdout=log_fh,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
) )