Repository navigation
[WIP] pipeline caching: Re-use previous Pipeline results rather than relying on BuildKit caching. - #193
Closed
aluzzardi wants to merge 1 commit into
Closed
[WIP] pipeline caching: Re-use previous Pipeline results rather than relying on BuildKit caching.#193aluzzardi wants to merge 1 commit into
aluzzardi wants to merge 1 commit into
Conversation
on BuildKit caching. With the current approach, everytime a pipeline is referenced (e.g. `mount: "/src": from: bar`) a new Pipeline is created and *bar* is re-computed. We rely on BuildKit to figure out the operations already happened and return the same result. However: - When something goes wrong, the Pipeline is executed twice (or more). Either because of a buildkit hiccup (e.g. `llb.Local` producing a different vertex digest on consecutive run), or because of a consistency issue on our end (e.g. `always: true` adds a cache buster) - Logs can be confusing: the Pipeline will produce logs any time it's referenced, with a `CACHED` status This change attepts a different approach: - Keep a cache of all executed Pipelines, keyed by de-referenced Value (e.g. for `mount: "/src": from: bar`, the key will be bar's path) - Lazy compute Pipelines, re-use the result of previous run if already computed Signed-off-by: Andrea Luzzardi <[email protected]>
Contributor
Author
|
NOTE: currently not working well because |
verdverm
reviewed
Mar 18, 2021
| } | ||
|
|
||
| func (m *PipelineManager) Do(ctx context.Context, v *compiler.Value, out *Fillable) (*Pipeline, error) { | ||
| pv := v.Dereference() |
Contributor
There was a problem hiding this comment.
what does v.Concrete() report here?
Contributor
There was a problem hiding this comment.
Is Reference's second return value (path []string) the same as the .Path().String() here? (also both before and after v&pv)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP: For discussion, please do not merge
With the current approach, everytime a pipeline is referenced (e.g.
mount: "/src": from: bar) a new Pipeline is created and bar isre-computed. We rely on BuildKit to figure out the operations already
happened and return the same result.
However:
Either because of a buildkit hiccup (e.g.
llb.Localproducing a differentvertex digest on consecutive run), or because of a consistency issue
on our end (e.g.
always: trueadds a cache buster)referenced, with a
CACHEDstatusThis change attepts a different approach:
(e.g. for
mount: "/src": from: bar, the key will be bar's path)computed
Signed-off-by: Andrea Luzzardi [email protected]