-
Notifications
You must be signed in to change notification settings - Fork 877
buildkit: --mount-type=cache must support locking external cache store.
#3820
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
buildkit: --mount-type=cache must support locking external cache store.
#3820
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e676815 to
6c763c1
Compare
6c763c1 to
09cc2b2
Compare
74234a8 to
ae657ec
Compare
ae657ec to
bc57835
Compare
bc57835 to
bba97f0
Compare
|
@nalind PTAL fixed requested issues. |
pkg/parse/parse.go
Outdated
| // GetVolumes gets the volumes from --volume and --mount | ||
| func GetVolumes(ctx *types.SystemContext, store storage.Store, volumes []string, mounts []string, contextDir string) ([]specs.Mount, []string, error) { | ||
| unifiedMounts, mountedImages, err := getMounts(ctx, store, mounts, contextDir) | ||
| func GetVolumes(ctx *types.SystemContext, store storage.Store, volumes []string, mounts []string, contextDir string) ([]specs.Mount, []string, []string, error) { |
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'm not sure we want to keep GetVolumes() in the public API if we're going to have to change its signature when we add new volume features.
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.
@nalind I'm also unsure about what to do here. Maybe we can add a new function which is not exposed and mark this as to-be deprecated ?
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 don't think this function gets called from outside of this repository, so no need to wait there.
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.
Moved it to internal/parse/parse.go.
724cc80 to
66cd081
Compare
cmd/buildah/run.go
Outdated
| // since LockedTargets must contain list of all locked files | ||
| // don't break here since we need to unlock other files but | ||
| // log so user can take a look | ||
| logrus.Errorf("Lockfile %q was expected here, stat failed with %v", path, 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.
Is there anything a user could do at this point to correct this? Or support for that matter?
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.
@TomSweeneyRedHat No user cannot do anything but I think this is worth logging cause following case is never expected to happen and if it happens it could be a symptom of a bigger problem in our fs locking library or anywhere above that.
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.
That's what I thought @flouthoc . I was kind of waffling about whether this should be a debug or not, but probably better to keep it as an error.
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.
Errors should cause the app to exit, if this does not then this should be a warning.
|
LGTM, but would like another head nod. |
66cd081 to
efab259
Compare
A shared cache on host must support locking so other parallel/concurrent builds will wait for current executing RUN statement to finish. * Locks the cache store as soon as RUN is triggered. * Locked target is added to cleanup list so it can be unlocked as soon as RUN step is completed. Signed-off-by: Aditya R <arajan@redhat.com>
Implementation of `GetVolumes` seems to be changing with addition of new features hence moving it from exposed parse package to internal parse package and move needed helpers with it. Signed-off-by: Aditya R <arajan@redhat.com>
efab259 to
843cbe7
Compare
|
@rhatdan @TomSweeneyRedHat @nalind PTAL. This should be good i guess, resolved all the feedback points. |
|
@flouthoc, you might need a rebase |
|
LGTM other than the possible rebase. |
|
/lgtm |
A shared cache on host must support locking so other parallel/concurrent builds
will wait for current executing RUN statement to finish.
as RUN step is completed.
Usage
RUN --mount=type=cache,target=/test,sharing=lockedCloses: #3815