Skip to content

Commit

Permalink
Upgrade to containerd 2.0.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Feb 18, 2024
1 parent 4dc24e6 commit a7c5b21
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 78 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- run: go test -v ./...
build:
strategy:
Expand All @@ -20,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.22"
- run: go build -o bin/containerd-shim-rund-v1-${{ matrix.arch }} ./cmd/containerd-shim-rund-v1.go
env:
GOOS: darwin
Expand Down
2 changes: 1 addition & 1 deletion cmd/containerd-shim-rund-v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"context"
"github.com/containerd/containerd/v2/runtime/v2/shim"
"github.com/containerd/containerd/v2/core/runtime/v2/shim"
"github.com/macOScontainers/rund/containerd"
)

Expand Down
6 changes: 3 additions & 3 deletions containerd/container.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package containerd

import (
"github.com/containerd/containerd/v2/errdefs"
"github.com/containerd/containerd/v2/mount"
"github.com/containerd/containerd/v2/oci"
"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/errdefs"
"github.com/hashicorp/go-multierror"
"golang.org/x/sys/unix"
"os"
Expand Down
29 changes: 21 additions & 8 deletions containerd/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package containerd
import (
"context"
"fmt"
"github.com/containerd/containerd/v2/mount"
"github.com/containerd/containerd/v2/namespaces"
"github.com/containerd/containerd/v2/oci"
"github.com/containerd/containerd/v2/runtime/v2/shim"
"github.com/containerd/containerd/v2/api/types"
apitypes "github.com/containerd/containerd/v2/api/types"
"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/containerd/v2/core/runtime/v2/shim"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/log"
"io"
"os"
"os/exec"
"path"
Expand All @@ -16,18 +19,28 @@ import (
)

func NewManager(name string) shim.Manager {
return manager{name: name}
return &manager{name: name}
}

type manager struct {
name string
}

func (m manager) Name() string {
func (m *manager) Info(_ context.Context, _ io.Reader) (*types.RuntimeInfo, error) {
info := &apitypes.RuntimeInfo{
Name: m.Name(),
Version: &apitypes.RuntimeVersion{
Version: Version,
},
}
return info, nil
}

func (m *manager) Name() string {
return m.name
}

func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (params shim.BootstrapParams, retErr error) {
func (*manager) Start(ctx context.Context, id string, opts shim.StartOpts) (params shim.BootstrapParams, retErr error) {
params.Version = 3
params.Protocol = "ttrpc"

Expand Down Expand Up @@ -89,7 +102,7 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (param
return params, nil
}

func (manager) Stop(ctx context.Context, id string) (shim.StopStatus, error) {
func (*manager) Stop(ctx context.Context, id string) (shim.StopStatus, error) {
cwd, err := os.Getwd()
if err != nil {
return shim.StopStatus{}, err
Expand Down
2 changes: 1 addition & 1 deletion containerd/plugin.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package containerd

import (
"github.com/containerd/containerd/v2/core/runtime/v2/shim"
"github.com/containerd/containerd/v2/pkg/shutdown"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/containerd/v2/runtime/v2/shim"
"github.com/containerd/plugin"
"github.com/containerd/plugin/registry"
)
Expand Down
12 changes: 6 additions & 6 deletions containerd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"github.com/containerd/containerd/v2/api/events"
taskAPI "github.com/containerd/containerd/v2/api/runtime/task/v3"
"github.com/containerd/containerd/v2/api/types/task"
"github.com/containerd/containerd/v2/errdefs"
"github.com/containerd/containerd/v2/mount"
"github.com/containerd/containerd/v2/namespaces"
"github.com/containerd/containerd/v2/oci"
"github.com/containerd/containerd/v2/core/mount"
"github.com/containerd/containerd/v2/core/runtime"
"github.com/containerd/containerd/v2/core/runtime/v2/shim"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/containerd/v2/pkg/shutdown"
"github.com/containerd/containerd/v2/protobuf"
ptypes "github.com/containerd/containerd/v2/protobuf/types"
"github.com/containerd/containerd/v2/runtime"
"github.com/containerd/containerd/v2/runtime/v2/shim"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/ttrpc"
"github.com/containerd/typeurl/v2"
Expand Down
3 changes: 3 additions & 0 deletions containerd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package containerd

const Version = "0.7.0"
43 changes: 23 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module github.com/macOScontainers/rund

go 1.20
go 1.22

require (
github.com/containerd/containerd/v2 v2.0.0-beta.0
github.com/containerd/containerd/v2 v2.0.0-beta.2
github.com/containerd/errdefs v0.1.0
github.com/containerd/fifo v1.1.0
github.com/containerd/log v0.1.0
github.com/containerd/plugin v0.1.0
Expand All @@ -18,22 +19,22 @@ require (

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.12.0-rc.0 // indirect
github.com/container-orchestrated-devices/container-device-interface v0.6.1 // indirect
github.com/containerd/cgroups/v3 v3.0.2 // indirect
github.com/Microsoft/hcsshim v0.12.0-rc.2 // indirect
github.com/containerd/cgroups/v3 v3.0.3 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/containerd/containerd v1.7.8 // indirect
github.com/containerd/continuity v0.4.2 // indirect
github.com/containerd/containerd v1.7.13 // indirect
github.com/containerd/continuity v0.4.3 // indirect
github.com/containerd/go-runc v1.1.0 // indirect
github.com/containerd/platforms v0.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
Expand All @@ -44,17 +45,19 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.11.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
tags.cncf.io/container-device-interface v0.6.2 // indirect
tags.cncf.io/container-device-interface/specs-go v0.6.0 // indirect
)

replace github.com/containerd/containerd/v2 => github.com/macOScontainers/containerd/v2 v2.0.0-20231111120959-adc332757eab
replace github.com/containerd/containerd/v2 => github.com/macOScontainers/containerd/v2 v2.0.0-20240218142517-4e59b5b68c3e
Loading

0 comments on commit a7c5b21

Please sign in to comment.