1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 pythonAtLeast,
6 python,
7 fetchPypi,
8 autoPatchelfHook,
9
10 # dependencies
11 aiohttp,
12 aiohttp-cors,
13 aiosignal,
14 attrs,
15 click,
16 cloudpickle,
17 colorama,
18 colorful,
19 cython,
20 filelock,
21 frozenlist,
22 gpustat,
23 grpcio,
24 jsonschema,
25 msgpack,
26 numpy,
27 opencensus,
28 packaging,
29 prometheus-client,
30 psutil,
31 pydantic,
32 py-spy,
33 pyyaml,
34 requests,
35 setproctitle,
36 smart-open,
37 virtualenv,
38
39 # optional-dependencies
40 fsspec,
41 pandas,
42 pyarrow,
43 dm-tree,
44 gym,
45 lz4,
46 matplotlib,
47 scikit-image,
48 scipy,
49 aiorwlock,
50 fastapi,
51 starlette,
52 uvicorn,
53 tabulate,
54 tensorboardx,
55}:
56
57let
58 pname = "ray";
59 version = "2.33.0";
60in
61buildPythonPackage rec {
62 inherit pname version;
63 format = "wheel";
64
65 disabled = pythonOlder "3.10" || pythonAtLeast "3.13";
66
67 src =
68 let
69 pyShortVersion = "cp${builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion}";
70 binary-hash = (import ./binary-hashes.nix)."${pyShortVersion}" or { };
71 in
72 fetchPypi (
73 {
74 inherit pname version format;
75 dist = pyShortVersion;
76 python = pyShortVersion;
77 abi = pyShortVersion;
78 platform = "manylinux2014_x86_64";
79 }
80 // binary-hash
81 );
82
83 nativeBuildInputs = [
84 autoPatchelfHook
85 ];
86
87 pythonRelaxDeps = [
88 "click"
89 "grpcio"
90 "protobuf"
91 "virtualenv"
92 ];
93
94 dependencies = [
95 aiohttp
96 aiohttp-cors
97 aiosignal
98 attrs
99 click
100 cloudpickle
101 colorama
102 colorful
103 cython
104 filelock
105 frozenlist
106 gpustat
107 grpcio
108 jsonschema
109 msgpack
110 numpy
111 opencensus
112 packaging
113 prometheus-client
114 psutil
115 pydantic
116 py-spy
117 pyyaml
118 requests
119 setproctitle
120 smart-open
121 virtualenv
122 ];
123
124 optional-dependencies = rec {
125 air-deps = data-deps ++ serve-deps ++ tune-deps ++ rllib-deps;
126 data-deps = [
127 fsspec
128 pandas
129 pyarrow
130 ];
131 rllib-deps = tune-deps ++ [
132 dm-tree
133 gym
134 lz4
135 matplotlib
136 pyyaml
137 scikit-image
138 scipy
139 ];
140 serve-deps = [
141 aiorwlock
142 fastapi
143 pandas
144 starlette
145 uvicorn
146 ];
147 tune-deps = [
148 tabulate
149 tensorboardx
150 ];
151 };
152
153 postInstall = ''
154 chmod +x $out/${python.sitePackages}/ray/core/src/ray/{gcs/gcs_server,raylet/raylet}
155 '';
156
157 pythonImportsCheck = [ "ray" ];
158
159 meta = {
160 description = "Unified framework for scaling AI and Python applications";
161 homepage = "https://github.com/ray-project/ray";
162 changelog = "https://github.com/ray-project/ray/releases/tag/ray-${version}";
163 license = lib.licenses.asl20;
164 maintainers = with lib.maintainers; [ billhuang ];
165 platforms = [ "x86_64-linux" ];
166 };
167}