Collection of ideas that could improve CI reliability, performance and cost.
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
The issue lists seven broad CI improvement ideas and links prior work in nodejs/node#65927 and nodejs/build#3056; start by reading those discussions and the existing CI build and test configurations. Choose one idea for investigation and measure its effects on CI time, reliability, or cost. Done means reporting evidence and a focused follow-up proposal or linked issue; no specific files or acceptance criteria are named here.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The collaborator summits repeatedly bring up "CI flakiness" as a general topic as a pain point for collaborators. While this could mean different things to different people (Time to complete CI runs, unreliability of parts of the infrastructure, flaky tests needing re-runs) there are a few things that we could potentially look at. This issue includes a selection of things I've consindered that could potentially improve CI efficiency and they range from simple to wacky. These are high level ideas and are not yet fleshed out but I'm sharing them as a discussion starter for anyone who wants to pick them up and run with them or to provide any other thoughts.
- Find a way to stop the build process rebuilding so much when nothing has changed (For example why should it need to relink the
nodebinary when you want to runmake test?). There was some experimentation in this area by James in https://github.com/nodejs/node/pull/65927 who was looking to reduce redundancy but perhaps we could benefit from taking a closer look at this approach and whether it can be enhanced/expanded. - The standard problem with
tq-csafiles typically being the limit of how much parallelism you can run in the builds due to memory constraints as those files use a lot of RAM when being compiled (Although this week on a -j4 system with 8GB I hit a limit earlier in the build so it may not just be those files that cause particularly high memory usage). If we could limit those parts with large memory use then we could potentially increase the-jvalues that we use on some systems. - Could we run some of the
sequentialtest suite along side other things e.g. wpt so that things in the sequential stuff wouldn't interfere with each other? (I don't know the answer and I suspect it hasn't been looked at). Risky, but perhaps worthy of consideration and evaluation now that we have over 7500 tests onmain - How much could we gain in using more "fanned" builds (Build once, test in multiple OSs as we do on Windows) instead of building on each system? While fanned builds can be a bit troublesome it could reduce overall machine time (and cost). Do we care about verifying the build process on every Linux distribution for example? We'd want to understand the difference in build/test times but I think we're typically running at about 50/50 now unless a lot needs to be recompiled. If we took such an approach we could potentially give a subset of machines doing the builds higher specifications to allow the builds to progress faster although it's not clear that such segregation would be a good idea from a resource utilisation perspective. It would aoso make it easier to track the amount of time spent on build vs test to determine where efforts can/should be focussed on for any further optimisations.
- Automatic re-runs of failing tests. for each failing test at the end of the run, re-run it ten times and declare a pass if any of them worked. There's a reasonable chance that could avoid a lot of reruns. There has been some trialling of this on windows by Antoine which has been in place for the last three years via the
--measure-flakinessoption on the test runner, although at present that does not give a "success" result for the job overall if it was shown to pass in the re-runs. - Do we need to revisit the configurations we build on? There are two aspects to this: Platform/distribution coverage and "alternative" builds such as the ones we mostly do in containers (plus builds with pointer compression enabled) Reducing the matrix would reduce the chances of failures, but also run the risk of functionality not working. We could still run some of them in the "daily" builds if desired with the corresponding risk of having to figure out where any failures that occurred were introduced.
- Another possible option (which I know Richard isn't in favour of but it's still worth putting out there for consideration int eh current climate) would be that instead of running all variants on every PR we could pick a subset e.g. select one "other" Linux distributions (via a
genericlinux-x64or similar label) for each PR as well as the release one. That would reduce the load on the CI and reduce the number of machines we need. As per the last point it would have a corresponding risk of not being able to uniquely identify when any build fault on those platforms was introduced. This could be combined with point 4 regarding fanned builds.
On point 1 I've just looked at a typical Linux/x64 build and here are some lines from the CI job. While it's about 1-2 minutes and so not huge in the 40 minute process it is still potentially wasted machine time:
13:19:46 LINK(target) /home/iojs/build/workspace/node/out/Release/node
13:19:55 make test-ci -j1
13:20:59 LINK(target) /home/iojs/build/workspace/node/out/Release/node
For point 5 I had a look at one windows job which had an example of a failed test which was auto-re-run 10 times:
08:45:26 failed 4 out of 10
08:45:26 not ok 909 parallel/test-process-finalization
[...]
08:49:13 Failed tests:
08:49:13 d:\workspace\node-test-binary-windows-js-suites\node\Release\node.exe --test-reporter=./test/common/test-error-reporter.js --test-reporter-destination=stdout d:\workspace\node-test-binary-windows-js-suites\node\test\parallel\test-process-finalization.mjs
In this case it failed 4/10 so appears to be a flaky test. it we were to allow this to be treated as a pass for the purposes of allowing the CI to be landed then it could save a significant amount of rebuild time from having to resume CI jobs. We'd need to decide whether to have a specific threshold for this. This has not yet been tested on non-Windows platforms though as far as I'm aware..
If anyone wants to take a look at any of these feel free to report back in this issue and/or create another linked issue for your investigations.
- Lenguaje dominante
- Jinja
- Estrellas
- 542
- Forks
- 184
- Merge medio
- 4 d 16 h
- PR fusionados (30 d)
- 11
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nodejs/build
-
build-agenda
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
nodejs/build#4514 · 14 comentarios ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nodejs/build#4324 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 3 días
-
Release build retention policyAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
Los mantenedores suelen responder en 3 días
-
`binary_tmp` directory on test-mnx-ubuntu2204-x64-1 causing space issues and PR test failuresAbiertoincident
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
nodejs/build#4528 · 3 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de nodejs/build
Issues similares
-
Update Go Version to >=1.27.3Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
lorisleiva/laravel-docker#166 ·
-
coderabbit
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
guymaim/robo-trader#398 ·
Los mantenedores suelen responder en 1 día
-
Bug pulumi/pulumi-policy-opa R2 S0
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
pulumi/pulumi-policy-opa#46 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
kanboard/kanboard#5929 · 1 comentario · 3 reacciones ·
Los mantenedores suelen responder en 5 días