-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/147 global cache #460
Conversation
I made it a draft PR knowing that there is outstanding work on docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I won't get to this for the next couple of days and I need more time to look at the code in detail. So for now just some high-level comments on the general approach ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far! 🚀
definitely we might have a solution for compiled languages but not for python or javascript which might be the complicated ones...let's see! in any case this is out of scope for this PR IMHO as you stated -> good job!!!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it! Especially the surgical changes in the Go build tasks and the use of io.fs.FS
😉
cmd/start/cache.go
Outdated
return leaveAlone | ||
} | ||
return remove // delete everything else | ||
}, withBaseFileRemover(filepath.Join(fsb.base, odsCacheDirName), fnRemove)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if this would be easier to read if the "decider func" would be defined upfront, and only referenced here?
if err != nil { | ||
return err | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering whether we really need two different ways to deal with directories and files. It seems like fnSkip
either returns stuff for directories (walkChildren
or leaveAlone
), or for files (remove
) ... of course fnRemove
is called with true
/false
, but that seems to be for logging purposes only so not sure whether this is worth it.
Anyway, I haven't thought this through and I might be off here ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For directories there are three cases:
- Remove directory and (thus skip further walking)
- Skip directory to leave it in place.
- Enter but not delete directory to allow deleting files inside a directory.
For files it only needs to be decided whether they should be removed or not.
Anyways perhaps with improved naming this will be clearer.
cmd/start/cache_test.go
Outdated
func TestCacheCleaning(t *testing.T) { | ||
|
||
tests := map[string]struct { | ||
fileSystem fstest.MapFS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
The latest pushes did not trigger the workflows. https://www.githubstatus.com/ looks green. |
@henrjk I think workflows are not executed when there is a merge conflict. Check if resolving this triggers a execution of the workflows. |
You rock! I didn't know about this and also did not notice the conflict. |
- Do not delete files outside of deps cache. - Remove parameter `cache-dependencies` and always enable it instead. This removes the need for the additional test which was removed. - Some minor stylistic changes - Updated docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 🚀
This provides support for caching dependencies by changing
ods-start
to no longer clean any content in the working directory and instead spare files under.ods-cache
.In addition
ods-start
cleans the cache by removing files except at locations.ods-cache/deps/*/**
.The PR also introduces parameter
cache-dependencies
defaulting totrue
inods-build-go
. The default places the go module cache at.ods-cache/deps/gomod
by setting environment variableGOMODCACHE
to that area.In addition
ods-build-go
now reports the free disk space.If disk space on the PVC runs out one should replace or resize the PVC to accommodate the storage demands. This is a manual operation.
Compared to the PR #412 this does not implement an additional mechanism to skip dependency caching for a particular (re)build other than changing the parameter
cache-dependencies
. As a consequence the mechanism to implement dynamic disablement of caching via file.ods/cache-deps-parent-dir
has not been implemented.Closes #147
Tasks:
docs/design
directory or not applicabledocs
directory or not applicablemake test
) or not applicable