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

How to properly build the cuda.dockerfile #902

Closed
themantalope opened this issue Mar 31, 2023 · 3 comments
Closed

How to properly build the cuda.dockerfile #902

themantalope opened this issue Mar 31, 2023 · 3 comments

Comments

@themantalope
Copy link

Getting an error when trying to build locally:

docker build . -f Dockerfiles/cuda.Dockerfile --tag clipasservice:latest
[+] Building 2.1s (11/12)                                                                                                                                                                                          
 => [internal] load build definition from cuda.Dockerfile                                                                                                                                                     0.0s
 => => transferring dockerfile: 1.64kB                                                                                                                                                                        0.0s
 => [internal] load .dockerignore                                                                                                                                                                             0.0s
 => => transferring context: 65B                                                                                                                                                                              0.0s
 => [internal] load metadata for nvcr.io/nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04                                                                                                                        0.9s
 => [1/8] FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04@sha256:383fa307b6c341d937cefe7db3d4fdf17ce7e8daf195259fe709da9ba169545f                                                                  0.0s
 => [internal] load build context                                                                                                                                                                             0.0s
 => => transferring context: 3.19kB                                                                                                                                                                           0.0s
 => CACHED [2/8] RUN apt-get update && apt-get install -y --no-install-recommends     python3-setuptools python3-wheel python3-pip     && apt-get clean && rm -rf /var/lib/apt/lists/*;                       0.0s
 => CACHED [3/8] RUN python3 -m pip install --default-timeout=1000 --no-cache-dir torch torchvision torchaudio nvidia-pyindex transformers --extra-index-url https://download.pytorch.org/whl/cu113           0.0s
 => CACHED [4/8] RUN python3 -m pip install --default-timeout=1000 --no-cache-dir "jina[standard]==3.11.0"                                                                                                    0.0s
 => CACHED [5/8] COPY . /cas/                                                                                                                                                                                 0.0s
 => CACHED [6/8] WORKDIR /cas                                                                                                                                                                                 0.0s
 => ERROR [7/8] RUN if [ "torch" != "torch" ]; then python3 -m pip install --no-cache-dir "./[torch]" ; fi     && python3 -m pip install --no-cache-dir .                                                     1.1s
------
 > [7/8] RUN if [ "torch" != "torch" ]; then python3 -m pip install --no-cache-dir "./[torch]" ; fi     && python3 -m pip install --no-cache-dir .:
#0 1.053 ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
------
cuda.Dockerfile:30
--------------------
  29 |     
  30 | >>> RUN if [ "${BACKEND_TAG}" != "torch" ]; then python3 -m pip install --no-cache-dir "./[${BACKEND_TAG}]" ; fi \
  31 | >>>     && python3 -m pip install --no-cache-dir .
  32 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c if [ \"${BACKEND_TAG}\" != \"torch\" ]; then python3 -m pip install --no-cache-dir \"./[${BACKEND_TAG}]\" ; fi     && python3 -m pip install --no-cache-dir ." did not complete successfully: exit code: 1
@ZiniuYu
Copy link
Member

ZiniuYu commented Apr 4, 2023

Hi @themantalope ,

Can you do cp Dockerfiles/cuda.Dockerfile server/Dockerfile and go from there?

@themantalope
Copy link
Author

themantalope commented Apr 4, 2023

Yep it works, as long as you are in the server directory. Don't need to copy the Dockerfiles. Seems like the server dir is the correct build context

cd server
docker build . -f ../Dockerfiles/cuda.Dockerfile -t clip-as-service-gpu:latest

I put in a PR with updated readme.

@hem9984
Copy link

hem9984 commented Jul 23, 2024

this fix doesnt work anymore 60.17 ERROR: Package 'networkx' requires a different Python: 3.8.10 not in '>=3.9'

ERROR: failed to solve: process "/bin/sh -c python3 -m pip install --default-timeout=1000 --no-cache-dir torch torchvision torchaudio nvidia-pyindex transformers --extra-index-url https://download.pytorch.org/whl/cu113" did not complete successfully: exit code: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants