Adam S
06/23/2024, 11:33 AM~/.gradle/
)
nano $GRADLE_USER_HOME/init.d/kotest-build-cache.init.gradle.kts
2. Paste this build cache config:
gradle.settingsEvaluated {
if (rootProject.name == "kotest") {
buildCache {
remote<HttpBuildCache> {
if (url != null) {
logger.warn("Kotest remote build cache is already configured. You might want to remove \$GRADLE_USER_HOME/init.d/kotest-build-cache.init.gradle.kts.")
} else {
logger.lifecycle("Configuring Kotest remote build cache!")
url = uri("<http://5.161.201.26:5071/cache>")
isAllowUntrustedServer = true
isAllowInsecureProtocol = true
isPush = false
}
}
}
}
}
Once we've configured a nice URL instead of a raw IP address, then https://github.com/kotest/kotest/pull/4141 can be merged and this file can be removed and build cache will Just Work. Until then, I'm curious whether you notice a difference in build times.Oliver.O
06/23/2024, 11:38 AMOliver.O
06/23/2024, 11:51 AMOliver.O
06/23/2024, 11:57 AMAdam S
06/23/2024, 11:58 AMOliver.O
06/23/2024, 12:00 PMAdam S
06/23/2024, 12:00 PMAdam S
06/23/2024, 12:01 PMOliver.O
06/23/2024, 12:02 PMAdam S
06/23/2024, 12:03 PMAdam S
06/23/2024, 12:04 PMAdam S
06/23/2024, 12:05 PMAdam S
06/23/2024, 12:05 PMAdam S
06/23/2024, 12:07 PMOliver.O
06/23/2024, 12:13 PMAdam S
06/23/2024, 12:17 PMOliver.O
06/23/2024, 1:41 PMgradlew kotlinUpgradeYarnLock
, and a changing yarn.lock file would block the build. Currently it will produce a warning.
Locally, I manage yarn.lock and NPM dependencies for all projects with a JS part (Kotest included). That sometimes explains why my reviews get delayed, e.g. if new versions of Kotlin/JS arrive.Oliver.O
06/23/2024, 3:21 PMUntil then, I'm curious whether you notice a difference in build times.That's a bit hard with local testing, right? When my local build cache is up to date,
gradlew assemble
completes in 16 seconds.
Gradle will use the local build cache first and delegate to the remote build cache for build outputs that don't have a local match. Normally, my local build cache will always be more recent than CI outputs. So I'd have to wait for a while without doing any Kotest development, then have some CI action update the remote build cache, then resume local development. In this case, I'll benefit from the remote build cache.
I guess what would benefit most is if we allow PR actions to cache their outputs. Then subsequent PR runs could be way faster.Adam S
06/23/2024, 5:32 PMAdam S
06/23/2024, 5:33 PMif we allow PR actions to cache their outputsThat will be the case, when the PR is merged.
Adam S
06/23/2024, 5:34 PMEmil Kantis
06/24/2024, 10:23 AMAdam S
06/24/2024, 11:28 AMEmil Kantis
06/24/2024, 11:29 AMEmil Kantis
06/24/2024, 11:30 AMAdam S
06/24/2024, 11:33 AMAdam S
06/24/2024, 11:35 AMAdam S
06/24/2024, 11:36 AM$GRADLE_USER_HOME/gradle.properties
I specify a fixed version:
# Try to help with Build Cache re-use by always using the same JDK
org.gradle.java.home=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/
Emil Kantis
06/24/2024, 12:16 PM$ nslookup <http://gradle-build-cache.kotest.io|gradle-build-cache.kotest.io> 19s 13:38:35
Server: 2001:2042:fe60:5700::1
Address: 2001:2042:fe60:5700::1#53
Non-authoritative answer:
Name: <http://gradle-build-cache.kotest.io|gradle-build-cache.kotest.io>
Address: 5.161.201.26
Emil Kantis
06/24/2024, 12:16 PMAdam S
06/24/2024, 12:23 PM