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