ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
34.2k stars 5.81k forks source link

Ray adds path to sys.path with no __init__.py #46768

Open J-B-Blankenship opened 4 months ago

J-B-Blankenship commented 4 months ago

What happened + What you expected to happen

Note: This bug was incredibly difficult to track down due to the subtlety, and this can always be reproduced with the Bazel build system, protocol buffer generation, and utilization of messages alongside Ray code.

My project uses Bazel as the build system. This includes generation of protocol buffer files from .proto files. The system used by Bazel generates runfiles to produce hermetic builds with very specific pathing that is ultimately added to sys.path.

Some of the madness:

['/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/_main', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_ray/site-packages/ray/thirdparty_files', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/protobuf~/python/python', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/protobuf~/python', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_hpack/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_hyperframe/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_h2/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_multidict/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_grpclib/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/_main/data_schemas/data_schemas_py_proto_pb', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rogue_roguedb~/rogue/services/services_py_proto_pb', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_certifi/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_urllib3/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_websockets/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_polygon_api_client/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pytz/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_numpy/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_scipy/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_cloudpickle/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_farama_notifications/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_typing_extensions/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_gymnasium/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_dm_tree/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_lz4/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_six/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_python_dateutil/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tzdata/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pandas/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_psutil/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pyarrow/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_frozenlist/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_aiosignal/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_click/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_filelock/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_fsspec/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_attrs/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_rpds_py/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_referencing/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_jsonschema_specifications/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_jsonschema/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_msgpack/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_packaging/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_protobuf/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pyyaml/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_charset_normalizer/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_idna/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_requests/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorboardx/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_ray/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pillow/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_imageio/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_lazy_loader/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_networkx/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tifffile/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_scikit_image/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_absl_py/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_wheel/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_astunparse/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_flatbuffers/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_gast/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_google_pasta/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_grpcio/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_h5py/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_ml_dtypes/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_namex/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_optree/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_mdurl/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_markdown_it_py/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pygments/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_rich/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_keras/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_libclang/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_opt_einsum/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_setuptools/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_markdown/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorboard_data_server/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_markupsafe/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_werkzeug/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorboard/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorflow_io_gcs_filesystem/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_termcolor/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_wrapt/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorflow/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_shellingham/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_typer/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/_main', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/protobuf~', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rogue_roguedb~', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_absl_py', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_aiosignal', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_astunparse', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_attrs', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_certifi', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_charset_normalizer', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_click', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_cloudpickle', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_dm_tree', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_farama_notifications', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_filelock', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_flatbuffers', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_frozenlist', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_fsspec', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_gast', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_google_pasta', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_grpcio', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_gymnasium', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_h5py', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_idna', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_imageio', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_jsonschema', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_jsonschema_specifications', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_keras', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_lazy_loader', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_libclang', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_lz4', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_markdown', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_markdown_it_py', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_markupsafe', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_mdurl', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_ml_dtypes', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_msgpack', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_namex', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_networkx', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_numpy', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_opt_einsum', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_optree', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_packaging', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pandas', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pillow', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_polygon_api_client', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_protobuf', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_psutil', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pyarrow', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pygments', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_python_dateutil', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pytz', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_pyyaml', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_ray', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_referencing', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_requests', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_rich', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_rpds_py', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_scikit_image', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_scipy', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_setuptools', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_shellingham', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_six', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorboard', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorboard_data_server', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorboardx', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorflow', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tensorflow_io_gcs_filesystem', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_termcolor', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tifffile', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_typer', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_typing_extensions', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_tzdata', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_urllib3', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_websockets', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_werkzeug', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_wheel', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_wrapt', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_grpclib', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_h2', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_hpack', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_hyperframe', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rules_proto_grpc_python_pip_deps_311_multidict', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/external/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu/lib/python311.zip', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/external/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/external/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/lib-dynload', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/external/rules_python~~python~python_3_11_x86_64-unknown-linux-gnu/lib/python3.11/site-packages', '/home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/rules_python~~pip~rogue_trading_python_dependencies_311_setuptools/site-packages/setuptools/_vendor']

In this particular list, the first argument did not exist before running code that ultimately calls ray.init() when interacting with the Ray library. There is no __init__.py at the location, and adding an __init__.py retroactively does not resolve the issue. This is due to the other paths defined that are the correct ones now not being prioritized.

Expectation: Ray should not add to sys.path and keep only the original. If Ray must add to sys.path, the library should append to the end to give priority to earlier entries.

Versions / Dependencies

Python 3.11.7 ray[tune] >= 2.32.0

Additional dependencies that can be provided upon request for a minimal reproducible example.

Reproduction script

A reproducible example would require Bazel and multiple files to form a complete example. This can be provided upon request to try to produce the most trivial version possible without proprietary code.

However, Ray is clearly altering the sys.path, and a mitigation would be to simply append instead to preserve functionality wherever that may be in the code (likely around ray.init()).

Issue Severity

Medium: It is a significant difficulty but I can work around it.

J-B-Blankenship commented 4 months ago

The path added appears to be the current working directory aka the following:

import os
print(os.getcwd())

which is the same as /home/developer/.cache/bazel/_bazel_developer/646bcbb063181c5dac5a581e1c4fefdd/execroot/_main/bazel-out/k8-fastbuild/bin/automation/trading.runfiles/_main

Suspect places in the codebase can be found here: https://github.com/search?q=repo%3Aray-project%2Fray%20sys.path&type=code

The second result looks especially guilty of the behavior observed above. A simple change to append vs. insert would appear to resolve this issue and not require shifting all entries to the right (eg. not efficient).

anyscalesam commented 4 months ago

@J-B-Blankenship are you trying to compile Ray from source yourself?

J-B-Blankenship commented 4 months ago

@anyscalesam , I am not trying to build from source. The order is the part that matters here. Somewhere along the lines it gets shuffled through the use of calling Ray and triggering the init logic.

My fix has been to remove then append to the system path in the file affected in my case where imports are not working. This is a fix, but it is far from ideal.

rkooo567 commented 3 months ago

@J-B-Blankenship I think the direction you mentioned makes sense (not modifying sys.path or append). But we need to figure out exactly why we are doing this before fixing it. For that, can you help us your setup a little bit?

J-B-Blankenship commented 3 months ago

@J-B-Blankenship I think the direction you mentioned makes sense (not modifying sys.path or append). But we need to figure out exactly why we are doing this before fixing it. For that, can you help us your setup a little bit?

  • When I tried ray.init, I found it only adds thirdparty_files to sys.path. is this the same behavior you are seeing?
  • Did you use ray runtime environment feature? (runtime_env={"working_dir": ...} especially)
  • If both are not true, can you tell us a little bit more about how to reproduce the issue?

I will provide a fully reproducible setup that you can use out of the box and test with. Give me a week or so to put that together.

I presume a Docker container setup will work with the dependencies setup and the command provided in a README.md or something? The example repo will be made public to do a basic git clone.