-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Cache compiled script on disk #2099
Comments
FYI I experimented a bit with caching the compiled script. I'd like to use Cake as a task runner and the 4 sec penalty seemed a bit much for running tasks that take under 1 sec on their own. I just used normal run
compile run (build cache and run)
cached run
It shaved off 4.5 secs for cached runs and is now acceptable to run quick tasks, it will probably help with #2179. I attached the changed file if anyone is interested (lots of things missing for a proper pull request). |
Hi, I would like to try to tackle this task and I'm looking for some suggestion on how to proceed.
Thanks! |
@alberto-chiesa there is an open RFC here: cake-build/rfcs#2 which discusses this, and we would need to get sign off there on the approach before proceeding with any work on this feature. |
Thanks @gep13 ! I didn't knew about the RFC repo. It seems the linked proposal answers my exact same questions. Nice to see I wasn't too off-target. Continuing there about the points to discuss. |
1 similar comment
Thanks @gep13 ! I didn't knew about the RFC repo. It seems the linked proposal answers my exact same questions. Nice to see I wasn't too off-target. Continuing there about the points to discuss. |
Is there any updates on this? the slowness of the startup of cake has been fairly annoying for me and I'm about to look into switching to Nuke for this reason only. |
@jamiegs No update on this since no one have submitted a PR for it yet. |
@jamiegs happy to take contributions on this, it's not that we don't want this Core team currently have a few other things with higher priority atm. If all you want is a is a pre compiled .NET Core app you could take a look at Frosting or Cake.Bridge https://github.com/cake-build/frosting https://github.com/devlead/Cake.Bridge/tree/master/src/CakeConsoleRunner Frosting is a more Asp.Net core style and Cake.Bridge is more like 1:1 mapping of Cake script to console app. |
Differences from RFC-02 1) The cache argument was removed. A new section was added to the cake.config file [Cache] with 2 possible properties Enabled and Path. Enabled defaults to false and Path defaults cache under the tools folder. 2) I originally used a time stamp to determine if the cache was valid or not. I have changed this to use a hash like pull request 2584 used. I did change it to use SHA1CryptoServiceProvider instead of MD5 since MD5 is not FIPS compliant.
Differences from RFC-02 1) The cache argument was removed. A new section was added to the cake.config file [Cache] with 2 possible properties Enabled and Path. Enabled defaults to false and Path defaults cache under the tools folder. 2) I originally used a time stamp to determine if the cache was valid or not. I have changed this to use a hash like pull request 2584 used. I did change it to use SHA1CryptoServiceProvider instead of MD5 since MD5 is not FIPS compliant.
Our situation: We currently use (quite large) shared build scripts in all our repositories. Each stage (initialize, build, test, package, deploy, finalize) is a separate stage and requires recompilation of the cake scripts. Compiling the build scripts takes about 20 seconds, so it would be very sweet if we could decrease this to 0. Since we have different agents (although the build server tries to run everything for a specific build on the same agent), we would like to cache this. I see 2 options:
My preferred option is 2. If there is anything I can do to help, let me know. |
@GeertvanHorrik thanks for your thoughts. Not sure if you have seen it, but there is an open RFC regarding the addition of caching into Cake. Before moving forward with any implementation, we need to get agreement regarding the way forward. This RFC is here: If you wanted to read through that (if you haven't already) and add some thoughts to the PR, we can continue to refine the RFC, and then begin on the implementation. |
There's an open PR #2650 to be reviewed after 1.0 right? |
@devlead yes, I believe that there is a PR for providing some of the functionality, however, we haven't agreed via the RFC exactly what we are hoping to achieve with this functionality, so until that is addressed, I don't think we can move forward with any PR. |
Yip just wanted to make sure we didn't duplicate any effort |
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
This is the same as pull request 2650 but has been updated to match the change made in Cake version 1.0.0.
* Enable * Config: Settings.EnableScriptCache=true * Arg: --settings_enablescriptcache=true * Env: CAKE_SETTINGS_ENABLESCRIPTCACHE=true * Cache Location * Config: Paths.Cache = /path/to/cache * Arg: --paths_cache=/path/to/cache * Env: CAKE_PATHS_CACHE=/path/to/cache * fixes cake-build#2099 Co-authored-by: devlead@users.noreply.github.com
GH2099: Fix and add script cache integration test
🎉 This issue has been resolved in version v2.2.0 🎉 The release is available on: Your GitReleaseManager bot 📦🚀 |
Any reason this is not turned on by default? Is it just off for the initial release? I'd prefer to avoid adding yet another config file to the root of my projects enable this feature if possible. |
@RehanSaeed Yes, it's a complex feature... We'll let it stabilize first and consider turning on by default in a future release |
New major features generally opt-in to break as few builds as possible and enable iron out any kinks before enabling it for all. Config file isn't required you can also configure via environment variable or command line arg |
Would be nice if we could cache compiled script to disk if it haven't changed.
The text was updated successfully, but these errors were encountered: