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
|
- name: Cleanup container
|
||||||
if: always()
|
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 ==================== #
|
||||||
wait-for-stage-a:
|
wait-for-stage-a:
|
||||||
@@ -173,7 +181,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Cleanup container
|
- name: Cleanup container
|
||||||
if: always()
|
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:
|
finish:
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -114,14 +114,17 @@ find_latest_image() {
|
|||||||
if [[ -n "${CUSTOM_IMAGE}" ]]; then
|
if [[ -n "${CUSTOM_IMAGE}" ]]; then
|
||||||
IMAGE="${CUSTOM_IMAGE}"
|
IMAGE="${CUSTOM_IMAGE}"
|
||||||
echo "Using custom image: ${IMAGE}"
|
echo "Using custom image: ${IMAGE}"
|
||||||
retry_with_backoff 6 docker pull "${IMAGE}"
|
|
||||||
else
|
else
|
||||||
IMAGE=$(find_latest_image)
|
IMAGE=$(find_latest_image)
|
||||||
if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then
|
fi
|
||||||
retry_with_backoff 6 docker pull "${IMAGE}"
|
# Always pull so each stage runs the registry's current image; the cleanup
|
||||||
else
|
# step removes the image after the stage so the runner doesn't accumulate
|
||||||
echo "Image ${IMAGE} already present locally; skipping pull"
|
# stale layers across runs.
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
# Remove any stale container of the same name so re-runs are idempotent.
|
# Remove any stale container of the same name so re-runs are idempotent.
|
||||||
|
|||||||
Reference in New Issue
Block a user