Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Installation]: Container image do not build Dockerfile.cpu #8502

Closed
1 task done
axel7083 opened this issue Sep 16, 2024 · 3 comments · Fixed by #8540
Closed
1 task done

[Installation]: Container image do not build Dockerfile.cpu #8502

axel7083 opened this issue Sep 16, 2024 · 3 comments · Fixed by #8540
Labels
installation Installation problems

Comments

@axel7083
Copy link

axel7083 commented Sep 16, 2024

Your current environment

$: podman -v
podman version 5.2.2

How you are installing vllm

$: podman build -f Dockerfile.cpu -t vllm-cpu-env --shm-size=4g .
...
Error: building at STEP "RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt pip install --upgrade pip &&     pip install -r requirements-build.txt": resolving mountpoints for container "3a97f46183fa64e10c96f20f9a38a5ed46d2e9e7c4e7bbfbce6fa1adfdacd66e": invalid container path "requirements-build.txt", must be an absolute path

We can see that in the Dockerfile.cpu we are mounting the requirement-*.txt files

--mount=type=bind,src=requirements-build.txt,target=requirements-build.txt \

--mount=type=bind,src=requirements-common.txt,target=requirements-common.txt \

--mount=type=bind,src=requirements-cpu.txt,target=requirements-cpu.txt \

And while they are mounted, no absolute path is provided, leading to the error above.

Solution proposal

+ COPY requirements-build.txt requirements-build.txt
RUN --mount=type=cache,target=/root/.cache/pip \
-    --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt \
    pip install --upgrade pip && \
    pip install -r requirements-build.txt

OR

+ WORKDIR /
RUN --mount=type=cache,target=/root/.cache/pip \
    --mount=type=bind,src=requirements-build.txt,target=requirements-build.txt \
    pip install --upgrade pip && \
    pip install -r requirements-build.txt

According to containers/buildah#4309 a WORKDIR must be defined to use a relative path for target. I opened an issue on the buildah side to have more information containers/buildah#5738

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@axel7083 axel7083 added the installation Installation problems label Sep 16, 2024
@simon-mo
Copy link
Collaborator

The file was written against DOCKER_BUILDKIT=1 in mind, does podman support this?

@axel7083
Copy link
Author

I would probably say it does, but as I do not work on buildah and don't have extensive knowledge on his capabilities I can't say. The problem here seems to really be a sidecase, as the target=requirements-build.txt is a relative path, and in most places this is not an issue, but apparently buildah do not support this without defining the WORKDIR.

I opened containers/buildah#5738 to draw some attention from the buildah team. (podman uses buildah to build the images).

dtrifiro added a commit to dtrifiro/vllm that referenced this issue Sep 17, 2024
podman does not like RUN --mount with relative paths
when WORKDIR is not set.

fixes vllm-project#8502
@dtrifiro
Copy link
Contributor

This can be fixed by setting WORKDIR before running the command: fixed in #8540

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Installation problems
Projects
None yet
3 participants