forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_asan_tests.sh
executable file
·59 lines (47 loc) · 1.41 KB
/
run_asan_tests.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
54
55
56
57
58
59
#!/usr/bin/env bash
set -euxo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)"
RAY_DIR="${ROOT_DIR}/../.."
asan_install() {
echo "installing"
(cd "${RAY_DIR}"/python && pip install -e . --verbose)
}
asan_setup() {
echo "Setting up the environment"
pip uninstall -y ray || true
conda uninstall -y wrapt || true
pip install wrapt || true
pip install -r ray-project/requirements.txt
pip install -U pytest==5.4.3
echo "Installing cython example"
(cd "${RAY_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/9/libasan.so" >> ~/.bashrc
echo "ASAN_OPTIONS=detect_leaks=0" >> ~/.bashrc
echo "Compiling ray"
cd "${RAY_DIR}"
asan_install || true
}
asan_run() {
(
export LD_PRELOAD="/usr/lib/gcc/x86_64-linux-gnu/9/libasan.so"
export ASAN_OPTIONS="detect_leaks=0"
cd "${RAY_DIR}"
# Ray tests
bazel test --test_output=streamed python/ray/serve/...
bazel test --test_output=streamed python/ray/dashboard/...
bazel test --test_output=streamed python/ray/tests/...
bazel test --test_output=streamed python/ray/tune/...
)
}
asan_recompile() {
git fetch
git checkout "${GIT_SHA:-$1}"
asan_install || true
}
if [ 0 -lt "$#" ]; then
"asan_$1" "${@:2}"
else
echo "Available commands: setup, run, recompile"
fi