Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Sample Virtual Assistant Deployment: Folder structure is not proper #2336

Closed
urdurgaprasad opened this issue Sep 9, 2019 · 12 comments
Closed
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Issue is created by anyone that is not a collaborator in the repository. Status: Backlog This will go in the product backlog Type: Bug Something isn't working

Comments

@urdurgaprasad
Copy link

urdurgaprasad commented Sep 9, 2019

What project is affected?

botframework-solutions - Sample Virtual Assistant (Typescript)

What language is this in?

English

What happens?

Bot builder deployment script generating lib and node modules folders in root directory where package.json, tsconfig.json and web.config files are located. Where as part of publish command it has been referred project directory as root directory\src. With this, required package.json, lib folders, web.config files are missing and unable to start sample bot in web client post deployment.

Also please confirm, web.config should refer index.js or index.ts?

What are the steps to reproduce this issue?

Followed instructions specified in link https://microsoft.github.io/botframework-solutions/tutorials/typescript/create-assistant/1_intro/ for typescript VA sample.

What were you expecting to happen?

Can you share any logs, error output, etc.?

Any screenshots or additional context?

@urdurgaprasad urdurgaprasad added Needs Triage Needs to be triaged for assignment Type: Bug Something isn't working labels Sep 9, 2019
@urdurgaprasad urdurgaprasad changed the title Sample Virtual Assistant: Folder structure is not proper Sample Virtual Assistant Deployment: Folder structure is not proper Sep 9, 2019
@Batta32 Batta32 self-assigned this Sep 10, 2019
@lauren-mills lauren-mills added Status: Backlog This will go in the product backlog Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Issue is created by anyone that is not a collaborator in the repository. and removed Needs Triage Needs to be triaged for assignment labels Sep 10, 2019
@urdurgaprasad
Copy link
Author

urdurgaprasad commented Sep 10, 2019

@lauren-mills , @Batta32 This issue has been marked for backlog. Could you please help me with workaround to install type script based sample virtual assistant with proper directory structure to proceed in the mean time?

@dfavretto
Copy link
Contributor

Hi @urdurgaprasad,

Investigating the deployment.ps1 and publish.ps1 files, we discovered the final message after the deployment, gives indications on running the publish.ps1 script using the variable $projDir as the value for the parameter projFolder, which has the path to the src folder, and this is a mistake.

We'll be updating the deployment.ps1 script to fix this message, and in the meantime, you can omit that parameter, as it will default to your project path correctly, thus publishing correctly.

Let us know if this works for you! 😊

@urdurgaprasad
Copy link
Author

@dfavretto It worked, thank you. One more observation, luis_functions.ps1 referring to .luis files where as in repository structure we have .lu files only. Same with qna_functions.ps1.

One query, why we are maintaining two different folders i.e. src and lib with almost same replica of files?

@dfavretto
Copy link
Contributor

Hi @urdurgaprasad,

Regarding the .luis files in luis_functions.ps1, if you observe the deploy_cognitive_models.ps1 script, it gets all the .lu files from the deployment/resources/LU/{langCode} folder, and sends it as parameter.
Inside the luis_functions.ps1 script, these files are processed with the ludown tool, which creates .luis files from the .lu files. The same happens in qna_functions.ps1 script, where the .lu files are processed to get .qna files.

For the two different folders, this is the way TypeScript works, you have your src folder where all your .ts files are located, and before running your code, you transpile your TypeScript code into JavaScript code (using the command npm run build), and in turn it gets executed using Node. The .js files, which are located inside the lib folder, are autogenerated, so it's not advisable to edit them.

If you want to interiorize deeper on how TypeScript works, you can check the official documentation.

@urdurgaprasad
Copy link
Author

urdurgaprasad commented Sep 12, 2019

@dfavretto Thank You for the detailed explanation. It is very helpful.

In my machine, this .lu to .luis conversion is failing with error in resolving the path . In my machine, my user id is created as 'Durga Prasad'.Because of the space with in the user id, unable to resolve the path and not creating .luis file. Any suggestion on how this can be resolved by overriding the path ?

@dfavretto
Copy link
Contributor

@urdurgaprasad let us check this out, we'll do some testing using a Virtual Assistant with spaces in the path and we'll reach you later

@Batta32
Copy link
Collaborator

Batta32 commented Sep 12, 2019

@urdurgaprasad we came up with some questions:

  • Which OS are you using?
  • Which terminal are you using? (PowerShell, Command Line, Bash)
  • Are you using the latest version of the generator-botbuilder-assistant? Today we published the 1.0.6 in npm!

npm install -g generator-botbuilder-assistant

In our case, we tested with the following environment:

  • Windows 10
  • PowerShell 6
  • Version 1.0.6 generator-botbuilder-assistant

We executed the deploy script adding a Write-Host to print the lu path which is used by the DeployLUIS method, and noticed that finished successfully even though the paths contains some spaces.
However, executing the ludown parse toluis command separately, an error raises.

image

As a workaround, you can execute the ludown parse toluis command adding the quotes in the paths like follows, replacing the <PLACEHOLDERS>:

ludown parse toluis --in "<PATH_TO_THE_LU_FILE>" --outFolder "<PATH_TO_LU_FOLDER>" --luis_culture "<SPECIFIC_CULTURE>"

@urdurgaprasad
Copy link
Author

urdurgaprasad commented Sep 13, 2019

@Batta32 Please find the requested information below:

  • Which OS are you using? : Windows 10 Pro 64 bit
  • Which terminal are you using? (PowerShell, Command Line, Bash) : PowerShell 6.2.2
  • Are you using the latest version of the generator-botbuilder-assistant? Today we published the 1.0.6 in npm!: Yes, using bot builder 1.0.6

Error while running deploy script:

image

and when I looked at log below is the message:
"ENOENT: no such file or directory, open 'D:**\Chatbot\Source\va-sample-dev\Deployment\resources\LU\en\general.luis'"

Below is the error while connecting skill to existing virtual assistant:
image

@urdurgaprasad
Copy link
Author

@Batta32 In your case, your user name created as "MartinBattaglino" where as mine is "Durga Prasad" with space between.

So, my doubt is these scripts are referring libraries located in path
C:\Users\Durga Prasad\AppData\Roaming\npm, and because of space, path is breaking and unable to execute scripts properly.

@Batta32
Copy link
Collaborator

Batta32 commented Sep 17, 2019

Hi @urdurgaprasad,

We just understood what you meant, it wasn't an issue related to how the deploy.ps1 script or botskills cli tool was using the paths internally, but probably about the location of your npm installation which contains the executed libraries.

Try changing the location of the npm installation to the C hard disk.

Also, here you have some links to review:

@urdurgaprasad
Copy link
Author

@Batta32 Below link helped to resolve the issue. Thank you all for your support.

https://blog.jsinh.in/change-default-nodejs-npm-and-npm-cache-directory-on-windows/#.XYHT1ihKhPZ

@Batta32
Copy link
Collaborator

Batta32 commented Sep 18, 2019

Awesome @urdurgaprasad!

We will close the issue because you could make it work! Feel free to reopen if you have a similar issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Issue is created by anyone that is not a collaborator in the repository. Status: Backlog This will go in the product backlog Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants