serverless-heaven / serverless-webpack

Serverless plugin to bundle your lambdas with Webpack
MIT License
1.72k stars 417 forks source link

Google, OpenWhisk or Azure support? #128

Closed Jonovono closed 6 years ago

Jonovono commented 7 years ago

Wondering if support for Google Cloud Functions is on the horizon?

Whoaa512 commented 7 years ago

Since this plugin is designed to work with serverless, which supports Google Cloud functions, I think this plugin supports Google Functions.

Let us know if that is not the case, and why.

alexcasalboni commented 7 years ago

Has anyone tested this plugin with IBM OpenWhisk, Google Cloud Functions, and Azure Functions?

HyperBrain commented 7 years ago

@alexcasalboni Do you have the opportunity to test it with a test project for one of the providers? We also use only AWS at work, so I cannot make any valid statement on the issue.

HyperBrain commented 7 years ago

Just renamed the issue. We should gather feedback from users that tried the plugin with other providers than AWS here.

alexcasalboni commented 7 years ago

@HyperBrain I just reached out to the main vendor-plugins maintainers, so maybe we'll find out faster :)

jthomas commented 7 years ago

I've been testing the OpenWhisk provider with this plugin. I can successfully deploy functions bundled with webpack. 💪

The examples I've tested from the samples folder work without modification.

There is an issue with the invoke plugin that is bound to AWS Lambda's function interface. https://github.com/elastic-coders/serverless-webpack/blob/master/lib/run.js#L93-L104

Is it possible to just fire the native invoke plugin for the provider rather than triggering this manually?

jthomas commented 7 years ago

Could we also add a section to the README highlighting support for the other providers with details on which features work? Maybe a table?

HyperBrain commented 7 years ago

@jthomas Big 👍 for the evaluation and testing. It is good to hear that at least the basic functionality works as expected.

Could we also add a section to the README highlighting support for the other providers with details on which features work? Maybe a table?

Good idea! Feel free to add a PR for the README changes (and add the OpenWhisk results there). The section could imo be named "Provider support" with a table as you proposed.

Is it possible to just fire the native invoke plugin for the provider rather than triggering this manually?

I like this idea. Maybe the plugin could just hook into serverless invoke local, so that it is provider independent and will run through all initializations done there, but adds the compile step. Then we could remove the invoke/run command completely and the user would use one well-known function, regardless if the plugin is enabled or not. The plugin should not replicate functionality that is offered by Serverless or other plugins that are specialized for these tasks. I will create a separate issue/task for the use of serverless invoke local and the corresponding hooks and link it here.

jthomas commented 7 years ago

Here's the PR for the provider table. https://github.com/elastic-coders/serverless-webpack/pull/149

jthomas commented 7 years ago

More testing has revealed that watch works but serve doesn't.

The serve plugin also uses a provider dependent interface to execute the handler. https://github.com/elastic-coders/serverless-webpack/blob/master/lib/serve.js#L119-L129

HyperBrain commented 7 years ago

Serve will be abandoned and removed (see #135) in version 3.0.0 in favor of the serverless-offline plugin which works better. If the invoke is switched to the standard implementation too, it would leave no unsupported functions at all in the compatibility table 😄

HyperBrain commented 7 years ago

@pmuens Do you have some time to test the same things that @jthomas did with the OpenWhisk plugin? It would be great if we could fill the table added in #149 with the Google results.

HyperBrain commented 7 years ago

The invoke local integration I mentioned above (https://github.com/elastic-coders/serverless-webpack/issues/128#issuecomment-314409846) is handled in #151 . As soon as the PR ( #153 ) is finalized we should test it with the different providers and adjust the provider support table accordingly.

HyperBrain commented 7 years ago

@jthomas The V3 version in the v3.0.0 branch should now fully support invoke local. Can you try it with OpenWhisk and complete the provider support table again in that branch? Thank you 😃

jthomas commented 7 years ago

@HyperBrain invoke local works 👍 but --watch does not 👎. It just returns after invoking the function. Is this currently working?

HyperBrain commented 7 years ago

@jthomas Yes, --watch works for me. I tested it with the example @cwaltken-edrans mentioned in #180. My test system was Windows 10, Git Bash and Node 6.10.x. I posted my results in the forementioned issue (see here https://github.com/elastic-coders/serverless-webpack/issues/180#issuecomment-320438678).

Technically the watch waits for file change callbacks from webpack's watch and retriggers the invoke local.

IMO there are multiple possibilities to cause the issue for you:

However it is worth further investigation. The invoke local support (including watch) should be provider agnostic as it only uses framework and Webpack functions.

HyperBrain commented 7 years ago

@jthomas I just released v3. Can you check with the OpenWhisk plugin again and fill the compatibility table? Thanks.

jthomas commented 7 years ago

I've just checked this and all commands are now working!

HyperBrain commented 7 years ago

That's good news 👍 Thanks for testing.

markmssd commented 6 years ago

Hey guys, I'm a Google Cloud Functions type of guy (https://github.com/serverless/serverless-google-cloudfunctions), and I could not get it working. After further investigation, it seems like serverless-google-cloudfunctions does not support package.individually: true. Anyone else struggling with this?

markmssd commented 6 years ago

UPDATE: #199 is exactly the error I'm getting. Weird since it seems to have been resolved!

HyperBrain commented 6 years ago

Closing this as it was only a summary to get info about other providers