Sanity tests perf improvements (#296248)

This commit is contained in:
Dmitriy Vasyura
2026-02-22 08:55:53 -08:00
committed by GitHub
parent 939e20b2a0
commit ee401a1256
16 changed files with 238 additions and 254 deletions

View File

@@ -5,7 +5,6 @@ CONTAINER=""
ARCH="amd64"
MIRROR="mcr.microsoft.com/mirror/docker/library/"
BASE_IMAGE=""
PAGE_SIZE=""
ARGS=""
while [ $# -gt 0 ]; do
@@ -13,7 +12,6 @@ while [ $# -gt 0 ]; do
--container) CONTAINER="$2"; shift 2 ;;
--arch) ARCH="$2"; shift 2 ;;
--base-image) BASE_IMAGE="$2"; shift 2 ;;
--page-size) PAGE_SIZE="$2"; shift 2 ;;
*) ARGS="$ARGS $1"; shift ;;
esac
done
@@ -28,11 +26,6 @@ ROOT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
# Only build if image doesn't exist (i.e., not loaded from cache)
if ! docker image inspect "$CONTAINER" > /dev/null 2>&1; then
if [ "$PAGE_SIZE" != "" ]; then
echo "Setting up QEMU user-mode emulation for $ARCH"
docker run --privileged --rm tonistiigi/binfmt --install "$ARCH"
fi
echo "Building container image: $CONTAINER"
docker buildx build \
--platform "linux/$ARCH" \
@@ -45,18 +38,11 @@ else
echo "Using cached container image: $CONTAINER"
fi
# For 64K page size, use QEMU system emulation with a 64K kernel
if [ "$PAGE_SIZE" = "64k" ]; then
exec "$SCRIPT_DIR/run-qemu-64k.sh" \
--container "$CONTAINER" \
-- $ARGS
else
echo "Running sanity tests in container"
docker run \
--rm \
--platform "linux/$ARCH" \
--volume "$ROOT_DIR:/root" \
--entrypoint sh \
"$CONTAINER" \
/root/containers/entrypoint.sh $ARGS
fi
echo "Running sanity tests in container"
docker run \
--rm \
--platform "linux/$ARCH" \
--volume "$ROOT_DIR:/root" \
--entrypoint sh \
"$CONTAINER" \
/root/containers/entrypoint.sh $ARGS