-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Temp disk space usage #345
Comments
Out of interest, what are you using Bower for on your build server? |
But why aren't you checking the Bower packages into source control? |
I do a lot of build engineering work w/ Jenkins, and I'm firmly in the camp of never checking packages / dependencies into source control. I always lock versions and restore using a package manager, whether it's NPM / npm-shrinkwrap.json, Bundler / Gemfile.lock, Nuget / packages.config, Bower / component.json, etc, etc. It keeps repo sizes down (admittedly a bigger concern with binary deps) amongst other advantages. Regardless of which camp you fall into, Bower should still clean up its temp files 😺 I had the other devs on the team scope out their temp directories and they all had the same issue -- anywhere between 500MB and 5 GB of temp junk hanging around from Bower 😲 |
Yes, it should definitely clean up. We also strongly recommend that you check-in components installed by Bower (for similar reasons to those outlined here: http://www.futurealoof.com/posts/nodemodules-in-git.html). |
@Iristyle bower uses Still, to prevent future issues, the folders could be manually cleaned with a give probability (e.g.: each 5% of the times bower is run, it would kick off the manual cleanup of the temp directory). |
If it's a bug with the tmp module I would rather see it reported and fixed there rather than us working around it. |
@sindresorhus @satazor I think that the graceful cleanup option only removes files created by the module - so it will only remove a temp directory if it is empty. https://github.com/raszi/node-tmp#directory-creation:
|
Oh, I see. Looks strange to me that @raszi Do you think it would be good to add an option to delete the created tmp dirs even if they are not empty (globally or per created dir?) |
@satazor It's not that good idea but I can do that and I even have a pull request related to this. So I'll implement this unsafe delete option and release the new version in a few days. |
@satazor and others: I've released the new version which supports the recursive delete option. If you create a directory with enabled |
Use unsafeCleanup to clear temporary dirs, closes #345.
@satazor just had a chance to check this out ... it's not quite 100%. All of the guid based directories disappear, and most, but not all of the I flushed out temp, then ran my build to watch would happen. I'm going to guess that this might have something to do with package dependencies. My Bower output includes
The packages kicking around in temp still are the following...
For ref, this is my {
"name": "ClientSide Dependencies",
"version": "1.0.0",
"main": "",
"dependencies": {
"AngularJS": "git+https://github.com/Iristyle/bower-angular.git#1.1.4",
"angular-auth": "git+https://github.com/Iristyle/bower-angularAuth.git#0.0.3",
"bwizard": "git+https://github.com/gilluminate/Bootstrap-Wizard.git",
"jquery": "1.8.3",
"jquery.cookie": "v1.3.1",
"chai": "1.5.0",
"mocha": "1.8.1",
"bootstrap": "2.2.2",
"modernizr": "git+https://github.com/Iristyle/bower-modernizr.git#2.6.2",
"requirejs": "2.1.6",
"lawnchair": "0.6.3",
"lodash":"v1.2.1",
"toastr": "1.1.5",
"font-awesome": "3.1.0",
"angular-strap": "0.7.1",
"angular-placeholders": "git+https://github.com/Iristyle/bower-angular-placeholders.git#0.0.1a",
"requirejs-glob": "0.1.2",
"select2": "3.3.2",
"angular-ui-select2": "latest"
}
} |
Bower doesn't seem to clean up after itself very well.
In addition to the space required for the cache, which is understandable, I just noticed that there are many stray copies of packages in the temp directory
On our build server, this amounted to about 10GB and was enough to use up all the disk space, preventing jobs from executing (we have a large disk for Jenkins jobs, but temp is on the same volume as our smaller OS disk).
For now, I'm going to setup a job to purge this stuff, but I think that Bower should trash whatever stuff it might use temporarily.
The text was updated successfully, but these errors were encountered: