Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Incremental rebuilds #17

Merged
merged 8 commits into from
Oct 29, 2018
Merged

Incremental rebuilds #17

merged 8 commits into from
Oct 29, 2018

Conversation

arrdem
Copy link
Owner

@arrdem arrdem commented Oct 29, 2018

This changeset implements the machinery required to achieve incremental content hash based rebuilding atop dependency order builds.

The fundamental strategy here is to use the rule-id extension point to compute a content address for every single rule to be built. If that content address exists in a trivial filesystem cache, then the previously built product in the cache is deserialized and used.

The rule-build contract has been extended to define rules to occur within a chroot addressed by me.raynes.fs/*cwd*. This allows the roll machinery to preserve and potentially restore previously rolled build products.

The product records have been extended with :id, being the content address of the product.

The task clean-cache [ttl-age-ms] has been added, allowing users to clean cached build products beyond some age or to bust the cache entirely using clean-cache 0 to remove all cached products.

Fixes #5

This changeset captures a ton of work related to getting Katamari set up with a
new build product cache structure and a sane (at least for the default
extensions) implementation of `katamari.roll.extensions/rule-id` which computes
the ID for a given rule based on the inputs (and their IDs), and the sorted set
of content hashes of all the files used by the target.

This allows Katamari to do at worst coarse grained change detection based on
changes in content hashes. The change detection machinery could be improved to
leverage the same fundamental first date check then content check logic which
the Rollfile parser uses.

The `rule-id` machinery is used to implement lazy cache hit based rebuilding -
products are only built if they can't be fetched from the cache.

Unfortunately because the check and hit algorithm uses full build products and
is baked into the implementation of `roll`, there isn't (currently) a way to
determine what target(s) will be rebuilt without just doing the build.

Also included in this patch - a new TTL based cache cleaning task. This also
allows for cache busting - `cache-clean 0` to wipe it all away. There is
currently no automatic cache cleaning say after builds.
@arrdem arrdem merged commit 6a5438a into master Oct 29, 2018
@arrdem arrdem deleted the incremental-rebuilds branch October 29, 2018 02:10
@arrdem arrdem restored the incremental-rebuilds branch December 17, 2018 00:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant