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

vendor: github.com/containerd/containerd v1.7.0-rc.2 #44530

Closed
wants to merge 3 commits into from

Conversation

@thaJeztah
Copy link
Member Author

Some linting failures to fix;

libcontainerd/remote/client.go:204:13: copylocks: assignment copies lock value to opts: github.com/docker/docker/vendor/github.com/containerd/containerd/runtime/v2/runc/options.Options contains github.com/docker/docker/vendor/google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex (govet)
				opts := *c.v2runcoptions
				        ^
daemon/runtime_unix_test.go:42:17: copylocks: assignment copies lock value to configdOpts: github.com/docker/docker/vendor/github.com/containerd/containerd/runtime/v2/runc/options.Options contains github.com/docker/docker/vendor/google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex (govet)
	configdOpts := *stockRuntime.Shim.Opts.(*v2runcoptions.Options)
	               ^
builder/builder-next/adapters/containerimage/pull.go:21:2: SA1019: "github.com/containerd/containerd/remotes/docker/schema1" is deprecated: use images formatted in Docker Image Manifest v2, Schema 2, or OCI Image Spec v1. (staticcheck)
	"github.com/containerd/containerd/remotes/docker/schema1"
	^

@thaJeztah
Copy link
Member Author

Hm... looks like that's in the vendor code? (perhaps we can work around it, but could also be it needs to be fixed in containerd?)

@thaJeztah thaJeztah force-pushed the containerd_1.7 branch 2 times, most recently from 6d34a86 to 55f08ef Compare November 25, 2022 00:44
@thaJeztah
Copy link
Member Author

=== FAIL: daemon TestGetRuntime/StockRuntime (0.00s)
    runtime_unix_test.go:105: assertion failed: cannot handle unexported field at {*types.Runtime}.Shim.Opts.(*options.Options).state:
        	"github.com/docker/docker/vendor/github.com/containerd/containerd/runtime/v2/runc/options".Options
        consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported
    --- FAIL: TestGetRuntime/StockRuntime (0.00s)

=== FAIL: daemon TestGetRuntime/ConfiguredRuntime (0.00s)
    runtime_unix_test.go:105: assertion failed: 
        --- got
        +++ tt.want
          &types.Runtime{
          	Path: "/bin/true",
          	Args: nil,
          	Shim: &types.ShimConfig{
          		Binary: "io.containerd.runc.v2",
        - 		Opts:   s`binary_name:"/bin/true" root:"/var/run/docker/runtime-runc"`,
        + 		Opts:   &s`binary_name:"/bin/true" root:"/var/run/docker/runtime-runc"`,
          	},
          }
        
    --- FAIL: TestGetRuntime/ConfiguredRuntime (0.00s)

