Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Don't leave charm files sitting in the cache #7010
Conversation
babbageclunk
added some commits
Feb 20, 2017
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit dd86e50
into
juju:2.1
Mar 20, 2017
added a commit
that referenced
this pull request
Mar 23, 2017
babbageclunk
deleted the
babbageclunk:no-cache-dir
branch
May 26, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
babbageclunk commentedFeb 21, 2017
Description of change
When the charmrepo downloads charm archives it stores them in a cache directory. On the controller this is unnecessary, since the archive is loaded into the blobstore (which is available to all of the controllers in HA, rather than just the one that downloaded the charm initially). Additionally, if a controller had had a large number of models that had been migrated away or otherwise removed, the charms used by those models would still be taking up space on the filesystem.
Remove the charm from the cache once it's been stored.
A cleaner way to do this would be to have the cache dir be an attribute of the CharmStore. The store would get a Cleanup method that would be called when the archive is finished with and would delete the charm dir. Then the controller code wouldn't set a cache dir at all - it would just be a temp directory, and would be removed when the charm was finished with. I haven't done that yet because I want to talk to @rogpeppe about what would work for other places that use the charm store.
Also includes a driveby to rename service to application in the apiserver/application unit tests.
QA steps
Bug reference
Part of the fix for https://bugs.launchpad.net/juju/+bug/1579976