Build Cache - Architecture
This feature is only available in Incredibuild's Enterprise and Business Plans and is currently in limited availability. For more details, speak to your Customer Success Representative.
Build Cache Clients and Endpoints
Every Initiator can use Build Cache as a Build Cache Client by contributing and/or reading from the cache. A Build Cache Client uses the cache in one or more Build Cache Endpoints.
Local and Remote (Shared) Cache
By default, each Initiator runs Build Cache locally, meaning that both the Build Cache Client and Endpoint are on the Initiator itself. In addition to the local Build Cache, the Initiator can connect to a remote (shared) cache (you can use both simultaneously).
To create a remote build cache, install an Incredibuild Agent on a dedicated machine that will not be used to assist or initiate builds. The remote cache is shared when multiple Initiators use and/or contribute to this cache.
To configure if an Agent is using a local or remote cache, on the Agent machine go to the Agent Settings > Build Cache Client tab.
Use Cases and Best Practices
Developer Machines - Working from home or in the office
For most machines, we recommend enabling both local and remote cache. This assumes that these machines are persistent (laptops, desktops, or persistent VMs), and that there are other machines (typically CI servers) that use only the remote cache and are writing to that cache. If no machines are writing exclusively using the shared cache, developer machines should only use local cache.
When you enable both local and remote cache on an agent, that agent can only contribute to the local cache.
When a build is run, the local cache is checked first. If there is a hit, the cache is used. Otherwise, Incredibuild checks the remote cache. If there is a hit, we use it and also update the local cache so that future executions will use the local cache and reduce network traffic. This is particularly useful when working from home due to the lower upload bandwidth. If there are no hits, the build is run and the information is added to the local cache.
CI Machines
CI builds can typically be considered a “source of truth”: they usually contain code that is trustworthy, stable, and is shared by other CI builds and developers. For the most part, code that is merged so that it is part of a CI build will change less often. As a result, its compiled artifacts (object files, etc.) are likely to be used by others, improving Build Cache efficiency and faster builds for everyone. When using machines for CI use cases, we recommend only using remote (shared) cache. The machines will then both read and write to the remote cache. This ensures that their content will be available even if the CI machine is torn down (as is done in many use cases). This also allows this cache to be shared with your developers working from home or in the office.
Remote (Shared) Cache Endpoints
For endpoints that host a remote/shared cache, use the following recommendations to maximize performance:
-
Install Incredibuild on an Agent, but do not assign any licenses to the Agent so that it does not assist with or initiate any builds.
-
Do not run other programs on this machine, it should be a dedicated machine.
-
Add an Agent description to clearly identify the Agent as your shared cache.