As we discussed on IRC, the website build is taking too long because of the pagination on the press page.
1 hour to build our website is just a waste of resources and our time. Let's discuss possible solutions.
We could try and make it even more static, e.g. make all the sites html in templates/ (As emmapeel said on IRC)
We could use fixed length pagination (1, 2, 3.. and so on instead of years)
We could go back to what we had before
Too long: between 40 minutes up to 1 hour to generate the staging website. Then, the same amount of time to push to production. So it's like 1h20 to 2 hours to get a simple modification like a TB release.
Before adding the pagination in /press, the website was building in ~20 minutes.
And in addition to this; when you have 8 cores/16 threads CPU with 32GB Ram.. I would expect parallel builds (multi-threading) to actually take this build to below 10 minutes. And otherwise I can compile the Linux kernel faster than this site.
In short, there are some small things that can be done around the templates to help things, but the root of the problem is that Lektor is simply extremely inefficient when compiling sites that have lots of pages.
The problem and possible solutions are discussed here in upstream issue #180
This issue has been waiting for information two
weeks or more. It needs attention. Please take care of
this before the end of
2024-09-11. ~"Needs
Information" tickets will be moved to the Icebox after
that point.
(Any ticket left in Needs Review, Needs Information, Next, or Doing
without activity for 14 days gets such
notifications. Make a comment describing the current state
of this ticket and remove the Stale label to fix this.)
To make the bot ignore this ticket, add the bot-ignore label.
In terms of low-hanging fruits, I think we should be able to reduce the number of builds from 3 to 2. Of course we wouldn't build more than once but it seems this is still required:
the build never needed to run three times in a row, it just needs to run twice. that's also because of i18n (and -scss, and community generator) but that's an unfixable problem with how lektor works
Given the amount of time kez spent looking at Lektor internals, I trust their assessment. But even shaving off this one extra build should yield a 30% improvement on building this website, so I'll push the necessary changes in the tpo/tpa/ci-templates project asap.
Thanks to some updates and changes around the i18n and scss plugins, our Lektor websites now build in 1 pass instead of 2 or 3, so they should build roughly 66% faster in CI.
These changes will affect mainly www.torproject.org in addition to support.torproject.org and community.torproject.org. Other Lektor projects like newsletter.torproject.org were small enough that build times weren't a significant issue to start with.
The blog is unfortunately not affected by this improvement, because it never had to be built in mulitple passes. That issue is tracked in blog#40015 (closed)