-
Notifications
You must be signed in to change notification settings - Fork 950
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
ctrd,cli,daemon,pkg: update to adapt with containerd@v1.2.5 #2725
ctrd,cli,daemon,pkg: update to adapt with containerd@v1.2.5 #2725
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2725 +/- ##
==========================================
+ Coverage 69.32% 69.41% +0.08%
==========================================
Files 278 277 -1
Lines 17448 17391 -57
==========================================
- Hits 12096 12072 -24
+ Misses 4025 3998 -27
+ Partials 1327 1321 -6
|
@@ -25,20 +25,20 @@ func init() { | |||
func (suite *APIImageSaveLoadSuite) SetUpTest(c *check.C) { | |||
SkipIfFalse(c, environment.IsLinux) | |||
|
|||
PullImage(c, helloworldImage) | |||
PullImage(c, busyboxImage125) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use image busyboxImage128
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. I will file other pr to replace all the busyboxImage125 because the 128 tag is stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I roll it back because 125 tag has only one manifest, not a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think define busyboxImage
is enough, without tag, or we need change lots of places, we have done these times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we cannot use the latest one, because the latest has no stable digest and ID. we don't know what the real ID is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is busyboxImage=xxx125 or xxx128
, I do not like busyboxImage128
define with tag at all. It can be fix in another pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or can we reset these change in test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it to busyboxLegacyImage
instead of 125
in the following pr.
cc @rudyfly
switch cfg.MediaType { | ||
case ocispec.MediaTypeImageConfig, images.MediaTypeDockerSchema2Config: | ||
data, err := content.ReadBlob(ctx, img.ContentStore(), cfg.Digest) | ||
case ocispec.MediaTypeImageConfig, images.MediaTypeDockerSchema2Config, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @HusterWan and @Ace-Tang , there is used to support existing downloaded images, for example, redis:2 with the application/octet-stream
media type. if we don't support it here, we will miss the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @rudyfly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that
ctrd/utils.go
Outdated
"github.com/opencontainers/runtime-spec/specs-go" | ||
"github.com/pkg/errors" | ||
) | ||
|
||
// NewDefaultSpec new a template spec with default. | ||
func NewDefaultSpec(ctx context.Context, id string) (*specs.Spec, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need default spec from containerd now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
// NewCioFIFOSet prepares fifo files. | ||
func NewCioFIFOSet(processID string, withStdin bool, withTerminal bool) (*CioFIFOSet, error) { | ||
// NewFIFOSet prepares fifo files. | ||
func NewFIFOSet(processID string, withStdin bool, withTerminal bool) (*cio.FIFOSet, error) { | ||
root := "/run/containerd/fifo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let make it a variable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was my plan. I will do that in next pr.
e, err := events.Recv() | ||
if err != nil { | ||
logrus.Errorf("failed to receive event: %v", err) | ||
var e *events.Envelope |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about combine var define with below:
var (
action string
containerID string
attributes = map[string]string{}
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
using following commands: govendor fetch github.com/containerd/containerd/...@v1.2.5 govendor fetch github.com/gogo/protobuf/...@v1.0.0 govendor fetch github.com/gogo/googleapis/...@08a7655d27152912db7aaf4f983275eaf8d128ef govendor fetch google.golang.org/grpc/...@v1.12.0 govendor fetch github.com/golang/protobuf/...@v1.1.0 Signed-off-by: Wei Fu <fuweid89@gmail.com>
The containerd has been improved a lot in v1.2, which makes the service stable before. Based on this, we need to do the upgrade. Basically, both the contaienrd and shim API interfaces are stable so that we don't need to worry about the remote API calls. However, the package level interface has been changed a lot. The commit is used to align with containerd@v1.2.5. 1. events part: using exchange event helper instead of raw grpc conn 2. image part: a. import: new Import interface makes the import easier without Importer. b. commit: content helper has been upgraded with less arguments for caller. and `diff` package separates the Applier and Comparer interfaces. The changes can make the code clear in PouchContainer 3. lease: containerd client doesn't provide ListLeases interface directly. PouchContainer needs to get LeasesService and make the call by itself. 4. container IO: remove codes which comes from containerd. The code was used to align with containerd v1.2, which can make upgrade work easier. For now, we can remove this. Signed-off-by: Wei Fu <fuweid89@gmail.com>
Ⅰ. Describe what this PR did
The containerd has been improved a lot in v1.2, which makes the service
stable than before. Based on this, we need to do the upgrade.
Basically, both the contaienrd and shim API interfaces are stable so
that we don't need to worry about the remote API calls. However, the
package level interface has been changed a lot. The commit is used to
align with containerd@v1.2.0.
I also use subshell to run the
integration::ping_pouchd
command so that the error log can show up in CI.Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
no need
Ⅳ. Describe how to verify it
use existing CI testing case
Ⅴ. Special notes for reviews
I separate the change into two commits because the vendor change is too big.
There are somethings need to do after this PR, for example, it is time to remove the ctrd/wrapper_client.go because the grpc has been updated and it can support the defaultMaxStreamsClient
after this patch, the #1897 will be fixed.
fix #1897 #1713