Hi,

The Python library named Ray (https://www.ray.io/) was added to LEAN in 2021:

Since then, it seems that it's been broken. When calling ray.init(), this is the error thrown:

[ERROR] FATAL UNHANDLED EXCEPTION:2022-05-11 03:27:48,039 WARNING utils.py:535 -- Detecting docker specified CPUs. In previous versions of Ray, CPU detection in containers was incorrect. Please ensure that Ray has enough CPUs allocated. As a temporary workaround to revert to the prior behavior, set `RAY_USE_MULTIPROCESSING_CPU_COUNT=1` as an env var before starting Ray. Set the env var: `RAY_DISABLE_DOCKER_CPU_WARNING=1` to mute this warning.,2022-05-11 03:27:49,368 WARNING services.py:1826 -- WARNING: The object store is using /tmp instead of /dev/shm because /dev/shm has only 67108864 bytes available. This will harm performance! You may be able to free up space by deleting files in /dev/shm. If you are inside a Docker container, you can increase /dev/shm size by passing '--shm-size=2.77gb' to 'docker run' (or add it to the run_options list in a Ray cluster config). Make sure to set this to more than 30% of available RAM.,2022-05-11 03:28:36,237 ERROR worker.py:478 -- print_logs: Connection closed by server.,2022-05-11 03:28:36,237 ERROR worker.py:1247 -- listen_error_messages_raylet: Connection closed by server.,2022-05-11 03:28:36,237 ERROR import_thread.py:89 -- ImportThread: Connection closed by server.,terminate called without an active exception,runLauncher.sh: line 15:     7 Aborted                 (core dumped) dotnet QuantConnect.Lean.Launcher.dll --data-folder /Data --config /QuantConnect/backtesting/airlock/config.json --results-destination-folder /QuantConnect/backtesting/airlock/

Ray being a fantastic library for Python, I believe it is worth the time to fix it and make it running again in LEAN.

Thanks,

Fred