Skip to content

Conversation

@dmcgowan
Copy link
Member

Update the platforms package to alias to the new platforms package.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah added cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jan 20, 2024
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

I added cherry-pick labels (for the first commit).

@thaJeztah
Copy link
Member

I added cherry-pick labels (for the first commit).

Hm.. we may want to check the go module versions though; it looks like some versions specified in the new module are pretty recent (hcsshim v0.12.0-rc.2). We should check what the minimum version is that works, and pick that (to allow go module MVS to do its thing).

@thaJeztah
Copy link
Member

I opened a PR to downgrade the minimum required version of hcsshim, so that this module can more easily be consumed by other projects and in other branches (1.6, 1.7);

@thaJeztah
Copy link
Member

Perhaps we should wait for containerd/platforms#5 (tag as v0.1.1); that way we can update at least the v1.7 branch to use the aliases. For 1.6 we'd have to update hcsshim to v0.10.0 (to be discussed), but 1.7 should already meet the required version.

(currently trying with my PR branch in moby/moby#47142)

@thaJeztah
Copy link
Member

thaJeztah commented Jan 21, 2024

The good news; it now builds (v0.1.0 forced a GRPC updated, which didn't work well); the "bad" news is that I have 2 tests failing that expected a platform foobar to be invalid, but somehow it now doesn't produce an error; moby/moby#47142 (comment)

Could be some bug on the moby side, but we'd have to dig into that (perhaps @dmcgowan has time to check). I'm sure that can be fixed (just curious what changed in the behavior).

Daemon logs show that it returns an untyped error, hence using the default (500 / Internal Server error);

time="2024-01-21T00:18:31.260074294Z" level=debug msg="Calling POST /v1.45/images/create?fromImage=hello-world&platform=foobar&tag=latest"
time="2024-01-21T00:18:31.260220544Z" level=debug msg="FIXME: Got an API for which error does not match any expected type!!!" error="\"foobar\": unknown operating system or architecture: invalid argument" error_type="*fmt.wrapError" module=api
time="2024-01-21T00:18:31.260320336Z" level=error msg="Handler for POST /v1.45/images/create returned error: \"foobar\": unknown operating system or architecture: invalid argument"
time="2024-01-21T00:18:31.260407169Z" level=debug msg="FIXME: Got an API for which error does not match any expected type!!!" error="\"foobar\": unknown operating system or architecture: invalid argument" error_type="*fmt.wrapError" module=api

Wondering if this is excepted; maybe it's the change from pkg/errors to stdlib error-wrapping ? 🤔

error_type="*fmt.wrapError" module=api

@thaJeztah
Copy link
Member

Ah! I think I found the cause; the need module doesn't use containerd's errdefs package;

Screenshot 2024-01-21 at 01 25 19

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

looks like the change of errors is a breaking change; and the new errors are not exported, so cannot be detected / typed.

AkihiroSuda
AkihiroSuda previously approved these changes Jan 22, 2024
@dmcgowan
Copy link
Member Author

looks like the change of errors is a breaking change; and the new errors are not exported, so cannot be detected / typed.

We should find a solution for this but that change is already in main and our 2.0 betas. Splitting out errdefs may be the best solution. We could use interfaces to test for errors but that wouldn't help in cases where we use errors.Is.

@thaJeztah
Copy link
Member

We should find a solution for this but that change is already in main and our 2.0 betas. Splitting out errdefs may be the best solution. We could use interfaces to test for errors but that wouldn't help in cases where we use errors.Is.

Yeah, agree; for main / v2.0 (beta) this is probably find if we already have that errdefs change in current main;

  • let's update this PR to use v0.1.1 (to at least include the changes from downgrade minimum required version of hcsshim to v0.10.0 platforms#5)
  • work on the errdefs situation; we may need a common implementation of the errdefs definitions across branches, so that error-types can be matched in situations where multiple containerd versions (v1.x and v2.x) are in use, and errors cross boundaries.

"LGTM" after updating the first commit to v0.1.1

Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Derek McGowan <derek@mcg.dev>
@dmcgowan dmcgowan force-pushed the replace-platform-package branch from aea6938 to e79ec7a Compare January 23, 2024 17:22
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan
Copy link
Member Author

/retest

@dmcgowan dmcgowan added this pull request to the merge queue Jan 23, 2024
Merged via the queue into containerd:main with commit f276561 Jan 23, 2024
@dmcgowan dmcgowan deleted the replace-platform-package branch April 20, 2024 00:46
@thaJeztah thaJeztah added cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants