James Ennis pushed to branch jennis/quota_declaration_fix at BuildStream / buildstream
Commits:
-
e8b035ba
by James Ennis at 2018-11-07T17:51:49Z
1 changed file:
Changes:
... | ... | @@ -147,6 +147,39 @@ The default mirror is defined by its name, e.g. |
147 | 147 |
``--default-mirror`` command-line option.
|
148 | 148 |
|
149 | 149 |
|
150 |
+Local cache expiry
|
|
151 |
+~~~~~~~~~~~~~~~~~~
|
|
152 |
+BuildStream locally caches artifacts, build trees, log files and sources within a
|
|
153 |
+cache located at ``~/.cache/buildstream`` (unless a $XDG_CACHE_HOME environment
|
|
154 |
+variable exists). When building large projects, this cache can get very large,
|
|
155 |
+thus BuildStream will attempt to clean up the cache automatically by expiring the least
|
|
156 |
+recently *used* artifacts.
|
|
157 |
+ |
|
158 |
+By default, cache expiry will begin once the file system which contains the cache
|
|
159 |
+approaches maximum usage. However, it is also possible to impose a quota on the local
|
|
160 |
+cache in the user configuration. This can be done in two ways:
|
|
161 |
+ |
|
162 |
+1. By restricting the maximum size of the cache directory itself.
|
|
163 |
+ |
|
164 |
+For example, to ensure that BuildStream's cache does not grow beyong 100 GB,
|
|
165 |
+simply declare the following in your user configuration (``~/.config/buildstream.conf``):
|
|
166 |
+ |
|
167 |
+```yaml
|
|
168 |
+cache:
|
|
169 |
+ quota: 100G
|
|
170 |
+```
|
|
171 |
+ |
|
172 |
+2. By expiring artifacts once the file system which contains the cache exceeds a specified usage.
|
|
173 |
+ |
|
174 |
+To ensure that we start cleaning the cache once we've used 80% of local disk space (on the file system
|
|
175 |
+which mounts the cache):
|
|
176 |
+ |
|
177 |
+```yaml
|
|
178 |
+cache:
|
|
179 |
+ quota: 80%
|
|
180 |
+```
|
|
181 |
+ |
|
182 |
+ |
|
150 | 183 |
Default configuration
|
151 | 184 |
---------------------
|
152 | 185 |
The default BuildStream configuration is specified here for reference:
|