You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Further to my conversation with @ac360 I'm opening this issue to provide feedback about the Provider API. I've been reviewing the API and AWS & Auzre implementations to help understand how to deliver the OpenWhisk provider plugins.
Provider Templates
This template file is used to scaffold the Node.js handler for new services. The template matches Lambda's handler interface. Both Azure and OpenWhisk use different handler signatures.
Is there a way for the providers to provide their own templates?
We should definitely move the handler creation process into a provider specific create plugin (so that each provider can copy it's own files) and keep the main create plugin Serverless related (it should only create the serverless files).
We should furthermore extend the create lifecycles (e.g. a create:createServiceDir or something similar) so that plugin authors can hook into them easily (like we've done with the deploy plugin).
P.S. we're about to provide an option to make plugins provider specific (#1429). This way the plugins will only run when the services provider matches.
What do you think @eahefnawy ? Do we have a way that providers can provide their own templates?
@jthomas yep we will just update the create plugin to choose a certain handler.js template file based on the passed provider as an option just like @pmuens described. Will merge that tomorrow!
Activity
pmuens commentedon Jun 30, 2016
Hey @jthomas!
Thank you for the feedback and jumping in on the OpenWhisk implementation!
Right now we simply copy the handler file (see https://github.com/serverless/serverless/blob/v1.0/lib/plugins/create/create.js#L77-L80).
The
createplugin only supports thecreate:createlifecycle. https://github.com/serverless/serverless/tree/v1.0/lib/plugins/create#provided-lifecycle-eventsWe should definitely move the handler creation process into a provider specific
createplugin (so that each provider can copy it's own files) and keep the maincreateplugin Serverless related (it should only create the serverless files).We should furthermore extend the
createlifecycles (e.g. acreate:createServiceDiror something similar) so that plugin authors can hook into them easily (like we've done with thedeployplugin).P.S. we're about to provide an option to make plugins provider specific (#1429). This way the plugins will only run when the services provider matches.
What do you think @eahefnawy ? Do we have a way that providers can provide their own templates?
eahefnawy commentedon Jun 30, 2016
@jthomas yep we will just update the
createplugin to choose a certainhandler.jstemplate file based on the passed provider as an option just like @pmuens described. Will merge that tomorrow!Happy to have you here James 😊
jthomas commentedon Jul 1, 2016
FYI I'm working on the OpenWhisk implementation here:
https://github.com/jthomas/serverless/tree/v1.0-openwhisk
Hoping to have basic deploy working next week.
I'll also be at the Serverless meetup in London on Monday if anyone wants to say hello!
pmuens commentedon Jul 4, 2016
Hey @jthomas
Great! Really looking forward to OpenWhisk support! I'll attend the meetup as well.
See you there!
pmuens commentedon Jul 12, 2016
Is discussed in detail in #1470
and should be available soon. Will close this one here. Thanks for the proposal @jthomas