Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
6ff919e
Refine JNI bazel script to make it suitable for more systems
Feb 15, 2019
a396961
Conflict resolution
Mar 4, 2019
ce314ff
java bazel config
Mar 5, 2019
a1e7ea0
Merge branch 'ruifang.crf_stage' of https://github.com/ant-tech-allia…
Mar 5, 2019
c39a75b
java bazel config
Mar 5, 2019
268e694
java bazel config
Mar 6, 2019
c63eb04
java bazel config
Mar 6, 2019
c2bc0d8
Update test.sh
ruifangChen Mar 6, 2019
1b8a5a4
Update java/testng.xml
raulchen Mar 6, 2019
40c0b62
Update build.sh
ruifangChen Mar 6, 2019
8eb90fa
Update test.sh
ruifangChen Mar 6, 2019
bded0ae
Update build.sh
ruifangChen Mar 6, 2019
0263855
delete the variable RAY_USR_CMAKE
Mar 6, 2019
a3ecbd7
Merge branch 'ruifang.crf_stage' of https://github.com/ant-tech-allia…
Mar 6, 2019
470518b
Update test.sh
ruifangChen Mar 6, 2019
2b69448
Update .travis.yml
ruifangChen Mar 6, 2019
2aa6ceb
Update .travis.yml
ruifangChen Mar 6, 2019
172e8cc
Update testng.xml
ruifangChen Mar 6, 2019
99eea65
Update BUILD.bazel
ruifangChen Mar 6, 2019
1eec35f
Update ray_java.bzl
ruifangChen Mar 6, 2019
e25e66e
Merge branch 'master' into ruifang.crf_stage
ruifangChen Mar 7, 2019
3a2acd9
modify the java/test.sh
Mar 7, 2019
ec17991
delete the 'test bazel build' and add install-bazel.sh to installatio…
Mar 7, 2019
fb93804
Add java's checkstyle with bazel and modify with some other suggestions
Mar 11, 2019
38f70ac
Merge branch 'master' into ruifang.crf_stage
ruifangChen Mar 11, 2019
248cdef
modify bazel format
Mar 11, 2019
7fbe6ac
Some code errors
Mar 11, 2019
13ece31
code errors
Mar 11, 2019
9b6f46d
modify the error 'pushd not find'
Mar 11, 2019
a6cfd79
modify compile error
Mar 11, 2019
301eab5
Merge branch 'master' of https://github.com/ant-tech-alliance/ray int…
Mar 12, 2019
5540b93
modify generate_java_gcs_fbs to ensure runtime's compile is successful
Mar 12, 2019
e745a05
Update Arrow to plasma-client-separation-on-c0a2e73
Mar 12, 2019
a293816
modify code with raulchen's and pcmoritz's suggestions
Mar 12, 2019
e296c0b
add soft link to some path that cmake used
Mar 12, 2019
27b9e97
modify java/test.sh
Mar 12, 2019
f73ec2b
Merge branch 'master' into ruifang.crf_stage
pcmoritz Mar 13, 2019
29ed8bb
modify java/test.sh with the exitcode 2
Mar 13, 2019
50bb868
modify java/test.sh
Mar 13, 2019
ed909b2
[Java] Package binary dependencies into jar
raulchen Mar 14, 2019
d4707f2
format
raulchen Mar 14, 2019
f1f6e21
add @boost//:asio to logging_test
Mar 15, 2019
0c79831
delete checkstyle and add .bazelrc file
Mar 15, 2019
b64a029
Merge branch 'ruifang.crf_stage' of https://github.com/ant-tech-allia…
Mar 15, 2019
ae02b6a
Refine JNI bazel script to make it suitable for more systems
Feb 15, 2019
6236d59
java bazel config
Mar 5, 2019
91666b7
java bazel config
Mar 5, 2019
f9d3cc4
java bazel config
Mar 6, 2019
0a0c525
java bazel config
Mar 6, 2019
9006b29
Update test.sh
ruifangChen Mar 6, 2019
2247b0b
Update java/testng.xml
raulchen Mar 6, 2019
29f45c8
Update build.sh
ruifangChen Mar 6, 2019
a064c0a
Update test.sh
ruifangChen Mar 6, 2019
70f8238
Update build.sh
ruifangChen Mar 6, 2019
f432bb3
delete the variable RAY_USR_CMAKE
Mar 6, 2019
35a0be0
Update test.sh
ruifangChen Mar 6, 2019
168a430
Update .travis.yml
ruifangChen Mar 6, 2019
85641ae
Update .travis.yml
ruifangChen Mar 6, 2019
12abf44
Update testng.xml
ruifangChen Mar 6, 2019
9f35289
Update BUILD.bazel
ruifangChen Mar 6, 2019
bfe211d
Update ray_java.bzl
ruifangChen Mar 6, 2019
ee495bb
modify the java/test.sh
Mar 7, 2019
43dfbcf
delete the 'test bazel build' and add install-bazel.sh to installatio…
Mar 7, 2019
86b7de0
Add java's checkstyle with bazel and modify with some other suggestions
Mar 11, 2019
dcb1c21
modify bazel format
Mar 11, 2019
b62e8c8
Some code errors
Mar 11, 2019
04397ea
code errors
Mar 11, 2019
61d0eb9
modify the error 'pushd not find'
Mar 11, 2019
eaae232
modify compile error
Mar 11, 2019
5470647
modify generate_java_gcs_fbs to ensure runtime's compile is successful
Mar 12, 2019
621ad88
Update Arrow to plasma-client-separation-on-c0a2e73
Mar 12, 2019
5b83532
modify code with raulchen's and pcmoritz's suggestions
Mar 12, 2019
af00ed9
add soft link to some path that cmake used
Mar 12, 2019
87f183c
modify java/test.sh with the exitcode 2
Mar 13, 2019
2d64515
modify java/test.sh
Mar 13, 2019
755efc7
[Java] Package binary dependencies into jar
raulchen Mar 14, 2019
8674a68
delete checkstyle and add .bazelrc file and modify java_test
Mar 15, 2019
84d5d31
merge
Mar 15, 2019
2324c67
Fix function manager test
Mar 15, 2019
c9a6361
Test1 (#104)
raulchen Mar 15, 2019
d644522
delete local checkstyle and add .bazelrc file and modify java_test
Mar 15, 2019
16d9dd6
Fix function manager test
Mar 15, 2019
82007d1
reslove conficts
Mar 15, 2019
c4de040
add import
Mar 15, 2019
fcdc856
fix
raulchen Mar 15, 2019
3a1c838
fix
raulchen Mar 15, 2019
a2bf5ce
fix
raulchen Mar 15, 2019
2b3d922
move the java deps to runtime's resources
Mar 15, 2019
cc5d784
delete the variable RAY_USR_CMAKE
Mar 6, 2019
36a20d6
modify .travis.yml as the master
Mar 15, 2019
575564d
modify .travis.yml as ray-project/ray's master
Mar 15, 2019
9954544
Merge branch 'master' into ruifang.crf_stage
ruifangChen Mar 17, 2019
fe54544
Merge branch 'ruifang.crf_stage' of https://github.com/ant-tech-allia…
Mar 17, 2019
a11045f
Resolve conflicts caused by crf_stag-fix-test branch merge
Mar 17, 2019
c0276b4
Add temporary commit for arrow to start to test
Mar 18, 2019
5364ebe
modify java/BUILD
Mar 18, 2019
90b94be
modify with raulchen's suggestion
Mar 18, 2019
72fe9a5
Update java/test.sh
raulchen Mar 18, 2019
cb4fc92
Update java/test.sh
raulchen Mar 18, 2019
e0fa777
modify some errors
Mar 19, 2019
f9d371a
Merge branch 'ruifang.crf_stage' of https://github.com/ant-tech-allia…
Mar 19, 2019
2435f51
modify some errors
Mar 19, 2019
f58b6a6
Update BUILD.bazel
raulchen Mar 19, 2019
40ceb4e
modify with raulchen's suggestions
Mar 19, 2019
c287290
Merge branch 'master' of https://github.com/ant-tech-alliance/ray int…
Mar 20, 2019
d002e5b
Use apache arrow commit in bazel
Mar 20, 2019
c285710
modify java/test.sh error
Mar 20, 2019
326f5a2
Auto generate deps
raulchen Mar 20, 2019
5613347
add java/WORKSPACE
raulchen Mar 20, 2019
723afbd
Revert "add java/WORKSPACE"
raulchen Mar 20, 2019
f9a1344
Revert "Auto generate deps"
raulchen Mar 20, 2019
48030ad
Restore java -jar way to execute java use case
Mar 21, 2019
520c40a
modify java/third_party/workspace.bzl
Mar 21, 2019
27150f3
Update test.sh
raulchen Mar 21, 2019
3b900e5
update checkstyle_java github's address
Mar 21, 2019
5060a41
Merge branch 'master' into ruifang.crf_stage
ruifangChen Mar 21, 2019
347b147
add deps to org_ray_ray_test
Mar 21, 2019
f0e3656
add 'cat hs_err_*' to .travis.yml
Mar 21, 2019
606a876
Revert "add 'cat hs_err_*' to .travis.yml"
raulchen Mar 21, 2019
abccca9
Fix FunctionManagerTest
raulchen Mar 21, 2019
b504a22
fix generate_java_gcs_fbs
raulchen Mar 21, 2019
cd0f583
Supress output
raulchen Mar 21, 2019
6477aca
Revert "fix generate_java_gcs_fbs"
raulchen Mar 21, 2019
60073ae
fix maven install
raulchen Mar 21, 2019
9d1fed2
pass in PATH
raulchen Mar 21, 2019
c71acfe
debug
raulchen Mar 21, 2019
330301b
fix
raulchen Mar 21, 2019
28c9169
fix
raulchen Mar 21, 2019
ba2b535
modify problem: mvn command not found
Mar 21, 2019
7943543
Revert "modify problem: mvn command not found"
raulchen Mar 22, 2019
101fbd1
skip test
raulchen Mar 22, 2019
8c756d0
Revert "skip test"
raulchen Mar 22, 2019
67b628f
Fix loading native libraries
raulchen Mar 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# build config
build --compilation_mode=opt
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,16 @@ matrix:
env:
- JDK='Oracle JDK 8'
- PYTHON=3.5 PYTHONWARNINGS=ignore
- RAY_USE_CMAKE=1
- RAY_INSTALL_JAVA=1
install:
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
- if [ $RAY_CI_JAVA_AFFECTED != "1" ]; then exit; fi

- ./ci/travis/install-dependencies.sh
- ./ci/suppress_output ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- ./ci/travis/install-ray.sh
- ./ci/suppress_output ./ci/travis/install-ray.sh
script:
- if [ $RAY_CI_JAVA_AFFECTED != "1" ]; then exit; fi

- ./java/test.sh

- os: linux
Expand Down Expand Up @@ -167,7 +165,7 @@ install:
- ./ci/suppress_output bash src/ray/test/run_gcs_tests.sh
# Raylet tests.
- ./ci/suppress_output bash src/ray/test/run_object_manager_tests.sh
- ./ci/suppress_output bazel test --build_tests_only --test_lang_filters=cc ... -c opt
- ./ci/suppress_output bazel test --build_tests_only --test_lang_filters=cc //:all

script:
- export PATH="$HOME/miniconda/bin:$PATH"
Expand Down
67 changes: 39 additions & 28 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cc_binary(
name = "raylet",
srcs = ["src/ray/raylet/main.cc"],
copts = COPTS,
visibility = ["//java:__subpackages__"],
deps = [
":ray_util",
":raylet_lib",
Expand Down Expand Up @@ -100,6 +101,7 @@ cc_test(
copts = COPTS,
deps = [
":ray_util",
"@boost//:asio",
"@com_google_googletest//:gtest_main",
],
)
Expand Down Expand Up @@ -372,7 +374,7 @@ pyx_library(
)

cc_binary(
name = "raylet_library_java.so",
name = "libraylet_library_java.so",
srcs = [
"src/ray/raylet/lib/java/org_ray_runtime_raylet_RayletClientImpl.h",
"src/ray/raylet/lib/java/org_ray_runtime_raylet_RayletClientImpl.cc",
Expand All @@ -394,7 +396,7 @@ cc_binary(
"//conditions:default": ["external/bazel_tools/tools/jdk/include/linux"],
}),
linkshared = 1,
linkstatic = 0,
linkstatic = 1,
deps = [
"//:raylet_lib",
"@plasma//:plasma_client",
Expand All @@ -403,25 +405,31 @@ cc_binary(

genrule(
name = "raylet-jni-darwin-compat",
srcs = [":raylet_library_java.so"],
outs = ["raylet_library_java.dylib"],
srcs = [":libraylet_library_java.so"],
outs = ["libraylet_library_java.dylib"],
cmd = "cp $< $@",
output_to_bindir = 1,
)

filegroup(
name = "raylet_library_java",
srcs = select({
"@bazel_tools//src/conditions:darwin": [":raylet_library_java.dylib"],
"//conditions:default": [":raylet_library_java.so"],
"@bazel_tools//src/conditions:darwin": [":libraylet_library_java.dylib"],
"//conditions:default": [":libraylet_library_java.so"],
}),
visibility = ["//visibility:public"],
visibility = ["//java:__subpackages__"],
)

filegroup(
name = "gcs_fbs_file",
srcs = ["src/ray/gcs/format/gcs.fbs"],
visibility = ["//java:__subpackages__"],
)

flatbuffer_py_library(
name = "python_gcs_fbs",
srcs = [
"src/ray/gcs/format/gcs.fbs",
":gcs_fbs_file",
],
outs = [
"ActorCheckpointIdData.py",
Expand Down Expand Up @@ -526,10 +534,11 @@ genrule(
mv ./src/redis-cli $(location redis-cli) &&
chmod +x $(location redis-cli)
""",
visibility = ["//java:__subpackages__"],
)

cc_binary(
name = "ray_redis_module.so",
name = "libray_redis_module.so",
srcs = [
"src/ray/gcs/redis_module/ray_redis_module.cc",
"src/ray/gcs/redis_module/redis_string.h",
Expand All @@ -538,6 +547,7 @@ cc_binary(
copts = COPTS,
linkshared = 1,
linkstatic = 1,
visibility = ["//java:__subpackages__"],
deps = [
":ray_common",
],
Expand All @@ -552,29 +562,30 @@ genrule(
"//:python_node_manager_fbs",
"//:redis-server",
"//:redis-cli",
"//:ray_redis_module.so",
"//:libray_redis_module.so",
"//:raylet",
"//:raylet_monitor",
"@plasma//:plasma_store_server",
],
outs = ["ray_pkg"],
outs = ["ray_pkg.out"],
cmd = """
set -x &&
mkdir -p python/ray &&
cp $(location python/ray/_raylet.so) python/ray &&
mkdir -p python/ray/core/src/ray/thirdparty/redis/src/ &&
cp $(location //:redis-server) python/ray/core/src/ray/thirdparty/redis/src/ &&
cp $(location //:redis-cli) python/ray/core/src/ray/thirdparty/redis/src/ &&
mkdir -p python/ray/core/src/ray/gcs/redis_module/ &&
cp $(locations //:ray_redis_module.so) python/ray/core/src/ray/gcs/redis_module/libray_redis_module.so &&
mkdir -p python/ray/core/src/ray/raylet/ &&
cp $(location //:raylet_monitor) python/ray/core/src/ray/raylet/ &&
mkdir -p python/ray/core/src/plasma &&
cp $(location @plasma//:plasma_store_server) python/ray/core/src/plasma/ &&
cp $(location //:raylet) python/ray/core/src/ray/raylet/ &&
for f in $(locations //:python_gcs_fbs); do cp $$f python/ray/core/generated/; done &&
mkdir -p python/ray/core/generated/ray/protocol/ &&
for f in $(locations //:python_node_manager_fbs); do cp $$f python/ray/core/generated/ray/protocol/; done &&
mv python $(location ray_pkg)
""",
WORK_DIR=$$(pwd) &&
cp -f $(location python/ray/_raylet.so) $$WORK_DIR/python/ray &&
mkdir -p $$WORK_DIR/python/ray/core/src/ray/thirdparty/redis/src/ &&
cp -f $(location //:redis-server) $$WORK_DIR/python/ray/core/src/ray/thirdparty/redis/src/ &&
cp -f $(location //:redis-cli) $$WORK_DIR/python/ray/core/src/ray/thirdparty/redis/src/ &&
mkdir -p $$WORK_DIR/python/ray/core/src/ray/gcs/redis_module/ &&
cp -f $(locations //:libray_redis_module.so) $$WORK_DIR/python/ray/core/src/ray/gcs/redis_module/ &&
cp -f $(location //:raylet_monitor) $$WORK_DIR/python/ray/core/src/ray/raylet/ &&
cp -f $(location @plasma//:plasma_store_server) $$WORK_DIR/python/ray/core/src/plasma/ &&
cp -f $(location //:raylet) $$WORK_DIR/python/ray/core/src/ray/raylet/ &&
for f in $(locations //:python_gcs_fbs); do cp -f $$f $$WORK_DIR/python/ray/core/generated/; done &&
mkdir -p $$WORK_DIR/python/ray/core/generated/ray/protocol/ &&
for f in $(locations //:python_node_manager_fbs); do
cp -f $$f $$WORK_DIR/python/ray/core/generated/ray/protocol/;
done &&
echo $$WORK_DIR > $@
""",
local = 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcmoritz by setting local = 1 here, this genrule can copy the files directly to the project dir. So we don't need to copy them in bulid.sh.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that this can still work even if bazel build is called from a non-root dir.
@alegithub111 nice fix!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, this is a great find :) I'm glad we can get rid of the copy and meddling with the permissions!

)
15 changes: 13 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
workspace(name = "com_github_ray_project_ray")

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("//java:repo.bzl", "java_repositories")

java_repositories()

git_repository(
name = "com_github_checkstyle_java",
commit = "85f37871ca03b9d3fee63c69c8107f167e24e77b",
remote = "https://github.com/ruifangChen/checkstyle_java",
)

git_repository(
name = "com_github_nelhage_rules_boost",
Expand Down Expand Up @@ -38,8 +49,8 @@ new_git_repository(
new_git_repository(
name = "plasma",
build_file = "@//bazel:BUILD.plasma",
commit = "6a27c660ea700febf6fd73b2e851ab96e9315134",
remote = "https://github.com/ray-project/arrow",
commit = "9c33e1aee98f96a82c6a0b6bb214df172a143fb1",
remote = "https://github.com/apache/arrow",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcmoritz we set plasma to the latest master of the apache repo here, which includes your dlmalloc fix. And we've set default plasma memory size to 100mb for tests. So CI won't trigger the leak issue.

what's the status of #4385? If the leak issue is hard to fix, can we merge this PR first?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that #4385 is almost ready to merge now, I think it makes sense to wait for it, since then both the pyarrow wheels and the bazel sources will be in sync and we can avoid having a master with the leak. If we can get #4385 merged tomorrow let's wait for it and otherwise I'm happy to merge this PR first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let's wait till tomorrow then.

)

new_git_repository(
Expand Down
40 changes: 34 additions & 6 deletions bazel/BUILD.plasma
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")

java_library(
name = "org_apache_arrow_arrow_plasma",
srcs = glob(["java/plasma/src/main/java/**/*.java"]),
data = [":plasma_client_java"],
visibility = ["//visibility:public"],
deps = [
"@org_slf4j_slf4j_api//jar",
],
)

java_binary(
name = "org_apache_arrow_arrow_plasma_test",
srcs = ["java/plasma/src/test/java/org/apache/arrow/plasma/PlasmaClientTest.java"],
main_class = "org.apache.arrow.plasma.PlasmaClientTest",
visibility = ["//visibility:public"],
deps = [
":org_apache_arrow_arrow_plasma",
"@junit_junit//jar",
],
)

cc_library(
name = "arrow",
srcs = [
Expand All @@ -8,6 +29,7 @@ cc_library(
"cpp/src/arrow/status.cc",
"cpp/src/arrow/util/io-util.cc",
"cpp/src/arrow/util/logging.cc",
"cpp/src/arrow/util/memory.cc",
"cpp/src/arrow/util/thread-pool.cc",
],
hdrs = [
Expand All @@ -19,6 +41,7 @@ cc_library(
"cpp/src/arrow/util/io-util.h",
"cpp/src/arrow/util/logging.h",
"cpp/src/arrow/util/macros.h",
"cpp/src/arrow/util/memory.h",
"cpp/src/arrow/util/string_builder.h",
"cpp/src/arrow/util/string_view.h",
"cpp/src/arrow/util/thread-pool.h",
Expand Down Expand Up @@ -48,6 +71,7 @@ cc_library(
"cpp/src/plasma/common.h",
"cpp/src/plasma/common_generated.h",
"cpp/src/plasma/compat.h",
"cpp/src/plasma/external_store.h",
"cpp/src/plasma/fling.h",
"cpp/src/plasma/io.h",
"cpp/src/plasma/malloc.h",
Expand All @@ -65,7 +89,7 @@ cc_library(
)

cc_binary(
name = "plasma_client_java.so",
name = "libplasma_java.so",
srcs = [
"cpp/src/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.cc",
"cpp/src/plasma/lib/java/org_apache_arrow_plasma_PlasmaClientJNI.h",
Expand All @@ -77,7 +101,7 @@ cc_binary(
"cpp/src",
],
linkshared = 1,
linkstatic = 0,
linkstatic = 1,
deps = [":plasma_client"],
)

Expand All @@ -101,17 +125,17 @@ genrule(

genrule(
name = "plasma-jni-darwin-compat",
srcs = [":plasma_client_java.so"],
outs = ["plasma_client_java.dylib"],
srcs = [":libplasma_java.so"],
outs = ["libplasma_java.dylib"],
cmd = "cp $< $@",
output_to_bindir = 1,
)

filegroup(
name = "plasma_client_java",
srcs = select({
"@bazel_tools//src/conditions:darwin": [":plasma_client_java.dylib"],
"//conditions:default": [":plasma_client_java.so"],
"@bazel_tools//src/conditions:darwin": [":libplasma_java.dylib"],
"//conditions:default": [":libplasma_java.so"],
}),
visibility = ["//visibility:public"],
)
Expand All @@ -122,10 +146,14 @@ cc_library(
"cpp/src/plasma/dlmalloc.cc",
"cpp/src/plasma/events.cc",
"cpp/src/plasma/eviction_policy.cc",
"cpp/src/plasma/external_store.cc",
"cpp/src/plasma/plasma_allocator.cc",
],
hdrs = [
"cpp/src/plasma/events.h",
"cpp/src/plasma/eviction_policy.h",
"cpp/src/plasma/external_store.h",
"cpp/src/plasma/plasma_allocator.h",
"cpp/src/plasma/store.h",
"cpp/src/plasma/thirdparty/ae/ae.h",
"cpp/src/plasma/thirdparty/ae/ae_epoll.c",
Expand Down
42 changes: 42 additions & 0 deletions bazel/ray.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_library_public")
load("@com_github_checkstyle_java//checkstyle:checkstyle.bzl", "checkstyle_test")

def flatbuffer_py_library(name, srcs, outs, out_prefix, includes = [], include_paths = []):
flatbuffer_library_public(
Expand All @@ -10,3 +11,44 @@ def flatbuffer_py_library(name, srcs, outs, out_prefix, includes = [], include_p
include_paths = include_paths,
includes = includes,
)

def flatbuffer_java_library(name, srcs, outs, out_prefix, includes = [], include_paths = []):
flatbuffer_library_public(
name = name,
srcs = srcs,
outs = outs,
language_flag = "-j",
out_prefix = out_prefix,
include_paths = include_paths,
includes = includes,
)

def define_java_module(name, additional_srcs = [], additional_resources = [], define_test_lib = False, test_deps = [], **kwargs):
native.java_library(
name = "org_ray_ray_" + name,
srcs = additional_srcs + native.glob([name + "/src/main/java/**/*.java"]),
resources = native.glob([name + "/src/main/resources/**"]) + additional_resources,
**kwargs
)
checkstyle_test(
name = "org_ray_ray_" + name + "-checkstyle",
target = "//java:org_ray_ray_" + name,
config = "//java:checkstyle.xml",
suppressions = "//java:checkstyle-suppressions.xml",
size = "small",
tags = ["checkstyle"],
)
if define_test_lib:
native.java_library(
name = "org_ray_ray_" + name + "_test",
srcs = native.glob([name + "/src/test/java/**/*.java"]),
deps = test_deps,
)
checkstyle_test(
name = "org_ray_ray_" + name + "_test-checkstyle",
target = "//java:org_ray_ray_" + name + "_test",
config = "//java:checkstyle.xml",
suppressions = "//java:checkstyle-suppressions.xml",
size = "small",
tags = ["checkstyle"],
)
17 changes: 9 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,15 @@ else
$PYTHON_EXECUTABLE -m pip install \
--target=$ROOT_DIR/python/ray/pyarrow_files pyarrow==0.12.0.RAY \
--find-links https://s3-us-west-2.amazonaws.com/arrow-wheels/9357dc130789ee42f8181d8724bee1d5d1509060/index.html
bazel build //:ray_pkg -c opt --verbose_failures --action_env=PYTHON_BIN_PATH=$PYTHON_EXECUTABLE
# Copy files and keep them writeable. This is a workaround, as Bazel
# marks all generated files non-writeable. If we would just copy them
# over without adding write permission, the copy would fail the next time.
# TODO(pcm): It would be great to have a solution here that does not
# require us to copy the files.
find $ROOT_DIR/bazel-genfiles/ray_pkg/ -exec chmod +w {} \;
cp -r $ROOT_DIR/bazel-genfiles/ray_pkg/ray $ROOT_DIR/python || true

if [ "$RAY_BUILD_JAVA" == "YES" ]; then
bazel run //java:bazel_deps -- generate -r $ROOT_DIR -s java/third_party/workspace.bzl -d java/dependencies.yaml
bazel build //java:all --verbose_failures --action_env=PATH
fi

if [ "$RAY_BUILD_PYTHON" == "YES" ]; then
bazel build //:ray_pkg --verbose_failures --action_env=PYTHON_BIN_PATH=$PYTHON_EXECUTABLE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the past I think we needed -c opt to be able to compile on mac (otherwise there was some clash with a macro names "DEBUG"), but not sure if that's still the case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the clash is still there.
@alegithub111 added -c opt to the .bazelrc, so we don't need to specify this in every command.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, let's revert this change, we should not assume people are modifying their .bazelrc to make this work.

We can also try to find another solution (e.g. remove the clash).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pcmoritz I didn't make myself clear. we added a project-local .bazelrc file (see the first file in this PR). People don't need to modify their own files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, great!

fi
fi

popd
Loading