commaai / agnos-builder

Build AGNOS, the operating system for your comma 3/3X
32 stars 53 forks source link

Speedup system build time #259

Open adeebshihadeh opened 1 month ago

adeebshihadeh commented 1 month ago

Goal is to get a <10m build time without a cache on the CI runner. According to https://github.com/commaai/agnos-builder/pull/251, we're currently at 33m.

For validation, trigger CI 5 times and post the timings of the "Build system" step. The max shouldn't exceed 10m.

  1. remove anything that's unnecessary
  2. refactoring and reordering steps
  3. parallelize steps

If done carefully, it should be possible to do this without a comma 3/3X and have someone on the Discord test it for you at the end.

Bounty is worth 3x ($600) if it ends up being <5m.

Emmanueltech commented 1 month ago

Hi, I would like to work on this

andiradulescu commented 1 month ago

@Emmanueltech you need to show some initial progress in a PR to lock the bounty - the lock then times out after a week of no progress. More info in Bounties.

robin-reckmann commented 1 month ago

@adeebshihadeh I would propose to store the compiled .deb files for capnp, ffpmeg, modemmanager and qtwayland, as well as the wheel for pyqt5 in the repo. This should bring down the docker image creation time by quite a bit. Or do you prefer to compile them every time from source?

adeebshihadeh commented 1 month ago

@adeebshihadeh I would propose to store the compiled .deb files for capnp, ffpmeg, modemmanager and qtwayland, as well as the wheel for pyqt5 in the repo. This should bring down the docker image creation time by quite a bit. Or do you prefer to compile them every time from source?

I suspect it won't be worth it, but feel free to prove me wrong with a PR. Things I'd be concerned about:

andiradulescu commented 1 month ago

If we want custom "debs" built and uploaded separately, we should have a comma PPA.

The install of the comma PPA would look like this:

sudo add-apt-repository ppa:comma/comma
sudo apt update

Then you can just install the packages with apt.

Ubuntu launchpad also has it's own CI, so the packages will be built there.

Never actually used it, but this is nice way of delivering Ubuntu packages.

Could be used for:

As for these ones I would just move them to the 24.04 packages:

A random example of a popular PPA:

andiradulescu commented 1 month ago

If we don't want to deal with a PPA, we could:

webbdays commented 3 weeks ago

@adeebshihadeh is this issue still relevant?

robin-reckmann commented 6 days ago

@adeebshihadeh Can we ignore the package compile time assuming they will only be updated infrequently? With this PR https://github.com/commaai/agnos-builder/pull/354 the overall build_system.sh time is around 9mins (see https://github.com/commaai/agnos-builder/pull/359). This uses the docker cache for the package compilation, but builds the overall image from scratch for calculation of the build time.

ilvar commented 2 days ago

What is the config of namespace-profile-arm64-8x16-2004-caching runner?

andiradulescu commented 2 days ago

What is the config of namespace-profile-arm64-8x16-2004-caching runner?

exactly as in the name: