[Workflow] Fix kernel release build failures for aarch64 and wheel renaming (#22018)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Baizhou Zhang
2026-04-03 03:23:03 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 838f815e9f
commit 98ac40192b
2 changed files with 14 additions and 5 deletions
+12 -3
View File
@@ -25,6 +25,14 @@ mkdir -p "${BUILDX_CACHE_DIR}" "${CCACHE_HOST_DIR}"
# Ensure a buildx builder with docker-container driver (required for cache export)
BUILDER_NAME="sgl-kernel-builder"
# RESET_BUILDER=1 removes and recreates the builder to clear corrupted internal
# state (e.g. stale containerd snapshots from base image layer GC).
if [ "${RESET_BUILDER:-0}" = "1" ]; then
echo "Resetting buildx builder: ${BUILDER_NAME}"
docker buildx rm "${BUILDER_NAME}" 2>/dev/null || true
rm -rf "${BUILDX_CACHE_DIR}"
mkdir -p "${BUILDX_CACHE_DIR}"
fi
if ! docker buildx inspect "${BUILDER_NAME}" >/dev/null 2>&1; then
docker buildx create --name "${BUILDER_NAME}" --driver docker-container --use --bootstrap
else
@@ -51,6 +59,7 @@ echo "Builder: ${BUILDER_NAME}"
echo "BUILD_JOBS: ${BUILD_JOBS:-auto}"
echo "NVCC_THREADS: ${NVCC_THREADS:-32}"
echo "USE_CCACHE: ${USE_CCACHE:-1}"
echo "RESET_BUILDER: ${RESET_BUILDER:-0}"
echo "----------------------------------------"
# Optional build-args (empty string disables)
@@ -73,8 +82,8 @@ docker buildx build \
--build-arg PYTHON_VERSION="${PYTHON_VERSION}" \
--build-arg PYTHON_TAG="${PY_TAG}" \
"${BUILD_ARGS[@]}" \
--cache-from type=local,src=${BUILDX_CACHE_DIR} \
--cache-to type=local,dest=${BUILDX_CACHE_DIR},mode=max \
--cache-from "type=local,src=${BUILDX_CACHE_DIR}" \
--cache-to "type=local,dest=${BUILDX_CACHE_DIR},mode=max" \
--target deps \
--load \
-t "${DEPS_TAG}" \
@@ -132,7 +141,7 @@ export CMAKE_ARGS="${CMAKE_ARGS:-} -DSGL_KERNEL_COMPILE_THREADS=${NVCC_THREADS}"
echo "Build parallelism: CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}, NVCC_THREADS=${NVCC_THREADS}"
${PYTHON_ROOT_PATH}/bin/python -m uv build --wheel -Cbuild-dir=build . --color=always --no-build-isolation
./rename_wheels.sh
PYTHON=${PYTHON_ROOT_PATH}/bin/python ./rename_wheels.sh
if [ "${USE_CCACHE}" = "1" ]; then
echo "=== ccache stats (after) ==="
+2 -2
View File
@@ -55,7 +55,7 @@ for wheel in "${wheel_files[@]}"; do
TMPDIR=$(mktemp -d)
trap 'rm -rf -- "$TMPDIR"' ERR
python3 -m wheel unpack "$wheel" --dest "$TMPDIR"
"${PYTHON:-python3}" -m wheel unpack "$wheel" --dest "$TMPDIR"
UNPACKED=$(find "$TMPDIR" -mindepth 1 -maxdepth 1 -type d | head -1)
DIST_INFO=$(find "$UNPACKED" -maxdepth 1 -type d -name "*.dist-info" | head -1)
WHEEL_META="${DIST_INFO}/WHEEL"
@@ -78,7 +78,7 @@ for wheel in "${wheel_files[@]}"; do
mv "$DIST_INFO" "${UNPACKED}/${NEW_BASE}"
rm -f "$wheel"
python3 -m wheel pack "$UNPACKED" --dest-dir "$WHEEL_DIR"
"${PYTHON:-python3}" -m wheel pack "$UNPACKED" --dest-dir "$WHEEL_DIR"
rm -rf "$TMPDIR"
trap - ERR
done