Skip to content

Commit c62ba56

Browse files
committed
Cleans up duplicative deps change check
Signed-off-by: dougbtv <dosmith@redhat.com>
1 parent 172d679 commit c62ba56

File tree

3 files changed

+35
-33
lines changed

3 files changed

+35
-33
lines changed

buildkite/bootstrap.sh

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ ignore_patterns=(
164164
"cmake/hipify.py"
165165
"cmake/cpu_extension.cmake"
166166
)
167-
167+
# Detect if there are critical changes matching patterns
168+
CRITICAL_CHANGE_DETECTED=0
168169
for file in $file_diff; do
169-
# First check if file matches any pattern
170170
matches_pattern=0
171171
for pattern in "${patterns[@]}"; do
172172
if [[ $file == $pattern* ]] || [[ $file == $pattern ]]; then
@@ -175,7 +175,6 @@ for file in $file_diff; do
175175
fi
176176
done
177177

178-
# If file matches pattern, check it's not in ignore patterns
179178
if [[ $matches_pattern -eq 1 ]]; then
180179
matches_ignore=0
181180
for ignore in "${ignore_patterns[@]}"; do
@@ -186,41 +185,46 @@ for file in $file_diff; do
186185
done
187186

188187
if [[ $matches_ignore -eq 0 ]]; then
189-
RUN_ALL=1
190-
echo "Found changes: $file. Run all tests"
188+
CRITICAL_CHANGE_DETECTED=1
189+
echo "Found critical changes: $file"
191190
break
192191
fi
193192
fi
194193
done
195194

195+
# RUN_ALL can be set manually, but also set it when critical changes are detected
196+
if [[ -z "${RUN_ALL:-}" ]]; then
197+
RUN_ALL=0
198+
fi
199+
if [[ $CRITICAL_CHANGE_DETECTED -eq 1 ]]; then
200+
RUN_ALL=1
201+
echo "RUN_ALL set due to critical changes"
202+
fi
203+
196204
# Decide whether to use precompiled wheels
197-
# Relies on existing patterns array as a basis.
198205
if [[ -n "${VLLM_USE_PRECOMPILED:-}" ]]; then
199206
echo "VLLM_USE_PRECOMPILED is already set to: $VLLM_USE_PRECOMPILED"
200-
elif [[ $RUN_ALL -eq 1 || "${BUILDKITE_BRANCH}" == "main" ]]; then
207+
elif [[ $CRITICAL_CHANGE_DETECTED -eq 1 || "${BUILDKITE_BRANCH}" == "main" ]]; then
201208
export VLLM_USE_PRECOMPILED=0
202-
echo "Detected critical changes, building wheels from source"
209+
echo "Detected critical changes or main branch, building wheels from source"
203210
else
204211
export VLLM_USE_PRECOMPILED=1
205212
echo "No critical changes, using precompiled wheels"
206213
fi
207214

208215
# Decide whether to skip building docker images (pull & mount code instead)
209-
# Honor manual override if provided.
210216
if [[ -n "${SKIP_IMAGE_BUILD:-}" ]]; then
211217
echo "SKIP_IMAGE_BUILD is preset to: ${SKIP_IMAGE_BUILD}"
212218
else
213-
# Auto decision:
214-
# - No critical changes (RUN_ALL==0)
215-
# - VLLM_USE_PRECOMPILED==1
216-
if [[ "${VLLM_USE_PRECOMPILED:-}" == "1" && "$RUN_ALL" -eq 0 ]]; then
219+
if [[ "${VLLM_USE_PRECOMPILED:-}" == "1" && "$CRITICAL_CHANGE_DETECTED" -eq 0 ]]; then
217220
SKIP_IMAGE_BUILD=1
218221
else
219222
SKIP_IMAGE_BUILD=0
220223
fi
221224
fi
222225

223226
# Determine the lowest common ancestor (LCA) commit with main branch if skipping image build
227+
DOCKER_IMAGE_OVERRIDE=""
224228
if [[ "${SKIP_IMAGE_BUILD}" == "1" ]]; then
225229
LCA_COMMIT=""
226230
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then

buildkite/test-template-ci.j2

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,16 @@
3737
{%- set tests_only = (tests_acc.only_tests and tests_acc.any) %}
3838
{%- set changed_tests = tests_acc.changed %}
3939

40-
{% macro vllm_checkoutoverlay_script(step,default_working_dir,skip_image_build,fail_fast,cov_enabled) -%}
41-
set {% if fail_fast == "true" %}-xeuo pipefail{% else %}-xuo{% endif %}
40+
{% macro vllm_checkoutoverlay_script(step, default_working_dir, skip_image_build, fail_fast, cov_enabled) %}
41+
{% if fail_fast == "true" -%}
42+
set -xeuo pipefail
43+
{%- else -%}
44+
set -xuo pipefail
45+
{%- endif %}
46+
4247
echo "SKIP_IMAGE_BUILD={{ skip_image_build }}"
43-
{% if skip_image_build == "1" %}
4448

