Commit graph

26 commits

Author SHA1 Message Date
Guyang Song
8e1e783596
fix "team:xxx" tag of cpp tests #22163
Cpp worker tests should be part of ray core.
2022-02-07 11:33:55 -08:00
qicosmos
7172802d8c
[C++ Worker][xlang] Support calling python worker (#21390)
C++ API need to call python and java worker, this pr support call python worker. Call python worker is similar with call c++ worker, need to pass PyFunction, PyActorClass and PyActorMethod.

## call python normal task
```python
#test_cross_language_invocation.py
import ray

@ray.remote
def py_return_input(v):
    return v
```

c++ api call python function
```c++
  auto py_obj1 = ray::Task(ray::PyFunction</*ReturnType*/int>{/*module_name=*/"test_cross_language_invocation",
                                                     /*function_name=*/"py_return_input"})
                     .Remote(42);
  EXPECT_EQ(42, *py_obj1.Get());
```
The user need to fill python module name and function name, then pass arguments into the remote.
The user also need to assign the return type and arguments types of the python function, it used to do static safe checking and get result.

## call python actor task
```python
#test_cross_language_invocation.py
@ray.remote
class Counter(object):
    def __init__(self, value):
        self.value = int(value)

    def increase(self, delta):
        self.value += int(delta)
        return str(self.value)
```
c++ api call python actor function
```c++
  // Create  python actor
  auto py_actor_handle =
      ray::Actor(ray::PyActorClass{/*module_name=*/"test_cross_language_invocation",  /*class_name=*/"Counter"})
          .Remote(1);
  EXPECT_TRUE(!py_actor_handle.ID().empty());

  // Call python actor task
  auto py_actor_ret =
      py_actor_handle.Task(ray::PyActorMethod</*ReturnType*/std::string>{/*actor_function_name=*/"increase"}).Remote(1);
  EXPECT_EQ("2", *py_actor_ret.Get());
```
The user need to fill python module name and class name when creating python actor.

PyActorMethod only need to fill the function name.

It's also similar with calling c++ actor task, also has compile-time safe checking.
2022-01-21 13:55:30 +08:00
Guyang Song
c04fb62f1d
[C++ worker] set native library path for shared library search (#19376) 2021-10-18 16:03:49 +08:00
gjoliver
635010d460
Update build rules and patches for darwin_arm64 platform. (#19037)
* Update build rules and patches for darwin_arm64 platform.

Changes include:

Update nelhage/rules_boost package from current version (08/5/2020) to 5/27/2021 version.
Remove rules_boost-undefine-boost_fallthrough.patch, since BOOST_FALLTHROUGH seems to be defined now.
Minor changes to rules_boost-windows-linkopts.patch to use default condition to add -lpthread flag for all platforms.
Add darwin_arm64 config to BUILD files for lib civetweb pulled in via prometheu dependency.

* upgrade boost to 1.74.0 from 1.71.0 to match the udpated build file for windows.

* Fix ray_cpp_pkg

* Use boost/bind/bind.hpp

boost/bind.hpp and global namespace placeholders are deprecated.

* lint

* Use absl::bind_front when possible. Otherwise, NOLINT

* lint

* lint

* lint

* lint

* more lint

* final lint

* trigger build
2021-10-09 18:48:35 -07:00
Guyang Song
739cf64115
[C++ API] support head_args config in C++ API (#18709) 2021-09-23 19:30:53 +08:00
qicosmos
64c25987f3
[C++ Worker]Simple kv store example (#18613) 2021-09-18 16:02:44 +08:00
qicosmos
dd096c8e73
[C++ Worker]Fix abi issue (#18273) 2021-09-10 11:53:05 +08:00
Simon Mo
b573864928
[CI] Add test owners (#17893) 2021-08-18 18:38:31 -07:00
qicosmos
a2a1c46c83
[C++ Worker]Fix for mac (#17633)
* linkopts shared

* replace gflags with absl flags

* fix

* add test option

* fix

* add cpp worker to mac ci

* fix

* support empty redis password;mod arc argv

* add encoding

* test

* ignore example test on mac

* support mac

* fix

* fix and update doc

* fix

* fix run.sh

* fix init

* fix typo

* fix run.sh

* fix lint

Co-authored-by: 久龙 <guyang.sgy@antfin.com>
2021-08-13 12:22:37 +08:00
SongGuyang
dcb1baabd7
[C++ API] support loading C++ dynamic libraries from code search path (#16828) 2021-07-16 13:02:45 +08:00
SongGuyang
560fd15568
[C++ worker] support build and add C++ worker to python wheel (#16496) 2021-07-08 14:42:26 +08:00
Kai Yang
e925051ce4
[Core] Get node to connect for driver in global state accessor (#16810) 2021-07-08 11:21:12 +08:00
SongGuyang
41b9a5102b
[C++ worker] support build C++ worker during python setup (#16636) 2021-06-29 10:29:47 +08:00
qicosmos
4da69174c8
[C++ Worker]Remove unused boost sub libs for the generated template project (#16526) 2021-06-21 14:46:48 +08:00
qicosmos
0f87eca3e9
[C++ Worker]Generate a template project for users (#16337) 2021-06-16 17:45:45 +08:00
SongGuyang
17b5f4dcaa
[C++ worker] support config from RayConfig and command line(gflag) (#16086) 2021-05-31 11:56:02 +08:00
SongGuyang
a4c108e5f6
[C++ worker] delete unuseful test (#16082) 2021-05-27 11:23:59 +08:00
qicosmos
bbb61d0c00
[C++ Worker] remove core.h in api (#16079)
* remove core.h in api

* remove unused code and header

* remove core.h and some depencencies

* fix
2021-05-26 20:52:21 +08:00
qicosmos
d8f58e683f
[C++ worker] Add c++ worker log (#16015) 2021-05-26 16:13:02 +08:00
qicosmos
8790bb465b
[C++ worker] Remove func ptr offset (#15809) 2021-05-19 18:03:39 +08:00
qicosmos
de7ee75d27
[C++ worker] Ray normal task for RAY_REMOTE (#14599) 2021-03-27 09:56:40 +08:00
qicosmos
277b6f5d3c
Support arbitrary arguments for c++ worker normal tasks and actor tasks (#14233) 2021-03-01 16:27:03 +08:00
SongGuyang
361e5f0bef
support dynamic library loading in C++ worker (#13734) 2021-02-01 19:24:33 +08:00
SongGuyang
5cbc411e38
[cpp worker] support cluster mode (#9977) 2020-09-18 11:08:18 +08:00
SongGuyang
cb70864c04
[cpp worker] support cluster mode and object Put/Get works (#9682) 2020-08-28 13:53:36 +08:00
SongGuyang
c195dc8f88
Basic C++ worker implementation (#6125) 2020-03-27 23:01:08 +08:00