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