mozilla-ai / lumigator

Source code for Mozilla.ai's Lumigator platform
Apache License 2.0
9 stars 0 forks source link

ModuleNotFoundError: No module named 'ray' but ray is in virtual environment #233

Open ividal opened 3 days ago

ividal commented 3 days ago

Describe the bug pants test for backaend yields an error as if ray were missing.

System Information (please complete the following information):

To Reproduce Steps to reproduce the behavior:

  1. Follow these instructions
  2. Check ray is in the environment:
mzaivenv➜  lumigator git:(main) ✗ pip freeze | grep ray
memray==1.13.4
ray==2.30.0
  1. pants test lumigator/python/mzai/backend/tests:backend_tests@parametrize=darwin
  2. See error:
    ImportError while loading conftest 'lumigator/python/mzai/backend/tests/conftest.py'.
    lumigator/python/mzai/backend/tests/conftest.py:12: in <module>
    from mzai.backend.api.deps import get_db_session, get_s3_client
    lumigator/python/mzai/backend/api/deps.py:7: in <module>
    from ray.dashboard.modules.serve.sdk import ServeSubmissionClient
    E   ModuleNotFoundError: No module named 'ray'

Expected behavior See tests run, ideally 0 errors and full coverage 😇 🎄

Screenshots N/A

Additional context

ividal commented 3 days ago

@aittalam You have a tonne of information and even found how to solve this already - just created this so as to not lose it :)

veekaybee commented 3 days ago

Were you able to resolve this via regenerating the lockfiles? pants generate-lockfiles

aittalam commented 3 days ago

Unfortunately not, mine was more like a local patch to be able to run tests rather than actually fixing the issue:

remove the build files added to lm-buddy:

rm lumigator/python/mzai/lm_buddy/BUILD.pants
rm lumigator/python/mzai/lm_buddy/tests/BUILD.pants

rebuild the lockfiles (will take a bit):

pants generate-lockfiles

run the test

pants test lumigator/python/mzai/backend/tests:backend_tests@parametrize=darwin

... regenerating lockfiles fixes one issue (the fact that it did not found jobrunner anymore) but not the larger problem (the BUILD.pants files are not enough for lmb to work with pants).

I'll check it more thoroughly tomorrow but I am happy to collect any further info / pointers in the meantime :-)

ividal commented 3 days ago

pants generate-lockfiles

I was. Actually just deleting those and then running through bootstrap again did it.