@thaJeztah thaJeztah force-pushed the containerd_1.7 branch 2 times, most recently from 2886b06 to e0fc5eb Compare November 25, 2022 01:20
Comment on lines 203 to 218
opts := *c.v2runcoptions
opts.IoUid = uint32(uid)
opts.IoGid = uint32(gid)
info.Options = &opts
// libcontainerd/remote/client.go:204:13: copylocks: assignment copies lock value to opts: github.com/docker/docker/vendor/github.com/containerd/containerd/runtime/v2/runc/options.Options contains github.com/docker/docker/vendor/google.golang.org/protobuf/internal/impl.MessageState contains sync.Mutex (govet)
// opts := *c.v2runcoptions
// ^
info.Options = &v2runcoptions.Options{
NoPivotRoot: c.v2runcoptions.GetNoPivotRoot(),
NoNewKeyring: c.v2runcoptions.GetNoNewKeyring(),
ShimCgroup: c.v2runcoptions.GetShimCgroup(),
IoUid: uint32(uid),
IoGid: uint32(gid),
BinaryName: c.v2runcoptions.GetBinaryName(),
Root: c.v2runcoptions.GetRoot(),
SystemdCgroup: c.v2runcoptions.GetSystemdCgroup(),
CriuImagePath: c.v2runcoptions.GetCriuImagePath(),
CriuWorkPath: c.v2runcoptions.GetCriuWorkPath(),
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Does anyone have a good approach for these kind of things? So the issue is that these types embed a mutex (through the state (protoimpl.MessageState); the linter (correctly) flags the old code because we're copying the mutex. https://github.com/containerd/containerd/blob/v1.7.0-beta.0/runtime/v2/runc/options/oci.pb.go#L23-L31

type Options struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// disable pivot root when creating a container
	NoPivotRoot bool `protobuf:"varint,1,opt,name=no_pivot_root,json=noPivotRoot,proto3" json:"no_pivot_root,omitempty"`
	// create a new keyring for the container
	NoNewKeyring bool `protobuf:"varint,2,opt,name=no_new_keyring,json=noNewKeyring,proto3" json:"no_new_keyring,omitempty"`

The reason we copy is that we want to have the existing options, but update some fields; So my naive approach is to construct a new option, and copy all the fields. While that works; it's brittle, as (e.g.) if a field is added or removed, this code will not copy those new fields.

I wish these types had a .Copy() method to get a copy of them (to prevent the mutex being copied), but perhaps there's a better approach for this.

Related discussion on StackOverflow; https://stackoverflow.com/a/64183968/1811501, which seems to indicate this is on purpose, and the MessageState has a pragma.DoNotCopy (and in this case pragma.DoNotCompare) to indicate it should not be copied; https://github.com/protocolbuffers/protobuf-go/blob/v1.28.1/internal/impl/message_reflect.go#L358-L364

type MessageState struct {
	pragma.NoUnkeyedLiterals
	pragma.DoNotCompare
	pragma.DoNotCopy

So, perhaps we're doing it wrong? Or should the type be changed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe I'm looking at proto.Clone() or proto.Merge

Copy link
Member Author

Choose a reason for hiding this comment

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

^^ updated to use proto.Clone()

@thaJeztah
Copy link
Member Author

Looks like changes may be needed in BuildKit to make it compatible with some of the newer OTEL dependencies from containerd, or maybe some dependencies weren't updated (but need to);

#23 0.391 ---> Making bundle: binary (in /tmp/bundles/binary)
#23 0.416 Building static /tmp/bundles/binary-daemon/dockerd (linux/amd64)...
#23 48.71 # github.com/docker/docker/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:50:38: undefined: metric.Int64Counter
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:51:38: undefined: metric.Float64Histogram
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:96:38: undefined: metric.Int64Counter
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:97:44: undefined: metric.Float64Histogram
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:99:38: h.meter.NewInt64Counter undefined (type metric.Meter has no field or method NewInt64Counter)
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:102:39: h.meter.NewInt64Counter undefined (type metric.Meter has no field or method NewInt64Counter)
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:105:39: h.meter.NewFloat64Histogram undefined (type metric.Meter has no field or method NewFloat64Histogram)
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go:65:25: undefined: global.GetMeterProvider
#23 59.99 # github.com/docker/docker/vendor/github.com/moby/buildkit/util/tracing/transform
#23 59.99 vendor/github.com/moby/buildkit/util/tracing/transform/span.go:34:26: sd.InstrumentationLibrarySpans undefined (type *"github.com/docker/docker/vendor/go.opentelemetry.io/proto/otlp/trace/v1".ResourceSpans has no field or method InstrumentationLibrarySpans)
#23 59.99 vendor/github.com/moby/buildkit/util/tracing/transform/span.go:56:17: undefined: v11.InstrumentationLibrary
#23 59.99 vendor/github.com/moby/buildkit/util/tracing/transform/instrumentation.go:9:42: undefined: commonpb.InstrumentationLibrary
#23 ERROR: process "/bin/sh -c   set -e\n  target=$([ \"$DOCKER_STATIC\" = \"1\" ] && echo \"binary\" || echo \"dynbinary\")\n  xx-go --wrap\n  PKG_CONFIG=$(xx-go env PKG_CONFIG) ./hack/make.sh $target\n  xx-verify $([ \"$DOCKER_STATIC\" = \"1\" ] && echo \"--static\") /tmp/bundles/${target}-daemon/dockerd$([ \"$(xx-info os)\" = \"windows\" ] && echo \".exe\")\n  xx-verify $([ \"$DOCKER_STATIC\" = \"1\" ] && echo \"--static\") /tmp/bundles/${target}-daemon/docker-proxy$([ \"$(xx-info os)\" = \"windows\" ] && echo \".exe\")\n  mkdir /build\n  mv /tmp/bundles/${target}-daemon/* /build/\n" did not complete successfully: exit code: 1
------
 > [build 6/6] RUN --mount=type=bind,target=.     --mount=type=tmpfs,target=cli/winresources/dockerd     --mount=type=tmpfs,target=cli/winresources/docker-proxy     --mount=type=cache,target=/root/.cache/go-build,id=moby-build-linux/amd64 <<EOT (set -e...):
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:96:38: undefined: metric.Int64Counter
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:97:44: undefined: metric.Float64Histogram
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:99:38: h.meter.NewInt64Counter undefined (type metric.Meter has no field or method NewInt64Counter)
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:102:39: h.meter.NewInt64Counter undefined (type metric.Meter has no field or method NewInt64Counter)
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go:105:39: h.meter.NewFloat64Histogram undefined (type metric.Meter has no field or method NewFloat64Histogram)
#23 48.71 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/config.go:65:25: undefined: global.GetMeterProvider
#23 59.99 # github.com/docker/docker/vendor/github.com/moby/buildkit/util/tracing/transform
#23 59.99 vendor/github.com/moby/buildkit/util/tracing/transform/span.go:34:26: sd.InstrumentationLibrarySpans undefined (type *"github.com/docker/docker/vendor/go.opentelemetry.io/proto/otlp/trace/v1".ResourceSpans has no field or method InstrumentationLibrarySpans)
#23 59.99 vendor/github.com/moby/buildkit/util/tracing/transform/span.go:56:17: undefined: v11.InstrumentationLibrary
#23 59.99 vendor/github.com/moby/buildkit/util/tracing/transform/instrumentation.go:9:42: undefined: commonpb.InstrumentationLibrary

@thaJeztah
Copy link
Member Author

Looking at go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go to see what versions would be compatible;

We're missing Int64Counter and Float64Histogram

Removed between v0.27.0 and v0.28.0; open-telemetry/opentelemetry-go@/metric/v0.27.0.../metric/v0.28.0
Looks to be removed in open-telemetry/opentelemetry-go@18f4cb8 (open-telemetry/opentelemetry-go#2587)

API EPIC 4/4] Fix tests and examples (#2587)

  • Empty All of the metrics dir
  • Add instrument api with documentation
    ...

😂 yeah; removing actual code from your package, and implementing a new API is what I would expect "fix tests and examples" to be 😂

@thaJeztah
Copy link
Member Author

So, who specified the wrong versions? The problem here is that v0.x.x is "unstable", and as it specifieds a minimum version, that will include "any breaking change after".

try to fix go.opentelemetry.io dependency hell

docker ("indirect") and buildkit ("direct") specify v0.29.0;

go mod graph --modfile=vendor.mod | grep ' go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp'
github.com/docker/docker go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
github.com/moby/buildkit@v0.11.4 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0

containerd specified v0.34.0 for go.opentelemetry.io/otel/metric;

go mod graph --modfile=vendor.mod | grep ' go.opentelemetry.io/otel/metric@'
github.com/docker/docker go.opentelemetry.io/otel/metric@v0.34.0
github.com/containerd/containerd@v1.7.0-rc.2 go.opentelemetry.io/otel/metric@v0.34.0
github.com/moby/buildkit@v0.11.4 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.37.0 go.opentelemetry.io/otel/metric@v0.34.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/otel/internal/metric@v0.27.0 go.opentelemetry.io/otel/metric@v0.27.0

But BuildKit uses;

git checkout v0.11.4

go mod graph | grep ' go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp'
github.com/moby/buildkit go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
k8s.io/apiserver@v0.22.5 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0
k8s.io/component-base@v0.22.5 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0

But looks like BuildKit has older versions of the other packages installed;

go mod graph | grep ' go.opentelemetry.io/otel/metric@'
github.com/moby/buildkit go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/otel/internal/metric@v0.27.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/exporters/otlp@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/oteltest@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/sdk/export/metric@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/sdk/metric@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0

Looks like go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 is the first version taking the new metrics into account;
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/instrumentation/net/http/otelhttp/v0.31.0/instrumentation/net/http/otelhttp/handler.go#L52-L53

Changed in open-telemetry/opentelemetry-go-contrib@a587520 (open-telemetry/opentelemetry-go-contrib#1977)

Unfortunately, updating these to v0.31.0 works around the other issues, but breaks BuildKit, which doesn't support the newer API;

go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.31.0 // indirect // updated to v0.31+ to account for https://github.com/moby/moby/pull/44530#issuecomment-1460509785
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect // updated v0.31+ to account for https://github.com/moby/moby/pull/44530#issuecomment-1460509785
Building static bundles/binary-daemon/dockerd (linux/arm64)...
# github.com/docker/docker/vendor/github.com/moby/buildkit/util/tracing/transform
vendor/github.com/moby/buildkit/util/tracing/transform/span.go:34:26: sd.InstrumentationLibrarySpans undefined (type *"github.com/docker/docker/vendor/go.opentelemetry.io/proto/otlp/trace/v1".ResourceSpans has no field or method InstrumentationLibrarySpans)
vendor/github.com/moby/buildkit/util/tracing/transform/span.go:56:17: undefined: v11.InstrumentationLibrary
vendor/github.com/moby/buildkit/util/tracing/transform/instrumentation.go:9:42: undefined: commonpb.InstrumentationLibrary
# github.com/docker/docker/vendor/github.com/moby/buildkit/worker/containerd
vendor/github.com/moby/buildkit/worker/containerd/containerd.go:56:74: cannot use &gogoptypes.Empty{} (value of type *"github.com/docker/docker/vendor/github.com/gogo/protobuf/types".Empty) as *emptypb.Empty value in argument to client.IntrospectionService().Server

thaJeztah added a commit to thaJeztah/docker that referenced this pull request Mar 8, 2023
…x` is "unstable", and as it specifieds a minimum version, that will include "any breaking change after".

try to fix go.opentelemetry.io dependency hell

docker ("indirect") and buildkit ("direct") specify `v0.29.0`;

```bash
go mod graph --modfile=vendor.mod | grep ' go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp'
github.com/docker/docker go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
github.com/moby/buildkit@v0.11.4 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
```

containerd specified v0.34.0 for `go.opentelemetry.io/otel/metric`;

```bash
go mod graph --modfile=vendor.mod | grep ' go.opentelemetry.io/otel/metric@'
github.com/docker/docker go.opentelemetry.io/otel/metric@v0.34.0
github.com/containerd/containerd@v1.7.0-rc.2 go.opentelemetry.io/otel/metric@v0.34.0
github.com/moby/buildkit@v0.11.4 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.37.0 go.opentelemetry.io/otel/metric@v0.34.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/otel/internal/metric@v0.27.0 go.opentelemetry.io/otel/metric@v0.27.0
```

But BuildKit uses;

```bash
git checkout v0.11.4

go mod graph | grep ' go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp'
github.com/moby/buildkit go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
k8s.io/apiserver@v0.22.5 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0
k8s.io/component-base@v0.22.5 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0
```

But looks like BuildKit has older versions of the other packages installed;

```bash
go mod graph | grep ' go.opentelemetry.io/otel/metric@'
github.com/moby/buildkit go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/otel/internal/metric@v0.27.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/exporters/otlp@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/oteltest@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/sdk/export/metric@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/sdk/metric@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
```

Looks like `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0` is the first version taking the new metrics into account;
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/instrumentation/net/http/otelhttp/v0.31.0/instrumentation/net/http/otelhttp/handler.go#L52-L53

Changed in open-telemetry/opentelemetry-go-contrib@a587520 (open-telemetry/opentelemetry-go-contrib#1977)

Unfortunately, updating  these to v0.31.0 works around the other issues, but breaks BuildKit, which doesn't support the newer API;

    go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.31.0 // indirect // updated to v0.31+ to account for moby#44530 (comment)
    go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect // updated v0.31+ to account for moby#44530 (comment)

```bash
Building static bundles/binary-daemon/dockerd (linux/arm64)...
vendor/github.com/moby/buildkit/util/tracing/transform/span.go:34:26: sd.InstrumentationLibrarySpans undefined (type *"github.com/docker/docker/vendor/go.opentelemetry.io/proto/otlp/trace/v1".ResourceSpans has no field or method InstrumentationLibrarySpans)
vendor/github.com/moby/buildkit/util/tracing/transform/span.go:56:17: undefined: v11.InstrumentationLibrary
vendor/github.com/moby/buildkit/util/tracing/transform/instrumentation.go:9:42: undefined: commonpb.InstrumentationLibrary
vendor/github.com/moby/buildkit/worker/containerd/containerd.go:56:74: cannot use &gogoptypes.Empty{} (value of type *"github.com/docker/docker/vendor/github.com/gogo/protobuf/types".Empty) as *emptypb.Empty value in argument to client.IntrospectionService().Server
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member Author

So, TL;DR;

  • containerd 1.7.0 requires go.opentelemetry.io/otel/metric@v0.34.0
  • buildkit v0.11.4 requires go.opentelemetry.io/otel/metric@v0.27.0 (and doesn't work with v0.28.0 and up)

@thaJeztah
Copy link
Member Author

Looks like the update in containerd came in

So currently we cannot update containerd until BuildKit v0.12.0 🤔

@AkihiroSuda @tonistiigi any suggestions? (would there be some hack we can apply to make v0.11.x work with both "old" and "new" OTEL?

@AkihiroSuda AkihiroSuda changed the title vendor: github.com/containerd/containerd v1.7.0-beta.1 vendor: github.com/containerd/containerd v1.7.0-rc.2 Mar 8, 2023
@AkihiroSuda
Copy link
Member

So currently we cannot update containerd until BuildKit v0.12.0 🤔

Can we just vendor the master branch of BuildKit (for the master branch of Moby)?
I assume we can vendor BuildKit v0.12 GA before releasing Moby v24 GA.

@thaJeztah
Copy link
Member Author

Yeah, so I wanted to prevent already depending on an unreleased version of buildkit, so that we could do a v24.0.0 release when we wanted to.

  • Technically, we wouldn't have to update the vendor yet to containerd 1.7 and we could stick to 1.6 (which is an LTS release)
  • But.. we may need some of the new functionality of 1.7 at some point
  • while 1.6 is an LTS release, SemVer + go modules would disagree, and won't allow you to "pin" to the 1.6 LTS release if other dependencies updated their go.mod to 1.7 (containerd should probably use major version updates for LTS releases, otherwise that won't work)

I want to try if I can use a replace rule to pin OTEL to an older version and if both containerd and BuildKit are happy with the old version.

@thaJeztah
Copy link
Member Author

Hm... right, so I can make OTEL working, but looks like there's a breaking change in containerd that is backward incompatible with BuildKit v0.11;

    Building static bundles/binary-daemon/dockerd (linux/arm64)...
    # github.com/docker/docker/vendor/github.com/moby/buildkit/worker/containerd
    vendor/github.com/moby/buildkit/worker/containerd/containerd.go:56:74: cannot use &gogoptypes.Empty{} (value of type *"github.com/docker/docker/vendor/github.com/gogo/protobuf/types".Empty) as *emptypb.Empty value in argument to client.IntrospectionService().Server

…240-3a7f492d3f1b

full diff: opencontainers/image-spec@02efb9a...3a7f492

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
    Building static bundles/binary-daemon/dockerd (linux/arm64)...
    # github.com/docker/docker/vendor/github.com/moby/buildkit/worker/containerd
    vendor/github.com/moby/buildkit/worker/containerd/containerd.go:56:74: cannot use &gogoptypes.Empty{} (value of type *"github.com/docker/docker/vendor/github.com/gogo/protobuf/types".Empty) as *emptypb.Empty value in argument to client.IntrospectionService().Server

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@TBBle
Copy link
Contributor

TBBle commented Jun 17, 2023

Was this working last time you looked? I was playing with container-image-store for Windows on a rare quiet evening, and that will require vendoring containerd 1.7.2 (which contains backported Windows Snapshotter work that the tests turn out to need, apparently).

So I tried adapting this draft to current master as a starting point, and fixed a few conflicts in the tests, but still hit a compile issue. I wasn't sure if that's "changes since this last worked" or if it never reached a working state, as CI logs have expired.

@thaJeztah thaJeztah removed this from the v-future milestone Sep 14, 2023
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.

None yet

5 participants