Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Conversation

@VanyLaw
Copy link
Contributor

@VanyLaw VanyLaw commented May 27, 2020

Description

Current Solution

  • currently, I use source code as runtime template.
    • in local publilsh, we copy runtime template and bot folder into temp folder. Do the npm install and build and start in temp folder.
    • in azure publish, we copy source code and bot folder into temp folder, build it and zip it and upload to azure. Do the npm install and start in azure. Azure web app only install node_modules in the first time deploy.
    • in eject, we copy source code, then doing npm install and npm build.

Solution for switch different type of runtime (c#, JS) Maybe we need some UI design later

  • Currently, I add a key field in settings.runtime to clarify which runtime we are using. If we set this into csharp-azurewebapp we use c# runtime as template, set node-azurewebapp to use JS.

Enable js runtime:

  • support eject js runtime and switch c# to js.
  • support local publish
  • support deploy to azure
  • js runtime support both azure webapp and azure functions

Task Item

close #3272
closes #1682
merge #3453

Screenshots

VanyLaw and others added 30 commits May 18, 2020 18:27
@luhan2017
Copy link
Contributor

@cwhitten , We had investigated on this and found that all the failures we met are related to gyp. Wenyi checked in a readme file which explain the prerequisite to run the js runtime.
For windows, users need to install windows-build-tools, and for linux, users need to install xcode-select.

Currently the ejection process will do the npm install for user and it will fail with gyp without installing the prerequisite.
How about we just copy the runtime, and tell user to follow the instructions in readme to install and build.
Then come back to composer to start the runtime?

I think the main purpose for ejection is to do the custom runtime, so it is nature for user to do the npm install & run build by their own.

@VanyLaw
Copy link
Contributor Author

VanyLaw commented Aug 18, 2020

Thanks for the info @zhixzhan, I add scripts-prepend-node-path=true in .npmrc to fix about the npm path issue. But for the node-gyp error, could only install xcode-select to fix? Like run xcode-select --install.

@VanyLaw
Copy link
Contributor Author

VanyLaw commented Aug 18, 2020

FYI, the gyp Err is because we use restify as js runtime server, and it's dependency dtrace-provider need gyp build. and gyp need python2 environment. So if user have not install windows-build-tool or xcode-select, it will throw error during npm install.

@zxyanliu
Copy link
Contributor

zxyanliu commented Aug 19, 2020

I tested on my Window machine. I did not see any errors.

Steps I followed:

  • set registry into myget: npm config set registry https://botbuilder.myget.org/F/botbuilder-v4-js-daily/npm/
  • git clone https://github.com/microsoft/BotFramework-Composer.git
  • cd BotFramework-Composer/Composer
  • yarn, yarn build, yarn start
  • create an echo bot with Composer and tested in Emulator work
  • Eject JS runtime
    image
  • Then see
    Picture1

I did not see any errors throughout the process. What are the next steps?

@zhixzhan
Copy link
Contributor

Thanks for the info @zhixzhan, I add scripts-prepend-node-path=true in .npmrc to fix about the npm path issue. But for the node-gyp error, could only install xcode-select to fix? Like run xcode-select --install.

@VanyLaw Before that I have tried Xcode-select -- install or softwareupdate --install --all but both failed.

@VanyLaw
Copy link
Contributor Author

VanyLaw commented Aug 19, 2020

@zxyanliu Thanks you for the try. Because we use all the packages from npm, you can skip the "set registry step". After you eject the runtime, the next step is clicking the start bot button to start it, then you can test in your emulator.

@zxyanliu
Copy link
Contributor

zxyanliu commented Aug 19, 2020

@zxyanliu Thanks you for the try. Because we use all the packages from npm, you can skip the "set registry step". After you eject the runtime, the next step is clicking the start bot button to start it, then you can test in your emulator.

Thanks for the tip. @VanyLaw

After ejecting the JS runtime, I tested the echo bot. This is what I got from the Emulator.

image

@cwhitten
Copy link
Member

End to end tests are failing the SaveAs spec. I'm seeing unexpected behavior when trying to Save As. The bot being copied is not the currently loaded bot.

Screenshot shows EmptyBot being loaded up to copy, but I currently have the TodoLuis bot open.
Screen Shot 2020-08-19 at 10 29 34 AM

@zxyanliu
Copy link
Contributor

zxyanliu commented Aug 19, 2020

@cwhitten

End to end tests are failing the SaveAs spec. I'm seeing unexpected behavior when trying to Save As. The bot being copied is not the currently loaded bot.

This behavior happens to: ToDoWithLuis, SimpleToDo and Interruptions samples. Every time after you create an Empty Bot first, then creating the three samples mentioned will load the Empty Bot template.

This behavior happens in the main branch as well.

@cwhitten
Copy link
Member

@cwhitten

End to end tests are failing the SaveAs spec. I'm seeing unexpected behavior when trying to Save As. The bot being copied is not the currently loaded bot.

This behavior happens to: ToDoWithLuis, SimpleToDo and Interruptions samples. Every time after you create an Empty Bot first, then creating the three samples mentioned will load the Empty Bot template.

This behavior happens in the main branch as well.

Got it. Thanks @zxyanliu

Let's address this issue outside this PR

@cwhitten cwhitten requested review from a-b-r-o-w-n and cwhitten and removed request for corinagum August 19, 2020 23:28
@cwhitten cwhitten merged commit bbb65c8 into main Aug 19, 2020
@cwhitten cwhitten deleted the wenyluo/jsRuntime branch August 19, 2020 23:28
alanlong9278 added a commit that referenced this pull request Aug 20, 2020
* main:
  feat: enable js runtime (preview) (#3198)
  feat: Design tweaks to Skill Manifest Generation Wizard (#3864)
  feat: Update package to 4.10.0 and update schema and add samples for signoutuser  (#3862)
  fix lu inline update (#3861)
lei9444 added a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* add js runtime

* set copy button disable when copying

* updated js runtime to load settings correctly

* updated js runtime to load settings correctly

* add js runtime publish

* add runtime config

* fixed sample templates

* read folder path from settings

* change publish folder for js runtime

* exlucde *.zip from archived files

* fixed appsettings path for deployment

* added web.config as well as iisnode.yml configuration files for deployment

* compiled js runtime

* merge settings

* enum value to lower case

* fixed zip deployment issue

* deploy js runtime without eject

* js runtime lib files

* fix restart

* fix lint

* fix zip runtime

* fix bot-deploy package can not update in azurepublish plugin

* fix copy runtime everytime when local publish

* updated configuration files for deployment

* add yarn install in first time clicking start

* bump runtime dependencies' version

* fix deploy absolute url and include .deployment into zip

* decouple platform in localpublish plugin

* move some code into nodejs runtime core

* merge master

* fix profile edit and save not saving to settings

* Remove language specific features from core and into runtime plugin (microsoft#3453)

* Remove language specific features from core and into runtime plugin

* cleanup a bit of the azurepublish plugin for readability

* move some code, add some comments

* refactor bot project deploy and split into several sub-classes. move this from inside composer into the plugin

* remove bot-deploy package
combine azurePublish and azureFunctionsPublish
refine buildDeploy api method to allow for knowledge of what target is being built for

* remove azureFunctionsPublish (replaced by azureFunctions)

* fix to node runtime

* allow start bot button to be async

* clean up dependencies, paths

* remove rimraf yarn.lock in package.json and catch error during setBot

* merge settings and write once inside the runtime plugin

* make sure to use exec instead of execSync

* make sure everything happens in the right order
don't use console.log

* identify runtime by name field

* update luis package in azurePublish plugin and fix getRuntimeByProject

* remove lib folder in azurePublish

* test: increase 'adaptive-flow' test coverage to 77% (microsoft#3530)

* + UT: adaptive-flow-renderer/widgets

* + UT: adaptive-flow-editor/utils

* remove unref hook: useWindowDimension

* + UT: KeyboardZone

* + UT: cursorTracker

* + UT: adaptive-flow-editor/constants

* +UT: AdaptiveFlowEditor

* + UT: adaptive-flow-editor/contexts

* + UT: useEditorEventApi

* fix CI error

* + UT: NodeWrapper

* + UT: EdgeMenu

* KeyboardZone behavioror test

* change the test file structure of cursorTracker

* update a test case (microsoft#3531)

Co-authored-by: Chris Whitten <[email protected]>

* fix lgWorker test failure (microsoft#3529)

Co-authored-by: Chris Whitten <[email protected]>

* chore: adds webpack bundle analyzer (microsoft#3542)

* issues#3309

* fixes lints

* Default to bot settings if no route cache

* fix: microsoft#3485

* fix: microsoft#3486 Debug/Fix HMR support

* webpack bundle analyzer

Co-authored-by: Soroush <[email protected]>
Co-authored-by: Chris Whitten <[email protected]>
Co-authored-by: Andy Brown <[email protected]>

* refactor: split some actions off setSettings (microsoft#3525)

* split some actions off setSettings

* add more actions - eject still not working

* fix arguments in eject

* split some actions off setSettings

* add more actions - eject still not working

* fix arguments in eject

* Update setting.ts

* fix some tests

* Update index.ts

* move logo-clicking to commands.ts

* Update commands.ts

* fix: Dialog validate throw error when delete an action (microsoft#3537)

* fix: Dialog validate throw error when delete an action

* use optional chaining and more explicit length check

* fix lint

Co-authored-by: Chris Whitten <[email protected]>
Co-authored-by: Andy Brown <[email protected]>

* use const instead of raw http status values

* rename js runtime to node-azurewebapp

Co-authored-by: Wenyi Luo <[email protected]>
Co-authored-by: zeye <[email protected]>
Co-authored-by: liweitian <[email protected]>
Co-authored-by: Chris Whitten <[email protected]>
Co-authored-by: Zhixiang Zhan <[email protected]>
Co-authored-by: Soroush <[email protected]>
Co-authored-by: Soroush <[email protected]>
Co-authored-by: Andy Brown <[email protected]>
Co-authored-by: Ben Yackley <[email protected]>
Co-authored-by: leileizhang <[email protected]>

* fix js runtime in core

* fix js runtime local publish

* fix exclude paths not working in copyDir

* delete bot-deploy in lib

* merge nodejs runtime packages into one and fix deploy path error

* fix yarn to install lu 4.10.0

* fix merge conflict

* enable switch runtime in managed mode

* add npmrc to set registry in azure, make sure daily build version package can be install

* fix several comments

* fix comments

* fix luisbot deploy endpointKey issue and send 202 response before runtime template copy

* fix luisbot deploy endpointKey issue and send 202 response before runtime template copy

* fix ut in eject

* move DialogSetting interface into shared folder

* fix build error

* fix e2e test fail

* add test for js runtime

* dotnet runtime luis settings refactor, remove duplicate settings file (microsoft#3677)

* remove appsettings.deployment.json and appsettings.development.json

* fix get publish status after merge main

* some updates to the plugins README to include new functionality

* additional docs for the plugin APIs

* upgrade dependency

* support skills

* optimized structure of js runtime

* to get correct project root

* added manifest support in js runtime

* ignored lib folder in js runtime

* updated docs of js runtime

* fix some comments

* removed skills validation

* remove appsettings.json in dotnet

* fixed case issue of microsoft app id

* increased param length limit of web server

* shared skill conversation id factory

* remove listener before stop bot, move manifest saving into runtime plugin

* fix unit test

* modify node runtime actions test, add node runtime test into CI

* modify all node runtime tests

* add working directory in ci yml

* add preview in js eject and update restify package version

* add ts into dev dep

* build after eject

* added test cases for skill conversation id factory

* fix npm build involve jest in production environment

* polish

* fix some comments

* add eslint and fix lint

* updated set output target of typescript to es6

* use lodash merge instead object assign

* change method parameter to object, move botStatusInterval from recoil to component

* remove templatePath in publish api call and get it in plugins by runtime type in project

* azure functions in js runtime

* polish exec in runtime plugin, use lodash mergeWith to replace original mergeDeep

* polish runtime plugin

* make console log in azure publish plugin to logger

* fix mkdir error in runtime plugin; popup confirm dialog instead error when customized runtime existed

* stop bot before switch eject runtime

* ignore warning and error in npm install, modify schema folder into Schema folder in eject, in case linux eject

* add doc for js runtime

* polish

* polish

* modify readme

* merge multi parameter into object

Co-authored-by: Zichuan Ma <[email protected]>
Co-authored-by: Qi Kang <[email protected]>
Co-authored-by: Ben Brown <[email protected]>
Co-authored-by: zeye <[email protected]>
Co-authored-by: liweitian <[email protected]>
Co-authored-by: Chris Whitten <[email protected]>
Co-authored-by: Zhixiang Zhan <[email protected]>
Co-authored-by: Soroush <[email protected]>
Co-authored-by: Soroush <[email protected]>
Co-authored-by: Andy Brown <[email protected]>
Co-authored-by: Ben Yackley <[email protected]>
Co-authored-by: leileizhang <[email protected]>
Co-authored-by: Qi Kang <[email protected]>
Co-authored-by: Lu Han <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Area: Publish R10 Release 10 - August 17th, 2020 topic: runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Js runtime as azurewebapp Output code in NodeJs