akshata29 / entaoai

Chat and Ask on your own data. Accelerator to quickly upload your own enterprise data and use OpenAI services to chat to that uploaded data and ask questions
MIT License
841 stars 254 forks source link

The Frontend is not deployed automatically #5

Closed FL0S0T closed 1 year ago

FL0S0T commented 1 year ago

Hi, I have deployed the solutions with azure cli directly into Azure. Everything worked fine, but the frontend was not deployed. As described in the section on how to deploy it manually to Azure, is it necessary to build the React frontend and deploy it manually? Cheers

akshata29 commented 1 year ago

Using the azure developer CLI (azd) it will deploy both the function app and the core app. I did not test using az CLI, but let me test it further. Planning to add github actions as well as "Deploy to Azure" button soon.

FL0S0T commented 1 year ago

sry i mean AZD.

The frontend app is not added in my case...

Where should I look for the deployed frontend app?

FL0S0T commented 1 year ago

I have checked the backend webapp.

In the tar.gz file with the python backend the frontend is not included and deployed. Only the backend script are available.

sekoch commented 1 year ago

@akshata29 @FL0S0T means that the zipdeploy of the core app only includes the backend python files but not the static frontend folder with assets etc. The frontend is missing on the webapp.

Via KUDU console only the app.py and 3 other files are available. The index.html with asset folder is missing.

akshata29 commented 1 year ago

@FL0S0T - Did you run "npm run build"? That will create the static files which is required for the backend app from the UI perspective.

FL0S0T commented 1 year ago

@akshata29 the deployment script runs it by it self. I have also build it after the missed deployment by my self with npm run build.

We have now deployed it manually but it throws errors... I think there is something falls in this case we mix automatic with manual deployment.

Is in the automatic deployment the frontend app included as it looks like?

akshata29 commented 1 year ago

@FL0S0T - Happy to jump on the call if it's easier to take a look at the issue to help remove the blocker. What are the errors for the manual deployment? Does it work locally?

Yes in the automated deployment, both the Azure Functions and the application are deployed

FL0S0T commented 1 year ago

@akshata29 sure but how to exchange the e-mail? ;)

This is the error of the function app:

Exception while executing function: Functions.ChatGpt Result: Failure Exception: KeyError: 'values' Stack:   File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 473, in _handleinvocation_request     call_result = await self._loop.run_in_executor(   File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run     result = self.fn(*self.args, self.kwargs)   File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/dispatcher.py", line 742, in _run_sync_func     return ExtensionManager.get_sync_invocation_wrapper(context,   File "/azure-functions-host/workers/python/3.9/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper     result = function(args)   File "/home/site/wwwroot/ChatGpt/init.py", line 57, in main     result = ComposeResponse(body, indexNs, indexType)   File "/home/site/wwwroot/ChatGpt/init__.py", line 66, in ComposeResponse     values = json.loads(jsonData)['values']

akshata29 commented 1 year ago

That looks to me just some missing configuration value from the deployment. I did check in the ARM template and github actions, to help break down the service deployment and code deployment. See if that works, did test it few times

FL0S0T commented 1 year ago

@akshata29 I started a new deployment and it was successfull but the frontend app is missing when I open the backend app (where it should included, right?)

../backend/static/index.html 0.46 kB ../backend/static/assets/github-fab00c2d.svg 0.96 kB ../backend/static/assets/index-6b62bf29.css 16.47 kB │ gzip: 2.89 kB ../backend/static/assets/index-0717304f.js 1,681.96 kB │ gzip: 477.94 kB │ map: 12,419.41 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:

Deploying services (azd deploy)

(✓) Done: Deploying service backend

SUCCESS: Your Azure app has been deployed! You can view the resources created under the resource group lursepocgpt in Azure Portal:

akshata29 commented 1 year ago

@FL0S0T - That looks like successful deployment of all services as well as code deployment? Do you not see anything when you browse https://[my app].azurewebsites.net/?. Do you see functions deployed (~10) in https://[my function].azurewebsites.net/?

FL0S0T commented 1 year ago

@akshata29 on the backend I get en error with "not Found". The Function App is up and running.

akshata29 commented 1 year ago

@FL0S0T - Did create the docker image for both API and App, if you want to just download that to run locally

akshata29 commented 1 year ago

Closing with assumption that deployment is all good