Commit graph

13301 commits

Author SHA1 Message Date
Guyang Song
876fef0fcf
[C++ worker] optimize the log of dynamic library loading (#26120) 2022-06-28 14:08:47 +08:00
Qing Wang
8884bfb445
[Java] Support starting named actors in different namespace. (#25995)
Allow you start actors in different namespace instead of the driver namespace.
Usage is simple:
```java
Ray.init(namespace="a");
/// Named actor a will starts in namespace `b`
ActorHandle<A> a = Ray.actor(A::new).setName("myActor", "b").remote();
```

Co-authored-by: Hao Chen <chenh1024@gmail.com>
2022-06-28 13:49:15 +08:00
Ricky Xu
44daf3ecd7
[Core][State Observability] Get API using List endpoints + filtering on ids (#25894)
## Why are these changes needed?
This is a first implementation of GET APIs for

nodes
actors
placement groups
workers
tasks
objects
E.g.

# CLI
(dev) ➜  ray git:(ricky/obs-get) ray get nodes cab26304d105caa6f2100908f7b461ef9ed244984ec30b4b46f953f9
---
node_id: cab26304d105caa6f2100908f7b461ef9ed244984ec30b4b46f953f9
node_ip: 172.31.47.143
node_name: 172.31.47.143
resources_total:
    CPU: 8.0
    memory: 16700517582.0
    node:172.31.47.143: 1.0
    object_store_memory: 8350258790.0
state: ALIVE


# Python 
from ray.experimental.state.api import get_node
from ray.experimental.state.common import NodeState

node :NodeState = get_node(<id>)
print(node)

We currently do not support getting specific resources by id for 'jobs' and 'runtime-envs'

jobs: it is not exposing id to be queried easily yet
runtime envs: it doesn't have an id associated.

TODO:
it uses list endpoints + filtering as for now, future iterations will implement GET-specific endpoints and interaction with raylet/GCS with point query APIs.
Unit testing for state_manager for GET endpoints when implemented.
Getting jobs by id
2022-06-27 17:14:29 -07:00
Dmitri Gekhtman
3af3269b8e
[KubeRay][docs] Warning about kubectl apply, update feature state wording. (#25685)
This PR

Adds a warning about a known issue to the KubeRay section of the Ray docs.
Updates the description of the feature state of KubeRay integration.
Adds some links to the KubeRay docs.
2022-06-27 14:11:00 -07:00
Ruben Berenguel
7f8d3c3dc7
Update installation instructions (#23121)
Currently unqualified `conda install` is installing 1.44.0 whereas `ray` is requiring 1.43.0 in `pip install`, thus the instructions are cancelling themselves out and you end with an unusable installation due to no symbols for `grpcio` in ARM

Co-authored-by: Simon Mo <simon.mo@hey.com>
2022-06-27 13:55:50 -07:00
shrekris-anyscale
66650cdadb
[Serve] Remove serve.start() in run_graph task (#26096) 2022-06-27 09:44:36 -07:00
shrekris-anyscale
607c276e43
[Serve] Add cosmetic improvements to serve build (#25935) 2022-06-27 09:42:20 -07:00
Artur Niederfahrenhorst
64a0eae758
simplexfix (#26122) 2022-06-27 08:25:19 -07:00
Ricky Xu
3d8ca6cf0f
[Core][cli][usability] ray stop prints errors during graceful shutdown (#25686)
Why are these changes needed?
This is to address false alarms on subprocesses exiting when killed by ray stop with SIGTERM.

What has been changed?
Added signal handlers for some of the subprocesses:
dashboard (head)
log monitor
ray client server
Changed the --block semantics and prompt messages.

Related issue number
Closes #25518
2022-06-27 08:14:59 -07:00
Lixin Wei
c4b9e9ffa5
[Java] Add entry to run custom test using bazel (#26073)
Now we can run custom java tests by:

0. `cp testng_custom_template.xml testng_custom.xml`
1. Specify test class/method in `testng_custom.xml`
2. `bazel test //java:custom_test --test_output=streamed`
2022-06-27 11:40:16 +08:00
tomsunelite
db6f8a2f01
Fix java detached actor not working (#26003)
detached java actor is not working(actor will be dead after driver exit) when creating a java actor with ActorLifetime.DETACHED option

Co-authored-by: sunkunjian1 <sunkunjian1@jd.com>
2022-06-27 11:21:06 +08:00
Dmitri Gekhtman
1055eadde0
[Dashboard] Fix dashboard RAM and CPU with cgroups2 (#25710)
Closes #25283.

The dashboard shows inaccurate memory and cpu data when run inside of a docker container, in particular when using cgroups v2. This PR fixes that.
2022-06-26 14:01:26 -07:00
Dmitri Gekhtman
0d5131ba37
[Autoscaler][minor] Improve shutdown handler, add retries to KubeRay config fetch (#25904)
Uses a Monitor attribute in the shutdown handler instead of an args attribute. Necessary because some integrations (including KubeRay) instantiate the Monitor directly rather than running python Monitor.py with arguments.

Adds HTTP retries to Ray CR fetch. Necessary for robustness because Ray CR fetch exceptions are not currently handled during autoscaler initialization.
2022-06-25 11:56:25 -07:00
Kai Fricke
75d08b0632
[tune/structure] Refactor suggest into search package (#26074)
This PR renames the `suggest` package to `search` and alters the layout slightly.

In the new package, the higher-level abstractions are on the top level and the search algorithms have their own subdirectories.

In a future refactor, we can turn algorithms such as PBT into actual `SearchAlgorithm` classes and move them into the `search` package. 

The main reason to keep algorithms and searchers in the same directory is to avoid user confusion - for a user, `Bayesopt` is as much a search algorithm as e.g. `PBT`, so it doesn't make sense to split them up.
2022-06-25 14:55:30 +01:00
Eric Liang
7a29461c40
Add back ray.state in deprecation wrapper; print stack trace on warning (#26086) 2022-06-24 15:59:58 -07:00
clarng
f7d0ad3bb7
Enable isort for base directory (#26085)
Remove base dir : 'python/ray/*.py' from the isort blacklist. This is needed so it will run isort on subdirectories under python/ray, and allow us to start enabling isort for subdirectories
2022-06-24 15:32:51 -07:00
Amog Kamsetty
f71a4680da
[AIR] Add __init__.py to ray.air.callbacks (#26088) 2022-06-24 15:29:28 -07:00
shrekris-anyscale
6092869ff3
[Serve] [Docs] Create end-to-end documentation example for Serve REST API and CLI (#25936) 2022-06-24 14:44:39 -07:00
Antoni Baum
0ec198acc2
[AIR] Remove unnecessary pandas from examples (#26009)
Removes unnecessary pandas usage from AIR examples. Helps ensure users do not follow bad practices.
2022-06-24 14:38:23 -07:00
Clark Zinzow
fcd583688a
[Datasets] [Hotfix] Update ds.to_pandas() limit error to reflect current limit API (#26081)
This PR is a hotfix updating the ds.to_pandas() limit error to reflect the current limit API in to_pandas().
2022-06-24 14:34:40 -07:00
shrekris-anyscale
97a9a20f74
[Serve] [Docs] Add Serve REST API Schema to Serve API Docs (#25786) 2022-06-24 14:06:26 -07:00
Chen Shen
95fe3271ec
[Core][Doc] remove cython section from advanced doc. #26062
the example is removed.
2022-06-24 10:39:45 -07:00
SangBin Cho
ef8461abac
[Core] Fix check failure from incorrect death cause (#26007)
rkooo567
Member
rkooo567 commented 2 days ago
Why are these changes needed?
Fixes the check failure;

  | 2022-06-21 19:14:10,718	WARNING worker.py:1737 -- A worker died or was killed while executing a task by an unexpected system error. To troubleshoot the problem, check the logs for the dead worker. RayTask ID: ffffffffffffffff7cc1d49b6d4812ea954ca19a01000000 Worker ID: 9fb0f63d84689c6a9e5257309a6346170c827aa7f970c0ee45e79a8b Node ID: 2d493b4f39f0c382a5dc28137ba73af78b0327696117e9981bd2425c Worker IP address: 172.18.0.3 Worker port: 35883 Worker PID: 31945 Worker exit type: SYSTEM_ERROR Worker exit detail: Worker unexpectedly exits with a connection error code 2. End of file. There are some potential root causes. (1) The process is killed by SIGKILL by OOM killer due to high memory usage. (2) ray stop --force is called. (3) The worker is crashed unexpectedly due to SIGSEGV or other unexpected errors.
  | (HTTPProxyActor pid=31945) [2022-06-21 19:14:10,710 C 31945 31971] pb_util.h:202:  Check failed: death_cause.context_case() == ContextCase::kActorDiedErrorContext
  | (HTTPProxyActor pid=31945) *** StackTrace Information ***
  | (HTTPProxyActor pid=31945)     ray::SpdLogMessage::Flush()
  | (HTTPProxyActor pid=31945)     ray::RayLog::~RayLog()
  | (HTTPProxyActor pid=31945)     ray::core::CoreWorker::HandleKillActor()
  | (HTTPProxyActor pid=31945)     std::_Function_handler<>::_M_invoke()
  | (HTTPProxyActor pid=31945)     EventTracker::RecordExecution()
  | (HTTPProxyActor pid=31945)     std::_Function_handler<>::_M_invoke()
  | (HTTPProxyActor pid=31945)     boost::asio::detail::completion_handler<>::do_complete()
  | (HTTPProxyActor pid=31945)     boost::asio::detail::scheduler::do_run_one()
  | (HTTPProxyActor pid=31945)     boost::asio::detail::scheduler::run()
  | (HTTPProxyActor pid=31945)     boost::asio::io_context::run()
  | (HTTPProxyActor pid=31945)     ray::core::CoreWorker::RunIOService()
  | (HTTPProxyActor pid=31945)     execute_native_thread_routine
  | (HTTPProxyActor pid=31945)
  | (HTTPProxyActor pid=31982) INFO:     Started server process [31982]
NOTE: This is a temporary fix. The root cause is that there's a path that doesn't properly report the death cause (when this RPC is triggered by gcs_actor_scheduler). This should be addressed separately to improve exit observability.

Since this is intended to be picked for 1.13.1, I only added the minimal fix.
2022-06-24 06:22:33 -07:00
Kai Fricke
012306da68
[hotfix] Fix linkcheck (#26070) 2022-06-24 13:38:01 +01:00
Artur Niederfahrenhorst
bed9083f35
[RLlib] Add timeout to filter synchronization. (#25959) 2022-06-24 14:37:43 +02:00
Kai Fricke
eee866d762
[tune/structure] Introduce logger package (#26049)
This PR splits up logger.py and moves it into its own subpackage. External imports don't have to be changed at all.
2022-06-24 08:46:24 +01:00
Jun Gong
257e67474c
[RLlib] introduce serialization for our custom gym space types. (#25923) 2022-06-23 22:55:57 -07:00
Jun Gong
8c9cac350d
Fix unit test test_check_env.py and est_check_multi_agent.py. (#25993) 2022-06-23 22:55:41 -07:00
Artur Niederfahrenhorst
a3f1323457
[RLlib] Make QMix use the ReplayBufferAPI (#25560) 2022-06-23 22:55:22 -07:00
Chen Shen
ef00917df0
[CI] deflake test_multi_node_3 by increasing its timeout 2022-06-23 22:48:17 -07:00
Simon Mo
5342163b9d
[CI] Use BUILDKITE_JOB_ID for better navigation for flaky tracker (#26021) 2022-06-23 18:07:29 -07:00
Antoni Baum
94492c2b49
[AIR/Docs] Improve user guide gallery (#26016)
Moves logging to examples, reorders to match TOC, adds missing entry.
2022-06-23 17:51:01 -07:00
Sebastián Ramírez
8bde3f5dd7
🎨 Update type annotations to include options in ray.remote() (#25999)
The current type annotations expect and support using:

```Python
@ray.remote
def do_things(x: int, y: float):
    return x * y
```

...without options.

This PR adds type annotations for passing options, as in:

```Python
@ray.remote(num_cpus=3)
def do_more_things(name: str, value: float):
    return f"{name}: {value}"
```

Before:

<img width="687" alt="Screenshot 2022-06-22 at 04 49 11" src="https://user-images.githubusercontent.com/1326112/174999689-80bdc3ce-b437-464f-b05c-7613b3f8f89b.png">

After (autocompletion):

<img width="687" alt="Screenshot 2022-06-22 at 04 50 34" src="https://user-images.githubusercontent.com/1326112/174999899-5062335a-17ee-44a8-ad5c-97335e201e7b.png">

...and no errors:

<img width="687" alt="Screenshot 2022-06-22 at 04 51 15" src="https://user-images.githubusercontent.com/1326112/175000001-0a978871-8835-426f-9e09-5848194639fd.png">
2022-06-23 17:50:25 -07:00
SangBin Cho
c2e003a47a
[Usage stats] Record Ray native library usage from a home temp folder (#25842)
This PR records the historical Ray native library usage to the home temp folder. Note that library usage only includes Ray native libraries (rllib, tune, dataset, workflow, and train). NOTE: The library usage is always recorded to /tmp/ray, but they will only recorded when the cluster that enables the usage stats is running. Note that this can generate quite big amount of false positive (e.g., If I import rllib once, and start cluster for local development, they will all considered as a rllib cluster).
2022-06-23 17:49:06 -07:00
Sihan Wang
478733d751
[Serve] Bump min_workers configuration for Serve nightly tests (#25892) 2022-06-23 15:38:07 -07:00
Kai Fricke
b0e1cfbcaa
[ci] repro-ci.py: Use Name tag instead of repo_name (#26035) 2022-06-23 14:12:45 -07:00
Kai Fricke
b21314fac2
[tune/structure] Introduce trainable package (#26046)
Introduce a `trainable` package to house Trainable, FunctionTrainable (renamed), Session, and utilities.
2022-06-23 21:50:55 +01:00
Sven Mika
59a967a3a0
[RLlib] Cleanup some deprecated metric keys and classes. (#26036) 2022-06-23 21:30:01 +02:00
Jian Xiao
33b30aed15
[Datasets] Object GC for pipelining (#25820)
We leak memory when we create a DatasetPipeline from a "collapsed" DatasetPipeline (which executes multiple stages and produces a stream of output Datasets as the input base Datasets for the new DatasetPipeline).
The DatasetPipeline splitting is such a collapsing operation, so the child pipelines will have zero stages (no matter how many stages the parent pipeline had), which will make us no longer able to tell if it's safe to clear output blocks of child pipelines.

This PR fixes this by preserving whether the base Datasets can be cleared when we create new DatasetPipeline from the old.
2022-06-23 12:28:51 -07:00
JYX
bde46e8a88
Fix several typos in rollout_worker.py (#26028) 2022-06-23 11:41:53 -07:00
Guyang Song
2934efe502
[runtime_envmove 'eager_intall' to 'config' (#26004) 2022-06-23 13:16:52 -05:00
Guyang Song
26ae3a0239
[Doc] [C++ API] Add note about ABI issue (#26030) 2022-06-23 13:14:50 -05:00
Sven Mika
be1042429d
[RLlib] Deprecation: Replace remaining evaluation_num_episodes with evaluation_duration. (#26000) 2022-06-23 19:11:29 +02:00
Kai Fricke
7e93370c91
[tune/structure] Introduce stopper package (#26040)
Split different stoppers and put them in a `stopper` package.
2022-06-23 18:05:43 +01:00
Kai Fricke
8a2f6bda62
[tune/structure] Introduce experiment package (#26033)
Experiment, Trial, and config parsing moves into an `experiment` package.

Notably, the new public facing APIs will be

```
from ray.tune.experiment import Experiment
from ray.tune.experiment import Trial
```
2022-06-23 14:52:46 +01:00
Kai Fricke
edcf7489ef
[hotfix] Fix dashboard cli test (#26034)
#22698 broke master because the dashboard CLI test was not adjusted.
2022-06-23 11:39:09 +01:00
Kai Fricke
0959f44b6f
[tune/structure] Introduce execution package (#26015)
Execution-specific packages are moved to tune.execution.

Co-authored-by: Xiaowei Jiang <xwjiang2010@gmail.com>
2022-06-23 11:13:19 +01:00
Clark Zinzow
caa3868570
[Datasets] Add UDF passthrough args to map_batches(). (#25613)
Users often have UDFs that require arguments only known at Dataset creation time, and sometimes these arguments may be large objects better suited for shared zero-copy access via the object store. One example is batch inference on a large on-CPU model using the actor pool strategy: without putting the large model into the object store and sharing across actors on the same node, each actor worker will need its own copy of the model.

Unfortunately, we can't rely on closing over these object refs, since the object ref will then be serialized in the exported function/class definition, causing the object to be indefinitely pinned and therefore leaked. It's much cleaner to instead link these object refs in as actor creation and task arguments. This PR adds support for threading such object refs through as actor creation and task arguments and supplying the concrete values to the UDFs.
2022-06-22 23:30:09 -07:00
Eric Cousineau
647f6790c0
scripts: Update dashboard output to print URL (#22698)
Useful for Ctrl+Click for certain terminal emulators
2022-06-23 11:33:22 +08:00
Guyang Song
a8ef296649
[runtime env] remove unused runtime env uris from protobuf (#26001) 2022-06-23 10:45:54 +08:00