Skip to content

Commit 2f93ecd

Browse files
authored
Merge pull request #471 from open-edge-platform/update-branch
feat: Edge AI Demo Studio update (#992)
2 parents 42b109d + a1da698 commit 2f93ecd

684 files changed

Lines changed: 65409 additions & 48215 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

usecases/ai/edge-ai-demo-studio/.gitignore

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,7 @@ __pycache__
1212
# Thirdparty
1313
/thirdparty/
1414
/workers/thirdparty
15-
/workers/embeddings/thirdparty
16-
/workers/text-generation/thirdparty
1715
/workers/text-to-speech/kokoro/thirdparty
18-
/workers/lipsync/modules/lipsync/wav2lip/wav2lip256
19-
/workers/lipsync/data/avatars
20-
/workers/lipsync/models
21-
/workers/lipsync/build
22-
23-
/workers/embeddings/data
24-
/workers/wake-word-detection/data
2516

2617
/models
2718

@@ -42,3 +33,5 @@ tmp
4233
!/out/setup.sh
4334
!/out/start_web.bat
4435
!/out/setup.bat
36+
37+
/.installed
Lines changed: 23 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,44 @@
1-
# Edge AI Demo Studio - Deployment
1+
# Deployment
22

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.
44

5-
## Deployment
5+
## 1. Package the app
66

7-
### Packaging the Electron App
7+
- Windows (PowerShell): run the packaging script:
88

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)
2910

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:
3212

33-
Make sure you have ran the root setup script before running the commands above.
13+
- [scripts/bash/package.sh](../scripts/bash/package.sh)
3414

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).
3616

37-
**Q: Why is Electron failed to install**
17+
## 2. Run the packaged application
3818

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):
4020

41-
For Linux:
42-
```bash
43-
export ELECTRON_GET_USE_PROXY=http://proxy:port
44-
```
21+
- `EdgeAIDemoStudio.exe`
4522

46-
For Windows (PowerShell):
23+
- Linux (Ubuntu, other distros): open a terminal, change into the unzipped application folder inside `out/` and run:
4724

48-
```powershell
49-
$env:ELECTRON_GET_USE_PROXY="http://proxy:port"
50-
```
25+
- `./EdgeAIDemoStudio`
5126

52-
**Q: Why do I not have permission to run PowerShell scripts?**
27+
If the binary is not executable, make it executable first:
5328

54-
This is usually due to Windows PowerShell's execution policy restrictions.
29+
- `chmod +x EdgeAIDemoStudio`
5530

56-
**Quick Solution (Recommended):** Run the script with the `-ExecutionPolicy Bypass` flag each time:
31+
## 3. Ubuntu / Electron sandbox notes
5732

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:
6334

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
6837
```
6938

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).
7140

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
7342

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.
4.33 MB
Loading
12.4 KB
Binary file not shown.
7.52 KB
Loading

usecases/ai/edge-ai-demo-studio/electron/electron-fuses.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2025 Intel Corporation
1+
// Copyright (C) 2026 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

44
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses');
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
; Custom NSIS installer script for EdgeAIDemoStudio
2+
;
3+
; Features:
4+
; - Default install directory: folder containing the installer + \EdgeAIDemoStudio
5+
; - Optional desktop shortcut page (checkbox, checked by default)
6+
7+
; ---- Shared declarations (included in every build pass) ---------------
8+
; Functions MUST be defined here (in customHeader, not inside customWelcomePage).
9+
; Defining Functions inside a macro that is itself expanded from within
10+
; electron-builder's assistedInstaller.nsh causes NSIS 3.0.4 to misparse
11+
; stack Pop operations inside those Functions.
12+
; Guard with !ifndef BUILD_UNINSTALLER so the uninstaller pass does not
13+
; declare variables/functions that are never referenced there (which would
14+
; trigger warning 6001 / 6010, promoted to errors by electron-builder).
15+
!macro customHeader
16+
!include "nsDialogs.nsh"
17+
!include "LogicLib.nsh"
18+
19+
!ifndef BUILD_UNINSTALLER
20+
Var /GLOBAL DesktopShortcutCtrl
21+
Var /GLOBAL CreateDesktopShortcut
22+
23+
Function DesktopShortcutPageCreate
24+
nsDialogs::Create 1018
25+
Pop $0
26+
${If} $0 == error
27+
Abort
28+
${EndIf}
29+
30+
${NSD_CreateLabel} 0 0 100% 20u "Additional options"
31+
Pop $0
32+
33+
${NSD_CreateCheckbox} 0 28u 100% 14u "Create a shortcut on the Desktop"
34+
Pop $DesktopShortcutCtrl
35+
36+
; Unchecked by default
37+
${NSD_SetState} $DesktopShortcutCtrl ${BST_UNCHECKED}
38+
39+
nsDialogs::Show
40+
FunctionEnd
41+
42+
Function DesktopShortcutPageLeave
43+
${NSD_GetState} $DesktopShortcutCtrl $CreateDesktopShortcut
44+
FunctionEnd
45+
!endif
46+
!macroend
47+
48+
; ---- Default install directory ----------------------------------------
49+
; $EXEDIR = directory that contains the running installer .exe
50+
!macro customInit
51+
StrCpy $INSTDIR "$EXEDIR"
52+
!macroend
53+
54+
; ---- Register the custom page in the installer wizard -----------------
55+
; Only contains the Page directive — no Function definitions here.
56+
!macro customWelcomePage
57+
Page custom DesktopShortcutPageCreate DesktopShortcutPageLeave
58+
!macroend
59+
60+
; ---- Create desktop shortcut when user opted in ----------------------
61+
!macro customInstall
62+
${If} $CreateDesktopShortcut == ${BST_CHECKED}
63+
CreateShortCut "$DESKTOP\EdgeAIDemoStudio.lnk" "$INSTDIR\EdgeAIDemoStudio.exe"
64+
${EndIf}
65+
!macroend
66+
67+
; ---- Remove desktop shortcut on uninstall ----------------------------
68+
!macro customUnInstall
69+
Delete "$DESKTOP\EdgeAIDemoStudio.lnk"
70+
!macroend

0 commit comments

Comments
 (0)