|
53 | 53 |
|
54 | 54 | export CMAKE_PREFIX_PATH=$WORKSPACE/nvshmem_install:$CMAKE_PREFIX_PATH |
55 | 55 |
|
| 56 | +is_git_dirty() { |
| 57 | + local dir=$1 |
| 58 | + pushd "$dir" > /dev/null |
| 59 | + |
| 60 | + if [ -d ".git" ] && [ -n "$(git status --porcelain 2>/dev/null)" ]; then |
| 61 | + popd > /dev/null |
| 62 | + return 0 # dirty (true) |
| 63 | + else |
| 64 | + popd > /dev/null |
| 65 | + return 1 # clean (false) |
| 66 | + fi |
| 67 | +} |
| 68 | + |
| 69 | +# Function to handle git repository cloning with dirty/incomplete checks |
| 70 | +clone_repo() { |
| 71 | + local repo_url=$1 |
| 72 | + local dir_name=$2 |
| 73 | + local key_file=$3 |
| 74 | + |
| 75 | + if [ -d "$dir_name" ]; then |
| 76 | + # Check if directory has uncommitted changes (dirty) |
| 77 | + if is_git_dirty "$dir_name"; then |
| 78 | + echo "$dir_name directory is dirty, skipping clone" |
| 79 | + # Check if clone failed (directory exists but not a valid git repo or missing key files) |
| 80 | + elif [ ! -d "$dir_name/.git" ] || [ ! -f "$dir_name/$key_file" ]; then |
| 81 | + echo "$dir_name directory exists but clone appears incomplete, cleaning up and re-cloning" |
| 82 | + rm -rf "$dir_name" |
| 83 | + git clone "$repo_url" |
| 84 | + else |
| 85 | + echo "$dir_name directory exists and appears complete; manually update if needed" |
| 86 | + fi |
| 87 | + else |
| 88 | + git clone "$repo_url" |
| 89 | + fi |
| 90 | +} |
| 91 | + |
56 | 92 | # build and install pplx, require pytorch installed |
57 | 93 | pushd $WORKSPACE |
58 | | -git clone https://github.com/ppl-ai/pplx-kernels |
| 94 | +clone_repo "https://github.com/ppl-ai/pplx-kernels" "pplx-kernels" "setup.py" |
59 | 95 | cd pplx-kernels |
60 | 96 | # see https://github.com/pypa/pip/issues/9955#issuecomment-838065925 |
61 | 97 | # PIP_NO_BUILD_ISOLATION=0 disables build isolation |
|
64 | 100 |
|
65 | 101 | # build and install deepep, require pytorch installed |
66 | 102 | pushd $WORKSPACE |
67 | | -git clone https://github.com/deepseek-ai/DeepEP |
| 103 | +clone_repo "https://github.com/deepseek-ai/DeepEP" "DeepEP" "setup.py" |
68 | 104 | cd DeepEP |
69 | 105 | export NVSHMEM_DIR=$WORKSPACE/nvshmem_install |
70 | 106 | PIP_NO_BUILD_ISOLATION=0 pip install -vvv -e . |
|
0 commit comments