49+
{% if skip_image_build == "1" %}
4550
# Copy in the code from the checkout to the workspace
4651
rm -rf /vllm-workspace/vllm || true
4752
cp -a /workdir/. /vllm-workspace/
@@ -54,6 +59,7 @@ cp -a /vllm-workspace/vllm/* "$$SITEPKG/vllm/"
5459
rm -rf /vllm-workspace/src || true
5560
mkdir -p /vllm-workspace/src
5661
mv /vllm-workspace/vllm /vllm-workspace/src/vllm
62+
{% endif %}
5763

5864
(command -v nvidia-smi >/dev/null && nvidia-smi || true)
5965
export VLLM_LOGGING_LEVEL=DEBUG
@@ -62,13 +68,6 @@ cd {{ (step.working_dir or default_working_dir) | safe }}
6268

6369
# Run tests with intelligent targeting and coverage
6470
{{ add_docker_pytest_coverage(step, cov_enabled) }}
65-
{%- endmacro %}
66-
{% macro add_pytest_coverage(cmd, coverage_file) %}
67-
{% if "pytest " in cmd %}
68-
COVERAGE_FILE={{ coverage_file }} {{ cmd | replace("pytest ", "pytest --cov=vllm --cov-report=xml --cov-append --durations=0 ") }} || true
69-
{% else %}
70-
{{ cmd }}
71-
{% endif %}
7271
{% endmacro %}
7372

7473
{% macro add_docker_pytest_coverage(step, cov_enabled) %}
@@ -197,7 +196,6 @@ plugins:
197196
volumes:
198197
- /dev/shm:/dev/shm
199198
- {{ hf_home_fsx }}:{{ hf_home_fsx }}
200-
- $PWD:/workdir
201199
{% elif step.gpu == "h200" %}
202200
- docker#v5.2.0:
203201
image: {{ image }}
@@ -225,7 +223,6 @@ plugins:
225223
- /dev/shm:/dev/shm
226224
- /data/benchmark-hf-cache:/benchmark-hf-cache
227225
- /data/benchmark-vllm-cache:/root/.cache/vllm
228-
- $PWD:/workdir
229226
{% elif step.gpu == "b200" %}
230227
- docker#v5.2.0:
231228
image: {{ image }}
@@ -254,7 +251,6 @@ plugins:
254251
- /dev/shm:/dev/shm
255252
- /data/benchmark-hf-cache:/benchmark-hf-cache
256253
- /data/benchmark-vllm-cache:/root/.cache/vllm
257-
- $PWD:/workdir
258254
{% else %}
259255
- kubernetes:
260256
podSpec:

buildkite/test-template-fastcheck.j2

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
{% set hf_home_efs = "/mnt/efs/hf_cache" %}
1111
{% set hf_home_fsx = "/fsx/hf_cache" %}
1212

13-
{% macro vllm_checkoutoverlay_script(step,default_working_dir,skip_image_build,requirements_changed,fail_fast) -%}
13+
{% macro vllm_checkoutoverlay_script(step,default_working_dir,skip_image_build,fail_fast) -%}
1414
set {% if fail_fast == "true" %}-xeuo pipefail{% else %}-xuo{% endif %}
15-
echo "SKIP_IMAGE_BUILD={{ skip_image_build }} REQUIREMENTS_CHANGED={{ requirements_changed }}"
15+
echo "SKIP_IMAGE_BUILD={{ skip_image_build }}"
1616
{% if skip_image_build == "1" %}
1717

1818
# Copy in the code from the checkout to the workspace
@@ -28,11 +28,6 @@ rm -rf /vllm-workspace/src || true
2828
mkdir -p /vllm-workspace/src
2929
mv /vllm-workspace/vllm /vllm-workspace/src/vllm
3030

31-
# If deps changed, re-install (system-wide in the container)
32-
{% if requirements_changed == '1' %}
33-
cd /vllm-workspace
34-
uv pip install --system -r requirements/common.txt -r requirements/build.txt -r requirements/test.txt
35-
{% endif %}
3631
{% endif %}
3732

3833
(command -v nvidia-smi >/dev/null && nvidia-smi || true)
@@ -51,6 +46,13 @@ cd {{ (step.working_dir or default_working_dir) | safe }}
5146
echo "No command(s) defined for this step." >&2; exit 2
5247
{%- endif %}
5348
{%- endmacro %}
49+
{% macro add_pytest_coverage(cmd, coverage_file) %}
50+
{% if "pytest " in cmd %}
51+
COVERAGE_FILE={{ coverage_file }} {{ cmd | replace("pytest ", "pytest --cov=vllm --cov-report= --cov-append --durations=0 ") }} || true
52+
{% else %}
53+
{{ cmd }}
54+
{% endif %}
55+
{% endmacro %}
5456

5557
steps:
5658
{% if skip_image_build != "1" %}

0 commit comments

Comments
 (0)