Skip to content

Commit 423dc96

Browse files
authored
Revert "[dist] swap mac/linux wheel build order (#9746)" and "Fix package and upload ray jar (#9742)" (#9758)
* Revert "[dist] swap mac/linux wheel build order (#9746)" This reverts commit a934056. * Revert "Fix package and upload ray jar (#9742)" This reverts commit c290c30.
1 parent 21af0ce commit 423dc96

File tree

11 files changed

+99
-353
lines changed

11 files changed

+99
-353
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
/python/python-driver-*
1111
/thirdparty/pkg/
1212
/build/java
13-
.jar
1413

1514
# Files generated by flatc should be ignored
1615
/src/ray/gcs/format/*_generated.h

.travis.yml

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -99,37 +99,33 @@ matrix:
9999
script:
100100
- true # we still need this block to exist, otherwise it will fall back to the global one
101101

102-
# Build MacOS wheels and MacOS jars
103-
- os: osx
104-
osx_image: xcode7
102+
# Build Linux wheels.
103+
- os: linux
105104
env:
106-
- MAC_WHEELS=1 MAC_JARS=1
105+
- LINUX_WHEELS=1
107106
- PYTHONWARNINGS=ignore
108107
- RAY_INSTALL_JAVA=1
109108
install:
110-
- . ./ci/travis/ci.sh init RAY_CI_MACOS_WHEELS_AFFECTED,RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
109+
- . ./ci/travis/ci.sh init RAY_CI_LINUX_WHEELS_AFFECTED
111110
before_script:
112111
- . ./ci/travis/ci.sh build
113112
script:
114113
- . ./ci/travis/ci.sh test_wheels
115-
- bash ./java/build-jar-multiplatform.sh darwin
114+
cache: false
116115

117-
# Build Linux wheels and multi-platform jars.
118-
- os: linux
116+
# Build MacOS wheels.
117+
- os: osx
118+
osx_image: xcode7
119119
env:
120-
- LINUX_WHEELS=1 MULTIPLATFORM_JARS=1
120+
- MAC_WHEELS=1
121121
- PYTHONWARNINGS=ignore
122122
- RAY_INSTALL_JAVA=1
123123
install:
124-
- . ./ci/travis/ci.sh init RAY_CI_LINUX_WHEELS_AFFECTED,RAY_CI_JAVA_AFFECTED,RAY_CI_STREAMING_JAVA_AFFECTED
124+
- . ./ci/travis/ci.sh init RAY_CI_MACOS_WHEELS_AFFECTED
125125
before_script:
126126
- . ./ci/travis/ci.sh build
127127
script:
128128
- . ./ci/travis/ci.sh test_wheels
129-
- bash ./java/build-jar-multiplatform.sh linux
130-
- bash ./java/build-jar-multiplatform.sh multiplatform
131-
#- bash ./java/build-jar-multiplatform.sh deploy
132-
cache: false
133129

134130
# RLlib: Learning tests (from rllib/tuned_examples/*.yaml).
135131
- os: linux
@@ -396,39 +392,6 @@ deploy:
396392
repo: ray-project/ray
397393
condition: $LINUX_WHEELS = 1 || $MAC_WHEELS = 1
398394

399-
# Upload jars so that we can debug locally for every commit
400-
- provider: s3
401-
edge: true # This supposedly opts in to deploy v2.
402-
access_key_id: AKIAU6DMUCJUFL3EX3SM
403-
secret_access_key:
404-
secure: J1sX71fKFPQhgWzColllxfzcF877ScBZ1cIl71krZ6SO0LKnwsCScpQck5eZOyQo/Iverwye0iKtE87qNsiRi3+V2D9iulSr18T09j7+FjPKfxAmXmjfrNafoMXTDQroSJblCri5vl+DysISPqImJkWTNaYhGJ9QakoSd5djnAopLNWj6PCR3S50baS49+nB5nSIY3jMhtUzlaBdniFPFC81Cxyuafr4pv6McGRfR/dK+ZnPhdGtMnVeIJXB+ooZKQ26mDJKBPka4jm3u1Oa72b/Atu2RO3MwxTg79LTrMxXKh2OcCqhtD2Z3lz1OltvNSunCuwY8AejCJsfSLbM9mGDoz+xhNUWmYNy48YFf+61OY8PXi8S/9Q817yb3GpLbb2l/P+KMgq9eSEiELIOwuYsDxPX5TuAg6dx0wCNgDEBJoThSQjYl6MgJrLrs7p+JBxp3giedHiy0TLa5hCVKTj3euONAXDArYnnT+DvUIOkaeTk5DClRZbZ0sUXhLy//HuT5WJvjFBJJZ0u0f4RLVb5D7DI4uMZr7+yJPDR2AXCyW9YMaBEbmEYbPaKi283jlEyn7R33+AZlnXv0THHwZ4xvjKKG3/fBSXsOUmv5wmUveEqVGDj1mKPGj9NF8iA5qMm2AaZuJpEEBVBZtSlTZt6ZG7rzAJZGNL52t7xuMo=
405-
bucket: ray-wheels
406-
acl: public_read
407-
region: us-west-2
408-
local_dir: .jar
409-
upload-dir: "jars/$TRAVIS_BRANCH/$TRAVIS_COMMIT"
410-
skip_cleanup: true
411-
on:
412-
repo: ray-project/ray
413-
all_branches: true
414-
condition: $MULTIPLATFORM_JARS = 1 || $MAC_JARS=1
415-
416-
- provider: s3
417-
edge: true # This supposedly opts in to deploy v2.
418-
access_key_id: AKIAU6DMUCJUFL3EX3SM
419-
secret_access_key:
420-
secure: J1sX71fKFPQhgWzColllxfzcF877ScBZ1cIl71krZ6SO0LKnwsCScpQck5eZOyQo/Iverwye0iKtE87qNsiRi3+V2D9iulSr18T09j7+FjPKfxAmXmjfrNafoMXTDQroSJblCri5vl+DysISPqImJkWTNaYhGJ9QakoSd5djnAopLNWj6PCR3S50baS49+nB5nSIY3jMhtUzlaBdniFPFC81Cxyuafr4pv6McGRfR/dK+ZnPhdGtMnVeIJXB+ooZKQ26mDJKBPka4jm3u1Oa72b/Atu2RO3MwxTg79LTrMxXKh2OcCqhtD2Z3lz1OltvNSunCuwY8AejCJsfSLbM9mGDoz+xhNUWmYNy48YFf+61OY8PXi8S/9Q817yb3GpLbb2l/P+KMgq9eSEiELIOwuYsDxPX5TuAg6dx0wCNgDEBJoThSQjYl6MgJrLrs7p+JBxp3giedHiy0TLa5hCVKTj3euONAXDArYnnT+DvUIOkaeTk5DClRZbZ0sUXhLy//HuT5WJvjFBJJZ0u0f4RLVb5D7DI4uMZr7+yJPDR2AXCyW9YMaBEbmEYbPaKi283jlEyn7R33+AZlnXv0THHwZ4xvjKKG3/fBSXsOUmv5wmUveEqVGDj1mKPGj9NF8iA5qMm2AaZuJpEEBVBZtSlTZt6ZG7rzAJZGNL52t7xuMo=
421-
bucket: ray-wheels
422-
acl: public_read
423-
region: us-west-2
424-
local_dir: .jar
425-
upload-dir: "jars/latest"
426-
skip_cleanup: true
427-
on:
428-
repo: ray-project/ray
429-
branch: master
430-
condition: $MULTIPLATFORM_JARS = 1 || $MAC_JARS=1
431-
432395
- provider: script
433396
edge: true # This supposedly opts in to deploy v2.
434397
script: ./ci/keep_alive bash $TRAVIS_BUILD_DIR/ci/travis/build-autoscaler-images.sh || true

BUILD.bazel

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,6 @@ cc_binary(
18291829
}),
18301830
linkshared = 1,
18311831
linkstatic = 1,
1832-
visibility = ["//java:__subpackages__"],
18331832
deps = [
18341833
"//:core_worker_lib",
18351834
"//:global_state_accessor_lib",
@@ -1840,6 +1839,23 @@ cc_binary(
18401839
],
18411840
)
18421841

1842+
genrule(
1843+
name = "core_worker-jni-darwin-compat",
1844+
srcs = [":libcore_worker_library_java.so"],
1845+
outs = ["libcore_worker_library_java.dylib"],
1846+
cmd = "cp $< $@",
1847+
output_to_bindir = 1,
1848+
)
1849+
1850+
filegroup(
1851+
name = "core_worker_library_java",
1852+
srcs = select({
1853+
"@bazel_tools//src/conditions:darwin": [":libcore_worker_library_java.dylib"],
1854+
"//conditions:default": [":libcore_worker_library_java.so"],
1855+
}),
1856+
visibility = ["//java:__subpackages__"],
1857+
)
1858+
18431859
filegroup(
18441860
name = "python_sources",
18451861
srcs = glob([

bazel/ray.bzl

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_library_public")
22
load("@com_github_checkstyle_java//checkstyle:checkstyle.bzl", "checkstyle_test")
3-
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
43
load("@bazel_common//tools/maven:pom_file.bzl", "pom_file")
54

65
COPTS = ["-DRAY_USE_GLOG"] + select({
@@ -126,7 +125,7 @@ def copy_to_workspace(name, srcs, dstdir = ""):
126125
dstdir = "." + ("/" + dstdir.replace("\\", "/")).rstrip("/") + "/",
127126
),
128127
# Keep this batch script equivalent to the Bash script above (or take out the batch script)
129-
cmd_bat = """
128+
cmd_bat = r"""
130129
(
131130
if not exist {dstdir} mkdir {dstdir}
132131
) && (
@@ -141,57 +140,3 @@ def copy_to_workspace(name, srcs, dstdir = ""):
141140
),
142141
local = 1,
143142
)
144-
145-
def native_java_binary(module_name, name, native_binary_name):
146-
"""Copy native binary file to different path based on operating systems"""
147-
copy_file(
148-
name = name + "_darwin",
149-
src = native_binary_name,
150-
out = module_name + "/src/main/resources/native/darwin/" + name,
151-
)
152-
153-
copy_file(
154-
name = name + "_linux",
155-
src = native_binary_name,
156-
out = module_name + "/src/main/resources/native/linux/" + name,
157-
)
158-
159-
copy_file(
160-
name = name + "_windows",
161-
src = native_binary_name,
162-
out = module_name + "/src/main/resources/native/windows/" + name,
163-
)
164-
165-
native.filegroup(
166-
name = name,
167-
srcs = select({
168-
"@bazel_tools//src/conditions:darwin": [name + "_darwin"],
169-
"@bazel_tools//src/conditions:windows": [name + "_windows"],
170-
"//conditions:default": [name + "_linux"],
171-
}),
172-
visibility = ["//visibility:public"],
173-
)
174-
175-
def native_java_library(module_name, name, native_library_name):
176-
"""Copy native library file to different path based on operating systems"""
177-
copy_file(
178-
name = name + "_darwin",
179-
src = native_library_name,
180-
out = module_name + "/src/main/resources/native/darwin/lib{}.dylib".format(name),
181-
)
182-
183-
copy_file(
184-
name = name + "_linux",
185-
src = native_library_name,
186-
out = module_name + "/src/main/resources/native/linux/lib{}.so".format(name),
187-
)
188-
189-
native.filegroup(
190-
name = name,
191-
srcs = select({
192-
"@bazel_tools//src/conditions:darwin": [name + "_darwin"],
193-
"@bazel_tools//src/conditions:windows": [],
194-
"//conditions:default": [name + "_linux"],
195-
}),
196-
visibility = ["//visibility:public"],
197-
)

java/BUILD.bazel

Lines changed: 26 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
load("//bazel:ray.bzl", "define_java_module")
2-
load("//bazel:ray.bzl", "native_java_binary")
3-
load("//bazel:ray.bzl", "native_java_library")
2+
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
43
load("@rules_proto_grpc//java:defs.bzl", "java_proto_compile")
54

65
exports_files([
@@ -144,69 +143,52 @@ filegroup(
144143
],
145144
)
146145

147-
native_java_binary("runtime", "raylet", "//:raylet")
148-
149-
native_java_binary("runtime", "plasma_store_server", "//:plasma_store_server")
150-
151-
native_java_binary("runtime", "redis-server", "//:redis-server")
152-
153-
native_java_binary("runtime", "gcs_server", "//:gcs_server")
154-
155-
native_java_binary("runtime", "libray_redis_module.so", "//:libray_redis_module.so")
146+
# plasma_store_server binary should be located in jar root path
147+
# and keep in sync with mvn resource
148+
copy_file(
149+
name = "cp_plasma_store_server",
150+
src = "//:plasma_store_server",
151+
out = "plasma_store_server",
152+
)
156153

157-
native_java_library("runtime", "core_worker_library_java", "//:libcore_worker_library_java.so")
154+
# `//:redis-server`'s full path is `external/com_github_antirez_redis/redis-server`,
155+
# This rule removes the prefix, and only keeps `redis-server`.
156+
copy_file(
157+
name = "redis-server-without-prefix",
158+
src = "//:redis-server",
159+
out = "redis-server",
160+
)
158161

159162
filegroup(
160163
name = "java_native_deps",
161164
srcs = [
162-
":core_worker_library_java",
163-
":gcs_server",
164-
":libray_redis_module.so",
165-
":plasma_store_server",
166-
":raylet",
167-
":redis-server",
165+
":cp_plasma_store_server",
166+
":redis-server-without-prefix",
167+
"//:core_worker_library_java",
168+
"//:gcs_server",
169+
"//:libray_redis_module.so",
170+
"//:raylet",
168171
],
169172
)
170173

171174
# Generates the dependencies needed by maven.
172175
genrule(
173-
name = "cp_java_generated",
176+
name = "gen_maven_deps",
174177
srcs = [
175178
":all_java_proto",
179+
":java_native_deps",
176180
":copy_pom_file",
177181
],
178-
outs = ["cp_java_generated.out"],
182+
outs = ["gen_maven_deps.out"],
179183
cmd = """
180184
WORK_DIR="$$(pwd)"
181185
# Copy protobuf-generated files.
182186
rm -rf "$$WORK_DIR/java/runtime/src/main/java/io/ray/runtime/generated"
183187
for f in $(locations //java:all_java_proto); do
184188
unzip "$$f" -x META-INF/MANIFEST.MF -d "$$WORK_DIR/java/runtime/src/main/java"
185189
done
186-
date > $@
187-
""",
188-
local = 1,
189-
tags = ["no-cache"],
190-
)
191-
192-
# Generates the dependencies needed by maven.
193-
genrule(
194-
name = "gen_maven_deps",
195-
srcs = [
196-
":cp_java_generated",
197-
":java_native_deps",
198-
],
199-
outs = ["gen_maven_deps.out"],
200-
cmd = """
201-
WORK_DIR="$${PWD}"
202-
# Copy native dependencies.
203-
OS_NAME=""
204-
case "$${OSTYPE}" in
205-
linux*) OS_NAME="linux";;
206-
darwin*) OS_NAME="darwin";;
207-
*) echo "$${OSTYPE} is not supported currently"; exit 1;;
208-
esac
209-
NATIVE_DEPS_DIR="$$WORK_DIR/java/runtime/native_dependencies/native/$$OS_NAME"
190+
# Copy native dependecies.
191+
NATIVE_DEPS_DIR="$$WORK_DIR/java/runtime/native_dependencies/"
210192
rm -rf "$$NATIVE_DEPS_DIR"
211193
mkdir -p "$$NATIVE_DEPS_DIR"
212194
for f in $(locations //java:java_native_deps); do

0 commit comments

Comments
 (0)