Skip to content
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

nydus: update nydus-snapshotter dependency to v0.8.0 #3814

Merged
merged 3 commits into from
May 15, 2023

Conversation

changweige
Copy link
Contributor

@changweige changweige commented Apr 24, 2023

Nydus-snapshotter/converter does not record image's blobs digest on nydus image anymore since it is easy to overflow annotations' size limitation of Containerd. Nydus-snapshotter now relies on Containerd to GC.

@jedevc
Copy link
Member

jedevc commented Apr 24, 2023

cc @imeoer

@imeoer
Copy link
Contributor

imeoer commented Apr 24, 2023

Thanks! @changweige Can we also update the nydusd component version here and here ?

@changweige
Copy link
Contributor Author

changweige commented Apr 24, 2023

Thanks! @changweige Can we also update the nydusd component version here and here ?

What nydusd version are we suggesting now?

@jedevc
Copy link
Member

jedevc commented Apr 24, 2023

Also, is there a reason we need to bump the AWS SDK and protobuf deps as well? Are these dependencies pulled from nydus? If not, we should avoid bumping deps that are out of scope for this change.

@imeoer
Copy link
Contributor

imeoer commented Apr 24, 2023

What nydusd version are we suggesting now?

v2.1.6 should be ok.

Nydus-snapshotter/converter does not record image's blobs digest on
nydus image anymore since it is easy to overflow annotations' limiitations
of Containerd. Nydus-snapshotter now relies on Containerd to GC.

Signed-off-by: Changwei Ge <[email protected]>
@changweige
Copy link
Contributor Author

Also, is there a reason we need to bump the AWS SDK and protobuf deps as well? Are these dependencies pulled from nydus? If not, we should avoid bumping deps that are out of scope for this change.

Sorry for the late reply. Buildkit should only depend on the package github.com/containerd/nydus-snapshotter/pkg/converter which does not depend on any AWS packages. So I am not sure why go mod tidy also bumps the AWS deps of Buildikit. I still need more time to investigate it.

@thaJeztah
Copy link
Member

Sorry for the late reply. Buildkit should only depend on the package github.com/containerd/nydus-snapshotter/pkg/converter which does not depend on any AWS packages

Yeah, go modules unfortunately aren't that smart. the pkg/converter package does not have its own go.mod, which means it's part of the github.com/containerd/nydus-snapshotter module, and as such defines minimum versions required for all of the main module's go.mod. While pkg/converte may not use the AWS dependencies or anything else, go modules only looks at that after resolving the minimum version; basically;

  1. it collects all the dependencies specified by all modules (go.mod) used by BuildKit (recursively)
  2. for each, it determines the minimum required version (which is the highest version specified by any go.mod in 1.)
  3. if any of those are used by BuildKit (direct, or indirect), it updates the version in BuildKit's go.mod

I tried to convince the Go maintainers that this can be really problematic in projects with a large dependency tree, but they considered this to be "not a problem", and "easy to fix" for everyone (but too much work for Go itself);

@changweige
Copy link
Contributor Author

Sorry for the late reply. Buildkit should only depend on the package github.com/containerd/nydus-snapshotter/pkg/converter which does not depend on any AWS packages

Yeah, go modules unfortunately aren't that smart. the pkg/converter package does not have its own go.mod, which means it's part of the github.com/containerd/nydus-snapshotter module, and as such defines minimum versions required for all of the main module's go.mod. While pkg/converte may not use the AWS dependencies or anything else, go modules only looks at that after resolving the minimum version; basically;

  1. it collects all the dependencies specified by all modules (go.mod) used by BuildKit (recursively)
  2. for each, it determines the minimum required version (which is the highest version specified by any go.mod in 1.)
  3. if any of those are used by BuildKit (direct, or indirect), it updates the version in BuildKit's go.mod

I tried to convince the Go maintainers that this can be really problematic in projects with a large dependency tree, but they considered this to be "not a problem", and "easy to fix" for everyone (but too much work for Go itself);

Thanks @thaJeztah for the helpful information. Sounds like a way to address this is to make pkg/converter a sub-module within github.com/containerd/nydus-snapshotter

@jedevc
Copy link
Member

jedevc commented May 8, 2023

It should be fine actually - I was just wondering why those deps also got bumped, since it seemed out of scope for this PR.

I think it's fine to take the AWS SDK update with the nydus one 🎉

@thaJeztah
Copy link
Member

Sounds like a way to address this is to make pkg/converter a sub-module within github.com/containerd/nydus-snapshotter

Possibly that would work, but "sub-modules" (more actually they are "multi-module repositories") can be a big pain as well, especially if there's dependencies between those modules within your repo so I'd be careful introducing one.

It should be fine actually - I was just wondering why those deps also got bumped, since it seemed out of scope for this PR.

Yes, I think it's probably fine; I just recalled that I also had to update the dependency as part of updating the docker dependency to v24.0.0; #3846

In that PR I split it to separate commits to make it a bit more granular.

@jedevc
Copy link
Member

jedevc commented May 12, 2023

@changweige can you update the suggested nydus version as mentioned by @imeoer: #3814 (comment).

Otherwise, this LGTM.

@changweige
Copy link
Contributor Author

Sounds like a way to address this is to make pkg/converter a sub-module within github.com/containerd/nydus-snapshotter

Possibly that would work, but "sub-modules" (more actually they are "multi-module repositories") can be a big pain as well, especially if there's dependencies between those modules within your repo so I'd be careful introducing one.

It should be fine actually - I was just wondering why those deps also got bumped, since it seemed out of scope for this PR.

Yes, I think it's probably fine; I just recalled that I also had to update the dependency as part of updating the docker dependency to v24.0.0; #3846

In that PR I split it to separate commits to make it a bit more granular.

@thaJeztah Thanks for sharing the granular way to make the vendor code update more clear. But I feel like it's hard to apply the same method to this PR since the nydus-snapshotter's API has changed within v0.8.0 which means I have to make changing go.mod and source code in the same commit atomically, otherwise, a certain commit can't be compiled 🥺

Nydus has released more stable versions

Signed-off-by: Changwei Ge <[email protected]>
@changweige
Copy link
Contributor Author

@changweige can you update the suggested nydus version as mentioned by @imeoer: #3814 (comment).

Otherwise, this LGTM.

Thanks @jedevc . I have already updated the suggestion

crazy-max
crazy-max previously approved these changes May 15, 2023
@crazy-max crazy-max dismissed their stale review May 15, 2023 07:47

Needs "make generated-files"

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

@changweige You need to update generated files with make generated-files since protobuf deps update.

Because the protobuf has been bumped

Signed-off-by: Changwei Ge <[email protected]>
@changweige
Copy link
Contributor Author

@changweige You need to update generated files with make generated-files since protobuf deps update.

@crazy-max Thanks for reminding me. I have already run make generated-files and committed the resulted changes.

@jedevc jedevc requested a review from crazy-max May 15, 2023 09:26
@crazy-max crazy-max merged commit a9e8e39 into moby:master May 15, 2023
@jedevc
Copy link
Member

jedevc commented May 19, 2023

@changweige @imeoer it looks like since this merged we've got a lot more nydus related flakiness (also possibly related to #3786)

For example, see https://github.com/moby/buildkit/pull/3881/files:

  • process "mkdir /sys/fs/cgroup/securitytest" did not complete successfully: exit code: 1
  • failed to get compression blob "gzip": failed to get and ensure compression type of "gzip": failed to convert: unpack nydus blob: unpack nydus tar: unpack blob from nydus: can't find target image.blob by seeking tar: data not found

@imeoer
Copy link
Contributor

imeoer commented May 22, 2023

it looks like since this merged we've got a lot more nydus related flakiness (also possibly related to #3786)

Thanks for the report, will try to fix in containerd/nydus-snapshotter#483.

@crazy-max
Copy link
Member

crazy-max commented May 22, 2023

  • process "mkdir /sys/fs/cgroup/securitytest" did not complete successfully: exit code: 1

I think this one might also be related to #3786

Ah you already mentioned that issue @jedevc 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants