EngFlow Gradle cache plugin¶
Experimental
This plugin is currently experimental. Contact EngFlow if you'd like to use it.
The Gradle cache plugin enables you to use EngFlow's distributed Content-Addressable Storage (CAS) as a remote build cache for your Gradle builds. Using a remote cache for your Gradle build's artifacts speeds up development workflows by loading task outputs from the cache whenever available.
The Gradle cache plugin uses gRPC calls to write build artifacts to and fetch them from the CAS. This page describes how to install and configure the plugin.
Set up the EngFlow Gradle cache plugin¶
To use the EngFlow Gradle cache plugin, your settings.gradle.kt or settings.gradle file must contain plugin and remote cache-specific configuration. The following sections document the blocks you need to add or edit to the file.
Code samples show settings.gradle.kt
All code samples on this page show sections of an example settings.gradle.kt file. If you're using a settings.gradle file, adapt the samples accordingly.
The pluginManagement block¶
The EngFlow Gradle cache plugin is published as a Maven repository. Configure your pluginManagement block to fetch the plugin from the hosting location. Contact EngFlow for the hosting location details.
| Kotlin | |
|---|---|
The plugins block¶
Specify com.engflow.cache.gradle in the plugins block to apply the Gradle cache plugin.
The engflow block¶
Configure your access to the EngFlow caching cluster using the engflow block. This block requires cluster-specific information provided to you by your contact at EngFlow.
The engflow block contains the cluster and authentication blocks.
Specify the following in the cluster block:
endpoint: The EngFlow cluster’s URI. For example,examplename.cluster.engflow.com.instanceName: Include this value only if your cluster has a multitenancy setup.
In the authentication block, depending on how your cluster is configured, specify one of the following methods of authentication:
credentialHelper: See the Credential helper documentation for more information.mtls: Specify your certificate and privateKey. See the Authentication documentation for more information.
The cache block¶
This block contains the following parameters:
push: Whentrue, allows the build to write to the remote cache, assuming that you've provided valid credentials in theengflow.authenticationblock.enabled: Whentrue, allows the build to apply the plugin and use it for remote caching. Whenfalse, the plugin is neither applied nor used for remote caching.chunkSize: The maximum chunk size for writing cache entries. Set this parameter's value to a size that's compatible with your network performance and setup. Note that thedeadlineparameter's value may also affect the optimalchunkSize. Work with your EngFlow contact to arrive at the optimal value for your use case.deadline: Specify the amount of time (in minutes) to wait before ending a cache operation (read or write). Take thechunkSizeinto account while setting this value. Work with your EngFlow contact to arrive at the optimal value for your use case.retryBackoff: Specify the delay (in seconds) before retrying the operation.retryJitter: Specify the randomization of the retryBackoff time (in seconds).
Tip
Work with your EngFlow contact to arrive at optimal values for the parameters in the cache block. Specifically, the chunkSize and deadline values are key to acheiving the best possible caching performance.
Your Gradle cache plugin is now set up to read from and write to the remote cache.