build-wheel-manylinux2014.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. set -exuo pipefail
  3. export RAY_INSTALL_JAVA="${RAY_INSTALL_JAVA:-0}"
  4. # Python version key, interpreter version code
  5. PYTHON_VERSIONS=(
  6. "py39 cp39-cp39"
  7. "py310 cp310-cp310"
  8. "py311 cp311-cp311"
  9. "py312 cp312-cp312"
  10. )
  11. # Add the repo folder to the safe.dictory global variable to avoid the failure
  12. # because of secruity check from git, when executing the following command
  13. # `git clean ...`, while building wheel locally.
  14. git config --global --add safe.directory /ray
  15. # Setup runtime environment
  16. ./ci/build/build-manylinux-forge.sh
  17. source "$HOME"/.nvm/nvm.sh
  18. # Compile ray
  19. ./ci/build/build-manylinux-ray.sh
  20. # Build ray wheel
  21. for PYTHON_VERSIONS in "${PYTHON_VERSIONS[@]}" ; do
  22. PYTHON_VERSION_KEY="$(echo "${PYTHON_VERSIONS}" | cut -d' ' -f1)"
  23. if [[ "${BUILD_ONE_PYTHON_ONLY:-}" != "" && "${PYTHON_VERSION_KEY}" != "${BUILD_ONE_PYTHON_ONLY}" ]]; then
  24. continue
  25. fi
  26. PYTHON="$(echo "${PYTHON_VERSIONS}" | cut -d' ' -f2)"
  27. echo "--- Build wheel for ${PYTHON}"
  28. # The -f flag is passed twice to also run git clean in the arrow subdirectory.
  29. # The -d flag removes directories. The -x flag ignores the .gitignore file,
  30. # and the -e flag ensures that we don't remove the .whl directory, the
  31. # dashboard directory and jars directory, as well as the compiled
  32. # dependency constraints.
  33. git clean -f -f -x -d -e .whl -e python/ray/dashboard/client -e dashboard/client -e python/ray/jars -e python/requirements_compiled.txt
  34. ./ci/build/build-manylinux-wheel.sh "${PYTHON}"
  35. done
  36. # Clean the build output so later operations is on a clean directory.
  37. git clean -f -f -x -d -e .whl -e python/ray/dashboard/client -e python/requirements_compiled.txt
  38. bazel clean
  39. # Build ray jar
  40. ./ci/build/build-manylinux-jar.sh