-
Notifications
You must be signed in to change notification settings - Fork 0
Azure mvp deploy #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure mvp deploy #16
Changes from all commits
eee7cb1
5fca969
a10e886
beb94b9
7ee7858
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
|
|
||
| from .backend_client import BackendClient | ||
| from .config import Config | ||
| from .detector import DetectorBackend, build_detector | ||
| from .detector import DEFAULT_YOLOE_PROMPTS, DetectorBackend, build_detector | ||
| from .events import extract_events | ||
| from .reid import ReIDExtractor | ||
| from .s3 import ClipStore | ||
|
|
@@ -53,12 +53,23 @@ def process_job(job: dict, cfg: Config, store: ClipStore, detector: DetectorBack | |
| def main() -> None: | ||
| cfg = Config.load() | ||
| host, _, port = cfg.redis_connection.partition(":") | ||
| r = redis.Redis(host=host, port=int(port or 6379), decode_responses=True) | ||
| r = redis.Redis( | ||
| host=host, | ||
| port=int(port or 6379), | ||
| decode_responses=True, | ||
| socket_timeout=None, | ||
| socket_connect_timeout=5, | ||
| ) | ||
|
Comment on lines
+56
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Files:"
git ls-files | sed -n '1,120p'
echo
echo "cloud-ai/app/main.py outline:"
ast-grep outline cloud-ai/app/main.py || true
echo
echo "cloud-ai/app/main.py relevant lines:"
cat -n cloud-ai/app/main.py | sed -n '1,130p'
echo
echo "docs AZURE_MVP_DEPLOY relevant lines:"
cat -n docs/AZURE_MVP_DEPLOY.md | sed -n '140,180p'
echo
echo "Search Redis socket_timeout and BRPOP:"
rg -n "socket_timeout|BRPOP|decode_responses|redis\.Redis|Timeout reading from socket|worker" cloud-ai app docs .env.example infra -S || trueRepository: baasith6/camera-phase-1 Length of output: 13886 🌐 Web query:
💡 Result: In redis-py, the interaction between the client's socket_timeout and blocking commands like BRPOP has evolved significantly to resolve historical issues where socket-level timeouts would prematurely terminate blocking operations [1][2][3]. 1. Understanding the Timeouts - socket_timeout: This is a client-level configuration that sets a timeout for all low-level socket read/write operations [4][5]. If set to None (the default), the client waits indefinitely for a response from the Redis server [4]. - BRPOP timeout: This is an application-level parameter sent to the Redis server, which determines how long the server should wait for an element to become available in the specified list(s) [6]. A timeout of 0 instructs the server to block indefinitely [6]. 2. Historical Behavior and Issues Previously, if a user set a socket_timeout that was shorter than the BRPOP command's timeout, the client would raise a redis.exceptions.TimeoutError when the socket read exceeded the socket_timeout, even if the Redis server was still waiting for data [1][7]. Users often had to manually work around this by either using a separate Redis client instance without a socket_timeout for blocking operations or by setting the socket_timeout to be longer than the intended blocking duration [7][8]. 3. Current Behavior Recent updates to redis-py have addressed this by introducing logic to identify blocking commands [2][3]. When a blocking command (e.g., BRPOP, BLPOP, BZMPOP) is executed, the client now effectively bypasses or manages the socket_timeout for that specific operation [2][3]. Specifically, the client passes an internal indicator to the connection's read response method, which allows the socket to wait for the duration specified by the server (or indefinitely if the command timeout is 0) without being prematurely cut off by the client's global socket_timeout [2][3]. This ensures that the Redis server maintains control over the blocking duration, as intended [2]. Best Practice While the library now handles this automatically, it is still strongly recommended to set a non-None socket_timeout for production clients to prevent applications from hanging indefinitely in the event of network partitions or dead connections [4]. If your application requires robust blocking behavior, ensure you are using a current version of redis-py to take advantage of these improvements [2]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "redis dependency declarations:"
rg -n "redis\s*[:=][<>=~^>]*|redis" cloud-ai/requirements*.txt pyproject.toml poetry.lock Pipfile.lock cloud-ai/Dockerfile -S || true
echo
echo "redis-py changelog/docs availability in repo:"
fd -i 'redis|requirements|pyproject|poetry.lock|lock|Dockerfile|rfdetr|pip' cloud-ai -t f -x sh -c 'echo "--- $1"; sed -n "1,160p" "$1"' sh {}Repository: baasith6/camera-phase-1 Length of output: 1463 Keep Redis reads bounded and align the troubleshooting guidance.
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| store = ClipStore(cfg) | ||
| backend = BackendClient(cfg.backend_url, cfg.service_key) | ||
|
|
||
| print(f"[cloud-ai] loading backend={cfg.model_backend} model={cfg.model} device={cfg.device} ...", flush=True) | ||
| detector = build_detector(cfg.model_backend, cfg.model, cfg.device, cfg.yoloe_prompts) | ||
| active_prompts = cfg.yoloe_prompts or DEFAULT_YOLOE_PROMPTS | ||
| print( | ||
| f"[cloud-ai] YOLOE prompts ({len(active_prompts)}): {', '.join(active_prompts.keys())}", | ||
|
Comment on lines
67
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift Align prompt override semantics across runtime and deployment documentation. A non-empty
📍 Affects 4 files
🤖 Prompt for AI Agents |
||
| flush=True, | ||
| ) | ||
| reid_extractor = ReIDExtractor(device=cfg.device) | ||
| print("[cloud-ai] ready, waiting for clip jobs", flush=True) | ||
|
|
||
|
|
@@ -94,6 +105,9 @@ def main() -> None: | |
| print(f"[cloud-ai] clip {job.get('clipId')} dead-lettered after " | ||
| f"{MAX_RETRIES} attempts", flush=True) | ||
|
|
||
| except redis.TimeoutError: | ||
| # BRPOP idle timeout with socket_timeout=None should return None; ignore stray timeouts. | ||
| continue | ||
|
Comment on lines
+108
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== candidate files =="
git ls-files | rg '(^|/)main\.py$|cloud-ai/app/main\.py' || true
echo "== file outline/size =="
wc -l cloud-ai/app/main.py
ast-grep outline cloud-ai/app/main.py --view expanded || true
echo "== relevant section =="
sed -n '70,125p' cloud-ai/app/main.py
echo "== redis/lpush occurrences =="
rg -n "TimeoutError|brpop|lpush|continue|retry|dead" cloud-ai/app/main.pyRepository: baasith6/camera-phase-1 Length of output: 3584 🌐 Web query:
💡 Result: In the redis-py library, there is no exception named TimeoutOperationError. The standard exception for operation timeouts is redis.exceptions.TimeoutError [1][2]. Redis-py includes built-in, configurable support for retrying operations that fail due to transient errors, such as TimeoutError and ConnectionError [3][4]. Retry and Backoff Configuration: You can configure retry behavior by passing a Retry object to your Redis client instance [3][5]. This object allows you to specify a backoff strategy and the maximum number of retry attempts [6][3]. 1. Retry Instance: Defines how many times to retry and which exceptions trigger a retry [3]. 2. Backoff Strategy: Controls the delay between retry attempts. Common strategies include ExponentialBackoff, ExponentialWithJitterBackoff, and ConstantBackoff [7]. Using jitter (e.g., ExponentialWithJitterBackoff) is recommended to prevent thundering herd problems [3][7]. 3. Supported Errors: The Retry instance includes a supported_errors parameter to specify which exceptions should trigger a retry. By default, this typically includes ConnectionError and TimeoutError [6][3]. Example Configuration: Below is an example of how to configure a client with retry logic and exponential backoff: from redis import Redis from redis.retry import Retry from redis.backoff import ExponentialBackoff from redis.exceptions import ConnectionError, TimeoutError # Configure retry: 3 attempts, exponential backoff starting at 1 second, capped at 10 seconds retry_strategy = Retry(ExponentialBackoff(cap=10, base=1), 3) client = Redis( host='localhost', port=6379, retry=retry_strategy, retry_on_error=[ConnectionError, TimeoutError]) Default Behavior: As of recent versions (6.0.0+), redis-py automatically attempts a failed command three times by default using an exponential backoff strategy with jitter if no explicit retry configuration is provided [3]. Important Considerations: - Timeouts: Ensure your socket_timeout and socket_connect_timeout are set to appropriate values. Timeouts that are too short may trigger unnecessary retries for commands that would have succeeded, while excessively long timeouts can cause application threads to hang [3]. - Pipelines: Be aware that historical issues have been reported where retry logic did not behave as expected during pipeline execution [8]. Always verify behavior in your specific environment if using pipelines. Citations:
Scope the timeout handler to The outer 🤖 Prompt for AI Agents |
||
| except Exception as e: # noqa: BLE001 | ||
| # Worker-level error (Redis, etc.) — don't lose the current job. | ||
| print(f"[cloud-ai] worker error: {e}", flush=True) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # AUTO-GENERATED by installer/build.ps1 - do not edit by hand. | ||
| BAKED_BACKEND_URL = "http://localhost:8081" | ||
| BAKED_BACKEND_URL = "http://20.193.69.220:8081" | ||
| BAKED_AT_BUILD = True |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,8 @@ | |||||||||||||||||||||||||||||||||||||
| param( | ||||||||||||||||||||||||||||||||||||||
| [Parameter(Mandatory = $true)] | ||||||||||||||||||||||||||||||||||||||
| [string]$BackendUrl, | ||||||||||||||||||||||||||||||||||||||
| [string]$PythonPath = "", | ||||||||||||||||||||||||||||||||||||||
| [string]$IsccPath = "", | ||||||||||||||||||||||||||||||||||||||
| [switch]$AllowHttp | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
@@ -23,17 +25,58 @@ function Assert-BackendUrl([string]$Url, [bool]$AllowHttp) { | |||||||||||||||||||||||||||||||||||||
| throw "Production requires HTTPS (or http://localhost / http://127.0.0.1 for local builds). Got: $Url. Use -AllowHttp for MVP pilot without TLS." | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| function Find-ISCC { | ||||||||||||||||||||||||||||||||||||||
| function Find-ISCC([string]$ExplicitPath) { | ||||||||||||||||||||||||||||||||||||||
| $candidates = @( | ||||||||||||||||||||||||||||||||||||||
| $ExplicitPath, | ||||||||||||||||||||||||||||||||||||||
| $env:ONEVO_ISCC, | ||||||||||||||||||||||||||||||||||||||
| "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe", | ||||||||||||||||||||||||||||||||||||||
| "${env:ProgramFiles}\Inno Setup 6\ISCC.exe", | ||||||||||||||||||||||||||||||||||||||
| "$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe", | ||||||||||||||||||||||||||||||||||||||
| (Get-Command ISCC -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source) | ||||||||||||||||||||||||||||||||||||||
| ) | Where-Object { $_ -and (Test-Path $_) } | ||||||||||||||||||||||||||||||||||||||
| if (-not $candidates) { | ||||||||||||||||||||||||||||||||||||||
| throw "Inno Setup 6 (ISCC.exe) was not found. Install from https://jrsoftware.org/isdl.php" | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
| $userRoots = Get-ChildItem 'C:\Users' -Directory -ErrorAction SilentlyContinue | | ||||||||||||||||||||||||||||||||||||||
| Where-Object { $_.Name -notin @('Public', 'Default', 'Default User', 'All Users') } | ||||||||||||||||||||||||||||||||||||||
| foreach ($user in $userRoots) { | ||||||||||||||||||||||||||||||||||||||
| $candidates += @( | ||||||||||||||||||||||||||||||||||||||
| (Join-Path $user.FullName 'AppData\Local\Programs\Inno Setup 6\ISCC.exe'), | ||||||||||||||||||||||||||||||||||||||
| (Join-Path $user.FullName 'AppData\Local\Programs\Inno Setup 6\Compil32.exe') | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+40
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | grep -E '(^|/)build\.ps1$|Connector' | head -100
echo "== target =="
if [ -f connector/installer/build.ps1 ]; then
cat -n connector/installer/build.ps1
else
fd -a 'build\.ps1$' . | sed -n '1,80p'
fi
echo "== search iscc usage =="
rg -n "Compil32|ISCC|& \$iscc|\.(\$iscc)|Invoke|Start" connector/installer 2>/dev/null || trueRepository: baasith6/camera-phase-1 Length of output: 9382 🌐 Web query:
💡 Result: Inno Setup provides two primary executables for compiling installation scripts: Compil32.exe and ISCC.exe. Both rely on the same core compilation engine (ISCmplr.dll) to generate installers [1]. Compil32.exe Compil32.exe is the GUI-based Integrated Development Environment (IDE) for Inno Setup [1]. It is primarily designed for developers to interactively write, edit, and compile installation scripts (.iss files) [1]. While it can be invoked from the command line using the /cc parameter (e.g., compil32 /cc "script.iss"), it is not intended for headless or silent automation, as it does not suppress the progress display or graphical error messages [2][3]. ISCC.exe ISCC.exe (Inno Setup Command-line Compiler) is a dedicated console-mode application specifically designed for command-line usage [2][4]. It is the recommended tool for build automation, continuous integration pipelines, and any scenario requiring silent or non-interactive compilation [5][4]. Key differences and features: - Usage: Use ISCC.exe for scripts, batch files, and automated build environments [5][4]. Use Compil32.exe for manual script development and editing [1]. - Silent Compilation: ISCC.exe supports quiet mode via the /Q or /Qp flags, allowing you to hide progress displays or suppress output except for error messages [2][4]. - Command-line Options: ISCC.exe accepts various parameters to override script directives at runtime, such as /O (output path), /F (output filename), and /S (SignTool configuration) [2][4]. It also supports extended parameters for the Inno Setup Preprocessor (ISPP) [6]. - Exit Codes: Both compilers return standard exit codes: 0 for success, 1 for invalid parameters/internal errors, and 2 for compilation failure [2][3]. For command-line automation, the standard practice is to use ISCC.exe [5][7]. You can verify available options by running iscc /? in your command prompt [5][4]. Citations:
Do not select The build invokes the selected compiler synchronously ( 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| return ($candidates | Select-Object -First 1) | ||||||||||||||||||||||||||||||||||||||
| $found = $candidates | Where-Object { $_ -and (Test-Path $_) } | Select-Object -First 1 | ||||||||||||||||||||||||||||||||||||||
| if (-not $found) { | ||||||||||||||||||||||||||||||||||||||
| throw "Inno Setup 6 (ISCC.exe) was not found. Install from https://jrsoftware.org/isdl.php or set ONEVO_ISCC." | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| return $found | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| function Find-Python([string]$ExplicitPath) { | ||||||||||||||||||||||||||||||||||||||
| $candidates = @( | ||||||||||||||||||||||||||||||||||||||
| $ExplicitPath, | ||||||||||||||||||||||||||||||||||||||
| $env:ONEVO_PYTHON, | ||||||||||||||||||||||||||||||||||||||
| $env:PYTHON_EXE, | ||||||||||||||||||||||||||||||||||||||
| (Get-Command python -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source), | ||||||||||||||||||||||||||||||||||||||
| "$env:LOCALAPPDATA\Python\bin\python.exe", | ||||||||||||||||||||||||||||||||||||||
| "$env:LOCALAPPDATA\Programs\Python\Python314\python.exe", | ||||||||||||||||||||||||||||||||||||||
| "$env:LOCALAPPDATA\Programs\Python\Python313\python.exe", | ||||||||||||||||||||||||||||||||||||||
| "$env:LOCALAPPDATA\Programs\Python\Python312\python.exe", | ||||||||||||||||||||||||||||||||||||||
| "$env:LOCALAPPDATA\Programs\Python\Python311\python.exe" | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
| $userRoots = Get-ChildItem 'C:\Users' -Directory -ErrorAction SilentlyContinue | | ||||||||||||||||||||||||||||||||||||||
| Where-Object { $_.Name -notin @('Public', 'Default', 'Default User', 'All Users') } | ||||||||||||||||||||||||||||||||||||||
| foreach ($user in $userRoots) { | ||||||||||||||||||||||||||||||||||||||
| $candidates += @( | ||||||||||||||||||||||||||||||||||||||
| (Join-Path $user.FullName 'AppData\Local\Python\bin\python.exe'), | ||||||||||||||||||||||||||||||||||||||
| (Join-Path $user.FullName 'AppData\Local\Programs\Python\Python314\python.exe'), | ||||||||||||||||||||||||||||||||||||||
| (Join-Path $user.FullName 'AppData\Local\Programs\Python\Python313\python.exe'), | ||||||||||||||||||||||||||||||||||||||
| (Join-Path $user.FullName 'AppData\Local\Programs\Python\Python312\python.exe'), | ||||||||||||||||||||||||||||||||||||||
| (Join-Path $user.FullName 'AppData\Local\Programs\Python\Python311\python.exe') | ||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| $found = $candidates | Where-Object { $_ -and (Test-Path $_) } | Select-Object -First 1 | ||||||||||||||||||||||||||||||||||||||
| if (-not $found) { | ||||||||||||||||||||||||||||||||||||||
| throw "Python was not found. Set ONEVO_PYTHON or install Python 3.11+ and add it to PATH." | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| return $found | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| $BackendUrl = Assert-BackendUrl $BackendUrl $AllowHttp.IsPresent | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -51,8 +94,8 @@ try { | |||||||||||||||||||||||||||||||||||||
| throw "Invalid WinSW XML ($WinSwConfig): $($_.Exception.Message)" | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| $py = Get-Command python -ErrorAction SilentlyContinue | ||||||||||||||||||||||||||||||||||||||
| if (-not $py) { throw "Python was not found on PATH" } | ||||||||||||||||||||||||||||||||||||||
| $python = Find-Python $PythonPath | ||||||||||||||||||||||||||||||||||||||
| Write-Host "==> Python: $python" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| $baked = @" | ||||||||||||||||||||||||||||||||||||||
| # AUTO-GENERATED by installer/build.ps1 - do not edit by hand. | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -66,10 +109,13 @@ New-Item -ItemType Directory -Force -Path $DistDir | Out-Null | |||||||||||||||||||||||||||||||||||||
| $pyinstallerOut = Join-Path $DistDir "onevo-connector.exe" | ||||||||||||||||||||||||||||||||||||||
| if (Test-Path $pyinstallerOut) { Remove-Item $pyinstallerOut -Force } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| Write-Host "==> PyInstaller deps..." | ||||||||||||||||||||||||||||||||||||||
| & $python -m pip install -q -r (Join-Path $ConnectorRoot "requirements.txt") -r (Join-Path $ConnectorRoot "requirements-build.txt") | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| Write-Host "==> PyInstaller..." | ||||||||||||||||||||||||||||||||||||||
| Push-Location $ConnectorRoot | ||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||
| & python -m PyInstaller --noconfirm --clean --distpath $DistDir --workpath (Join-Path $DistDir "build") $SpecFile | ||||||||||||||||||||||||||||||||||||||
| & $python -m PyInstaller --noconfirm --clean --distpath $DistDir --workpath (Join-Path $DistDir "build") $SpecFile | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+112
to
+118
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== file exists and relevant lines =="
if [ -f connector/installer/build.ps1 ]; then
nl -ba connector/installer/build.ps1 | sed -n '90,135p'
else
echo "connector/installer/build.ps1 not found"
fi
echo
echo "== search for PowerShell exit code handling in same file =="
rg -n 'LASTEXITCODE|exit|pip|PyInstaller|Set-StrictMode|ErrorAction' connector/installer/build.ps1 || true
echo
echo "== package manifest snippets if present =="
git ls-files | rg '(^|/)requirements.*\.txt$|package\.json|pyproject\.toml|Pipfile|poetry\.lock' || trueRepository: baasith6/camera-phase-1 Length of output: 238 🏁 Script executed: #!/bin/sh
set -euo pipefail
echo "== file metadata =="
test -f connector/installer/build.ps1 && echo "found" || echo "missing"
echo
echo "== relevant lines using awk =="
if [ -f connector/installer/build.ps1 ]; then
awk 'NR>=100 && NR<=130 { printf "%6d\t%s\n", NR, $0 }' connector/installer/build.ps1
fi
echo
echo "== PowerShell / pip / exit handling references =="
if [ -f connector/installer/build.ps1 ]; then
grep -nE 'LASTEXITCODE|Set-StrictMode|ExitCode|pip|PyInstaller|try|catch|throw|exit ' connector/installer/build.ps1 || true
fi
echo
echo "== repository shell availability =="
command -v bash || true
command -v awk || true
command -v sed || true
command -v python3 || true
command -v node || trueRepository: baasith6/camera-phase-1 Length of output: 3206 🌐 Web query:
💡 Result: By default, PowerShell does not stop execution when a native (external) executable returns a non-zero exit code [1][2]. This occurs because native programs operate outside of PowerShell's internal error-handling system, which typically relies on exceptions [1][3]. Instead, native programs report success or failure solely through the Citations:
🏁 Script executed: #!/bin/sh
set -euo pipefail
echo "== PowerShell handling at top of build.ps1 =="
awk 'NR>=1 && NR<=90 { printf "%6d\t%s\n", NR, $0 }' connector/installer/build.ps1
echo
echo "== explicit native-command error handling settings in repository =="
grep -rnE 'PSNativeCommandUseErrorActionPreference|ErrorActionPreference|\$Err[A-Za-z]+ErrorActionPreference' . || true
echo
echo "== pip install invocations and immediate status checks in repository =="
grep -rnE '& \$python -m pip install|\$python -m pip install|\$LASTEXITCODE|\$?' connector/installer/build.ps1 || trueRepository: baasith6/camera-phase-1 Length of output: 11928 Fail immediately when dependency installation fails. The Proposed fix & $python -m pip install -q -r (Join-Path $ConnectorRoot "requirements.txt") -r (Join-Path $ConnectorRoot "requirements-build.txt")
+if ($LASTEXITCODE -ne 0) {
+ throw "Dependency installation failed (exit $LASTEXITCODE)."
+}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| if ($LASTEXITCODE -ne 0) { | ||||||||||||||||||||||||||||||||||||||
| throw "PyInstaller build failed (exit $LASTEXITCODE). Ensure pip install -r requirements-build.txt was run." | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -81,7 +127,7 @@ if (-not (Test-Path $pyinstallerOut)) { | |||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| Write-Host "==> Built $pyinstallerOut" | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| $iscc = Find-ISCC | ||||||||||||||||||||||||||||||||||||||
| $iscc = Find-ISCC $IsccPath | ||||||||||||||||||||||||||||||||||||||
| Write-Host "==> Inno Setup: $iscc" | ||||||||||||||||||||||||||||||||||||||
| & $iscc $IssFile | ||||||||||||||||||||||||||||||||||||||
| if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed (exit $LASTEXITCODE)" } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ param( | |
| [string]$VmAppDir = "/opt/onevo/app", | ||
| [string]$BackendUrl = "http://20.193.69.220:8081", | ||
| [string]$SshKeyPath = "", | ||
| [string]$PythonPath = "", | ||
| [string]$IsccPath = "", | ||
| [switch]$SkipInstaller, | ||
| [switch]$SkipBuild, | ||
| [switch]$UseGpu | ||
|
|
@@ -81,7 +83,10 @@ if (-not $SkipInstaller) { | |
| Write-Host "==> Ensuring installer tools (ffmpeg, WinSW)..." | ||
| & (Join-Path $root "scripts\ensure-installer-tools.ps1") | ||
| Write-Host "==> Building Windows installer..." | ||
| & (Join-Path $root "scripts\build-installer.ps1") -BackendUrl $BackendUrl -AllowHttp | ||
| $installerArgs = @{ BackendUrl = $BackendUrl; AllowHttp = $true } | ||
| if ($PythonPath) { $installerArgs.PythonPath = $PythonPath } | ||
| if ($IsccPath) { $installerArgs.IsccPath = $IsccPath } | ||
| & (Join-Path $root "scripts\build-installer.ps1") @installerArgs | ||
|
Comment on lines
+86
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift Restore HTTPS enforcement for public connector traffic. The deployment always passes
📍 Affects 2 files
🤖 Prompt for AI Agents |
||
| $installerExe = Get-ChildItem (Join-Path $root "connector\dist\ONEVO-Connector-Setup-*.exe") | | ||
| Sort-Object LastWriteTime -Descending | Select-Object -First 1 | ||
| if (-not $installerExe) { throw "Installer EXE not found after build" } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Move tool paths out of the pipeline source.
agent anycan run under a different node or service account, whereC:\Users\Abdul Baasith\...does not exist; the current documentation also makes operators edit versioned pipeline code for machine configuration.Jenkinsfile#L15-L16: remove the profile-specific values and obtainONEVO_PYTHON/ONEVO_ISCCfrom node-level Jenkins environment configuration.docs/JENKINS_DEPLOY.md#L15-L16: instruct operators to configure both variables on the Jenkins agent/service account, not inJenkinsfile.docs/JENKINS_DEPLOY.md#L94-L94: include Python-path configuration alongside ISCC troubleshooting.📍 Affects 2 files
Jenkinsfile#L15-L16(this comment)docs/JENKINS_DEPLOY.md#L15-L16docs/JENKINS_DEPLOY.md#L94-L94🤖 Prompt for AI Agents