Repository navigation
ci: stabilize release build memory on hosted agent - #177
Merged
Merged
Conversation
Replace the obsolete ng-cli template identifier so the package upgrade schematic resolves the base project instead of the ai-config partial. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
IIS serves only the static browser output, so skip the server bundle and route prerendering in the release build to cut esbuild's memory peak. List `production` explicitly so output hashing and budgets still apply. Also correct the GOMEMLIMIT/GOGC comment, which described a GitHub Actions runner rather than this Azure agent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #171
Summary
The Azure release pipeline (definition 586) intermittently ran out of memory on the ~7.9 GB Microsoft-hosted agent during
npm run build:ci. The build then stalled for about 45 minutes and failed with "We stopped hearing from agent". This PR makes the build pass consistently with three changes:4fe458b): setGOMEMLIMIT=6GiB,GOGC=50andNODE_OPTIONS=--max_old_space_size=4096on the build step.b2ff382, cherry-picked from Fix release pipeline after Angular upgrade #170): changeprojectTemplateinignite-ui-cli.jsonfrom"ng-cli"to"base". Without this,upgrade-packagesfalls back to the hiddenai-configpartial, which fails withMethod not implemented.before the build starts.14baeaf): add abrowser-onlyconfiguration toangular.json(server: false,ssr: false) and build with--configuration production,browser-only.productionhas to be listed explicitly. Naming a configuration replaces the default one, and on its ownbrowser-onlywould turn off output hashing and budgets.Why this works where #170 didn't
Angular's application builder runs esbuild as a separate Go process, and Go's memory use isn't affected by any Node setting. With the default
GOGC=100, Go lets its heap grow to about twice the live data before collecting, so esbuild took whatever memory the agent had left.Every mitigation tried in #170 acted on the Node side:
NG_BUILD_MAX_WORKERS=2,NG_BUILD_PARALLEL_TS=false, and moving from Node 24 to Node 26. None of them could limit esbuild.GOGC=50makes esbuild collect garbage about twice as often, andGOMEMLIMITgives the Go runtime a soft ceiling that triggers more aggressive collection as memory gets close to it.The Go options alone improved the success rate a lot but didn't eliminate stalls. Adding the browser-only build cut the bundling work, and the remaining stalls went away in testing.
Results (definition 586,
ubuntu-latest, ~7.9 GB)build:ciduration (successes)b2ff382)production, Go options (14baeaf)b2ff382: 382977, 382979, 382980, 382981, 382984, 382985, 382987 and 382988 succeeded. 382978 and 382989 lost the agent after 46 and 48 minutes inbuild:ci, the same failure as Angular 22 CI build intermittently exhausts hosted-agent memory #171.14baeaf: 382991 through 383000, all succeeded.Local verification of the browser-only build
npm run build:ci -- --configuration production,browser-onlyfinished in 3:01. The output indist/angular-grid-examples/browser:main-7E3VDCKY.js), confirming theproductionsettings applyindex.htmland no prerendered routesweb.configis includedNotes and remaining risk
GOMEMLIMIT(6 GiB for esbuild plus up to 4 GiB of Node heap exceeds the agent's memory) and the Node heap size.skipOnServerInterceptor), so the prerendered pages only had empty grids. The main loss is the build-time render of each route, which used to catch route-initialization errors before deploy.web.configrewrite sends non-file requests toindex.html, so direct links to routes still work.provideClientHydrationstays on. With no server-rendered HTML, Angular simply renders on the client.ng buildand the per-app SSR scripts are unchanged.After merge: staging check
On https://staging.infragistics.com/angular-grid-examples/:
inventory,hr-portal,finance,sales,fleet(both at the top level and underhome/)charts/: column, bar, line, pie, step, polar🤖 Generated with Claude Code