Commit graph

7134 commits

Author SHA1 Message Date
Archit Kulkarni
21760fd3ba
[runtime env] [CI] Use wait_for_condition in working_dir GC test instead of hardcoded sleep (#25983) 2022-06-28 11:51:29 -07:00
Amog Kamsetty
17766bc8b0
[AIR] Update KerasCallback to work with TensorflowPredictor (#26089)
The KerasCallback saves the model checkpoint as a file. However, for the saved checkpoint to work with TensorflowPredictor, the model weights needs to be saved under the MODEL_KEY in a dict format.
2022-06-28 11:22:42 -07:00
zcin
da5366f5f5
[serve] Set status message if deployment pending for too long (#25861)
If a ray cluster does not have enough resources for a serve deployment, the deployment will be stuck at `updating` status. This change will set the `message` field when allocations/initializations of actors have been pending for too long.

Co-authored-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com>
2022-06-28 11:21:52 -07:00
Simon Mo
68692b3464
[AIR][Serve] Rename ModelWrapperDeployment -> PredictorDeployment (#25962) 2022-06-28 10:26:10 -07:00
Stephanie Wang
3017128d5e
Revert "[Observability] Fix --follow lost connection when it is used for > 30 seconds (#26080)" (#26162)
This reverts commit 2d58bd5a50.
2022-06-28 10:04:58 -07:00
SangBin Cho
68336abf13
[State Observability] Support --detail flag. (#26071)
## Why are these changes needed?

This PR adds --detail flag to the list APIs.
2022-06-28 07:56:44 -07:00
SangBin Cho
2d58bd5a50
[Observability] Fix --follow lost connection when it is used for > 30 seconds (#26080)
## Why are these changes needed?

This PR fixes the issue where --follow lost connection when it is used for > 30 seconds because the gRPC timeout is configured to be 30 seconds, and we don't reset it when --follow is set.

This fixes the issue by setting timeout=None when keepalive==True

## Related issue number

Closes https://github.com/ray-project/ray/issues/25721
2022-06-28 05:48:25 -07:00
SangBin Cho
4b957e99b5
[State Observability] != predicate for filtering. (#26079)
## Why are these changes needed?

This PR implements `!=` predicate for filtering. As a result of this PR, two APIs are changed.

```
--filter key value -> --filter "key=val" or ---filter "key!=val"

list_actors(filters=[(key, val), (key2, val2)]) -> list_actors(filters=[(key, "=", val), (key2, "=", val2)])
```
2022-06-28 05:42:19 -07:00
Guyang Song
58bfad84d3
[runtime env] plugin refactor[1/n] (#26077) 2022-06-28 14:09:05 +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
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
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
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
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
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
Chen Shen
ef00917df0
[CI] deflake test_multi_node_3 by increasing its timeout 2022-06-23 22:48:17 -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
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
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
Guyang Song
2934efe502
[runtime_envmove 'eager_intall' to 'config' (#26004) 2022-06-23 13:16:52 -05: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
Yi Cheng
a1f02f68b7
[core][gcs] Make GCS client working with timeout_ms. (#25975)
In [PR](https://github.com/ray-project/ray/pull/24764) we move the reconnection to GcsRPCClient. In case of a GCS failure, we'll queue the requests and resent them once GCS is back.
This actually breaks request with timeout because  now, the request will be queued and never got a response. This PR fixed it.

For all requests, it'll be stored by the time it's supposed to be timeout. When GCS is down, we'll check the queued requests and make sure if it's timeout, we'll reply immediately with a Timeout error message.
2022-06-22 18:02:29 -07:00
shrekris-anyscale
4d8a82bdf6
[Serve] Use "serve" namespace during controller recovery (#25987) 2022-06-22 16:08:07 -07:00
Sumanth Ratna
67140f2d26
Remove node.py and ray_constants.py links from setup-dev.py (#25997) 2022-06-22 15:45:29 -07:00
Kai Fricke
d65d4aff9a
[tune/structure] Move CLI files into subpackage (#26011)
As part of the Tune restructuring, move the CLI scripts and commands to a cli subpackage.
2022-06-22 23:05:26 +01:00
Kai Fricke
ecf0b93146
[tune/structure] Move AutoML board (#26012)
As part of the Tune restructuring, move the AutoML Board into the automl package.
2022-06-22 21:52:38 +01:00
Chen Shen
afb092a03a
[Core] Out of Disk prevention (#25370)
Ray (on K8s) fails silently when running out of disk space.
Today, when running a script that has a large amount of object spilling, if the disk runs out of space then Kubernetes will silently terminate the node. Autoscaling will kick in and replace the dead node. There is no indication that there was a failure due to disk space.
Instead, we should fail tasks with a good error message when the disk is full.

We monitor the disk usage, when node disk usage grows over the predefined capacity (like 90%), we fail new task/actor/object put that allocates new objects.
2022-06-22 12:25:32 -07:00
Amog Kamsetty
d6e8b90236
[AIR] Update TorchPredictor to new Predictor API (#25536) 2022-06-22 09:49:07 -07:00
SangBin Cho
6552e096e6
[State Observability] Summary APIs (#25672)
Task/actor/object summary

Tasks: Group by the func name. In the future, we will also allow to group by task_group.
Actors: Group by actor class name. In the future, we will also allow to group by actor_group.
Object: Group by callsite. In the future, we will allow to group by reference type or task state.
2022-06-22 06:21:50 -07:00
xwjiang2010
b4026f9971
[air] RunConfig.failure --> failure_config (#25967) 2022-06-21 16:51:26 -07:00
Eric Liang
43aa2299e6
[api] Annotate as public / move ray-core APIs to _private and add enforcement rule (#25695)
Enable checking of the ray core module, excluding serve, workflows, and tune, in ./ci/lint/check_api_annotations.py. This required moving many files to ray._private and associated fixes.
2022-06-21 15:13:29 -07:00
Archit Kulkarni
565e366529
[runtime env] Use async internal kv in package download and plugins (#25788)
Uses the async KV API for downloading in the runtime env agent. This avoids the complexity of running the runtime env creation functions in a separate thread.

Some functions are still sync, including the working_dir/py_modules upload, installing wheels, and possibly others.
2022-06-21 15:02:36 -07:00
Antoni Baum
b7d4ae541d
[Train] Move load_checkpoint to utils (#25940)
Moves load_checkpoint methods from trainer files to util files for consistency and better modularity.
2022-06-21 13:03:56 -07:00
shrekris-anyscale
ad12f0cd02
[Serve] Deprecate outdated REST API settings (#25932) 2022-06-21 11:06:45 -07:00
Clark Zinzow
50d47486f2
[Datasets] Add file-extension-based path filter for file-based datasources. (#24822)
This PR adds a format-based file extension path filter for file-based datasources, and sets it as the default path filter. This will allow users to point the read_{format}() API at directories containing a mixture of files, and ensure that only files of the appropriate type are read. This default filter can still be disabled via ray.data.read_csv(..., partition_filter=None).
2022-06-21 11:06:21 -07:00