-
Notifications
You must be signed in to change notification settings - Fork 426
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
Cache rework Stage I #5088
Cache rework Stage I #5088
Conversation
First pass over the code to quickly put in place a cache with entries that use temporary files and atomic rename to finalize. Modified the actions / pull / registry / build code to call it. WIP - Tests will not work. Cache management commands will not work.
Specific cache list not yet implemented
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.
Overall this is a nice cleanup 👍
} | ||
if foundMatch { | ||
matches++ | ||
/* |
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.
Is it something to remove or pending for the next PR ?
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 wanted to return this when I refactor the clean and list stuff so that the operations are in the cache code, not CLI, in a following cleanup.
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'll make an issue so this is note missed - https://github.com/sylabs/singularity/issues/5095
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
This is the 1st step toward reworking the cache / image source client code to reduce duplication and make operations that fetch things into the cache safe where multiple operations are run concurrently on a file system that supports atomic rename.
Fixes: #4015
Fixes: #5020
This PR does...
pkg/internal/client/cache
topkg/internal/cache
as it's used by the clients, but also other code, and is not a client itself.pkg/internal/client/*
pull
,actions
and inbuild/sources
pull
actions
build
- prior to this some things like net weren't caching in some of these.--quiet
and is used across the client code.Future work
This PR is getting rather large, so instead of making it ever bigger I'd like to put up additional PRs over the next week to address the following:
The
pkg/image/client/xxx
code is just a collection of functions per client, mostly duplicated and named consistently, but with varying and long function sigs. Refactor so there is a commonclient.Config
struct, and specific clients implement a commonclient.Puller
andclient.Pusher
interfaces.REGRESSION - CTRL-C handlers have been stripped out. They need to be added back in, but using contexts with cancellation so that actions to cleanup happen close to the code creating files.
The
cache list
andcache clean
code needs to be properly refactored so that things directly acting on cache directories are inpkg/internal/cache
and not throughout the CLI code.