Skip to content
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

Improve build-image incremental workflow #561

Merged
merged 2 commits into from
Aug 9, 2022

Conversation

markmandel
Copy link
Member

@markmandel markmandel commented Aug 9, 2022

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix

What this PR does / Why we need it:

Several improvements to workflows that flow through the build-image to improve build and iteration times.

This includes:

Removal of debug images

We don't need this anymore, so no reason to build it for each architecture.

Use build-image target directory

I realised that when mixing the build-image workflow with local rust tools, that going between them, they would invalidate each other's incremental cache, since it was fingerprinted on absolute directories - drastically expanding build times between iterations.

Moving to a specific target directory for build-image usage drastically improves both the incremental build times of images, and every other workflow through build-image, such as e2e testing. (make test-agones can be used iteratively now).

More aggressive docker ignore

We only use a few files for the Docker image, so let's ignore everything else. Took the docker context down from 1GB+ to < 50MB.

On a linux machine all this brings incremental builds down from 10's of minutes to a minute or less, since only what has changed is compiled and pushed as we can now take advantage of rust incremental build and docker image caching.

Which issue(s) this PR fixes:

Work on #553

Special notes for your reviewer:

I know what the impact is on a Linux environment, would be good to know how it improves things on a Mac and Windows environment where there is an extra layer of virtualisation.

@markmandel markmandel added kind/feature New feature or request area/build-tools Development tooling. labels Aug 9, 2022
@github-actions github-actions bot added the size/s label Aug 9, 2022
@markmandel
Copy link
Member Author

CI failure should be fixed by #560

Several improvements to workflows that flow through the build-image to
improve build and iteration times.

This includes:

We don't need this anymore, so no reason to build it for each
architecture.

I realised that when mixing the `build-image` workflow with local rust
tools, that going between them, they would invalidate each other's
incremental cache, since it was fingerprinted on absolute directories -
drastically expanding build times between iterations.

This drastically improves both the incremental build times of images,
and every other workflow through `build-image`, such as e2e testing.
(`make test-agones` can be used iteratively now).

We only use a few files for the Docker image, so let's ignore everything
else. Took the docker context down from 1GB+ to < 50MB.

On a linux machine all this brings incremental builds down from 10's of
minutes to a minute or less, since only what has changed is compiled and
pushed as we can now take advantage of rust incremental build and
docker image caching.

Work on googleforgames#553
@markmandel
Copy link
Member Author

Ah! This is actually a real issue:

Step #4 - "test-docs": book/filters/load_balancer.html
Step #4 - "test-docs":   target does not exist --- book/filters/load_balancer.html --> ../../api/quilkin/filters/load_balancer/struct.Config.html

I'll go fix.

@quilkin-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: b851b3dc-0e08-46ea-935d-d3bd6b32c7eb

To build this version:

git fetch git@github.com:googleforgames/quilkin.git pull/561/head:pr_561 && git checkout pr_561
cargo build

@markmandel markmandel merged commit 2f7b2cb into googleforgames:main Aug 9, 2022
@markmandel markmandel deleted the build/speed branch August 9, 2022 18:28
XAMPPRocky pushed a commit that referenced this pull request Aug 22, 2022
* Improve build-image incremental workflow

Several improvements to workflows that flow through the build-image to
improve build and iteration times.

This includes:

We don't need this anymore, so no reason to build it for each
architecture.

I realised that when mixing the `build-image` workflow with local rust
tools, that going between them, they would invalidate each other's
incremental cache, since it was fingerprinted on absolute directories -
drastically expanding build times between iterations.

This drastically improves both the incremental build times of images,
and every other workflow through `build-image`, such as e2e testing.
(`make test-agones` can be used iteratively now).

We only use a few files for the Docker image, so let's ignore everything
else. Took the docker context down from 1GB+ to < 50MB.

On a linux machine all this brings incremental builds down from 10's of
minutes to a minute or less, since only what has changed is compiled and
pushed as we can now take advantage of rust incremental build and
docker image caching.

Work on #553

* Fix issue with site generation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-tools Development tooling. kind/feature New feature or request size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants