2020-06-15 17:27:17 -07:00
|
|
|
#!/usr/bin/env bash
|
2020-06-08 13:22:12 -07:00
|
|
|
|
2020-06-15 17:27:17 -07:00
|
|
|
set -euxo pipefail
|
2020-06-08 13:22:12 -07:00
|
|
|
|
2020-06-15 17:27:17 -07:00
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)"
|
2020-06-08 13:22:12 -07:00
|
|
|
|
2020-06-15 17:27:17 -07:00
|
|
|
asan_install() {
|
|
|
|
(cd "${ROOT_DIR}"/../python && pip install -e . --verbose)
|
|
|
|
}
|
|
|
|
|
|
|
|
asan_setup() {
|
|
|
|
echo "Setting up the environment"
|
|
|
|
pip install -r ray-project/requirements.txt
|
|
|
|
pip install -U pytest
|
|
|
|
|
|
|
|
echo "Installing cython example"
|
|
|
|
(cd "${ROOT_DIR}"/../doc/examples/cython && python setup.py install --user)
|
|
|
|
|
|
|
|
echo "Settting up the shell"
|
|
|
|
echo "build --config=asan" >> ~/.bazelrc # Setup cache
|
|
|
|
echo "LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/7/libasan.so" >> ~/.bashrc
|
|
|
|
echo "ASAN_OPTIONS=detect_leaks=0" >> ~/.bashrc
|
|
|
|
|
|
|
|
echo "Compiling ray"
|
|
|
|
git fetch
|
|
|
|
git pull origin master
|
|
|
|
asan_install || true
|
|
|
|
}
|
|
|
|
|
|
|
|
asan_run() {
|
|
|
|
(
|
|
|
|
export LD_PRELOAD="/usr/lib/gcc/x86_64-linux-gnu/7/libasan.so"
|
|
|
|
export ASAN_OPTIONS="detect_leaks=0"
|
|
|
|
|
|
|
|
cd "${ROOT_DIR}"/../..
|
|
|
|
|
|
|
|
# async plasma test
|
2020-07-07 09:47:25 -07:00
|
|
|
python -m pytest -v --durations=5 --timeout=300 python/ray/tests/test_async.py
|
2020-06-15 17:27:17 -07:00
|
|
|
|
|
|
|
# Ray tests
|
|
|
|
bazel test --test_tag_filters=-jenkins_only python/ray/serve/...
|
|
|
|
bazel test --test_tag_filters=-jenkins_only python/ray/dashboard/...
|
|
|
|
bazel test --test_tag_filters=-jenkins_only python/ray/tests/...
|
|
|
|
bazel test --test_tag_filters=-jenkins_only python/ray/tune/...
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
asan_recompile() {
|
|
|
|
git fetch
|
|
|
|
git checkout "${git_sha}"
|
|
|
|
asan_install || true
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ 0 -lt "$#" ]; then
|
2020-07-21 19:56:41 -07:00
|
|
|
"asan_$1" "${@:2}"
|
2020-06-15 17:27:17 -07:00
|
|
|
else
|
|
|
|
echo "Available commands: setup, run, recompile"
|
|
|
|
fi
|