wire protocol: use dedicated RPC calls for all pod and container life-cycle events.#274
Draft
klihub wants to merge 4 commits intocontainerd:mainfrom
Draft
wire protocol: use dedicated RPC calls for all pod and container life-cycle events.#274klihub wants to merge 4 commits intocontainerd:mainfrom
klihub wants to merge 4 commits intocontainerd:mainfrom
Conversation
Define dedicated RPC calls on the wire for all pod lifecycle events. Update stub, builtin and WASM plugins accordingly. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Define dedicated RPC calls on the wire for all container lifecycle events. Update stub, builtin and WASM plugins accordingly. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Update to use the new dedicated RPC calls to relay all pod and
container lifecycle events to plugins. Remove old StateChange
which used to multiplex {Run,PostUpdate,Stop,Remove}PodSandbox
pod and {PostCreate,Start,PostStart,PostUpdate,Remove}Container
container events.
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add a backward compatibility wrapper for old plugins which do not support the full set of dedicated lifecycle events yet. Fall back to relaying StateChange events to them. Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
41b9c58 to
f062b1e
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the wire protocol/ttrpc API to have proper RPC calls and messages for all pod and container life-cycle events.
The added calls and messages replace the 'catch-most'
StateChangecall which is now used to relay {Run,Stop,Remove}PodSandbox pod and {PostCreate,Start,PostStart, PostUpdate,Remove} container events using a single 'event type + field union' message on the wire. The visible stub/plugin and runtime adaptation interfaces are unaffected. The PR leavesStateChangein the protocol to allow transparent backward compatibility, and updates the runtime adaptation to fall back to using StateChange if the plugin side NRI version does not implement the new RPC calls yet.This has been attempted a few times earlier in connection with other changes, but since we've had multiple other real functional changes in flight, we always shied away from the resulting rebase conflicts and seeing this through. This time this is a self-contained PR with no other functional changes.
Although functionally straightforward, it's still painfully intrusive as it touches a lot of boilerplate. Currently we have 3 remaining PRs open which touch the protocol and will conflict: #166 (memory policy adjustment), #183 (plugin authentication), and #271 (version exchange). Of these #166 and #217 are probably small footprint enough to be fairly easily rebases (either way around).
Here are my updated runtime test trees with these changes included: