#4 Update containerd to v1.6.9
Merged 2 months ago by gotmax23. Opened 3 months ago by dghubble.
rpms/ dghubble/containerd rawhide  into  rawhide

@@ -1,4 +1,4 @@ 

- From bdf3fc2b4bfea5ee3f91c5c2758c5154f95d27ad Mon Sep 17 00:00:00 2001

+ From 3b98ff4a9f28118973917ed46c3eee59688fcc8f Mon Sep 17 00:00:00 2001

  From: Kazuyoshi Kato <katokazu@amazon.com>

  Date: Tue, 22 Mar 2022 00:40:39 +0000

  Subject: [PATCH] Use typeurl.Any instead of github.com/gogo/protobuf/types.Any
@@ -8,46 +8,46 @@ 

  

  Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>

  ---

-  cmd/containerd-shim/main_unix.go              |  4 +-

-  cmd/ctr/commands/containers/containers.go     |  2 +-

-  cmd/ctr/commands/tasks/kill.go                | 29 ++++++

-  container.go                                  | 10 +-

-  container_checkpoint_opts.go                  |  9 +-

-  container_opts.go                             | 10 +-

-  containers/containers.go                      |  8 +-

-  containerstore.go                             | 19 +++-

-  events.go                                     |  5 +-

-  events/events.go                              |  3 +-

-  events/exchange/exchange.go                   |  8 +-

-  go.mod                                        |  2 +-

-  go.sum                                        |  3 +-

-  integration/client/container_test.go          |  8 +-

-  integration/client/go.mod                     |  2 +-

-  integration/client/go.sum                     |  3 +-

-  metadata/boltutil/helpers.go                  | 20 ++--

-  metadata/containers.go                        |  3 +-

-  metadata/containers_test.go                   | 83 ++++++++++-------

-  pkg/cri/server/events.go                      |  3 +-

-  pkg/cri/server/helpers.go                     |  5 +-

-  pkg/cri/server/helpers_test.go                | 13 +++

-  pkg/cri/server/restart.go                     |  4 +-

-  protobuf/any.go                               | 47 ++++++++++

-  protobuf/any_test.go                          | 26 ++++++

-  runtime/runtime.go                            |  8 +-

-  runtime/v1/linux/runtime.go                   |  9 +-

-  runtime/v1/linux/task.go                      |  4 +-

-  runtime/v1/shim/service.go                    |  3 +-

-  runtime/v2/manager.go                         |  7 +-

-  runtime/v2/runc/container.go                  |  6 +-

-  runtime/v2/runc/task/service.go               |  5 +-

-  runtime/v2/runc/v1/service.go                 |  5 +-

-  runtime/v2/shim.go                            |  5 +-

-  runtime/v2/shim/publisher.go                  |  4 +-

-  services/containers/helpers.go                | 20 +++-

-  services/events/service.go                    |  3 +-

-  services/tasks/local.go                       |  5 +-

-  task.go                                       |  7 +-

-  42 files changed, 365 insertions(+), 150 deletions(-)

+  cmd/containerd-shim/main_unix.go          |  4 +-

+  cmd/ctr/commands/containers/containers.go |  2 +-

+  container.go                              | 10 +--

+  container_checkpoint_opts.go              |  8 +--

+  container_opts.go                         | 10 +--

+  containers/containers.go                  |  8 +--

+  containerstore.go                         | 19 ++++--

+  events.go                                 |  5 +-

+  events/events.go                          |  3 +-

+  events/exchange/exchange.go               |  8 +--

+  go.mod                                    |  2 +-

+  go.sum                                    |  3 +-

+  integration/client/container_test.go      |  8 +--

+  integration/client/go.mod                 |  2 +-

+  integration/client/go.sum                 |  3 +-

+  metadata/boltutil/helpers.go              | 20 +++---

+  metadata/containers.go                    |  3 +-

+  metadata/containers_test.go               | 83 ++++++++++++++---------

