|
1 | | -# Edge AI Demo Studio - Deployment |
| 1 | +# Deployment |
2 | 2 |
|
3 | | -This directory contains the Deployment instructions for Edge AI Demo Studio. |
| 3 | +This document explains how to package and run the application builds for Windows and Linux. |
4 | 4 |
|
5 | | -## Deployment |
| 5 | +## 1. Package the app |
6 | 6 |
|
7 | | -### Packaging the Electron App |
| 7 | +- Windows (PowerShell): run the packaging script: |
8 | 8 |
|
9 | | -For Linux: |
10 | | -```bash |
11 | | -../scripts/bash/package.sh |
12 | | -``` |
13 | | -For Windows (PowerShell/Command Prompt): |
14 | | -```bash |
15 | | -../scripts/win/package.ps1 |
16 | | -``` |
17 | | - |
18 | | -This script will help ensure all dependencies are installed and configured correctly before packaging and then it will create the package in [electron/out](../electron/out). |
19 | | - |
20 | | -If you have permission issue running the package script in Windows, please refer to [FAQ](#faq) |
21 | | - |
22 | | -## Running on Ubuntu 24.04 |
23 | | - |
24 | | -If you're running the packaged Electron app on Ubuntu 24.04, you may need to adjust AppArmor settings to allow the application to run properly: |
25 | | - |
26 | | -```bash |
27 | | -sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 |
28 | | -``` |
| 9 | +- [scripts/win/package.ps1](../scripts/win/package.ps1) |
29 | 10 |
|
30 | | -This command disables AppArmor restrictions on unprivileged user namespaces, which is required for Electron apps to function correctly on Ubuntu 24.04. |
31 | | -## Prerequisites |
| 11 | +- Linux / macOS (bash): run the packaging script: |
32 | 12 |
|
33 | | -Make sure you have ran the root setup script before running the commands above. |
| 13 | +- [scripts/bash/package.sh](../scripts/bash/package.sh) |
34 | 14 |
|
35 | | -## FAQ |
| 15 | +The packaging scripts produce an `out/` folder. Inside `out/` you'll find the packaged build artifacts — a ZIP archive and an unzipped application directory (the application folder). |
36 | 16 |
|
37 | | -**Q: Why is Electron failed to install** |
| 17 | +## 2. Run the packaged application |
38 | 18 |
|
39 | | -If you are running behind a proxy, please ensure you set proxy for Electron as below: |
| 19 | + - Windows: open the unzipped application folder inside `out/` and run the EXE (double-click or from PowerShell): |
40 | 20 |
|
41 | | -For Linux: |
42 | | -```bash |
43 | | -export ELECTRON_GET_USE_PROXY=http://proxy:port |
44 | | -``` |
| 21 | + - `EdgeAIDemoStudio.exe` |
45 | 22 |
|
46 | | -For Windows (PowerShell): |
| 23 | + - Linux (Ubuntu, other distros): open a terminal, change into the unzipped application folder inside `out/` and run: |
47 | 24 |
|
48 | | -```powershell |
49 | | -$env:ELECTRON_GET_USE_PROXY="http://proxy:port" |
50 | | -``` |
| 25 | + - `./EdgeAIDemoStudio` |
51 | 26 |
|
52 | | -**Q: Why do I not have permission to run PowerShell scripts?** |
| 27 | + If the binary is not executable, make it executable first: |
53 | 28 |
|
54 | | -This is usually due to Windows PowerShell's execution policy restrictions. |
| 29 | + - `chmod +x EdgeAIDemoStudio` |
55 | 30 |
|
56 | | -**Quick Solution (Recommended):** Run the script with the `-ExecutionPolicy Bypass` flag each time: |
| 31 | +## 3. Ubuntu / Electron sandbox notes |
57 | 32 |
|
58 | | -```powershell |
59 | | -powershell -ExecutionPolicy Bypass -NoProfile -File package.ps1 |
60 | | -``` |
61 | | - |
62 | | -This bypasses the execution policy for that single command without changing system settings. |
| 33 | +Some Linux systems restrict unprivileged user namespaces, which can prevent Electron's sandbox from working. If the app fails to start due to sandboxing, enable unprivileged user namespaces and reload sysctl settings: |
63 | 34 |
|
64 | | -**Alternative (Persistent Solution):** If you don't want to type the long command every time, you can change the execution policy for your entire PC. Open PowerShell as Administrator and run: |
65 | | - |
66 | | -```powershell |
67 | | -Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine |
| 35 | +```bash |
| 36 | +sudo sysctl -w kernel.unprivileged_userns_clone=1 |
68 | 37 | ``` |
69 | 38 |
|
70 | | -When prompted, type `Y` to confirm. |
| 39 | +After that change the setting persists across reboots. If enabling user namespaces is not possible in your environment, you can run the app with the `--no-sandbox` flag as a temporary workaround (not recommended for production). |
71 | 40 |
|
72 | | -**Note:** Only change the execution policy if you understand the security implications. `RemoteSigned` allows locally created scripts to run but requires downloaded scripts to be signed by a trusted publisher. You can revert to the default policy later with: |
| 41 | +## 4. Troubleshooting |
73 | 42 |
|
74 | | -```powershell |
75 | | -Set-ExecutionPolicy Restricted |
76 | | -``` |
| 43 | +- If packaging fails, inspect the packaging script output in the terminal. |
| 44 | +- Check `resources/logs/` in the repository for runtime errors from the packaged app. |
0 commit comments