Skip to content

Commit

Permalink
[CI] Build jar on manylinux2014 (#35538)
Browse files Browse the repository at this point in the history
We should build jar for release on manylinux2014 to resolve incompatibilities. Refer to https://discuss.ray.io/t/java-glibc-issue-during-ray-init-call/10407.
Co-authored-by: Guyang Song <guyang.sgy@gmail.com>
  • Loading branch information
XiaodongLv authored May 21, 2023
1 parent 63ebee2 commit 946459a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 0 additions & 1 deletion .buildkite/pipeline.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
commands:
# Build the wheels and jars
- UPLOAD_WHEELS_AS_ARTIFACTS=1 LINUX_WHEELS=1 LINUX_JARS=1 ./ci/ci.sh build
- bash ./java/build-jar-multiplatform.sh linux
# Upload the wheels and jars
# We don't want to push on PRs, in fact, the copy_files will fail because unauthenticated.
- if [ "$BUILDKITE_PULL_REQUEST" != "false" ]; then exit 0; fi
Expand Down
15 changes: 11 additions & 4 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ validate_wheels_commit_str() {
echo "All wheels passed the sanity check and have the correct wheel commit set."
}

build_wheels() {
build_wheels_and_jars() {
# Create wheel output directory and empty contents
# If buildkite runners are re-used, wheels from previous builds might be here, so we delete them.
mkdir -p .whl
Expand Down Expand Up @@ -466,11 +466,18 @@ build_wheels() {
IMAGE_NAME="quay.io/pypa/manylinux2014_${HOSTTYPE}"
IMAGE_TAG="2022-12-20-b4884d9"

local MOUNT_ENV=()
if [ "${LINUX_JARS-}" == "1" ]; then
MOUNT_ENV+=(
-e "BUILD_JAR=1"
)
fi

if [ -z "${BUILDKITE-}" ]; then
# This command should be kept in sync with ray/python/README-building-wheels.md,
# except the "${MOUNT_BAZEL_CACHE[@]}" part.
docker run --rm -w /ray -v "${PWD}":/ray "${MOUNT_BAZEL_CACHE[@]}" \
"${IMAGE_NAME}:${IMAGE_TAG}" /ray/python/build-wheel-manylinux2014.sh
"${MOUNT_ENV[@]}" "${IMAGE_NAME}:${IMAGE_TAG}" /ray/python/build-wheel-manylinux2014.sh
else
rm -rf /ray-mount/*
rm -rf /ray-mount/.whl || true
Expand All @@ -480,7 +487,7 @@ build_wheels() {
docker run --rm -v /ray:/ray-mounted ubuntu:focal ls /
docker run --rm -v /ray:/ray-mounted ubuntu:focal ls /ray-mounted
docker run --rm -w /ray -v /ray:/ray "${MOUNT_BAZEL_CACHE[@]}" \
"${IMAGE_NAME}:${IMAGE_TAG}" /ray/python/build-wheel-manylinux2014.sh
"${MOUNT_ENV[@]}" "${IMAGE_NAME}:${IMAGE_TAG}" /ray/python/build-wheel-manylinux2014.sh
cp -rT /ray-mount /ray # copy new files back here
find . | grep whl # testing

Expand Down Expand Up @@ -768,7 +775,7 @@ build() {
fi

if [[ "${NEED_WHEELS}" == "true" ]]; then
build_wheels
build_wheels_and_jars
fi
}

Expand Down
6 changes: 5 additions & 1 deletion python/build-wheel-manylinux2014.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PYTHON_NUMPYS=(
)

yum -y install unzip zip sudo
yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel xz
yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel maven xz
yum -y install openssl

if [[ "${HOSTTYPE-}" == "x86_64" ]]; then
Expand Down Expand Up @@ -129,3 +129,7 @@ done

# Clean the build output so later operations is on a clean directory.
git clean -f -f -x -d -e .whl -e python/ray/dashboard/client

if [ "${BUILD_JAR-}" == "1" ]; then
./java/build-jar-multiplatform.sh linux
fi

0 comments on commit 946459a

Please sign in to comment.