Agones: Improve build speed by refactoring Makefile

Created on 21 Dec 2018  路  4Comments  路  Source: googleforgames/agones

There are currently two issues with Makefile which prevent it from being parallelizable:

  1. Some dependencies are missing in the Makefile which prevent it from working with -j N where N > 0.

For example if I do:

$ make -j2 build build-controller-binary push-controller-image

It will likely fail or be incorrect (because build and push will be running in parallel, it will either fail to push or push a previous version). A fix for this is to add a dependency on build to push. There are all kinds of issues like that in the Makefile.

Ideally I should be able to say export MAKEFLAGS="-j 4" in my ~/.bashrc and my builds would be magically faster, but still correct regardless of targets that I specify.

  1. Some targets (e.g. build-agones-sdk-binary) are sequential, and pretty slow (in particular when building on macOS, which has horrible filesystem mount performance). They might benefit from being broken into smaller pieces which can run in paralllel.
help wanted arebuild-tools

Most helpful comment

I can work on fixing that.

Also I discovered that we're not using any go build caching, which kills interactive (re)build performance. Will send a PR which fixes that...

All 4 comments

I can work on fixing that.

Also I discovered that we're not using any go build caching, which kills interactive (re)build performance. Will send a PR which fixes that...

Also I discovered that we're not using any go build caching, which kills interactive (re)build performance. Will send a PR which fixes that...

YEESSSS - I've wanted this for a while, but never got around to it! :man_cartwheeling:

Some targets (e.g. build-agones-sdk-binary) are sequential, and pretty slow (in particular when building on macOS, which has horrible filesystem mount performance). They might benefit from being broken into smaller pieces which can run in paralllel.

YES ! building on macOS is slow.

It looks like building agones on Linux still has problems when building with -j. Is there any bug tracking this issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thisisnotapril picture thisisnotapril  路  6Comments

alexandrem picture alexandrem  路  5Comments

jmaeso picture jmaeso  路  5Comments

roberthbailey picture roberthbailey  路  5Comments

lazeratops picture lazeratops  路  4Comments