diff --git a/.buildkite/pipeline.build.yml b/.buildkite/pipeline.build.yml index 84529b780ee46..ba4dff2d1bd9e 100644 --- a/.buildkite/pipeline.build.yml +++ b/.buildkite/pipeline.build.yml @@ -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 diff --git a/ci/ci.sh b/ci/ci.sh index 6644d7e2b1c6a..c27903608bf48 100755 --- a/ci/ci.sh +++ b/ci/ci.sh @@ -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 @@ -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 @@ -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 @@ -768,7 +775,7 @@ build() { fi if [[ "${NEED_WHEELS}" == "true" ]]; then - build_wheels + build_wheels_and_jars fi } diff --git a/python/build-wheel-manylinux2014.sh b/python/build-wheel-manylinux2014.sh index 9e843fd2c406f..ca5733a480999 100755 --- a/python/build-wheel-manylinux2014.sh +++ b/python/build-wheel-manylinux2014.sh @@ -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 @@ -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