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

fix: unity cloud build cache improvements #1640

Merged
merged 27 commits into from
Aug 23, 2024
Merged

Conversation

aixaCode
Copy link
Collaborator

@aixaCode aixaCode commented Aug 2, 2024

What does this PR change?

We are currently experiencing longer build times with Unity Cloud due to issues with caching and the way we've set up our caching mechanism.

With this update, when creating a new branch, the build process will no longer attempt to use a template cache, which has caused random errors. Instead, it will create a new cache. Although the first build will be slower, this approach will prevent the random errors and failures that arise from cache inconsistencies.

For future improvements, to reduce the build time on the first run, we could consider using @T_MacOS and @T_WindowsOS as template caches. However, to maintain these caches up-to-date, we would need to build these template targets regularly. Implementing a cron job or scheduled builds could help automate this process.

When a build is successful on a new target, it will generate its own cache. For all subsequent builds on this target, the existing cache will be reused, significantly speeding up the build process. We will retain the targets and their caches as long as the PR remains open, ensuring proper cache reuse. This approach also enables us to leverage workspace caching effectively.

Based on my tests, this change has reduced average build times from 1 hour 15 minutes to 35 minutes.

This PR also introduces the ability to customize the caching strategy directly from GitHub, offering greater flexibility in managing builds.

Targets will be deleted, and their caches cleared, only when the PR is merged or closed.

@aixaCode aixaCode added do not merge force-build Used to trigger a build on draft PR and removed force-build Used to trigger a build on draft PR labels Aug 2, 2024
@aixaCode aixaCode marked this pull request as ready for review August 2, 2024 16:49
@aixaCode aixaCode removed the force-build Used to trigger a build on draft PR label Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

badge

Windows and Mac build successfull in Unity Cloud! You can find a link to the downloadable artifact below.

Name Link
Commit 97fa453
Logs https://github.com/decentraland/unity-explorer/actions/runs/10530076279
Download Windows https://github.com/decentraland/unity-explorer/suites/27534949134/artifacts/1848389015
Download Mac https://github.com/decentraland/unity-explorer/suites/27534949134/artifacts/1848377818
Built on 2024-08-23T18:25:48Z

@aixaCode aixaCode added the no QA needed Used to tag pull requests that does not require QA validation label Aug 21, 2024
@aixaCode aixaCode changed the title fix: don't delete build target on healthy build fix: unity cloud build cache improvements Aug 21, 2024
@aixaCode aixaCode requested review from dalkia and m3taphysics August 21, 2024 16:35
Copy link
Collaborator

@dalkia dalkia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice caching time 💪!

Left a comment, because Im not sure if we can avoid caching with this change

.github/workflows/build-unitycloud.yml Outdated Show resolved Hide resolved
@aixaCode aixaCode enabled auto-merge (squash) August 23, 2024 12:50
@aixaCode aixaCode disabled auto-merge August 23, 2024 12:53
@aixaCode aixaCode removed the request for review from m3taphysics August 23, 2024 13:03
@aixaCode aixaCode enabled auto-merge (squash) August 23, 2024 14:25
@aixaCode aixaCode disabled auto-merge August 23, 2024 15:06
@aixaCode aixaCode enabled auto-merge (squash) August 23, 2024 15:56
@aixaCode aixaCode disabled auto-merge August 23, 2024 15:56
@aixaCode aixaCode enabled auto-merge (squash) August 23, 2024 17:48
@aixaCode aixaCode merged commit d502d7e into main Aug 23, 2024
5 checks passed
@aixaCode aixaCode deleted the fix/unity-cloud-build-fixes branch August 23, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no QA needed Used to tag pull requests that does not require QA validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants