mirror of
https://github.com/vale981/ray
synced 2025-03-05 18:11:42 -05:00
Add __commit__ field to ray package in wheels (#7305)
This commit is contained in:
parent
2ad9bc5684
commit
ee0f71e398
5 changed files with 23 additions and 2 deletions
|
@ -144,7 +144,7 @@ matrix:
|
||||||
# This command should be kept in sync with ray/python/README-building-wheels.md,
|
# This command should be kept in sync with ray/python/README-building-wheels.md,
|
||||||
# except the `$MOUNT_BAZEL_CACHE` part.
|
# except the `$MOUNT_BAZEL_CACHE` part.
|
||||||
|
|
||||||
- ./ci/suppress_output docker run --rm -w /ray -v `pwd`:/ray $MOUNT_BAZEL_CACHE -ti rayproject/arrow_linux_x86_64_base:ARROW-5631 /ray/python/build-wheel-manylinux1.sh
|
- ./ci/suppress_output docker run -e TRAVIS_COMMIT=$TRAVIS_COMMIT --rm -w /ray -v `pwd`:/ray $MOUNT_BAZEL_CACHE -ti rayproject/arrow_linux_x86_64_base:ARROW-5631 /ray/python/build-wheel-manylinux1.sh
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- if [ $RAY_CI_LINUX_WHEELS_AFFECTED != "1" ]; then exit; fi
|
- if [ $RAY_CI_LINUX_WHEELS_AFFECTED != "1" ]; then exit; fi
|
||||||
|
|
|
@ -40,6 +40,9 @@ if [[ "$platform" == "linux" ]]; then
|
||||||
# Install the wheel.
|
# Install the wheel.
|
||||||
$PIP_CMD install -q "$PYTHON_WHEEL"
|
$PIP_CMD install -q "$PYTHON_WHEEL"
|
||||||
|
|
||||||
|
# Check that ray.__commit__ was set properly.
|
||||||
|
$PYTHON_EXE -u -c "import ray; print(ray.__commit__)" | grep $TRAVIS_COMMIT || (echo "ray.__commit__ not set properly!" && exit 1)
|
||||||
|
|
||||||
# Run a simple test script to make sure that the wheel works.
|
# Run a simple test script to make sure that the wheel works.
|
||||||
INSTALLED_RAY_DIRECTORY=$(dirname "$($PYTHON_EXE -u -c "import ray; print(ray.__file__)" | tail -n1)")
|
INSTALLED_RAY_DIRECTORY=$(dirname "$($PYTHON_EXE -u -c "import ray; print(ray.__file__)" | tail -n1)")
|
||||||
$PYTHON_EXE "$TEST_SCRIPT"
|
$PYTHON_EXE "$TEST_SCRIPT"
|
||||||
|
|
|
@ -79,6 +79,13 @@ for ((i=0; i<${#PY_VERSIONS[@]}; ++i)); do
|
||||||
$PIP_CMD install -q numpy==$NUMPY_VERSION cython==0.29.0
|
$PIP_CMD install -q numpy==$NUMPY_VERSION cython==0.29.0
|
||||||
# Install wheel to avoid the error "invalid command 'bdist_wheel'".
|
# Install wheel to avoid the error "invalid command 'bdist_wheel'".
|
||||||
$PIP_CMD install -q wheel
|
$PIP_CMD install -q wheel
|
||||||
|
# Set the commit SHA in __init__.py.
|
||||||
|
if [ -n "$TRAVIS_COMMIT" ]; then
|
||||||
|
sed -i.bak "s/{{RAY_COMMIT_SHA}}/$TRAVIS_COMMIT/g" ray/__init__.py && rm ray/__init__.py.bak
|
||||||
|
else
|
||||||
|
echo "TRAVIS_COMMIT variable not set - required to populated ray.__commit__."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
# Add the correct Python to the path and build the wheel. This is only
|
# Add the correct Python to the path and build the wheel. This is only
|
||||||
# needed so that the installation finds the cython executable.
|
# needed so that the installation finds the cython executable.
|
||||||
PATH=$MACPYTHON_PY_PREFIX/$PY_MM/bin:$PATH $PYTHON_EXE setup.py bdist_wheel
|
PATH=$MACPYTHON_PY_PREFIX/$PY_MM/bin:$PATH $PYTHON_EXE setup.py bdist_wheel
|
||||||
|
|
|
@ -28,6 +28,7 @@ sudo apt-get install unzip
|
||||||
export PATH=$PATH:/root/bin
|
export PATH=$PATH:/root/bin
|
||||||
|
|
||||||
# Install and use the latest version of Node.js in order to build the dashboard.
|
# Install and use the latest version of Node.js in order to build the dashboard.
|
||||||
|
set +x
|
||||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
|
||||||
source $HOME/.nvm/nvm.sh
|
source $HOME/.nvm/nvm.sh
|
||||||
nvm install node
|
nvm install node
|
||||||
|
@ -38,6 +39,7 @@ pushd python/ray/dashboard/client
|
||||||
npm ci
|
npm ci
|
||||||
npm run build
|
npm run build
|
||||||
popd
|
popd
|
||||||
|
set -x
|
||||||
|
|
||||||
mkdir .whl
|
mkdir .whl
|
||||||
for ((i=0; i<${#PYTHONS[@]}; ++i)); do
|
for ((i=0; i<${#PYTHONS[@]}; ++i)); do
|
||||||
|
@ -54,6 +56,14 @@ for ((i=0; i<${#PYTHONS[@]}; ++i)); do
|
||||||
# Fix the numpy version because this will be the oldest numpy version we can
|
# Fix the numpy version because this will be the oldest numpy version we can
|
||||||
# support.
|
# support.
|
||||||
/opt/python/${PYTHON}/bin/pip install -q numpy==${NUMPY_VERSION} cython==0.29.0
|
/opt/python/${PYTHON}/bin/pip install -q numpy==${NUMPY_VERSION} cython==0.29.0
|
||||||
|
# Set the commit SHA in __init__.py.
|
||||||
|
if [ -n "$TRAVIS_COMMIT" ]; then
|
||||||
|
sed -i.bak "s/{{RAY_COMMIT_SHA}}/$TRAVIS_COMMIT/g" ray/__init__.py && rm ray/__init__.py.bak
|
||||||
|
else
|
||||||
|
echo "TRAVIS_COMMIT variable not set - required to populated ray.__commit__."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
PATH=/opt/python/${PYTHON}/bin:$PATH /opt/python/${PYTHON}/bin/python setup.py bdist_wheel
|
PATH=/opt/python/${PYTHON}/bin:$PATH /opt/python/${PYTHON}/bin/python setup.py bdist_wheel
|
||||||
# In the future, run auditwheel here.
|
# In the future, run auditwheel here.
|
||||||
mv dist/*.whl ../.whl/
|
mv dist/*.whl ../.whl/
|
||||||
|
|
|
@ -98,7 +98,8 @@ from ray.runtime_context import _get_runtime_context # noqa: E402
|
||||||
from ray.cross_language import java_function, java_actor_class # noqa: E402
|
from ray.cross_language import java_function, java_actor_class # noqa: E402
|
||||||
from ray import util # noqa: E402
|
from ray import util # noqa: E402
|
||||||
|
|
||||||
# Ray version string.
|
# Replaced with the current commit when building the wheels.
|
||||||
|
__commit__ = "{{RAY_COMMIT_SHA}}"
|
||||||
__version__ = "0.9.0.dev0"
|
__version__ = "0.9.0.dev0"
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|
Loading…
Add table
Reference in a new issue