Commit graph

2663 commits

Author SHA1 Message Date
Larry
454db6902c
[Java] Add timeout parameter for Ray.get() API (#20282)
Why are these changes needed?

Add timeout(ms) param for Java ray.get. The API changes have been updated to doc ([Ray Core Walkthrough]->[Fetching Results]).

eg:
ObjectRef<Integer> objRef = Ray.put(1);
objRef.get(1000) 
Ray.get(Ray.task(MyRayApp::slowFunction).remote(), 3000)

Related issue number
#20247
2021-11-17 11:02:17 +08:00
Eric Liang
12a4489e30
Revert "[core] Nested task support via task depth + backpressure" (#20438)
Reverts ray-project/ray#17887

This causing several tests to be flaky (test_multinode_failures, test_virtual_actor, test_component_failures_2).
2021-11-16 11:14:45 -08:00
Chen Shen
33c1ee0e86
[Core][actor out-of-order execution 5/n] implement out-of-order scheduling queue #20176
This PR belongs to the stack that enables out of order execution. Previous PR: #20160, Next PR: #20177

In this PR specifically, we implemented a simple out_of_order_scheduling queue which queues the task for execution as soon as the dependency is ready.
2021-11-16 10:53:51 -08:00
Chen Shen
f02b53a810
[Core][actor out-of-order execution 3/n] Introducing out-of-order actor submit queue (#20150)
Why are these changes needed?
This is the third PR in the stack that supports out or order execution for threaded/async actors. Previous PR #20149 Next PR #20160
At a high level, threaded actor/async actor already don't guarantee execution order, and the current "sequential" order implementation has caused some confusion and inconvenience. Please refer to #19822 for detailed discussion.

In this PR, we implemented the out-of-order of queue that supports out of order execution. Conceptually it's very simple: it sends the requests as soon as the dependency is resolved.
2021-11-16 10:48:49 -08:00
SangBin Cho
137aec04c0
[Core] Better logs job message failure (#20363)
<!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. -->

## Why are these changes needed?

There's one user who has an issue that one of raylets cannot schedule tasks anymore because `num_worker_not_started_by_job_config_not_exist ` > 0.

This PR adds better log messages to figure out if the root cause is the job information is not properly propagated from GCS to raylet through Redis pubsub. 

## Related issue number

<!-- For example: "Closes #1234" -->

## Checks

- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for https://docs.ray.io/en/master/.
- [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(
2021-11-16 04:20:49 -08:00
Stephanie Wang
31eb385426
Revert "Revert "Revert "[core] Fail objects when pull/reconstruction hangs (#19789)" (#19904)" (#20120)" (#20406)
This reverts commit 0f57a9a105.
2021-11-15 20:36:22 -08:00
Alex Wu
75f421a3fd
[core] Nested task support via task depth + backpressure (#17887)
* needs depth

* depth

* .

* .

* .

* lint

* .

* lint

* fix tests

* .

* .

* .

* .

* cleanup

* .

* tests

* .

* more tests

* fix rest(?) of tests

* cleanup

* .

* .

* .

* .

* lint

* fix test basic

* fix ref counting?

* cleanup

* lint

* .

* pass dataset pipeline test

* .

* stephanie's comments + fix tests

* cleanup

* cleanup

* minor cleanup, then fix merge conflict

* lint

* cast

* feature flag

* lint

* lint

* refactor

* needs cleanup

* should pass

* lint

* .

* .

* .

* work?

* .

* works?

* lint

* work?

* .

* fix cpp tests

* .

* .

* split test

* fix windows?

* fix windows?

* fix test + check

* .

* all passing

* tests

* lint

* cleanup

* .

* most stephanie ocmments

* lint

* remove timer

* .

* allowed - capacity

* .

* everything except barrier

* addd guard

* works

* lint

* works?

* debug string

* last comment?

* short comments

* most comments

* lint

* done?

* done?

* .

* .

* .

* .

* done?

* done?

* update

* lint

* fix last test

* .

* .

* .

* .

* .

* .

* debug

* .

* .

* .

* .

* fix type

* .

* .

* cleanup

Co-authored-by: Alex Wu <alex@anyscale.com>
2021-11-15 17:39:50 -08:00
Lixin Wei
85dbda8cf1
[Core] Fix Crash in Debug Log (#20322)
* fix crash in debug log

* fix

* fix

* fix
2021-11-16 00:45:00 +09:00
Lixin Wei
b7e35acf14
[RuntimeEnv] Raise RuntimeEnvSetupError when Actor Creation Failed due to It (#19888)
* ray_pkg passed

* fix

* fix typo

* fix test

* fix test

* fix test

* fix

* draft

* compile OK

* lint

* fix

* lint

* fix ci

* Update src/ray/gcs/gcs_server/gcs_actor_manager.cc

Co-authored-by: SangBin Cho <rkooo567@gmail.com>

* remove comment

* rename

* resolve conflict

* use unique ownership

* use DestroyActor instead of ReconstructActor

* fix sigment fault

* fix crash in debug log

* Revert "fix crash in debug log"

This reverts commit 8f0e3d37f062b664d8d0e07c6c1a9a715b8ba1ee.

Co-authored-by: SangBin Cho <rkooo567@gmail.com>
2021-11-15 07:43:35 -08:00
Qing Wang
1172195571
[Java] Remove global named actor and global pg (#20135)
This PR removes global named actor and global PGs.

I believe these APIs are not used widely in OSS.
CPP part is not included in this PR.
@kfstorm @clay4444 @raulchen Please take a look if this change is reasonable.


IMPORTANT NOTE: This is a Java API change and will lead backward incompatibility in Java global named actor and global PG usage.

CPP part is not included in this PR.
INCLUDES:

 Remove setGlobalName() and getGlobalActor() APIs.
 Remove getGlobalPlacementGroup() and setGlobalPG
 Add getActor(name, namespace) API
 Add getPlacementGroup(name, namespace) API
 Update doc pages.
2021-11-15 16:28:53 +08:00
SangBin Cho
477b6265d9
[Core] Fix get_actor consistency on ray.kill (#20178)
* Improve race condition on ray.kill

* Fix a bug.

* Fix a bug

* fix core worker test

* done
2021-11-14 23:29:47 -08:00
Jiajun Yao
61778a952d
Only grant or reject spillback lease request (#20050) 2021-11-14 21:34:28 -08:00
SangBin Cho
475e4dbf76
[Core] Fix pg stats not imported (#20288)
* Fix pg stats not imported

* Fix metrics are not exported to the test
2021-11-14 19:05:57 -08:00
Chen Shen
6777a31751
[Core][actor out-of-order execution 2/n] create abstraction for the queuing logic on the client/actor submission. (#20149)
This second PR in the stack that supports out or order execution for threaded/async actors. Previous PR #20148 Next PR #20150
At a high level, threaded actor/async actor already don't guarantee execution order, and the current "sequential" order implementation has caused some confusion and inconvenience. Please refer to #19822 for detailed discussion.

This PR we further separate out the logic for ordering actor requests on the client side. In the next PR, we will implement a different type of queue that supports out of order execution.
2021-11-14 18:50:54 -08:00
Stephanie Wang
0f57a9a105
Revert "Revert "[core] Fail objects when pull/reconstruction hangs (#19789)" (#19904)" (#20120)
* Revert "Revert "[core] Fail objects when pull/reconstruction hangs (#19789)" (#19904)"

This reverts commit 630a8cacb3.

* debug

* fix/

* lint

* x

* fix

* x

* test

* x
2021-11-14 14:24:02 -08:00
Chen Shen
e49251d82e
[Core][actor out-of-order execution 4/n] refactor the actor receiver code
This is part of stack that enable out-of-order execution for actors. Previous PR #20150 Next PR #20176

Refactor the actor receiver code, by separating classes into their own header/cc files. specifically:
scheduling_queue.h for ScheduleQueue interface;
actor_scheduling_util.h for InBountRequest/DependencyWaiter/DependencyWaiterImpl
actor_scheduling_queue.h for ActorScheudlingQueue (the sequential execution queue)
normal_scheduling_queue.h for NormalSchedulingQueue (the task execution queue)
fiber_state_manager.h for FiberStateManager
thread_pool_manager.h for PoolManager and BoundedExecutor
2021-11-14 14:01:33 -08:00
Jiajun Yao
f8b738d029
[scheduler] Add scheduling debug log (#20302) 2021-11-12 18:48:05 -08:00
architkulkarni
138ec75246
[runtime env] Revert reference counting for per-actor URIs (#20281) 2021-11-12 11:09:38 -08:00
Chen Shen
a617cb8813
[Core][actor out-of-order execution 1/n] Move CoreWorkerDirectActorTaskSubmitter into a separate file
This is the stack of PRs that supports out or order execution for threaded/async actors. Next PR #20149
At a high level, threaded actor/async actor already don't guarantee execution order, and the current "sequential" order implementation has caused some confusion and inconvenience. Please refer to #19822 for detailed discussion.

The major changes of this stack is

introduce OutOfOrderActorSubmitQueue ([Core][actor out-of-order execution 3/n] Introducing out-of-order actor submit queue #20150)
Specifically, we have a per-client task submit queue, which guarantees the sequential order of task submission. In [Core][actor out-of-order execution 3/n] Introducing out-of-order actor submit queue #20150 we introduce OutOfOrderActorSubmitQueue, which relaxes the guarantee; it send the task over the network as soon as its dependency is resolved.
-- there are 2 PRs ([Core][actor out-of-order execution 1/n] Move CoreWorkerDirectActorTaskSubmitter into a separate file #20148 and [Core][actor out-of-order execution 2/n] create abstraction for the queuing logic on the client/actor submission. #20149) precedes this PR, which refactor the actor submission logic to make the abstraction possible.

OutOfOrderActorSchedullingQueue ([Core][actor out-of-order execution 5/n] implement out-of-order scheduling queue #20176)
Similarly, we also have a per-client task scheduling queue on the actor to ensure tasks are executed according to the submission order (sequence_no). OutOfOrderActorSchedullingQueue relaxes the guarantee by enqueuing the task as soon as all their dependencies are resolved.
-- there is one PR ([Core][actor out-of-order execution 4/n] refactor the actor receiver code #20160) precedes this PR, which refactor the actor scheduling logic to make it the code easier to read; however this one is optional.

plumbing PR ([Core][actor out-of-order execution 6/n] plumbing work to make it work e2e #20177)
This PR enables the out of order execution by introducing options(execute_out_of_order=True); and create actor client/server components according to the configuration.

There are something the PR hasn't touched upon is the restart/retry guarantees, which might need some discussion.

This PR we separate client from server code for Actor task submission. This makes the follow up change easier.
2021-11-12 09:28:58 -08:00
SangBin Cho
7132f91789
[Core] Reduce the frequency of retry messages (#20175)
* Reduce the frequency of retry messages

* done
2021-11-11 23:52:37 -08:00
Qing Wang
5d773e75e6
Fix idle worker leak issue if it received a SIGTERM when DrainAndShutdown. (#19877)
This PR fixes the issue that worker might be leaked if task finished with some errors.
See #19639 for more details.
2021-11-12 09:26:46 +08:00
mwtian
0330852baf
[Core][Pubsub] Implement Python GCS publisher and subscriber (#20111)
## Why are these changes needed?
This change adds Python publisher and subscriber in `gcs_utils.py`, and GRPC handler on GCS for publishing iva GCS. Error info is migrated to use the GCS-based pubsub, if feature flag `RAY_gcs_grpc_based_pubsub=true`.

Also, add a `--gcs-address` flag to some Python processes. It is not set anywhere yet, but will be set aftering Redis-less bootstrapping work.

Unit tests are added for the Python publisher and subscriber. Migrated error info publishers and subscribers are tested with existing unit tests, e.g. tests calling `ray._private.test_utils.get_error_message()` to ensure error info is published.

GCS based pubsub has gaps in handling deadline, cancelled requests and GCS restarts. So 3 more unit tests are disabled in the `HA GCS` mode. They will be addressed in a separate change.

## Related issue number
2021-11-11 14:59:57 -08:00
liuyang-my
efca009258
[Serve] Make Java Replica Extendable (#19463) 2021-11-10 15:05:37 -08:00
architkulkarni
923131ba37
[runtime env] Enable reference counting for URIs for actors (#20165) 2021-11-10 10:52:03 -08:00
DK.Pino
2c41936a39
[Placement Group] [Test] Fix pg.ready hang forever when gcs restarting (#20063)
* fixed

* lint

* fix comment

* revert previous fix code
2021-11-10 00:53:42 -08:00
Tao Wang
507bd9186b
[Core]Make convertion between ray/grpc status more specific (#20047)
* [Core]Make convertion between ray/grpc status more specific

* per comments

* lint

* per comments

* use ABORT instead of UNKNOWN, add some tests

* lint

* lint
2021-11-10 00:48:05 -08:00
Guyang Song
6bb0659010
[core][bugfix] fix print ref count for an erased iterator (#20138) 2021-11-09 14:50:25 -08:00
SangBin Cho
b0550aa440
[Core] Fix the named actor get or create race condition (#20126)
* Fix done.

* Fixed.

* clean up

* Done
2021-11-09 02:27:54 -08:00
Lingxuan Zuo
97259e33b2
Relink grpc/absl for streaming.so (#20136)
To avoid exporting thrirdparty library symbol globally, these absl/grpc libs have been applied in _streaming.so.

Side-effect:
Static variables might be uninitialized if core worker lib and streaming lib both use them.
2021-11-09 14:13:53 +08:00
Stephanie Wang
ffcc5935d7
[core] Evict lineage to bound memory usage (#19946)
* bound lineage

* Bound lineage in bytes

* test

* Lineage evicted error

* Lineage evicted

* lint

* test

* test

* comment

* doc

* x

* x

* x

* x
2021-11-08 21:53:40 -08:00
Kai Yang
e84391d1d3
[Core] Encode job ID in randomized task IDs for user-created threads (#19320)
## Why are these changes needed?

Currently, when `WorkerContext::GetCurrentTaskID()` returns a random task ID in user-created threads, and the returned task ID doesn't include the job ID. In this case, subsequent non-actor tasks and return values, and objects created by `ray.put()` don't include the job ID neither. This makes us hard to find the correct job ID from a task or object ID.

This PR updates the task ID generation code to always encode the job ID.

A side-effect of this PR is the change of possibility of task ID collision in user-created threads due to the fixed job ID part. w/o this PR: `sqrt(pi * 256 ^ 12 / 2)` ~= 352 trillion tasks. w/ this PR: `sqrt(pi * 256 ^ 8 / 2)` ~= 5 billion tasks. But this should be OK because the job ID part of task IDs in non-user-created threads are always fixed, so it won't be worse than non-user-created threads.

## Related issue number

## Checks

- [ ] I've run `scripts/format.sh` to lint the changes in this PR.
- [ ] I've included any doc changes needed for https://docs.ray.io/en/master/.
- [ ] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
   - [ ] Unit tests
   - [ ] Release tests
   - [ ] This PR is not tested :(
2021-11-08 21:00:40 +08:00
qicosmos
547bfbc4a4
[core]Simplify filesystem (#18941) 2021-11-08 17:54:07 +08:00
Qing Wang
6d8a7291ab
Add getNamespace API for Java worker (#20057)
[Java API] Add getNamespace API for Java worker.
2021-11-08 15:51:14 +08:00
SangBin Cho
7a18d90a25
Revert "[scheduler] Update local object store usage (#20026)" (#20118)
This reverts commit 7e013366ac.
2021-11-06 07:34:27 -07:00
SangBin Cho
f65cc72b4c
Revert "Set default max_pending_lease_requests_per_scheduling_category to 10 (#19924)" (#20124)
This reverts commit 0d850f3302.
2021-11-05 23:35:30 -07:00
mwtian
4d70ce1c86
[Core][Pubsub] add worker failure message to gcs pubsub (#20075)
## Why are these changes needed?
This is to demonstrate the steps needed to add a GCS pubsub channel, with GCS publisher and C++ subscribers subscribing via GCS client. For new channels, a unit test exercising the publishing and subscribing logic should also be added to `gcs_client_test.cc`.


## Related issue number
2021-11-05 14:52:49 -07:00
Jiajun Yao
0d850f3302
Set default max_pending_lease_requests_per_scheduling_category to 10 (#19924) 2021-11-05 14:24:20 -07:00
Alex Wu
146b3d6bcc
[scheduler] Include depth and function descriptor in scheduling class (#20004) 2021-11-05 08:19:48 -07:00
SangBin Cho
8299aae918
[Placement Group] Add stats to pg scheduling (#19841)
* Add an e2e stats to pg scheduling

* Fix bugs.

* fix a bug.

* Revert "fix a bug."

This reverts commit dd7e03d1346fa39e54898effaaf8a2771103176e.

* done except unit tests.

* done except unit tests.

* Add unit tests.

* Address code review.

* done

* Fix

* done

* Fixed the test
2021-11-05 06:51:42 -07:00
architkulkarni
c5175073b2
[runtime env] Add garbage collection for conda envs (#20072) 2021-11-04 23:13:34 -05:00
Alex Wu
4ffb7ccfac
[scheduler][cleanup] Remove one cpu optimization (#20022)
* .

* remove test

* Update cluster_task_manager.cc

* Update cluster_task_manager.cc

* lint

* lint

* .

Co-authored-by: Alex Wu <alex@anyscale.com>
2021-11-04 14:18:13 -07:00
Chen Shen
5c0e012ba3
[Core][Core-worker] de-escalate the error message when worker is accessed after shutdown. (#20049)
* de-escalate

* lint
2021-11-04 09:56:39 -07:00
architkulkarni
bcb63961d9
[runtime env] Add plugin name to internal URI format and add GC for py_modules (#20009) 2021-11-04 10:16:14 -05:00
Jiajun Yao
7e013366ac
[scheduler] Update local object store usage (#20026)
* Update local object store usage

* Update local object store usage

* Update local object store usage
2021-11-04 08:11:32 -07:00
Qing Wang
4373aa1e3b
Support generating a UUID string as the anonymous namespace for Java worker. (#19986)
Why are these changes needed?
For Java worker, we generate a UUID string as the namespace if a job is not specified a namespace by user.

Related issue number
#16474
2021-11-04 11:40:17 +08:00
Alex Wu
b52cc6ecdc
[scheduler] Fix dynamically increasing resources (#20036) 2021-11-03 17:28:44 -07:00
SangBin Cho
eacaff5d8d
[Core] Try scheduling tasks when the local resource creation is updated (#20019)
## Why are these changes needed?

Check https://github.com/ray-project/ray/pull/19996/files#r741963616

## Related issue number
2021-11-03 12:29:51 -07:00
Yi Cheng
555b87d552
[gcs] Enable grpc based broadcasting by default (#19716)
## Why are these changes needed?
This is part of redis removal project. This PR is going to enable grpc based broadcasting by default.

## Related issue number

<!-- For example: "Closes #1234" -->
#19438 
## Checks
2021-11-03 10:02:37 -07:00
SangBin Cho
73f21b83a0
[Core] improve the GCS address update failure error message. (#19930)
* improve the error message.

* improve  the error msg further
2021-11-03 07:02:44 -07:00
Eric Liang
28d4cfb039
[RFC] Reference counting bug when the object ref transits the same worker as a nested return and then arg (#19910) 2021-11-03 01:37:06 -07:00