Repository navigation
Conversation
|
Awesome! Thank you very much @jthomas !!! π― π |
|
That's awesome @jthomas!!!! π₯ π₯ π₯ |
|
OOOOOOOOOOOOMG!!! @jthomas you are the man!!!! |
|
Implementing OpenWhisk support for Serverless was mostly painless. Go Serverless! Documentation for the project was excellent. It was a huge benefit to also have the Azure implementation to review to help me understand how it should work. Working on this part-time, it took me a week to have deploy working, another two weeks to fill out the remaining plugins and another few weeks tidying up. OpenWhisk's NPM module handles all heavy lifting with the API. There were a few challenges to map the Amazon Lambda programming model to the OpenWhisk platform. Here's a list of the main issues I encountered... Regions vs EndpointsServerless supports deploying to different availability zones through regions identifiers. OpenWhisk developers control the platform instance they are deploying through by changing the platform endpoint. Currently, I'm not using the region parameter to control the deployment location. The platform endpoint is pulled from a user configuration file in the user's home directory, also used by the OpenWhisk CLI, or can be set manually using environment variables (OW_API, OW_AUTH). IBM Bluemix supports multiple regions but OW is only deployed in US-South whilst it is in beta. Developers using Serverless with OpenWhisk may be using IBM Bluemix or to a private instance they have deployed. When OpenWhisk is rolled out to other regions in IBM's cloud platform, I'm wondering how to support regions without coupling OpenWhisk support in Serverless with IBM Bluemix. We would like Serverless users to be able to seamlessly use and transition between any OpenWhisk instance. One option is to support allowing users to define the endpoints for region labels they specify in the configuration. Events vs Triggers/Rules/FeedsOpenWhisk has a different event model that Lambda. Note: Action is the term for function in OpenWhisk. Users can define Triggers, which are independent to Actions, that are a "named class of events". Using Rules, they bind Actions to these Triggers. Whenever that Trigger is fired, the event will be passed to the Action. Rules can be dynamically created and removed at runtime. Triggers can also be bound to Feeds, which are external event sources. Feeds will invoke the Trigger whenever an external event occurs. This can be a bit confusing to begin with but this example should help you to understand.... "I want my Action (called myAction) to fire periodically, say every eight seconds"
Both Actions, Triggers and Feeds can be called with parameters. Mapping this model to the current event parameters in the YAML file wasn't obvious. I decided to use the Here's the alarm example translated into the Serverless YAML definition. |
|
Hey @jthomas thanks for the really detailed writeup! Really valuable feedback! π π π |
|
Thanks for the detailed explanation @jthomas One question, you mentioned that you're using the Great work! and thanks a lot for this! π |
|
Triggers are deployed through the OpenWhisk API, not through a IBM "Cloud Formation" equivalent. I was using the Resources section mostly out of convenience! |
|
@jthomas that's a common use case. That's why we recently turned the |
|
I have a question for the Serverless team on usability and default values.... When we deploy a service function, using the API, the attribute overwrite controls whether it should replace existing functions with the same identifier. This defaults to false in the API. I'm using the default value at the moment. From a user experience perspective, it would be much better to default to true. Users deploying updates don't have to manually set this value in the manifest. The downside with this approach is that they might overwrite an existing service accidentally. What's the framework's position on issues like this? I'd prefer to improve the usability. I've already had a user run into this issue. |
So if other functions in other service don't have this same identifier, it won't overwrite an existing service? If so imo we should strive to make unique identifiers for all functions/services to avoid that "accident" while offering the best UX. @flomotlik @pmuens any further thoughts on this? |
|
I would vote (and expect) to always replace the function so that the deployment always reflects the current state on the developers machine. Right now the AWS implementation will also always upload the functions code (even if it's not changed). |
|
@jthomas could you reopen the PR against master? It was closed because I removed the V1.0 branch |
|
I've made a small change to default the "overwrite" parameter to true for Actions, Triggers and Rules. #1858 has been opened against master. |
Status:
Ready π
Description:
This PR provides the provider implementation for the OpenWhisk platform. I've implemented the entire suite of plugins for create, deploy, invoke and remove, with full unit test coverage and documentation. See the
lib/plugins/openwhiskdirectory for the source code.I have tested this implementation against the OpenWhisk platform deployed on IBM Bluemix.
There are a number of design issues to discuss based on my implementation, due to the differences between the Lambda and OpenWhisk platforms. I'll write up my notes tomorrow and add them to this PR to get feedback from the serverless team.
Enjoy!