+  metrics/cgroups/metrics_test.go           |  6 +-

+  pkg/cri/server/events.go                  |  3 +-

+  pkg/cri/server/helpers.go                 |  5 +-

+  pkg/cri/server/helpers_test.go            | 13 ++++

+  pkg/cri/server/restart.go                 |  4 +-

+  protobuf/any.go                           | 47 +++++++++++++

+  protobuf/any_test.go                      | 26 +++++++

+  runtime/runtime.go                        |  8 +--

+  runtime/v1/linux/runtime.go               |  9 +--

+  runtime/v1/linux/task.go                  |  4 +-

+  runtime/v1/shim/service.go                |  3 +-

+  runtime/v2/manager.go                     |  7 +-

+  runtime/v2/runc/container.go              |  6 +-

+  runtime/v2/runc/task/service.go           |  5 +-

+  runtime/v2/runc/v1/service.go             |  5 +-

+  runtime/v2/shim.go                        |  5 +-

+  runtime/v2/shim/publisher.go              |  4 +-

+  services/containers/helpers.go            | 20 ++++--

+  services/events/service.go                |  3 +-

+  services/tasks/local.go                   |  5 +-

+  task.go                                   |  7 +-

+  39 files changed, 270 insertions(+), 126 deletions(-)

   create mode 100644 protobuf/any.go

   create mode 100644 protobuf/any_test.go

  
@@ -144,7 +144,7 @@ 

   	t := &task{

   		client: c.client,

  diff --git a/container_checkpoint_opts.go b/container_checkpoint_opts.go

- index a64ef618b..c39628535 100644

+ index a64ef618b..ee2fa1b97 100644

  --- a/container_checkpoint_opts.go

  +++ b/container_checkpoint_opts.go

  @@ -28,9 +28,9 @@ import (
@@ -158,7 +158,7 @@ 

   	imagespec "github.com/opencontainers/image-spec/specs-go/v1"

   )

   

- @@ -56,7 +57,7 @@ func WithCheckpointImage(ctx context.Context, client *Client, c *containers.Cont

+ @@ -56,7 +56,7 @@ func WithCheckpointImage(ctx context.Context, client *Client, c *containers.Cont

   

   // WithCheckpointTask includes the running task

   func WithCheckpointTask(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
@@ -167,7 +167,7 @@ 

   	if err != nil {

   		return nil

   	}

- @@ -97,8 +98,8 @@ func WithCheckpointTask(ctx context.Context, client *Client, c *containers.Conta

+ @@ -97,8 +97,8 @@ func WithCheckpointTask(ctx context.Context, client *Client, c *containers.Conta

   

   // WithCheckpointRuntime includes the container runtime info

   func WithCheckpointRuntime(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
@@ -420,7 +420,7 @@ 

   

   		if err != nil {

  diff --git a/go.mod b/go.mod

- index e49859e83..61cea501a 100644

+ index 77f07d3ae..f42acf904 100644

  --- a/go.mod

  +++ b/go.mod

  @@ -17,7 +17,7 @@ require (
@@ -430,13 +430,13 @@ 

  -	github.com/containerd/typeurl v1.0.2

  +	github.com/containerd/typeurl v1.0.3-0.20220324183432-6193a0e03259

   	github.com/containerd/zfs v1.0.0

+  	github.com/containernetworking/cni v1.1.1

   	github.com/containernetworking/plugins v1.1.1

-  	github.com/coreos/go-systemd/v22 v22.3.2

  diff --git a/go.sum b/go.sum

- index fa93eb9ff..dc179935a 100644

+ index eefcc88f7..e4816994f 100644

  --- a/go.sum

  +++ b/go.sum

- @@ -257,8 +257,9 @@ github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Ev

+ @@ -260,8 +260,9 @@ github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Ev

   github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc=

   github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk=

   github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
@@ -468,7 +468,7 @@ 

   	}

   

  diff --git a/integration/client/go.mod b/integration/client/go.mod

- index f8aaabd20..542d2ce8f 100644

+ index f49dca653..bfd8b24ba 100644

  --- a/integration/client/go.mod

  +++ b/integration/client/go.mod

  @@ -10,7 +10,7 @@ require (
@@ -481,10 +481,10 @@ 

   	github.com/opencontainers/go-digest v1.0.0

   	github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799

  diff --git a/integration/client/go.sum b/integration/client/go.sum

- index 0d6a9ef9b..f6bd8ea5b 100644

+ index 9ca7044a8..5351d9eb6 100644

  --- a/integration/client/go.sum

  +++ b/integration/client/go.sum

- @@ -145,8 +145,9 @@ github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8h

+ @@ -146,8 +146,9 @@ github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8h

   github.com/containerd/ttrpc v1.1.0 h1:GbtyLRxb0gOLR0TYQWt3O6B0NvT8tMdorEHqIQo/lWI=

   github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ=

   github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg=
@@ -801,8 +801,31 @@ 

   }

   

   func testEnv(t *testing.T) (context.Context, *bolt.DB, func()) {

+ diff --git a/metrics/cgroups/metrics_test.go b/metrics/cgroups/metrics_test.go

+ index c71ea60a5..c362ea3b9 100644

+ --- a/metrics/cgroups/metrics_test.go

+ +++ b/metrics/cgroups/metrics_test.go

+ @@ -32,7 +32,7 @@ import (

+  	v2 "github.com/containerd/containerd/metrics/cgroups/v2"

+  	v1types "github.com/containerd/containerd/metrics/types/v1"

+  	v2types "github.com/containerd/containerd/metrics/types/v2"

+ -	"github.com/containerd/typeurl"

+ +	"github.com/containerd/containerd/protobuf"

+  	"github.com/prometheus/client_golang/prometheus"

+  

+  	metrics "github.com/docker/go-metrics"

+ @@ -152,7 +152,7 @@ func (t *mockStatT) Namespace() string {

+  

+  func (t *mockStatT) Stats(context.Context) (*types.Any, error) {

+  	if t.isV1 {

+ -		return typeurl.MarshalAny(&v1types.Metrics{})

+ +		return protobuf.MarshalAnyToProto(&v1types.Metrics{})

+  	}

+ -	return typeurl.MarshalAny(&v2types.Metrics{})

+ +	return protobuf.MarshalAnyToProto(&v2types.Metrics{})

+  }

  diff --git a/pkg/cri/server/events.go b/pkg/cri/server/events.go

- index b98dd1fd3..ca817d0fb 100644

+ index c8ffdadbf..fbecb29a0 100644

  --- a/pkg/cri/server/events.go

  +++ b/pkg/cri/server/events.go

  @@ -32,7 +32,6 @@ import (
@@ -823,10 +846,10 @@ 

   	evt, err := typeurl.UnmarshalAny(e)

   	if err != nil {

  diff --git a/pkg/cri/server/helpers.go b/pkg/cri/server/helpers.go

- index abc66e389..de9bdddc1 100644

+ index a8498116d..2b9c115e7 100644

  --- a/pkg/cri/server/helpers.go

  +++ b/pkg/cri/server/helpers.go

- @@ -374,10 +374,11 @@ func getRuntimeOptionsType(t string) interface{} {

+ @@ -375,10 +375,11 @@ func getRuntimeOptionsType(t string) interface{} {

   

   // getRuntimeOptions get runtime options from container metadata.

   func getRuntimeOptions(c containers.Container) (interface{}, error) {
@@ -1202,7 +1225,7 @@ 

   }

   

  diff --git a/runtime/v2/runc/v1/service.go b/runtime/v2/runc/v1/service.go

- index 0c84c1403..b27e59bbe 100644

+ index 8c473430e..8fdac3f8a 100644

  --- a/runtime/v2/runc/v1/service.go

  +++ b/runtime/v2/runc/v1/service.go

  @@ -41,6 +41,7 @@ import (
@@ -1222,7 +1245,7 @@ 

   				if err != nil {

   					return nil, fmt.Errorf("failed to marshal process %d info: %w", pid, err)

   				}

- @@ -617,7 +618,7 @@ func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (*taskAPI.

+ @@ -621,7 +622,7 @@ func (s *service) Stats(ctx context.Context, r *taskAPI.StatsRequest) (*taskAPI.

   		return nil, err

   	}

   	return &taskAPI.StatsResponse{
@@ -1436,28 +1459,6 @@ 

   	}

   	if i.Annotations != nil {

   		request.Annotations = i.Annotations

- diff --git a/metrics/cgroups/metrics_test.go b/metrics/cgroups/metrics_test.go

- --- a/metrics/cgroups/metrics_test.go

- +++ b/metrics/cgroups/metrics_test.go

- @@ -32,7 +32,7 @@ import (

-  	v2 "github.com/containerd/containerd/metrics/cgroups/v2"

-  	v1types "github.com/containerd/containerd/metrics/types/v1"

-  	v2types "github.com/containerd/containerd/metrics/types/v2"

- -	"github.com/containerd/typeurl"

- +	"github.com/containerd/containerd/protobuf"

-  	"github.com/prometheus/client_golang/prometheus"

-  

-  	metrics "github.com/docker/go-metrics"

- @@ -152,7 +152,7 @@ func (t *mockStatT) Namespace() string {

-  

-  func (t *mockStatT) Stats(context.Context) (*types.Any, error) {

-  	if t.isV1 {

- -		return typeurl.MarshalAny(&v1types.Metrics{})

- +		return protobuf.MarshalAnyToProto(&v1types.Metrics{})

-  	}

- -	return typeurl.MarshalAny(&v2types.Metrics{})

- +	return protobuf.MarshalAnyToProto(&v2types.Metrics{})

-  }

  -- 

- 2.37.2

+ 2.37.3

  

@@ -1,8 +1,9 @@ 

- diff --color -Naur a/pkg/cri/server/helpers.go b/pkg/cri/server/helpers.go

- --- a/pkg/cri/server/helpers.go	2021-11-17 21:04:57.000000000 +0100

- +++ b/pkg/cri/server/helpers.go	2021-11-22 22:39:01.743745977 +0100

- @@ -39,7 +39,7 @@ import (

-  	"github.com/containerd/typeurl"

+ diff --git a/pkg/cri/server/helpers.go b/pkg/cri/server/helpers.go

+ index a8498116d..3682be668 100644

+ --- a/pkg/cri/server/helpers.go

+ +++ b/pkg/cri/server/helpers.go

+ @@ -40,7 +40,7 @@ import (

+  	runtimespec "github.com/opencontainers/runtime-spec/specs-go"

   	"github.com/sirupsen/logrus"

   

  -	runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
@@ -10,7 +11,7 @@ 

   	imagedigest "github.com/opencontainers/go-digest"

   	"github.com/pelletier/go-toml"

   	"golang.org/x/net/context"

- @@ -365,8 +365,8 @@ func getRuntimeOptionsType(t string) int

+ @@ -366,8 +366,8 @@ func getRuntimeOptionsType(t string) interface{} {

   		return &runcoptions.Options{}

   	case plugin.RuntimeLinuxV1:

   		return &runctypes.RuncOptions{}

file modified
+1 -1
@@ -7,7 +7,7 @@ 

  

  # https://github.com/containerd/containerd

  %global goipath         github.com/containerd/containerd

- Version:                1.6.8

+ Version:                1.6.9

  

  %gometa

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (containerd-1.6.8.tar.gz) = c204c028cdfd76537d1da01c66526fc85b29b02d2412569bb9b265375603614b037356c61846025a72281398f0f46df326a5ea3df97f57901cce85f2f728f0ba

+ SHA512 (containerd-1.6.9.tar.gz) = fabe29103c431fb02ba55342e7cd3d41865803389b941fca9fea4449180d4dbc8eafafd6a8a1174997a7cd3bc2b6111960ccf51042792809b145ea500a534f53

I'm new at this, I believe a maintainer needs to upload the source tarball with fedpkg new-sources.
cc @eclipseo who last prepared the 0002 patch

Depends-On: https://src.fedoraproject.org/rpms/golang-k8s-cri-api/pull-request/1

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

I believe a maintainer needs to upload the source tarball with fedpkg new-sources.

Done!

How did you rebase the patches? Why did you remove the patch header?

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Thank you for your help on this! I uploaded the sources to the lookaside cache and triggered the CI. The scratch build failed, because the patches don't apply. You should edit 0001-Use-typeurl.Any-instead-of-github.com-gogo-protobuf-.patch to remove the changes made to the vendor directory, as that is removed before the patch is applied. After that, you can do a local build with fedpkg mockbuild to make sure everything works.

1 new commit added

  • Restore patch header and remove diff to vendor files
3 months ago

With a checkout of containerd v1.6.9, I cherry-picked https://github.com/containerd/containerd/pull/6706 and resolved conflicts. I've changed how I get the patch to preserve the header.

git format-patch -1 HEAD -- . ':!vendor/'

I've pushed that to my branch. I'm not seeing it update this PR though and the local mockbuild fails on the systemd-nspawn step without details, something I'll have to poke at tmrw.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

I see it just takes a while for the commits to appear here

This is failing to build:

# github.com/containerd/containerd/pkg/cri/store/container
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:101:21: undefined: v1.ContainerResources
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:218:20: invalid operation: s.Resources == nil (operator == not defined on untyped nil)
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:221:28: undefined: v1.ContainerResources
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:222:20: invalid operation: s.Resources != nil (operator != not defined on untyped nil)
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:230:29: undefined: v1.ContainerResources
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:246:20: invalid operation: s.Resources != nil (operator != not defined on untyped nil)
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:247:29: undefined: v1.ContainerResources
_build/src/github.com/containerd/containerd/pkg/cri/store/container/status.go:253:5: unknown field 'RootfsSizeInBytes' in struct literal of type "k8s.io/cri-api/pkg/apis/runtime/v1".WindowsContainerResources

Note that you need to provide updates to containerd's go libraries in Fedora as shown in the Dependency Changes section of the release notes.

So these builds don't actually use the go.mod and fetch dependenices from upstream repos. The BuildRequires (should these be setting each dependency's version?) is enumerating every dependency and you folks are managing RPMs for every Go package dependency in the ecosystem? That's wild.

Ok, looks like https://src.fedoraproject.org/rpms/golang-k8s-cri-api needs to be at v0.25.0

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

rebased onto a78c764

2 months ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Extending the Use-typeurl.Any patch... for

./metrics_test.go:155:10: cannot use typeurl.MarshalAny(&v1types.Metrics{}) (value of type typeurl.Any) as type *types.Any in return statement:
    need type assertion
./metrics_test.go:157:9: cannot use typeurl.MarshalAny(&v2types.Metrics{}) (value of type typeurl.Any) as type *types.Any in return statement:
    need type assertion
FAIL    github.com/containerd/containerd/metrics/cgroups [build failed]

1 new commit added

  • Extend the Use-typeurl.Any patch to metrics_test.go
2 months ago

Build succeeded.

@gotmax23 should I update the changelog? I believe this would close https://bugzilla.redhat.com/show_bug.cgi?id=2137464

Yes, that's correct. I've rebased your PR to add the bugzilla reference to the first commit. I'll merge this once CI passes.

rebased onto 8fa6e67

2 months ago

Build succeeded.

Pull-Request has been merged by gotmax23

2 months ago

Looks like fc38 works, but fc37 and fc36 need https://src.fedoraproject.org/rpms/golang-k8s-cri-api branches to be bumped.