New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple runtimes in service #530
Conversation
Any updates on this? It looks like an alternative to #256 |
Hi @brendanhonea, thanks for the PR. 'before:invoke:local:invoke': () =>
...
const functionDef = this.serverless.service.getFunction(this.options.function);
this.isFuncNode = _.startsWith(functionDef.runtime, 'node')
return this.serverless.pluginManager.spawn('webpack:validate');
})
.then(() => (this.skipCompile || !this.isFuncNode ? BbPromise.resolve() : this.serverless.pluginManager.spawn('webpack:compile')))
.then(() => (this.isFuncNode ? this.prepareLocalInvoke() : BbPromise.resolve())), Could you eventually add this to your fork? |
const entry = getEntryForFunction.call(this, functions[index], this.serverless.service.getFunction(func)); | ||
_.merge(entries, entry); | ||
const functionDef = this.serverless.service.getFunction(func); | ||
if (_.startsWith(functionDef.runtime, 'node')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when the global runtime is node and the runtime is not specified per function?
From: Add support for multiple runtimes in service serverless-heaven#530
Closing. Will use this PR instead: Check for node runtimes first #579. |
What did you implement:
Added support for projects that have lambdas running on multiple runtimes. In our case, we needed some java lambdas to run in the same project as our typescript lambdas and the plugin was trying to bundle all runtimes.
How did you implement it:
In validate.js, added a check for runtime.startswith('node') so that the plugin only tries to package node lambdas.
How can we verify it:
Create a serverless project that includes node lambdas, and lambdas from other supported runtimes (java, python, etc). Make sure that package.invidually is true. Master branch will try to package the other runtimes with webpack and will cause errors when invoking the lambdas. This fork will package only node lambdas with the plugin
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO