Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Apache OpenWhisk - Pluggable Event Providers

James Thomas
February 06, 2019

Apache OpenWhisk - Pluggable Event Providers

Presentation to Apache OpenWhisk community call on my experiment building a pluggable trigger feed event provider.

James Thomas

February 06, 2019
Tweet

More Decks by James Thomas

Other Decks in Technology

Transcript

  1. APACHE OPENWHISK TRIGGER FEED PROVIDERS Why don’t we have more?

    Lots of community contributions for runtimes Not so much for feed providers…
  2. APACHE OPENWHISK TRIGGER FEED PROVIDERS Why don’t we have more?

    Trigger feeds are not that simple to implement. Documentation is not great.
  3. APACHE OPENWHISK TRIGGER FEED PROVIDERS Was asked internally to produce

    an S3 compatible feed provider. Use polling to check bucket file etags for file changes.
  4. HOW OPENWHISK TRIGGER FEEDS WORK wsk trigger create periodic \

    --feed /whisk.system/alarms/alarm \ --param cron "*/2 * * * *" \ --param trigger_payload “{…}” \ --param startDate "2019-01-01T00:00:00.000Z" \ --param stopDate "2019-01-31T23:59:00.000Z" feed parameter refers to a normal action action invoked with the trigger details by cli
  5. TRIGGER FEED API custom feed provider is supposed to manage

    listening to event source and firing triggers on events
  6. EXISTING TRIGGER FEED PROVIDERS ARCHITECTURE - ADDING TRIGGER Feed Action

    Web Action Trigger Database Event Provider Event Source User Trigger wsk CLI - User creates trigger with feed with wsk CLI tool - CLI calls feed action with trigger & auth details - Feed action calls web action (?) - Web action writes to Trigger management database
  7. EXISTING TRIGGER FEED PROVIDERS ARCHITECTURE - EVENT PROVIDER Feed Action

    Web Action Trigger Database Event Provider Event Source User Trigger wsk CLI - Event provider follows DB updates - Uses trigger details to start listening to external event source - Web action writes to Trigger management database
  8. EXISTING TRIGGER FEED PROVIDERS ARCHITECTURE - EVENTS OCCUR Feed Action

    Web Action Trigger Database Event Provider Event Source User Trigger wsk CLI - Provider fires trigger with event details when they occur.
  9. APACHE OPENWHISK TRIGGER FEED PROVIDERS Looking at the different feed

    providers, most of the code is not specific to the event source. 90% of code base = generic trigger management
  10. “Can we build a generic event provider with a plugin

    architecture? - Easier to contribute event sources - Easier to maintain feed provider
  11. GENERIC TRIGGER FEED PROVIDERS ARCHITECTURE Feed Action Web Action Trigger

    Database Generic Event Provider Custom Event Source - Plugin handles custom event source integration - Trigger management handled by generic provider Custom Event Source Plugin
  12. Is this interesting to others? Possible next steps… - Open-source

    code on Github? - Write more event provider plugins? - Donate to Apache (eventually)?