|
| 1 | +#!/bin/bash |
| 2 | +set -e |
| 3 | + |
| 4 | +IMAGE_NAME="quay.io/pypa/manylinux_2_28_aarch64" |
| 5 | + |
| 6 | +# Enable BuildKit |
| 7 | +export DOCKER_BUILDKIT=1 |
| 8 | + |
| 9 | +# Create cache volumes if they don't exist |
| 10 | +docker volume create --name fory_bazel_cache >/dev/null |
| 11 | +docker volume create --name fory_pip_cache >/dev/null |
| 12 | +docker volume create --name fory_usr_local >/dev/null |
| 13 | +docker volume create --name fory_yum_cache >/dev/null |
| 14 | + |
| 15 | +echo "Running build in container..." |
| 16 | +# Mount the Bazel cache and set the BAZEL_OPTS environment variable to use it |
| 17 | +docker run --rm --platform linux/arm64 \ |
| 18 | + -v fory_yum_cache:/var/cache/yum \ |
| 19 | + -v fory_bazel_cache:/root/.cache/bazel \ |
| 20 | + -v fory_pip_cache:/root/.cache/pip \ |
| 21 | + -v fory_usr_local:/usr/local \ |
| 22 | + -e BAZEL_OPTS="--output_user_root=/root/.cache/bazel" \ |
| 23 | + -w /workspace -v "$(pwd)":/workspace "$IMAGE_NAME" bash -c " |
| 24 | +set -ex |
| 25 | +# Install dependencies required by the build scripts |
| 26 | +yum install -y git sudo wget which |
| 27 | +# The git repository is mounted from the host, so we need to mark it as safe for git commands |
| 28 | +git config --global --add safe.directory /workspace |
| 29 | +
|
| 30 | +# The manylinux image has multiple python versions. Instead of manipulating PATH, |
| 31 | +# which can be tricky with subshells, we will create symlinks in /usr/local/bin, |
| 32 | +# which is in the default system PATH. We are using Python 3.8. |
| 33 | +# Use -f to overwrite existing symlinks if any |
| 34 | +ln -s -f /opt/python/cp38-cp38/bin/python /usr/local/bin/python |
| 35 | +ln -s -f /opt/python/cp38-cp38/bin/pip /usr/local/bin/pip |
| 36 | +ln -s -f /opt/python/cp38-cp38/bin/python3 /usr/local/bin/python3 |
| 37 | +ln -s -f /opt/python/cp38-cp38/bin/pip3 /usr/local/bin/pip3 |
| 38 | +
|
| 39 | +./ci/deploy.sh install_pyarrow |
| 40 | +pip3 install Cython wheel pytest setuptools -U |
| 41 | +# Install Bazel using the new Python-based system |
| 42 | +python ./ci/run_ci.py cpp --install-deps-only |
| 43 | +# Run Python CI tasks |
| 44 | +python ./ci/run_ci.py python |
| 45 | +" |
| 46 | +echo "Build completed. Check ./dist directory for wheels" |
0 commit comments