Harfork Pipeline optimization
Issue contains proposals to optimize hardfork package generation pipeline. Example pipeline:
https://buildkite.com/o-1-labs-2/hardfork-package-generation-new/builds/117#019a59ae-2848-452d-bb03-44d2b2c5593b
Currently pipeline is taking ~50 minutes:
- 15 minutes for building apps and debian
- 7 minutes to build docker (docker builds are conduct in parallel, however the longest one - rosetta, takes 7 minutes)
- 32m - package verifications.
There are many areas of improvement. Separate issue is created for package verification (#18153 ) as this is most complex job. Here we are proposing changes to rest of the building jobs:
Building apps and debians:
- Ledger generation takes 4 m
- setting up buildx emulated docker - 2 m
- Copying/LIsting aws files - 3 minutes
- Building apps - 2 mins
- Building debians 4 min
We can save couple mins not building apps but using already built and cached in hetzner. Then we will only inject hf config. Also upload to aws can be done in parallel. Finally after we will use arm64 native host for building arm64 docker we can skip setup for buildx emulator
Buidling dockers
Here we can explore changing order of some layers so the one that is changing constantly (downloading and installing debians) can be moved at the end of dockerfile. As a result all previous layers will be untouched, which makes them perfect candidate for cache
Why do we need these?
- setting up buildx emulated docker - 2 m
- Copying/LIsting aws files - 3 minutes
could we skip them?
I think we don't care about arm64 support being released fast right?
- we are setting buildx emulated docker to every agent to simplify setup. Now it will be removed since we are using arm64 native machine
- We need to upload ledgers to aws
I mean, we could upload to AWS after packaging is done, or as a parallel task? It doesn't seems to be blocking stuff behind.
Yes. That's exactly what I'm trying to implement. Upload those file in non blocking job while Debian's/dockers are building