ci(xpu): clean build artifacts in cleanup (#27648)
Co-authored-by: Patil, Jitendra <jitendra.patil@intel.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Patil, Jitendra
Claude Opus 4.7
parent
5809bbe35d
commit
6110ed671f
@@ -118,7 +118,15 @@ jobs:
|
||||
|
||||
- name: Cleanup container
|
||||
if: always()
|
||||
run: docker rm -f ci_sglang_xpu || true
|
||||
run: |
|
||||
rm -rf \
|
||||
python/build \
|
||||
python/sglang.egg-info \
|
||||
test/result.jsonl || true
|
||||
docker rm -f ci_sglang_xpu || true
|
||||
if [[ -n "${CI_SGLANG_XPU_IMAGE:-}" ]]; then
|
||||
docker rmi -f "${CI_SGLANG_XPU_IMAGE}" || true
|
||||
fi
|
||||
|
||||
# ==================== Wait for Stage A ==================== #
|
||||
wait-for-stage-a:
|
||||
@@ -173,7 +181,15 @@ jobs:
|
||||
|
||||
- name: Cleanup container
|
||||
if: always()
|
||||
run: docker rm -f ci_sglang_xpu || true
|
||||
run: |
|
||||
rm -rf \
|
||||
python/build \
|
||||
python/sglang.egg-info \
|
||||
test/result.jsonl || true
|
||||
docker rm -f ci_sglang_xpu || true
|
||||
if [[ -n "${CI_SGLANG_XPU_IMAGE:-}" ]]; then
|
||||
docker rmi -f "${CI_SGLANG_XPU_IMAGE}" || true
|
||||
fi
|
||||
|
||||
finish:
|
||||
if: always()
|
||||
|
||||
@@ -114,14 +114,17 @@ find_latest_image() {
|
||||
if [[ -n "${CUSTOM_IMAGE}" ]]; then
|
||||
IMAGE="${CUSTOM_IMAGE}"
|
||||
echo "Using custom image: ${IMAGE}"
|
||||
retry_with_backoff 6 docker pull "${IMAGE}"
|
||||
else
|
||||
IMAGE=$(find_latest_image)
|
||||
if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then
|
||||
retry_with_backoff 6 docker pull "${IMAGE}"
|
||||
else
|
||||
echo "Image ${IMAGE} already present locally; skipping pull"
|
||||
fi
|
||||
fi
|
||||
# Always pull so each stage runs the registry's current image; the cleanup
|
||||
# step removes the image after the stage so the runner doesn't accumulate
|
||||
# stale layers across runs.
|
||||
retry_with_backoff 6 docker pull "${IMAGE}"
|
||||
|
||||
# Export the resolved image so the cleanup step can rmi the exact tag used.
|
||||
if [[ -n "${GITHUB_ENV:-}" ]]; then
|
||||
echo "CI_SGLANG_XPU_IMAGE=${IMAGE}" >> "${GITHUB_ENV}"
|
||||
fi
|
||||
|
||||
# Remove any stale container of the same name so re-runs are idempotent.
|
||||
|
||||
Reference in New Issue
Block a user