-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added incremental build option to Makefile to speed up rebuilds #454
added incremental build option to Makefile to speed up rebuilds #454
Conversation
Build Succeeded 👏 Build Id: fe9b74ed-408a-4662-a4fc-4ec70184d4c7 The following development artifacts have been built, and will exist for the next 30 days:
To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvements! Couple of thought below 🐇
build/Makefile
Outdated
@@ -101,6 +106,13 @@ ifdef DOCKER_RUN | |||
ensure-build-image += ensure-build-image | |||
endif | |||
|
|||
ifdef INCREMENTAL_BUILD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that this should be defaulted on - and then turned off for builds in do-release
. I'm not seeing any downsides. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switched default to incremental.
build/Makefile
Outdated
@@ -101,6 +106,13 @@ ifdef DOCKER_RUN | |||
ensure-build-image += ensure-build-image | |||
endif | |||
|
|||
ifdef INCREMENTAL_BUILD | |||
# keep a cache of files built by Go across docker invocations in a local directory. | |||
common_mounts += -v $(CURDIR)/.gocache:/root/.cache/go-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than use CURDIR, which is the working directory, let's explicitly put it in the $(build_path), then it never moves, regardless of where people call the Makefile from.
common_mounts += -v $(CURDIR)/.gocache:/root/.cache/go-build | |
common_mounts += -v $(build_path)/.gocache:/root/.cache/go-build |
Then we can also add a mkdir -p
to the ensure-build-config
target, so that the directory always is created before being mounted (I thought it should throw an error if it's not there - has that stopped happening?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker appears to be creating the directory automatically.
9b7d27e
to
f1627a3
Compare
f1627a3
to
4d2c8bc
Compare
(used everywhere by default except in do-release target) Before: ======= $ time make -C build -j4 build-images real 2m33.772s user 0m1.302s sys 0m0.889s Incremental re-builds: ======= $ time make -C build -j4 build-controller-image real 0m1.837s user 0m0.241s sys 0m0.085s $ time make -C build -j4 build-agones-sdk-image real 0m5.352s user 0m0.447s sys 0m0.244s $ time make -C build -j4 build-ping-image real 0m1.318s user 0m0.198s sys 0m0.063s $ time make -C build -j4 build-images real 0m5.506s user 0m1.177s sys 0m0.617s
4d2c8bc
to
5f307e7
Compare
Build Failed 😱 Build Id: 9560ca9e-4cb1-4de6-8e86-d9d4e2c2d25a Build Logs
|
Build Succeeded 👏 Build Id: 31b4fd7a-1d5f-4cff-9548-548d2f6479a9 The following development artifacts have been built, and will exist for the next 30 days:
To install this version:
|
Build Succeeded 👏 Build Id: 2bc5c718-7a3f-4da3-87b9-464a3a2b6ba6 The following development artifacts have been built, and will exist for the next 30 days:
To install this version:
|
🔥 WOW THAT IS FAST NOW 🔥 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should have done this eons ago!
This partially addresses #453.
Before:
Incremental re-builds: