Commit graph

47 commits

Author SHA1 Message Date
Qing Wang
c5252c5ceb
[Java] Support parallel actor in experimental. (#21701)
For the purpose to provide an alternative option for running multiple actor instances in a Java worker process, and the eventual goal is to remove the original multi-worker-instances in one worker process implementation.  we're proposing supporting parallel actor concept in Java. This feature enables that users could define some homogeneous parallel execution instances in an actor, and all instances hold one thread as the execution backend.

### Introduction

For the following example, we define a parallel actor with  10 parallelism. The backend actor has 10 concurrency groups for the parallel executions, it also means there're 10 threads for that.

We can access the instance by the instance handle, like:
```java
ParallelActorHandle<A> actor = ParallelActor.actor(A::new).setParallelism(10).remote();
ParallelInstance<A> instance = actor.getInstance(/*index=*/ 2);
Preconditions.checkNotNull(instance);
Ray.get(instance.task(A::incr, 1000000).remote()); // print 1000000           

instance = actor.getInstance(/*index=*/ 2);
Preconditions.checkNotNull(instance);
Ray.get(instance.task(A::incr, 2000000).remote().get()); // print 3000000

instance = actor.getInstance(/*index=*/ 3);
Preconditions.checkNotNull(instance);
Ray.get(instance.task(A::incr, 2000000).remote().get()); // print 2000000
```


### Limitation
- It doesn't support concurrency group on a parallel actor yet.

Co-authored-by: Kai Yang <kfstorm@outlook.com>
2022-04-21 22:54:33 +08:00
architkulkarni
5b6bf534a0
[Java] Fix typo projetct->project in XML file (#21060) 2021-12-20 20:21:35 +08:00
Zhi Lin
d3786ac131
Bump Java version to 2.0.0-SNAPSHOT (#15394)
* bump java version to 2.0.0-SNAPSHOT

* update
2021-08-30 12:25:30 +08:00
liuyang-my
12bd904594
[Serve] Define BackendConfig protobuf and adapt it in Java (#17201) 2021-08-06 09:50:45 -07:00
Amog Kamsetty
503b748d64
Revert "Revert "[Java] upgrade jar deps to fix cves" (#16889)" (#16899)
This reverts commit f2308a0cdf.
2021-07-06 14:00:50 -07:00
Amog Kamsetty
f2308a0cdf
Revert "[Java] upgrade jar deps to fix cves" (#16889)
This reverts commit 25666fff81.
2021-07-06 10:33:31 -07:00
chaokunyang
25666fff81
[Java] upgrade jar deps to fix cves (#16870) 2021-07-06 09:04:21 -07:00
liuyang-my
2c3ce469ba
[Serve] Define Java Backend (#16169) 2021-07-01 20:41:17 -07:00
chaokunyang
d1dd3410c8
[Java] Format ray java code (#13056) 2020-12-29 10:36:16 +08:00
chaokunyang
1979ea9c0a
fix disable javadoc lint (#11907) 2020-11-11 13:40:50 +08:00
chaokunyang
322f12600f
bump java version to 1.1.0 (#10795) 2020-09-16 12:05:11 +08:00
chaokunyang
1aad8aa39c
[Java] Fix java doc building error (#10757) 2020-09-14 17:44:45 +08:00
Hao Chen
f7558ed2a5
Remove outdated Java doc and run demo code in CI (#10698) 2020-09-11 19:15:52 +08:00
chaokunyang
a96af94e56
[Java] add developer section (#10670) 2020-09-09 15:45:49 +08:00
Eric Liang
30911960c8
[1.0] Simple, universal instead of Simple and universal (#10587) 2020-09-04 14:04:29 -07:00
Eric Liang
e5d089384b
[1.0] Ray whitepaper link and tagline update (#10455) 2020-09-01 09:48:35 -07:00
chaokunyang
7ffb37f711
[Java] add maven repo (#10109) 2020-08-14 11:31:01 -07:00
chaokunyang
64d6446cf3
change version from 0.1-SNAPSHOT to 0.9.0-SNAPSHOT (#9778) 2020-08-01 22:38:22 +08:00
chaokunyang
6464bf55c6
[dist] Mvn deploy (#9777) 2020-07-30 11:48:31 +08:00
Qing Wang
98bfcd53bc
[Java] Rename group id and package name. (#7864)
* Initial

* Change streaming's

* Fix

* Fix

* Fix org_ray

* Fix cpp file name

* Fix streaming

* Fix

* Fix

* Fix testlistening

* Fix missing sth in python

* Fix

* Fix

* Fix SPI

* Fix

* Fix complation

* Fix

* Fix CI

* Fix checkstyle

Fix checkstyle

* Fix streaming tests

* Fix streaming CI

* Fix streaming checkstyle.

* Fix build

* Fix bazel dep

* Fix

* Fix ray checkstyle

* Fix streaming checkstyle

* Fix bazel checkstyle
2020-04-12 17:59:34 +08:00
chaokunyang
289e5e8aff enable maven checkstyle (#6829) 2020-01-20 23:41:54 -08:00
Chaokun Yang
7bbfa85c66 [Streaming] Streaming data transfer java (#6474) 2019-12-22 10:56:05 +08:00
Kai Yang
806524384b [Java worker] Refactor object store and worker context on top of core worker (#5079) 2019-07-16 20:58:02 +08:00
Hao Chen
643f62dc43
[Java][Bazel] Refine auto-generated pom files (#4780) 2019-05-16 11:19:31 +08:00
ppeagle
5efb21e1d0 Initial commit for Ray streaming (#4268) 2019-03-30 19:32:05 +08:00
bibabolynn
ab55a1f93a [Java] Clean up outdated dependencies (#4489) 2019-03-28 14:33:45 +08:00
Hao Chen
d03999d01e
Cross-language invocation Part 1: Java calling Python functions and actors (#4166) 2019-03-21 13:34:21 +08:00
Hao Chen
a6a5b344b9 [Java] Upgrade checkstyle plugin (#4375) 2019-03-15 11:36:09 -07:00
Wang Qing
1fb56a4316 Remove deprecated module (#4038) 2019-02-14 10:04:09 +08:00
Philipp Moritz
3bb65677dc Use one memory mapped file for plasma (#3871) 2019-02-06 23:53:05 -08:00
ggdupont
a237b4a6a1 [Java] Fix package jaxb not exist when JDK11 (#3738) 2019-01-16 14:15:00 +08:00
Wang Qing
3cf59855af [Java] Replace junit with testNG (#3768) 2019-01-14 17:49:17 +08:00
Wang Qing
8e8e123777 [Java] Simplify Java worker configuration (#2938)
## What do these changes do?
Previously, Java worker configuration is complicated, because it requires setting environment variables as well as command-line arguments.

This PR aims to simplify Java worker's configuration. 
1) Configuration management is now migrated to [lightbend config](https://github.com/lightbend/config), thus doesn't require setting environment variables.
2) Many unused config items are removed.
3) Provide a simple `example.conf` file, so users can get started quickly.
4) All possible options and their default values are declared and documented in `ray.default.conf` file.

This PR also simplifies and refines the following code:
1) The process of `Ray.init()`.
2) `RunManager`.
3) `WorkerContext`. 

### How to use this configuration?
1. Copy `example.conf` into your classpath and rename it to `ray.conf`.
2. Modify/add your configuration items. The all items are declared in `ray.default.conf`.
3. You can also set the items in java system prosperities.

Note: configuration is read in this priority:
System properties > `ray.conf` > `ray.default.conf`

## Related issue number
N/A
2018-09-26 20:14:22 +08:00
Wang Qing
0e552fbb22 [Java] Update maven version to 0.1-SNAPSHOT
Update the version in maven from 0.1 to 0.1-SNAPSHOT, because SNAPSHOT is the conventional version name in dev process. Non-snapshot versions are only used for release.
2018-09-26 18:08:46 +08:00
Hao Chen
971df5ea8a [java] put function meta in task spec and load functions with function meta (#2881)
This PR adds a `function_desc` field into task spec. a function descriptor is a list of strings that can uniquely describe a function.
- For a Python function, it should be: [module_name, class_name, function_name]
- For a Java function, it should be: [class_name, method_name, type_descriptor]

There're a couple of purposes to add this field:

In this PR:
- Java worker needs to know function's class name to load it. Previously, since task spec didn't have such a field to hold this info, we did a hack by appending the class name to the argument list. With this change, we fixed that hack and significantly simplified function management in Java.

Will be done in subsequent PRs:
- Support cross-language invocation (#2576): currently Python worker manages functions by saving them in GCS and pass function id in task spec. However, if we want to call a Python function from Java, we cannot save it in GCS and get the function id. But instead, we can pass the function descriptor (module name, class name, function name) in task spec and use it to load the function.
- Support deployment: one major problem of Python worker's current function management mechanism is #2327. In prod env, we should have a mechanism to deploy code and dependencies to the cluster. And when code is already deployed, we don't need to save functions to GCS any more and can use `function_desc` to manage functions.
2018-09-25 23:05:05 -07:00
Hao Chen
8414e413a2 [java] refine and simplify java worker code structure (#2838) 2018-09-10 10:48:17 -07:00
Hao Chen
a719e089b0 [multi-language part 1] add a 'language' field to task specification (#2639) 2018-08-16 21:26:42 -07:00
Philipp Moritz
f13e3e22f2 Upgrade arrow to include tensorflow op fix (#2607) 2018-08-14 21:47:01 -07:00
Wang Qing
e4f68ff8cf [Java Worker] Support raylet on Java (#2479) 2018-08-01 17:52:49 -07:00
Hao Chen
0ea7a6abf0 add java tutorial (#2491) 2018-07-28 17:09:30 -07:00
Hanwei Jin
450b11f1d6 update to slf4j, remove DynamicLog (#2384) 2018-07-09 23:33:59 -07:00
Zhijun Fu
fa33ea5283 [Java] Java worker cluster support (#2359) 2018-07-09 10:20:41 -07:00
Wang Qing
b7088c1010 Clean the pom files (#2350) 2018-07-05 13:36:01 -07:00
Shuo
8e687cbc98 Unify the identity of a process while logging. (#2325) 2018-07-04 14:26:19 -07:00
mylinyuzhi
fa0ade2bc5 [Java] Replace binary rewrite with Remote Lambda Cache (SerdeLambda) (#2245)
* <feature> : serde lambda

* <feature>:fixed CR

with issue #2245

* <feature>: fixed CR
2018-06-13 12:58:07 -07:00
Yujie Liu
3b5e700fd7 [JavaWorker] Java code lint check and binding to CI (#2225)
* add java code lint check and fix the java code lint error

* add java doc lint check and fix the java doc lint error

* add java code and doc lint to the CI
2018-06-09 16:26:54 -07:00
Yujie Liu
a8d3c057c1 [JavaWorker] Enable java worker support (#2094)
* Enable java worker support
--------------------------
This commit includes a tailored version of the Java worker implementation from Ant Financial.
The changes for build system, python module, src module and arrow are in other commits, this commit consists of the following modules:
 - java/api: Ray API definition
 - java/common: utilities
 - java/hook: binary rewrite of the Java byte-code for remote execution
 - java/runtime-common: common implementation of the runtime in worker
 - java/runtime-dev: a pure-java mock implementation of the runtime for fast development
 - java/runtime-native: a native implementation of the runtime
 - java/test: various tests

Contributors for this work:
 Guyang Song, Peng Cao, Senlin Zhu,Xiaoying Chu, Yiming Yu, Yujie Liu, Zhenyu Guo

* change the format of java help document from markdown to RST

* update the vesion of Arrow for java worker

* adapt the new version of plasma java client from arrow which use byte[] instead of custom type

* add java worker test to ci

* add the example module for better usage guide
2018-05-26 14:38:50 -07:00