Skip to content
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

builder: define GetRemotes for the worker #44920

Merged
merged 2 commits into from
Feb 7, 2023

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Feb 3, 2023

Fixes #44918

The function signature has changed since v0.10.

Signed-off-by: Tonis Tiigi [email protected]

@tonistiigi
Copy link
Member Author

This fixes the panic and exports cache. For the import-export cycle to work properly moby/buildkit#3580 is also needed.

@neersighted
Copy link
Member

Can we get some additional CI tasks here to make sure we're exercising this code path?

@tonistiigi
Copy link
Member Author

@neersighted It's tricky because it is one of these cases where Moby plugs into BuildKit libraries to disable the default behavior and replace it with compatibility code that would work without containerd. #44908 enables the BuildKit tests that check these flows.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
Copy link
Member

The function signature has changed since v0.10.

Should this have been "since v0.8"? I started backporting this for 23.0, then noticed the commit message, so was wondering if that branch needed a different signature, but comparing them, they looked the same;

https://github.com/moby/buildkit/blob/v0.10.6/worker/result.go#L29-L32

// GetRemotes method abstracts ImmutableRef's GetRemotes to allow a Worker to override.
// This is needed for moby integration.
// Use this method instead of calling ImmutableRef.GetRemotes() directly.
func (wr *WorkerRef) GetRemotes(ctx context.Context, createIfNeeded bool, refCfg cacheconfig.RefConfig, all bool, g session.Group) ([]*solver.Remote, error) {

https://github.com/moby/buildkit/blob/v0.11.2/worker/result.go#L36-L39

// GetRemotes method abstracts ImmutableRef's GetRemotes to allow a Worker to override.
// This is needed for moby integration.
// Use this method instead of calling ImmutableRef.GetRemotes() directly.
func (wr *WorkerRef) GetRemotes(ctx context.Context, createIfNeeded bool, refCfg cacheconfig.RefConfig, all bool, g session.Group) ([]*solver.Remote, error) {

Using that line for guidance, I think signature changes happened in v0.9.0-rc1 and v0.10.0-rc1;

Comment on lines +89 to +90
var _ interface {
GetRemotes(context.Context, cache.ImmutableRef, bool, cacheconfig.RefConfig, bool, session.Group) ([]*solver.Remote, error)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While there's no exported interface to match yet, perhaps it would be good to add a "permalink" to the code in BuildKit for reference (to save people from hunting down the interface to look for)

@thaJeztah
Copy link
Member

re-ran CI 4 times, but it keeps timing out on BuildKit integration tests; don't know if it's related, or if I'm just unlucky; https://github.com/moby/moby/actions/runs/4107961433/jobs/7100496258

=== CONT  TestIntegration/TestDiffUpperScratch/worker=dockerd
    mergediff_test.go:1197: failed to handle changes: lstat ... no such file or directory: https://github.com/moby/buildkit/pull/2726#issuecomment-1070978499
=== CONT  TestIntegration/TestDiffLowerScratchDeletes/worker=dockerd
    client_test.go:6253: checkAllReleasable: skipping check for exported tars in non-containerd test
    client_test.go:6253: checkAllReleasable: skipping check for exported tars in non-containerd test
=== CONT  TestIntegration/TestDiffLowerScratch/worker=dockerd
    client_test.go:6253: checkAllReleasable: skipping check for exported tars in non-containerd test
    client_test.go:6253: checkAllReleasable: skipping check for exported tars in non-containerd test
=== CONT  TestIntegration/TestDiffSelfDeletes/worker=dockerd
    client_test.go:6253: checkAllReleasable: skipping check for exported tars in non-containerd test
panic: test timed out after 30m0s

goroutine 23509 [running]:
testing.(*M).startAlarm.func1()
	/usr/local/go/src/testing/testing.go:2036 +0x8e
created by time.goFunc
	/usr/local/go/src/time/sleep.go:176 +0x32
...

@thaJeztah thaJeztah closed this Feb 7, 2023
@thaJeztah thaJeztah reopened this Feb 7, 2023
Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am no longer confident these changes are correct as every CI run has timed out at 30 minutes in the same buildkit integration test. Something seems to be deadlocking, or otherwise misbehaving.

The function signature has changed since v0.10.

Signed-off-by: Tonis Tiigi <[email protected]>
@neersighted
Copy link
Member

It looks like what changed since the last push was another re-vendor? How can we backport this to 23.0 -- was the same BuildKit fix made on the 0.10 branch, so we can simply cherry-pick the first commit & use a different BuildKit version?

@tonistiigi
Copy link
Member Author

tonistiigi commented Feb 7, 2023

@neersighted
Copy link
Member

Ah, I see. No other changes?

@tonistiigi
Copy link
Member Author

@thaJeztah
Copy link
Member

I updated the cherry-pick to point to the new commit-sha, but will rebase the backport after #44952 is merged

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit b138373 into moby:master Feb 7, 2023
@thaJeztah
Copy link
Member

doh! and now forgot about the commit message;

The function signature has changed since v0.10.

well 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BuildKit builder with inline cache causes daemon crash
4 participants