BUILD 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. load("//bazel:python.bzl", "py_test_run_all_subdirectory")
  2. load("//bazel:python.bzl", "py_test_run_all_notebooks")
  3. load("//bazel:python.bzl", "doctest")
  4. exports_files(["test_myst_doc.py"])
  5. # --------------------------------------------------------------------
  6. # Tests from the doc directory.
  7. # Please keep these sorted alphabetically, but start with the
  8. # root directory.
  9. # --------------------------------------------------------------------
  10. py_test(
  11. name = "highly_parallel",
  12. size = "medium",
  13. main = "test_myst_doc.py",
  14. srcs = ["test_myst_doc.py"],
  15. tags = ["exclusive", "team:ml", "highly_parallel"],
  16. data = ["//doc/source/ray-core/examples:core_examples"],
  17. args = ["--path", "doc/source/ray-core/examples/highly_parallel.ipynb"]
  18. )
  19. ### Ray Data
  20. py_test(
  21. name = "datasets_train",
  22. size = "medium",
  23. srcs = ["source/ray-core/_examples/datasets_train/datasets_train.py"],
  24. tags = ["exclusive", "team:ml", "datasets_train"],
  25. args = ["--smoke-test", "--num-workers=2", "--use-gpu"]
  26. )
  27. py_test(
  28. name = "plot_hyperparameter",
  29. size = "small",
  30. main = "test_myst_doc.py",
  31. srcs = ["test_myst_doc.py"],
  32. args = ["--path", "doc/source/ray-core/examples/plot_hyperparameter.ipynb"],
  33. data = ["//doc/source/ray-core/examples:core_examples"],
  34. tags = ["exclusive", "team:ml"]
  35. )
  36. py_test(
  37. name = "automl_for_time_series",
  38. size = "medium",
  39. main = "test_myst_doc.py",
  40. srcs = ["test_myst_doc.py"],
  41. tags = ["exclusive", "team:ml", "timeseries_libs"],
  42. data = ["//doc/source/ray-core/examples:core_examples"],
  43. args = ["--path", "doc/source/ray-core/examples/automl_for_time_series.ipynb"]
  44. )
  45. py_test(
  46. name = "batch_prediction",
  47. size = "medium",
  48. main = "test_myst_doc.py",
  49. srcs = ["test_myst_doc.py"],
  50. tags = ["exclusive", "team:ml"],
  51. data = ["//doc/source/ray-core/examples:core_examples"],
  52. args = ["--path", "doc/source/ray-core/examples/batch_prediction.ipynb"]
  53. )
  54. py_test(
  55. name = "batch_training",
  56. size = "medium",
  57. main = "test_myst_doc.py",
  58. srcs = ["test_myst_doc.py"],
  59. tags = ["exclusive", "team:ml"],
  60. data = ["//doc/source/ray-core/examples:core_examples"],
  61. args = ["--path", "doc/source/ray-core/examples/batch_training.ipynb"]
  62. )
  63. py_test(
  64. name = "plot_parameter_server",
  65. size = "medium",
  66. main = "test_myst_doc.py",
  67. srcs = ["test_myst_doc.py"],
  68. args = ["--path", "doc/source/ray-core/examples/plot_parameter_server.ipynb"],
  69. data = ["//doc/source/ray-core/examples:core_examples"],
  70. tags = ["exclusive", "team:ml"]
  71. )
  72. py_test(
  73. name = "plot_pong_example",
  74. size = "large",
  75. main = "test_myst_doc.py",
  76. srcs = ["test_myst_doc.py"],
  77. args = ["--path", "doc/source/ray-core/examples/plot_pong_example.ipynb"],
  78. data = ["//doc/source/ray-core/examples:core_examples"],
  79. tags = ["exclusive", "team:ml"]
  80. )
  81. # --------------------------------------------------------------------
  82. # Test all doc/source/ray-observability/doc_code code included in rst/md files.
  83. # --------------------------------------------------------------------
  84. py_test_run_all_subdirectory(
  85. size = "medium",
  86. include = ["source/ray-observability/doc_code/*.py"],
  87. exclude = [],
  88. extra_srcs = [],
  89. tags = ["exclusive", "team:core"],
  90. )
  91. # --------------------------------------------------------------------
  92. # Test all doc/source/ray-core/doc_code code included in rst/md files.
  93. # --------------------------------------------------------------------
  94. py_test(
  95. name = "doc_code_runtime_env_example",
  96. size = "small",
  97. main = "source/ray-core/doc_code/runtime_env_example.py",
  98. srcs = ["source/ray-core/doc_code/runtime_env_example.py"],
  99. tags = ["exclusive", "post_wheel_build", "team:serve"]
  100. )
  101. py_test_run_all_subdirectory(
  102. size = "medium",
  103. include = ["source/ray-core/doc_code/*.py"],
  104. exclude = ["source/ray-core/doc_code/runtime_env_example.py",
  105. "source/ray-core/doc_code/cross_language.py"],
  106. extra_srcs = [],
  107. tags = ["exclusive", "team:core"],
  108. )
  109. # --------------------------------------------------------------------
  110. # Test all doc/source/serve/doc_code code included in rst/md files.
  111. # --------------------------------------------------------------------
  112. py_test_run_all_subdirectory(
  113. size = "medium",
  114. include = ["source/serve/doc_code/**/*.py"],
  115. exclude = [
  116. "source/serve/doc_code/distilbert.py",
  117. "source/serve/doc_code/stable_diffusion.py",
  118. "source/serve/doc_code/object_detection.py",
  119. "source/serve/doc_code/streaming_example.py",
  120. ],
  121. extra_srcs = [],
  122. tags = ["exclusive", "team:serve"],
  123. )
  124. py_test_run_all_subdirectory(
  125. size = "medium",
  126. include = ["source/serve/doc_code/streaming_example.py"],
  127. exclude = [],
  128. extra_srcs = [],
  129. tags = ["exclusive", "team:serve"],
  130. env = {"RAY_SERVE_ENABLE_EXPERIMENTAL_STREAMING": "1"},
  131. )
  132. py_test_run_all_subdirectory(
  133. size = "medium",
  134. include = [
  135. "source/serve/doc_code/distilbert.py",
  136. "source/serve/doc_code/stable_diffusion.py",
  137. "source/serve/doc_code/object_detection.py",
  138. ],
  139. exclude = [],
  140. extra_srcs = [],
  141. tags = ["exclusive", "team:serve", "gpu"],
  142. env = {"RAY_SERVE_PROXY_READY_CHECK_TIMEOUT_S": "60"},
  143. )
  144. # --------------------------------------------------------------------
  145. # Test all doc/source/tune/doc_code code included in rst/md files.
  146. # --------------------------------------------------------------------
  147. py_test_run_all_subdirectory(
  148. size = "medium",
  149. include = ["source/tune/doc_code/*.py"],
  150. exclude = [],
  151. extra_srcs = [],
  152. tags = ["exclusive", "team:ml"],
  153. )
  154. # --------------------------------------------------------------------
  155. # Test all doc/source/rllib/doc_code code included in rst/md files.
  156. # --------------------------------------------------------------------
  157. py_test_run_all_subdirectory(
  158. size = "medium",
  159. include = ["source/rllib/doc_code/*.py"],
  160. exclude = [],
  161. extra_srcs = [],
  162. tags = ["exclusive", "team:rllib"],
  163. )
  164. # --------------------------------------------------------------------
  165. # Test all doc/source/ray-air/doc_code code included in rst/md files.
  166. # --------------------------------------------------------------------
  167. py_test_run_all_subdirectory(
  168. size = "large",
  169. include = ["source/ray-air/doc_code/*.py"],
  170. exclude = [
  171. # Too large. Use a custom test below.
  172. "source/ray-air/doc_code/computer_vision.py",
  173. "source/ray-air/doc_code/hf_trainer.py", # Too large
  174. "source/ray-air/doc_code/predictors.py",
  175. ],
  176. extra_srcs = [],
  177. tags = ["exclusive", "team:ml"],
  178. )
  179. py_test(
  180. size = "enormous",
  181. name = "computer_vision_test",
  182. main = "source/ray-air/doc_code/computer_vision.py",
  183. srcs = ["source/ray-air/doc_code/computer_vision.py"],
  184. tags = ["exclusive", "team:ml"],
  185. )
  186. # --------------------------------------------------------------------
  187. # Test all doc/source/train/doc_code code included in rst/md files.
  188. # --------------------------------------------------------------------
  189. py_test_run_all_subdirectory(
  190. size = "large",
  191. include = ["source/train/doc_code/*.py"],
  192. exclude = [],
  193. extra_srcs = [],
  194. tags = ["exclusive", "team:ml"],
  195. )
  196. # --------------------------------------------------------------------
  197. # Test all doc/source/ray-overview/doc_test snippets, used on ray.io
  198. # --------------------------------------------------------------------
  199. py_test_run_all_subdirectory(
  200. size = "small",
  201. include = ["source/ray-overview/doc_test/*.py"],
  202. exclude = ["source/ray-overview/doc_test/ray_data.py"],
  203. extra_srcs = [],
  204. tags = ["exclusive", "team:ml"],
  205. )
  206. # --------------------------------------------------------------------
  207. # Test all doc/source/data/doc_code code included in rst/md files.
  208. # --------------------------------------------------------------------
  209. py_test_run_all_subdirectory(
  210. size = "large",
  211. include = ["source/data/doc_code/*.py"],
  212. exclude = [
  213. "source/ray-air/doc_code/predictors.py",
  214. "source/data/doc_code/loading_data_untested.py",
  215. ],
  216. extra_srcs = [],
  217. tags = ["exclusive", "team:data"],
  218. )
  219. # --------------------------------------------------------------------
  220. # Workspace templates tests
  221. # --------------------------------------------------------------------
  222. # Validate that all the paths and yamls within the templates.yaml file are valid.
  223. py_test(
  224. name = "templates_directory_validation",
  225. size = "small",
  226. main = "source/templates/testing/validate.py",
  227. srcs = ["source/templates/testing/validate.py"],
  228. data = glob(["source/templates/**/*"]),
  229. tags = ["exclusive", "team:ml"]
  230. )
  231. # --------------
  232. # Run GPU tests
  233. # --------------
  234. py_test_run_all_subdirectory(
  235. size = "large",
  236. include = ["source/ray-air/doc_code/predictors.py"],
  237. exclude = [],
  238. extra_srcs = [],
  239. tags = ["exclusive", "team:ml", "ray_air", "gpu"],
  240. )
  241. py_test(
  242. name = "pytorch_resnet_finetune",
  243. size = "large",
  244. main = "test_myst_doc.py",
  245. srcs = ["test_myst_doc.py"],
  246. tags = ["exclusive", "team:ml", "gpu", "ray_air"],
  247. data = ["//doc/source/train/examples/pytorch:train_pytorch_examples"],
  248. args = ["--path", "doc/source/train/examples/pytorch/pytorch_resnet_finetune.ipynb"]
  249. )
  250. # --------------------------------------------------------------------
  251. # Test all doc/external code
  252. # --------------------------------------------------------------------
  253. py_test_run_all_subdirectory(
  254. size = "large",
  255. include = ["external/*.py"],
  256. exclude = [],
  257. extra_srcs = [],
  258. tags = ["exclusive", "team:ml", "external"],
  259. )
  260. # --------------------------------------------------------------------
  261. # Tests code snippets in user guides.
  262. # --------------------------------------------------------------------
  263. doctest(
  264. files = glob(
  265. include=["source/**/*.rst", "source/**/*.md"],
  266. exclude=[
  267. "source/ray-contribute/getting-involved.rst",
  268. "source/ray-core/handling-dependencies.rst",
  269. "source/ray-core/tasks/nested-tasks.rst",
  270. "source/ray-observability/user-guides/ray-tracing.rst",
  271. "source/ray-observability/user-guides/cli-sdk.rst",
  272. "source/rllib/rllib-env.rst",
  273. "source/rllib/rllib-sample-collection.rst",
  274. "source/serve/advanced-guides/inplace-updates.md",
  275. "source/serve/deploy-many-models/multi-app.md",
  276. "source/serve/production-guide/deploy-vm.md",
  277. "source/serve/production-guide/fault-tolerance.md",
  278. "source/data/batch_inference.rst",
  279. "source/data/transforming-data.rst",
  280. "source/train/faq.rst"
  281. ]
  282. ),
  283. size = "large",
  284. tags = ["team:none"]
  285. )
  286. doctest(
  287. files = [
  288. "source/data/batch_inference.rst",
  289. "source/data/transforming-data.rst"
  290. ],
  291. tags = ["team:data"],
  292. gpu = True
  293. )