Skip to content

Conversation

@steveej
Copy link
Contributor

@steveej steveej commented Jul 18, 2019

TODO

  1. use async for the plugin interface implementation
  2. port one plugin for testing
  3. agree on the approach (the consumption and double-boxing of plugins for processing). allow mutable access to plugins for in-memory persistent plugin-state throughout the lifetime of the daemons. prefer a lock-frree read-only processing implementation and make the plugin responsible for handling their state via interior mutable fields.
  4. remove all potential panics in non-test code (unwrap/expect)
  5. port all other plugins
  6. double-check and try to minimize the trait bounds
  7. clean up git history
  8. get policy-engine: add TOML configuration for policy plugins  #129 merged
  9. double-check for panics in non-test code
  10. discuss plugin initialization in graph-builder. [WIP] graph-builder: add dynamic plugins configuration #74 can be merged after this one.
  11. discuss Box::leak vs lazy_static!

@steveej steveej requested review from lucab and shiywang July 18, 2019 13:21
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 18, 2019
@lucab
Copy link
Contributor

lucab commented Jul 19, 2019

@steveej If I'm reading this correctly, I'm in fact a bit concerned that we start consuming boxed-plugins instead of just referencing them. How do you envision glueing this together with the Arc<Vec<BoxedPlugin>> for configurable plugins from here?

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 23, 2019
@steveej steveej force-pushed the pr/async-plugins branch 5 times, most recently from 42e14f2 to f18e5e2 Compare July 29, 2019 15:33
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 29, 2019
@steveej steveej force-pushed the pr/async-plugins branch 5 times, most recently from 460319b to 6786a85 Compare August 14, 2019 18:21
@steveej steveej changed the title [RFC/WIP] introduce asynchronous plugin processing and port plugins [RFC/WIP] introduce asynchronous plugin processing Aug 15, 2019
@steveej steveej changed the title [RFC/WIP] introduce asynchronous plugin processing introduce asynchronous plugin processing Aug 15, 2019
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 16, 2019
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 18, 2019
@steveej steveej force-pushed the pr/async-plugins branch 2 times, most recently from d9584c7 to e573f86 Compare August 18, 2019 14:14
@steveej
Copy link
Contributor Author

steveej commented Aug 19, 2019

discuss Box::leak vs lazy_static!

I compared the alternatives and I think we would get away with the Box::leak approach in our code only instantiate the plugin vector once then use Box::leak to get and store a static reference.

let future_result = futures::stream::iter_ok::<_, Error>(plugins)
.fold(initial_io, |io, next_plugin| next_plugin.run(io))
.into_future()
// .flatten()
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover.

A symptom of using an asynchronous API throughout the the whole
processing chain is that the configured plugin collection must provide
static references, so that the references are guaranteed to be valid for
the whole lifetime of the program.

Changeset
* Implement the async interface and enhance its tests
* Port the channel-filter
* Port the quay metadata plugin
* Port edge_add_remove
* Port node_remove to async
* Port external web plugin example
* Adapt the graph-builder
* Adapt the policy-engine
@steveej
Copy link
Contributor Author

steveej commented Aug 20, 2019

@lucab thanks for another review, comments addressed! PTAL

@lucab
Copy link
Contributor

lucab commented Aug 21, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lucab, steveeJ

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 5fc450b into openshift:master Aug 21, 2019
@steveej steveej deleted the pr/async-plugins branch August 22, 2019 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants