forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-wheel-manylinux2014.sh
executable file
·53 lines (40 loc) · 1.71 KB
/
build-wheel-manylinux2014.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
set -exuo pipefail
export RAY_INSTALL_JAVA="${RAY_INSTALL_JAVA:-0}"
# Python version key, interpreter version code
PYTHON_VERSIONS=(
"py39 cp39-cp39"
"py310 cp310-cp310"
"py311 cp311-cp311"
"py312 cp312-cp312"
)
# Add the repo folder to the safe.directory global variable to avoid the failure
# because of security check from git, when executing the following command
# `git clean ...`, while building wheel locally.
git config --global --add safe.directory /ray
# Setup runtime environment
./ci/build/build-manylinux-forge.sh
source "$HOME"/.nvm/nvm.sh
# Compile ray
./ci/build/build-manylinux-ray.sh
# Build ray wheel
for PYTHON_VERSIONS in "${PYTHON_VERSIONS[@]}" ; do
PYTHON_VERSION_KEY="$(echo "${PYTHON_VERSIONS}" | cut -d' ' -f1)"
if [[ "${BUILD_ONE_PYTHON_ONLY:-}" != "" && "${PYTHON_VERSION_KEY}" != "${BUILD_ONE_PYTHON_ONLY}" ]]; then
continue
fi
PYTHON="$(echo "${PYTHON_VERSIONS}" | cut -d' ' -f2)"
echo "--- Build wheel for ${PYTHON}"
# The -f flag is passed twice to also run git clean in the arrow subdirectory.
# The -d flag removes directories. The -x flag ignores the .gitignore file,
# and the -e flag ensures that we don't remove the .whl directory, the
# dashboard directory and jars directory, as well as the compiled
# dependency constraints.
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
./ci/build/build-manylinux-wheel.sh "${PYTHON}"
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 -e python/requirements_compiled.txt
bazel clean
# Build ray jar
./ci/build/build-manylinux-jar.sh