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

Speed up CI, Reduce container image size #591

Merged
merged 4 commits into from
Mar 14, 2022

Conversation

luigi311
Copy link
Contributor

Use caching for cargo build to reduce the build times from 5 mins to 45 seconds when dependencies are non changing

Restructure the entire Dockerfile to use multistaging to reduce the docker image by ~500 mb from 1.05 GB to 584 MB.
Use github action internal caching so we dont have to deal with uploading and download the cache as an artifact.
Use cargo chef to build all the dependencies as a layer so that can be cached and have to only compile av1an itself.

Without cargo chef after my initial changes cold run was 9m 49s and when caching the build times came down to 6m 28s but the cache would be invalided on any code change so it was not usable
With cargo chef on a cold run it was still 9m 49s and a cached run it came down to 4m 57s, since this is caching the dependencies and still building av1an the time going forward should be closer to the 5m mark than the 9m 49s cold run.

@master-of-zen
Copy link
Owner

Amazing 🤩

@mergify mergify bot merged commit fe13740 into master-of-zen:master Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants