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

[release/1.6] deprecation: new package for deprecations #9329

Merged

Conversation

samuelkarp
Copy link
Member


This series of commits adds support for recording and querying deprecated feature usage. We currently document our deprecations in the RELEASES.md file and have some warnings emitted into the log, but determining whether any of those features are in use requires understanding the config and call patterns of clients and/or log scanning. A service that records deprecated feature usage will make it possible to surface warnings to administrators who may not be the regular end-user of containerd (such as a Kubernetes cluster admin).

This was implemented for containerd 2.0, but since the goal is helping with significant deprecations for 2.0 I am backporting to 1.6 (1.7 is already done), adding warnings as necessary.

The series as-is adds the basic infrastructure and warnings for 1 current deprecation that exists in release/1.7 and one that exists in main:

  • schema 1 image conversion (which should be removed from main soon)
  • dynamic Go plugins

Subsequent PRs will cover the other deprecations tracked in #9312.

The implementation is as follows:

  • A new warning service has been implemented which plugins can call to emit deprecation warnings.
  • The Introspection service's Server RPC now returns deprecation warnings, retrieved from the warning service.
  • Warnings are in-memory. Any non-persisted warnings are cleared when containerd restarts, but may be re-generated if the condition remains true.
  • Only allowlisted warning types and hard-coded messages can be returned. This bounds the size of the Server RPC response by the number of deprecations and bounds the memory usage of the warning service.
  • The last occurrence is the only timestamp tracked, as the most-recent usage should be the easiest to correlate in logs.
  • ctr deprecations list can be used to query recorded warnings and output either for human consumption or in json

Sample output:

$ sudo bin/ctr deprecations list
ID                                               LAST OCCURRENCE                   MESSAGE    
io.containerd.deprecation/go-plugin-library      2023-11-03T06:36:48.057745081Z    Dynamically-linked Go plugins as containerd runtimes are deprecated since containerd v2.0 and removed in containerd v2.1.
io.containerd.deprecation/pull-schema-1-image    2023-11-03T06:36:52.339535617Z    Schema 1 images will be deprecated in containerd v1.7 and removed in containerd v2.0. Since containerd v1.6.25, schema 1 images are identified by the "io.containerd.image/converted-docker-schema1" label.

It may be easiest to review this PR commit-by-commit, as the overall size is somewhat large but each individual commit is scoped to a single piece.

@samuelkarp
Copy link
Member Author

Opened #9334 for the flake TestIssue9103/should_be_stopped_status_if_init_has_been_killed.

This package enumerates the known deprecations in the current version of
containerd.  New deprecations should be added here, and old ones
removed.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit aff5b80)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 240733c)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
The Server rpc in introspection service is extended to expose
deprecation warnings based on observed feature use in containerd.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 57c897f)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Deprecation warnings are retrieved from the warning service and
returned via the Server RPC.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 9aab446)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit bc861b6)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 260e71a)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 079383d)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit 3fff8b4)
Signed-off-by: Samuel Karp <samuelkarp@google.com>
@ruiwen-zhao
Copy link
Member

/retest

@samuelkarp samuelkarp merged commit 5a014ed into containerd:release/1.6 Nov 9, 2023
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants