James Ennis pushed to branch jennis/quota_declaration_fix at BuildStream / buildstream
Commits:
-
3a42bc60
by James Ennis at 2018-11-07T18:01:02Z
1 changed file:
Changes:
| ... | ... | @@ -147,6 +147,42 @@ 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 |
+This quota defines the maximum size of the artifact cache in bytes.
|
|
| 173 |
+Other accepted values are: K, M, G or T (or you can simply declare the value in bytes, without the suffix)
|
|
| 174 |
+ |
|
| 175 |
+2. By expiring artifacts once the file system which contains the cache exceeds a specified usage.
|
|
| 176 |
+ |
|
| 177 |
+To ensure that we start cleaning the cache once we've used 80% of local disk space (on the file system
|
|
| 178 |
+which mounts the cache):
|
|
| 179 |
+ |
|
| 180 |
+```yaml
|
|
| 181 |
+cache:
|
|
| 182 |
+ quota: 80%
|
|
| 183 |
+```
|
|
| 184 |
+ |
|
| 185 |
+ |
|
| 150 | 186 |
Default configuration
|
| 151 | 187 |
---------------------
|
| 152 | 188 |
The default BuildStream configuration is specified here for reference:
|
