Skip to content

Add DevContainer configuration file #1389

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

Merged
merged 1 commit into from
Feb 6, 2025
Merged

Add DevContainer configuration file #1389

merged 1 commit into from
Feb 6, 2025

Conversation

yvan-sraka
Copy link
Contributor

DevContainer is a great tool for providing a one-click development environment for new contributors. It works seamlessly through the GitHub interface (with GitHub Codespaces) or locally with tools like VSCode or JetBrains’ built-in plugins. Maybe, DevContainer can help achieve a basic level of reproducibility between the CI and local development environments, e.g., the devcontainer CLI could be integrated into GitHub Actions?

@yvan-sraka yvan-sraka requested a review from torymur January 22, 2025 10:53
@yvan-sraka yvan-sraka self-assigned this Jan 22, 2025
@yvan-sraka yvan-sraka force-pushed the devcontainer branch 2 times, most recently from 8bd4faf to 7c7115b Compare January 28, 2025 09:32
@yvan-sraka
Copy link
Contributor Author

yvan-sraka commented Jan 28, 2025

EDIT: actually, the issue was that this version of torch is not compatible with Python 3.13 (so I updated pyproject.toml), but using Python 3.12 allowed it to resolve the correct version :) uv actually provides better error messages and helped me with this one!

I believe this PR provides a simple way to demonstrate that, on a typical x86_64 Linux machine with the correct NVIDIA system dependencies installed, running pip install -e ".[test]" in a fresh virtual environment fails with the following error:

Collecting vllm (from outlines==0.1.15.dev1+g7c7115b)
  Downloading vllm-0.5.1.tar.gz (790 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 790.6/790.6 kB 37.0 MB/s eta 0:00:00
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Collecting cmake>=3.21
        Using cached cmake-3.31.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.5 kB)
      Collecting ninja
        Using cached ninja-1.11.1.3-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.metadata (5.3 kB)
      Collecting packaging
        Using cached packaging-24.2-py3-none-any.whl.metadata (3.2 kB)
      Collecting setuptools>=49.4.0
        Using cached setuptools-75.8.0-py3-none-any.whl.metadata (6.7 kB)
      ERROR: Could not find a version that satisfies the requirement torch==2.3.0 (from versions: 2.5.0, 2.5.1)
      ERROR: No matching distribution found for torch==2.3.0
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 24.3.1 -> 25.0
[notice] To update, run: pip install --upgrade pip
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I have encountered this issue multiple times across different setups. AFAIU, the problem seems comes from wrong constraints in the pyproject.toml. I've tried using different versions of vllm, but I haven't been able to resolve the dependency issues with any of them...

@yvan-sraka yvan-sraka requested a review from rlouf January 28, 2025 09:48
@yvan-sraka yvan-sraka marked this pull request as ready for review January 30, 2025 14:52
@yvan-sraka
Copy link
Contributor Author

So, as advised in the Contribute guide, running conda env create -f environment.yml installs the following versions in the container:

Successfully installed Pygments-2.19.1 accelerate-1.3.0 airportsdata-20241001 anyio-4.8.0 beartype-0.15.0 chardet-5.2.0 click-8.1.8 cloudpickle-3.1.1 cmake-3.31.4 coverage-7.6.10 cramjam-2.9.1 diff-cover-9.2.2 diskcache-5.6.3 distro-1.9.0 exllamav2-0.2.7 fastapi-0.115.8 fastparquet-2024.11.0 genson-1.3.0 h11-0.14.0 httpcore-1.0.7 httptools-0.6.4 httpx-0.28.1 interegular-0.3.3 jax-0.5.0 jaxlib-0.5.0 jiter-0.8.2 lark-1.2.2 llama-cpp-python-0.3.7 lm-format-enforcer-0.10.1 markdown-it-py-3.0.0 mdurl-0.1.2 ml_dtypes-0.5.1 mpmath-1.3.0 msgpack-1.1.0 nest_asyncio-1.6.0 networkx-3.4.2 ninja-1.11.1.3 numpy-1.26.4 nvidia-cublas-cu12-12.1.3.1 nvidia-cuda-cupti-cu12-12.1.105 nvidia-cuda-nvrtc-cu12-12.1.105 nvidia-cuda-runtime-cu12-12.1.105 nvidia-cudnn-cu12-8.9.2.26 nvidia-cufft-cu12-11.0.2.54 nvidia-curand-cu12-10.3.2.106 nvidia-cusolver-cu12-11.4.5.107 nvidia-cusparse-cu12-12.1.0.106 nvidia-ml-py-12.570.86 nvidia-nccl-cu12-2.20.5 nvidia-nvjitlink-cu12-12.4.127 nvidia-nvtx-cu12-12.1.105 openai-1.60.2 opt_einsum-3.4.0 outlines-0.1.15.dev1+g32d3700 outlines_core-0.1.26 pillow-11.1.0 prometheus-fastapi-instrumentator-7.0.2 prometheus_client-0.21.1 protobuf-5.29.3 psutil-6.1.1 py-cpuinfo-9.0.0 pycountry-24.6.1 pytest-benchmark-5.1.0 pytest-cov-6.0.0 pytest-mock-3.14.0 python-dotenv-1.0.1 ray-2.41.0 responses-0.25.6 rich-13.9.4 sentencepiece-0.2.0 sniffio-1.3.1 starlette-0.45.3 sympy-1.13.1 tiktoken-0.8.0 torch-2.3.0 torchvision-0.18.0 triton-2.3.0 uvicorn-0.34.0 uvloop-0.21.0 vllm-0.5.1 vllm-flash-attn-2.5.9 watchfiles-1.0.4 websockets-14.2 xformers-0.0.26.post1

done
#
# To activate this environment, use
#
#     $ conda activate dottxt-ai
#
# To deactivate an active environment, use
#
#     $ conda deactivate

However, when I run pytest, it fails... Below are a few log traces, I would really appreciate any help!

@rlouf
Copy link
Member

rlouf commented Feb 5, 2025

Great! Should this be documented somewhere?

@yvan-sraka
Copy link
Contributor Author

Great! Should this be documented somewhere?

We could add a few lines in the Contribute guide! Do we merge that PR and I open a new issue for the failing tests?

@rlouf rlouf merged commit 69418da into main Feb 6, 2025
7 checks passed
@rlouf rlouf deleted the devcontainer branch February 6, 2025 09:52
@rlouf
Copy link
Member

rlouf commented Feb 6, 2025

Yes, let's do that

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

Successfully merging this pull request may close these issues.

2 participants