microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
869 stars 372 forks source link

A JS bot that includes native package does not run when deployed to Azure #7743

Open tracyboehrer opened 3 years ago

tracyboehrer commented 3 years ago

Describe the bug

Create a JS Function bot that includes Orchestrator, LUIS, and QnA. The bot will run locally. However, when deployed it does not function through Web Chat.

It does not appear to be specific to Functions though. Josh G will be providing details on required changes.

Version

Browser

OS

To Reproduce

1) Create a JS Bot 2) Install Orchestrator and and LUIS intent and QnA KB 3) Provision 4) Publish 5) Test via Web Chat on Azure.

joshgummersall commented 3 years ago

Here's the nitty-gritty - orchestrator-core includes a natively compiled component that is OS and architecture-dependent. Composer does a zip deploy that includes node_modules and does not re-execute npm install on the deployment target machine. The default Functions platform is 32bit Windows, so in the case that a user installs orchestrator-core locally on a non-32bit Windows machine (or, in my case, a Mac), the deployed bot will not work. This problem will affect web apps and functions alike. It's particularly noticeable for bots that use Orchestrator due to the compiled component, but it's a problem that could appear elsewhere.

daveta commented 3 years ago

That's a good assessment, given native bits, if your development platform isn't your production platform, then this will be a problem. Not only for orchestrator, but other nodejs packages that leverage native (like onnx).

Probably hooking something post deploy that executes npm install is the safest. It's possible if you know the destination production platform, you could pre-install the native bits for Orchestrator, but slippery slope - you'd also have to identify any other packages that use native and perform the same type of pre-install.

This won't be a problem with Nuget as it contains all the binaries within the package.

benbrown commented 3 years ago

I believe we will need to add a .deployment file to the node generators:

https://github.com/projectkudu/kudu/wiki/Deployment-hooks#sample-deployment-file

tracyboehrer commented 3 years ago

Is the best solution a deployment file? If so, I can move this to Components. But we'd need the deployment file to include in the generator.

benbrown commented 3 years ago

I am still trying to determine if this is the correct and working solution

benbrown commented 3 years ago

OK here is my latest data:

a .deployment file and a deploy.cmd file

these are both basically off the shelf (as provided by kudu) but with a few lines added to call npm install.

sgellock commented 3 years ago

Shiproom - orchestrator is P0 - approved

sgellock commented 3 years ago

Shiproom - given the complexity and the calendar, we're moving this to a patch release

benbrown commented 3 years ago

Just as a refresher to where we stand on this issue: