Closed alliscode closed 1 year ago
@alliscode which steps would I use to deploy the frontend from arm64 linux Ubuntu device after the backend has been deployed to azure already? does npm deployment support the arm64 processor instruction set? which azure cli version do you suggest to use on arm64? Thanks
@AndreV84 Just follow the steps found at https://github.com/microsoft/chat-copilot/blob/main/scripts/deploy/README.md#deploy-frontend-webapp
There is a version of NPM for arm64, yes.
The Azure CLI also does: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt
@glahaye thank you for your directions they have led me to:
./deploy-webapp.sh --subscription ** --resource-group ** --deployment-name Microsoft.Template-** --client-id ap*co*at-wm*av*dlg2
Getting deployment outputs...
WEB_APP_URL: icy-m**7a*e.3.**aticapps.net
WEB_APP_NAME: swa-co*chat-w*b*ta*dlg2
WEB_API_URL: app-c---hat-w-----tdlg2-w--api.azurewebsites.net
WEB_API_NAME: app-c--hat-wmk--dlg2-we--pi
Writing environment variables to '/home/user/chat-copilot/scripts/deploy/../../webapp/.env'...
Writing swa-cli.config.json...
~/chat-copilot/webapp ~/chat-copilot/scripts/deploy
Installing yarn dependencies...
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'
shall I create a separate issue @alliscode ?
However, you need to update the line probably in the pointed steps
--resource-group rg-{YOUR_DEPLOYMENT_NAME} --deployment-name {YOUR_DEPLOYMENT_NAME}
in case of the resource group it should be resource group name rather than rg-{your-deployment_name}, in my opinion. Moreover, I've noticed that the script downloads some x64 things that probably wouldn't run on arm64
`
chat-copilot/webapi/bin/Release/net6.0/linux-x64/CopilotChatWebApi.dll
pdating: x86/ (stored 0%)
updating: x86/leptonica-1.82.0.dll (deflated 59%)
updating: x86/tesseract50.dll (deflated 53%)
updating: UglyToad.PdfPig.Core.dll (deflated 56%)
updating: System.Security.Permissions.dll (deflated 60%)
updating: System.IO.FileSystem.dll (deflated 48%)
updating: x64/ (stored 0%)
updating: x64/leptonica-1.82.0.dll (deflated 58%)
updating: x64/tesseract50.dll (deflated 54%)
`
deployment from azure cloud shell with powershell scrips wouldn't complete either succinctly as it would require to use npx somehow as it seems instead of npm install -g
@AndreV84 What version of yarn do you have installed on your system?
As for --resource-group rg-{YOUR_DEPLOYMENT_NAME} --deployment-name {YOUR_DEPLOYMENT_NAME}, by default the RG name will be "rg-" followed by your deployment name. I guess it is possible that the RG name could be completely different if you didn't use the scripts to create it. You're welcome to create a PR to change that line in the document.
Is your goal to install FROM arm64, or TO arm64? Installing FROM arm64 shouldn't be a problem. If you wish to install TO arm64, you'll need to adjust the ARM template as it is currently set to deploy the backend to a win64 machine. Then, you'd have to compile the backend for arm64 and deploy the binary to your app service. This is quite a lot more involved than simply using the "Deploy to Azure" button!
@glahaye thank you for pointing out the yarn issue; after addressing it it got all like running into another issue:
✔ Successfully setup project!
Deploying to environment: production
Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary
[swa] ✔ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.023911/linux/StaticSitesClient@1.0.023911
⠋ Preparing deployment. Please wait...
That seems similar to https://github.com/Azure/static-web-apps-cli/issues/615. but exporting the Invariant=1 won't resolve the issue
This takes a while (5 minutes) to complete. Did you wait that long?
Also, I'm working on something now with which it will be possible to deploy a complete Chat Copilot solution without needing anything but a browser. Hopefully, that will alleviate some of the difficulties you are facing.
I tried waiting 50+ minutes
I export first
~/.npm-global/bin/swa
then run the deployment sh script
otherwise it won't find swa
now I can see there is the component that was missed
:~/.swa/deploy$ ls 1.0.023911 StaticSitesClient.json
but reiterating yet just asks to wait
@glahaye
@glahaye it got x86_64 so it won't run on arm, as it seems
/.swa/deploy/1.0.023911$ ./StaticSitesClient bash: ./StaticSitesClient: cannot execute binary file: Exec format error
` yarn global add @azure/static-web-apps-cli
yarn global v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@azure/static-web-apps-cli@1.1.4" with binaries:
- swa
Done in 6.00s.
`
` swa --print-config
Welcome to Azure Static Web Apps CLI (1.1.4)
Options:
- port: 4280
- host: localhost
- apiPort: 7071
- dataApiPort: 5000
- appLocation: .
- apiLocation: <undefined>
- dataApiLocation: <undefined>
- outputLocation: .
- swaConfigLocation: <undefined>
- ssl: false
- sslCert: <undefined>
- sslKey: <undefined>
- appBuildCommand: <undefined>
- apiBuildCommand: <undefined>
- run: <undefined>
- verbose: log
- devserverTimeout: 60
- open: false
- githubActionWorkflowLocation: <undefined>
- appDevserverUrl: <undefined>
- apiDevserverUrl: <undefined>
- env: preview
- appName: <undefined>
- dryRun: false
- apiLanguage: node
- apiVersion: 16
- dataApiDevserverUrl: <undefined>
- subscriptionId: <undefined>
- resourceGroup: <undefined>
- tenantId: <undefined>
- clientId: <undefined>
- clientSecret: <undefined>
- useKeychain: true
- clearCredentials: false
- folderName: swa-db-connections
- config: swa-cli.config.json
- printConfig: true
→ No configuration found, running swa init...
? Choose a configuration name: › deploy
`
more occurrences https://github.com/Azure/static-web-apps/issues/734 In my opinion, we should be able to run the whole thing deployment from azure cloud shell
I'm surprised you couldn't run the static web site app on ARM since it's written in TypeScript.
At any rate, SWA is no longer needed to deploy the Chat Copilot. The static frontend files are now distributed from the webapi (backend) service app by default.
You can still host them from somewhere else if you want but by default you can just point to the web app service's address and things will just work.
@glahaye so what steps exactly I need to execute to apply the patch to azure deployment deployed by the click to azure button? The upgrade did not propagate automatically, right?so How to apply it to the already existent deployment done via 'click to azure'? so what are the steps to apply it? can it be applied via deploy to azure or requires several other commands executed from terminal or azure shell?
@AndreV84 If you click again on the Deploy to Azure button with the same parameters are before, you should be OK.
@glahaye pressing "Deploy to Azure button" did create a new deployment attempt [ I haven't figured out how to remove prior deployment ] but the updated deployment got some issues """ Your deployment failed Offering icon Deployment name : Microsoft.Template-20231029153709 Subscription Resource group :
: 10/29/2023, 3:37:12 PM Correlation ID : f03e8f15-5418-4cd0-b2f4-45e30878472d """ What are the steps to fix it? Xie Xie thanks AV
is there any way I could use Azure OpenAI as a proxy to access original OpenAI API?
how to purge this? cog-speech-copichat-wmkbwtavtdlg2' has been soft-deleted. To restore the resource, you must specify 'restore' to be 'true' in the property. If you don't want to restore existing resource, please purge it first. (Code: FlagMustBeSetForRestore)
executino of the line below won't work
az resource delete --ids /subscriptions/2763498723649872364-random-placeholder/providers/Microsoft.CognitiveServices/locations/eastus/resourceGroups/oai_studio/deletedAccounts/cog-speech-copichat-wmkbwtavtdlg2 --verbose
Command ran in 0.985 seconds (init: 0.121, invoke: 0.864)
then I found at Azure portal Speech services the entry in "manage deleted resources" purged it too but the error remains saying it needs to be purged
after changing the name the deployment reported suceed state but how do I open the app? https://app-copichat1-wmkbwtavtdlg2-webapi.azurewebsites.net/ it shows some core error is it the correct url to open web app?
The current ARM template deployment only deploys the webAPI from the most recent release. Customers are then instructed to run scripts from the repo to deploy the webApp - the problem with this is that the webApp from the latest source may not be compatible with the latest webAPI that was deployed.
A workaround is to download the code package from the latest release and run the webApp deployment from there, however this is a lot of extra steps for our customers to have to take and increases the friction and chances for failure.