From 7ccebe7e4b4c2edfbce01767386f29d532a110a6 Mon Sep 17 00:00:00 2001 From: Parker Bibus Date: Thu, 14 May 2026 11:04:34 -0700 Subject: [PATCH] Fix Blazor Wasm and disable Ntex Fortunes in CI The Blazor Wasm and Ntex Fortunes scenarios have been failing in benchmarks-ci-02 since the Mar 26 build. Both fail at docker build --pull on dockerfiles pulled from upstream repos that have rolled forward in incompatible ways. Take a different approach for each: Blazor Wasm (docker/wasm-performance/): The upstream dockerfile at dotnet/aspnetcore installs Node.js 21 via https://deb.nodesource.com/setup_21.x. Recent aspnetcore npm packages (balanced-match, brace-expansion, eslint-visitor-keys, minimatch, @tootallnate/once, ...) require node 18 || 20 || >=22, and the rollup-driven 'npm run build' step now fails on Node 21 with ERR_REQUIRE_ESM. Add a local copy of the dockerfile (and its compose JSON and exec.sh) under docker/wasm-performance/ using setup_22.x, and point build/job-variables.yml at it via the local raw.githubusercontent.com URL. Track upstream by leaving everything else identical so future changes can be diff-rebased. An upstream fix is being pursued in dotnet/aspnetcore (PR #66686). Once that merges, drop docker/wasm-performance/ and revert build/job-variables.yml to the upstream config URL. Ntex Fortunes (disable): TechEmpower's frameworks/Rust/ntex/Cargo.toml uses 'ntex-bytes = { version = "1.5" }' (caret semver), so cargo resolves to the newest 1.x. ntex-bytes 1.6.0 shipped 2026-05-02 and introduced the BytePages type, which the fafhrd91/postgres ntex-3 tokio-postgres fork (frozen at commit fbc7a17) does not understand - it still uses BytesMut. The workspace builds tokio-postgres for every ntex binary when --features=tokio is set, so the ntex-db image cannot be produced. The TechEmpower/FrameworkBenchmarks repo is now archived, so a real upstream fix is not coming. Disable the Ntex Fortunes scenario in both places it runs (build/frameworks-database-scenarios.yml and build/containers-scenarios.yml) with an explanatory comment, and leave a follow-up note for re-enabling if the ntex source is pinned/forked back into a working state. Verified the Wasm fix locally with docker build --pull on Docker Desktop against the same dotnet/aspnetcore main commit (29e4b0d3): - upstream main dockerfile (setup_21.x): fails at 'npm run build' with ERR_REQUIRE_ESM in http-proxy-agent / @tootallnate/once - this PR's docker/wasm-performance/dockerfile (setup_22.x): publishes Wasm.Performance.Driver and produces the final playwright image successfully Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build/containers-scenarios.yml | 14 ++++-- build/frameworks-database-scenarios.yml | 17 +++++-- build/job-variables.yml | 5 ++- .../wasm-performance/benchmarks.compose.json | 26 +++++++++++ docker/wasm-performance/dockerfile | 45 +++++++++++++++++++ docker/wasm-performance/exec.sh | 3 ++ 6 files changed, 103 insertions(+), 7 deletions(-) create mode 100644 docker/wasm-performance/benchmarks.compose.json create mode 100644 docker/wasm-performance/dockerfile create mode 100644 docker/wasm-performance/exec.sh diff --git a/build/containers-scenarios.yml b/build/containers-scenarios.yml index 7239ba2cb..60daf79b3 100644 --- a/build/containers-scenarios.yml +++ b/build/containers-scenarios.yml @@ -113,9 +113,17 @@ parameters: - displayName: Json NTex arguments: --scenario json_ntex --property scenario=JsonNTex condition: Math.round(Date.now() / 43200000) % 10 == 8 # once every 10 half-days - - displayName: Fortunes NTex - arguments: --scenario fortunes_ntex --property scenario=FortunesNTex - condition: Math.round(Date.now() / 43200000) % 10 == 9 # once every 10 half-days + # Fortunes NTex is disabled: its docker build (ntex-db.dockerfile in + # TechEmpower/FrameworkBenchmarks) breaks because the fafhrd91/postgres + # ntex-3 tokio-postgres fork it depends on is no longer compatible + # with newer ntex-bytes resolved from TechEmpower's caret-versioned + # dep. TechEmpower/FrameworkBenchmarks is archived + # (https://github.com/TechEmpower/FrameworkBenchmarks), so no fix is + # coming upstream. See build/frameworks-database-scenarios.yml for + # the matching disable. + # - displayName: Fortunes NTex + # arguments: --scenario fortunes_ntex --property scenario=FortunesNTex + # condition: Math.round(Date.now() / 43200000) % 10 == 9 # once every 10 half-days steps: - ${{ each scenario in parameters.scenarios }}: diff --git a/build/frameworks-database-scenarios.yml b/build/frameworks-database-scenarios.yml index eecc4a4ef..71cc99845 100644 --- a/build/frameworks-database-scenarios.yml +++ b/build/frameworks-database-scenarios.yml @@ -52,9 +52,20 @@ parameters: arguments: --scenario json_gin --load.variables.connections 512 --property scenario=JsonGin # Ntex (Rust) - - - displayName: Ntex Fortunes - arguments: --scenario fortunes_ntex --load.variables.connections 512 --property scenario=FortunesNtex + # + # Ntex Fortunes is disabled: the docker build for ntex-db.dockerfile + # is broken because the TechEmpower workspace pulls in the + # fafhrd91/postgres `ntex-3` tokio-postgres fork (frozen at commit + # fbc7a17), which is no longer compatible with the latest ntex-bytes + # (1.6+) that cargo resolves from TechEmpower's caret-versioned + # `ntex-bytes = "1.5"`. The workspace fails to compile with E0308 + # mismatched-types errors on `BytesMut` vs `BytePages`. + # TechEmpower/FrameworkBenchmarks is now archived + # (https://github.com/TechEmpower/FrameworkBenchmarks), so a real fix + # upstream is unlikely and not worth chasing. Re-enable if the ntex + # source is brought back in-tree or pinned to a working dep set. + # - displayName: Ntex Fortunes + # arguments: --scenario fortunes_ntex --load.variables.connections 512 --property scenario=FortunesNtex # Vertx (Java) diff --git a/build/job-variables.yml b/build/job-variables.yml index 59259217f..16684a1d4 100644 --- a/build/job-variables.yml +++ b/build/job-variables.yml @@ -25,7 +25,10 @@ variables: value: -j https://raw.githubusercontent.com/aspnet/Benchmarks/main/src/BenchmarksApps/TechEmpower/PlatformBenchmarks/benchmarks.html.json - name: blazorWasmJobs - value: --config https://raw.githubusercontent.com/dotnet/aspnetcore/main/src/Components/benchmarkapps/Wasm.Performance/benchmarks.compose.json + # Use the local override under docker/wasm-performance/ instead of the upstream config + # at dotnet/aspnetcore. The local dockerfile installs Node.js 22 (Node 21 is EOL and + # recent aspnetcore npm dependencies require node 18 || 20 || >=22). + value: --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/docker/wasm-performance/benchmarks.compose.json - name: mvcJobs diff --git a/docker/wasm-performance/benchmarks.compose.json b/docker/wasm-performance/benchmarks.compose.json new file mode 100644 index 000000000..afcc71f53 --- /dev/null +++ b/docker/wasm-performance/benchmarks.compose.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://raw.githubusercontent.com/aspnet/Benchmarks/master/src/BenchmarksDriver2/benchmarks.schema.json", + "scenarios": { + "blazorwasmbenchmark": { + "application": { + "job": "blazorwasmbenchmark" + } + } + }, + "jobs": { + "blazorwasmbenchmark": { + "source": { + "repository": "https://github.com/aspnet/Benchmarks.git", + "branchOrCommit": "main", + "dockerFile": "docker/wasm-performance/dockerfile", + "dockerImageName": "blazorwasmbenchmark", + "dockerContextDirectory": "docker/wasm-performance" + }, + "buildArguments": [ + "gitBranch=main" + ], + "waitForExit": true, + "readyStateText": "Application started." + } + } +} diff --git a/docker/wasm-performance/dockerfile b/docker/wasm-performance/dockerfile new file mode 100644 index 000000000..5ba22612f --- /dev/null +++ b/docker/wasm-performance/dockerfile @@ -0,0 +1,45 @@ +# Local override of dotnet/aspnetcore's src/Components/benchmarkapps/Wasm.Performance/dockerfile. +# +# Differences from upstream: +# - Installs Node.js 22 (LTS) via setup_22.x instead of Node.js 21 (EOL). +# Recent npm dependencies in aspnetcore (e.g. balanced-match, brace-expansion, +# minimatch, eslint-visitor-keys, @tootallnate/once) require node 18, 20, or >=22. +# Node 21 is no longer supported and `npm run build` fails with ERR_REQUIRE_ESM. +# +# Track upstream: https://github.com/dotnet/aspnetcore/blob/main/src/Components/benchmarkapps/Wasm.Performance/dockerfile +FROM mcr.microsoft.com/dotnet/sdk:latest AS build + +ENV StressRunDuration=0 +ARG DEBIAN_FRONTEND=noninteractive + +# Setup for nodejs +RUN curl -sL https://deb.nodesource.com/setup_22.x | bash - + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + libunwind-dev \ + nodejs \ + git + +ARG gitBranch=main + +WORKDIR /src +ADD https://api.github.com/repos/dotnet/aspnetcore/git/ref/heads/${gitBranch} /aspnetcore.commit + +RUN git init \ + && git fetch https://github.com/aspnet/aspnetcore ${gitBranch} \ + && git reset --hard FETCH_HEAD \ + && git submodule update --init \ + && git remote add origin https://github.com/aspnet/aspnetcore + +RUN ./restore.sh +RUN npm run build +RUN .dotnet/dotnet publish -c Release -r linux-x64 --sc true -o /app ./src/Components/benchmarkapps/Wasm.Performance/Driver/Wasm.Performance.Driver.csproj +RUN chmod +x /app/Wasm.Performance.Driver + +WORKDIR /app +FROM mcr.microsoft.com/playwright/dotnet:v1.58.0-jammy-amd64 AS final +COPY --from=build ./app ./ +COPY ./exec.sh ./ + +ENTRYPOINT [ "bash", "./exec.sh" ] diff --git a/docker/wasm-performance/exec.sh b/docker/wasm-performance/exec.sh new file mode 100644 index 000000000..5cc8a372d --- /dev/null +++ b/docker/wasm-performance/exec.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +./Wasm.Performance.Driver $StressRunDuration