python_only_compile.sh 891 Bytes
Newer Older
1
2
3
4
5
6
7
#!/bin/bash
# This script tests if the python only compilation works correctly
# for users who do not have any compilers installed on their system

set -e
set -x

8
9
10
11
merge_base_commit=$(git merge-base HEAD origin/main)
echo "Current merge base commit with main: $merge_base_commit"
git show --oneline -s $merge_base_commit

12
13
14
15
16
cd /vllm-workspace/

# uninstall vllm
pip3 uninstall -y vllm
# restore the original files
17
mv src/vllm ./vllm
18
19
20
21
22
23
24

# remove all compilers
apt remove --purge build-essential -y
apt autoremove -y

echo 'import os; os.system("touch /tmp/changed.file")' >> vllm/__init__.py

25
VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
26
27
28
29
30
31
32
33
34

# Run the script
python3 -c 'import vllm'

# Check if the clangd log file was created
if [ ! -f /tmp/changed.file ]; then
    echo "changed.file was not created, python only compilation failed"
    exit 1
fi