debian-forge/osbuild
David Rheinsberg ef20b40faa util/fscache: introduce versioning
Add a new field to the cache-information called `version`, which is a
simple integer that is incremented on any backward-incompatible change.

The cache-implementation is modified to avoid any access to the cache
except for `<cache>/staging/`. This means, changes to the staging area
must be backwards compatible at all cost. Furthermore, it means we can
always successfully run osbuild even on possibly incompatible caches,
because we can always just ignore the cache and fully rely on the
staging area being accessible.

The `load()` method will always return cache-misses. The `store()`
method simply discards the entry instead of storing it. Note that
`store()` needs to provide a context to the caller, hence this
implementation simply creates another staging-context to provide to the
caller and then discard. This is non-optimal, but keeps the API simple
and avoids raising an exception to the caller (but this can be changed
if it turns out to be problematic or unwanted).

Lastly, the `cache.info` field behaves as usual, since this is also the
field used to read the cache-version. However, this file is never
written to improve resiliency and allow blacklisting buggy versions from
the past.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-12-15 08:55:39 +01:00
..
formats format: read metadata from object not result 2022-12-09 12:03:40 +01:00
util util/fscache: introduce versioning 2022-12-15 08:55:39 +01:00
__init__.py Post release version bump 2022-12-07 08:15:17 +00:00
__main__.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
api.py pipeline,api: write metadata directly 2022-12-09 12:03:40 +01:00
buildroot.py buildroot: explicitly bind mount runner 2022-10-11 12:49:16 +02:00
devices.py devices: new helper to ensure a device node exists 2022-11-22 18:28:38 +01:00
host.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
inputs.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
loop.py loop: silence W0201 (attribute outside init) in set_status 2022-05-06 17:33:23 +02:00
main_cli.py osbuid: integrate FsCache into ObjectStore 2022-12-09 12:03:40 +01:00
meta.py meta: ensure we have an absolute path for Index 2022-10-11 12:49:16 +02:00
monitor.py monitor/log: show build root and runner 2022-10-11 12:49:16 +02:00
mounts.py mounts: use the options object for mountopts 2022-11-30 14:21:10 +01:00
objectstore.py osbuid: integrate FsCache into ObjectStore 2022-12-09 12:03:40 +01:00
pipeline.py pipeline,api: write metadata directly 2022-12-09 12:03:40 +01:00
remoteloop.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00
sources.py osbuild: run isort on all files 2022-09-12 13:32:51 +02:00