Skip to content

Commit

Permalink
Updates for containerd 2.0 interface changes
Browse files Browse the repository at this point in the history
Signed-off-by: Derek McGowan <derek@mcg.dev>
  • Loading branch information
dmcgowan committed Nov 11, 2024
1 parent 5715910 commit 1f9aaf1
Show file tree
Hide file tree
Showing 757 changed files with 51,741 additions and 22,891 deletions.
15 changes: 8 additions & 7 deletions cmd/buildkitd/main_containerd_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import (

ctd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/defaults"
"github.com/moby/sys/userns"
"github.com/pelletier/go-toml"
"github.com/pkg/errors"
"github.com/urfave/cli"
"golang.org/x/sync/semaphore"

"github.com/moby/buildkit/cmd/buildkitd/config"
"github.com/moby/buildkit/util/bklog"
"github.com/moby/buildkit/util/disk"
Expand All @@ -19,11 +25,6 @@ import (
"github.com/moby/buildkit/worker"
"github.com/moby/buildkit/worker/base"
"github.com/moby/buildkit/worker/containerd"
"github.com/moby/sys/userns"
"github.com/pelletier/go-toml"
"github.com/pkg/errors"
"github.com/urfave/cli"
"golang.org/x/sync/semaphore"
)

const (
Expand Down Expand Up @@ -114,7 +115,7 @@ func init() {
cli.StringFlag{
Name: "containerd-worker-snapshotter",
Usage: "snapshotter name to use",
Value: ctd.DefaultSnapshotter,
Value: defaults.DefaultSnapshotter,
},
cli.StringFlag{
Name: "containerd-worker-apparmor-profile",
Expand Down Expand Up @@ -299,7 +300,7 @@ func containerdWorkerInitializer(c *cli.Context, common workerInitializerOpt) ([
parallelismSem = semaphore.NewWeighted(int64(cfg.MaxParallelism))
}

snapshotter := ctd.DefaultSnapshotter
snapshotter := defaults.DefaultSnapshotter
if cfg.Snapshotter != "" {
snapshotter = cfg.Snapshotter
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/buildkitd/main_containerd_worker_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ package main

import (
runcoptions "github.com/containerd/containerd/api/types/runc/options"
runtimeoptions "github.com/containerd/containerd/v2/types/runtimeoptions/v1"
"github.com/containerd/plugin"
runtimeoptions "github.com/containerd/containerd/api/types/runtimeoptions/v1"
"github.com/containerd/containerd/v2/plugins"
)

// getRuntimeOptionsType gets empty runtime options by the runtime type name.
func getRuntimeOptionsType(t string) interface{} {
if t == plugin.RuntimeRuncV2 {
if t == plugins.RuntimeRuncV2 {
return &runcoptions.Options{}
}
return &runtimeoptions.Options{}
Expand Down
2 changes: 1 addition & 1 deletion cmd/buildkitd/main_containerd_worker_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
runtimeoptions "github.com/containerd/containerd/v2/types/runtimeoptions/v1"
runtimeoptions "github.com/containerd/containerd/api/types/runtimeoptions/v1"
)

const runtimeRunhcsV1 = "io.containerd.runhcs.v1"
Expand Down
21 changes: 11 additions & 10 deletions cmd/buildkitd/main_oci_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ import (
"github.com/containerd/containerd/v2/plugins/snapshots/native"
"github.com/containerd/containerd/v2/plugins/snapshots/overlay"
"github.com/containerd/containerd/v2/plugins/snapshots/overlay/overlayutils"
fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter"
fuseoverlayfs "github.com/containerd/fuse-overlayfs-snapshotter/v2"
sgzfs "github.com/containerd/stargz-snapshotter/fs"
sgzconf "github.com/containerd/stargz-snapshotter/fs/config"
sgzlayer "github.com/containerd/stargz-snapshotter/fs/layer"
sgzsource "github.com/containerd/stargz-snapshotter/fs/source"
remotesn "github.com/containerd/stargz-snapshotter/snapshot"
"github.com/moby/sys/userns"
"github.com/pelletier/go-toml"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"golang.org/x/sync/semaphore"
"google.golang.org/grpc"
"google.golang.org/grpc/backoff"
"google.golang.org/grpc/credentials/insecure"

"github.com/moby/buildkit/cmd/buildkitd/config"
"github.com/moby/buildkit/executor/oci"
"github.com/moby/buildkit/session"
Expand All @@ -40,15 +50,6 @@ import (
"github.com/moby/buildkit/worker"
"github.com/moby/buildkit/worker/base"
"github.com/moby/buildkit/worker/runc"
"github.com/moby/sys/userns"
"github.com/pelletier/go-toml"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"golang.org/x/sync/semaphore"
"google.golang.org/grpc"
"google.golang.org/grpc/backoff"
"google.golang.org/grpc/credentials/insecure"
)

func init() {
Expand Down
22 changes: 14 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ require (
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.15
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.1
github.com/containerd/console v1.0.4
github.com/containerd/containerd v1.7.23
github.com/containerd/containerd/api v1.8.0
github.com/containerd/containerd/v2 v2.0.0
github.com/containerd/continuity v0.4.4
github.com/containerd/errdefs v1.0.0
github.com/containerd/fuse-overlayfs-snapshotter v1.0.8
github.com/containerd/fuse-overlayfs-snapshotter/v2 v2.0.0
github.com/containerd/go-cni v1.1.10
github.com/containerd/go-runc v1.1.0
github.com/containerd/log v0.1.0
github.com/containerd/nydus-snapshotter v0.14.0
github.com/containerd/platforms v1.0.0-rc.0
github.com/containerd/stargz-snapshotter v0.15.1
github.com/containerd/stargz-snapshotter v0.15.2-0.20241017154050-a6b9bdb5a9e1
github.com/containerd/stargz-snapshotter/estargz v0.15.1
github.com/containerd/typeurl/v2 v2.2.2
github.com/containernetworking/plugins v1.5.1
Expand Down Expand Up @@ -132,18 +132,20 @@ require (
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
github.com/containerd/containerd/v2 v2.0.0 // indirect
github.com/containerd/containerd v1.7.23 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/fifo v1.1.0 // indirect
github.com/containerd/plugin v1.0.0 // indirect
github.com/containerd/ttrpc v1.2.6 // indirect
github.com/containernetworking/cni v1.2.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/docker/docker-credential-helpers v0.8.2 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/felixge/fgprof v0.9.3 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -153,7 +155,7 @@ require (
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/hanwen/go-fuse/v2 v2.4.0 // indirect
github.com/hanwen/go-fuse/v2 v2.6.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand All @@ -162,21 +164,25 @@ require (
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/runtime-tools v0.9.1-0.20221107090550-2e043c6bd626 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/secure-systems-lab/go-securesystemslib v0.4.0 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tonistiigi/dchapes-mode v0.0.0-20241001053921-ca0759fec205 // indirect
github.com/vbatts/tar-split v0.11.5 // indirect
github.com/vbatts/tar-split v0.11.6 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
kernel.org/pub/linux/libs/security/libcap/psx v1.2.70 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
tags.cncf.io/container-device-interface v0.8.0 // indirect
tags.cncf.io/container-device-interface/specs-go v0.8.0 // indirect
)
Loading

0 comments on commit 1f9aaf1

Please sign in to comment.