Lumina Air · 執行、啟動與除錯
線上 Demo 經 agentatworklinux 連線至 AirCoreForge 的既有服務;Windows/Mac 本機套件仍是獨立的合成資料預覽。
Use Case 1 · 航班營運與轉機照護
本機先完整解壓 ZIP,進入 lumina-air-local/launchers。
Windows:雙擊 Start-UC1.cmd。清除已驗證的舊程序並重啟:.\Start-UC1.cmd -Action restart。檢查:.\Start-UC1.cmd -Action doctor。
Mac:雙擊 Start-UC1.command,或在 Terminal 執行 bash Start-UC1.command。重啟:bash Start-UC1.command restart。檢查:bash Start-UC1.command doctor。
本機網址:http://127.0.0.1:8601/(完成本機啟動後使用)。
Use Case 2 · 個人化附加服務與營收機會
本機先完整解壓 ZIP,進入 lumina-air-local/launchers。
Windows:雙擊 Start-UC2.cmd。清除已驗證的舊程序並重啟:.\Start-UC2.cmd -Action restart。檢查:.\Start-UC2.cmd -Action doctor。
Mac:雙擊 Start-UC2.command,或在 Terminal 執行 bash Start-UC2.command。重啟:bash Start-UC2.command restart。檢查:bash Start-UC2.command doctor。
本機網址:http://127.0.0.1:8602/(完成本機啟動後使用)。
完整啟動與除錯說明
需要 Python 3.11+;首次需網路安裝依賴。連接埠由其他程式佔用時會提示檢查,保留不明程序。
# Lumina Air:Windows / Mac 本機啟動與除錯 這份套件包含 UC1、UC2 程式,預設在本機執行合成資料預覽。UC1 使用 SQLite,UC2 使用 CSV;不需要 Wallet 或 Oracle 密碼。 ## 先選執行位置 - agentatworklinux:首頁各 Demo 的「開啟 Demo」使用伺服器,不需要本機 Python。系統部署完成後由 systemd 開機啟動、失敗自動重啟。 - Windows / Mac:已有本機套件時,完整解壓到固定、可寫入的資料夾。不要從 ZIP 檢視器直接雙擊。安裝 Python 3.11 以上,首次需要網路安裝套件。 - 本機 UC1 預設 http://127.0.0.1:8601/;UC2 預設 http://127.0.0.1:8602/。兩者與伺服器 8501 / 8502 分開。 ## Windows 1. 安裝 Python 3.11+,包含 `py.exe` launcher。 2. 在解壓後的 `lumina-air-local/launchers`,雙擊 `Start-UC1.cmd` 或 `Start-UC2.cmd`。首次建立 `.venv`、安裝套件及時區資料,健康檢查成功後開啟瀏覽器。 3. 在 PowerShell 切換到 `launchers` 後可執行: ```powershell .\Start-UC1.cmd -Action restart .\Start-UC2.cmd -Action restart .\Start-UC1.cmd -Action doctor .\Start-UC2.cmd -Action doctor .\Start-UC1.cmd -Action stop .\Start-UC2.cmd -Action stop .\Start-UC1.cmd -Port 8701 ``` `restart` 會核對此套件記錄的程序 ID、啟動身分與完整程式路徑,再停止舊程序,釋放舊 port,重新啟動並檢查。清除 UC1 程序也會清除該程序的連線池。 ## Mac 安裝 Python 3.11+。若系統 Python 太舊,請使用你已安裝的新 Python 執行 `python3.11 bootstrap.py`(版本名稱依實際安裝調整)。在 `launchers` 雙擊 `Start-UC1.command` 或 `Start-UC2.command`;若下載後可執行權限未保留,在 Terminal 切到該目錄後執行: ```bash chmod +x *.command ./Start-UC1.command ./Start-UC2.command ./Start-UC1.command restart ./Start-UC2.command restart ./Start-UC1.command doctor ./Start-UC2.command doctor ./Start-UC1.command stop ./Start-UC2.command stop ./Start-UC1.command start --port 8701 ``` 也可用 `bash Start-UC1.command` 執行,不必調整權限。不要為了啟動套件關閉整台機器的 Gatekeeper。 ## 舊 port 佔用、檢查與除錯 1. `start` 會檢查 port;若本套件已在相同模式、port、設定目錄健康執行,直接沿用。 2. `restart` 只清除此套件記錄且程序身分仍相符的舊程序;PID 被其他程序重用時不會終止它。停止超過 10 秒會停止操作並提示人工檢查,不強制殺掉其他程序。 3. 若 port 被其他套件、另一份副本或 SSH tunnel 佔用,工具會停止啟動並印出檢查指令。請關閉原本的 Terminal / tunnel 或改用 `--port`(Windows 使用 `-Port`)。不使用 `taskkill /IM python.exe`、`killall python` 或按 port 全殺。 4. Windows 查看擁有者:`Get-NetTCPConnection -LocalPort 8601 -State Listen | Select LocalAddress,LocalPort,OwningProcess`,再以 `Get-CimInstance Win32_Process -Filter "ProcessId=<PID>" | Select ProcessId,ExecutablePath,CommandLine` 核對來源。 5. Mac 查看擁有者:`lsof -nP -iTCP:8601 -sTCP:LISTEN`、`ps -ww -p <PID> -o command=`。UC2 改成 8602。 6. 診斷:`doctor` 顯示 Python、套件位置、port、HTTP 健康及程序身分;日誌在 `launchers/.runtime/uc1.log` 或 `uc2.log`,程序記錄在同目錄 JSON。 7. 安裝失敗:回專案根目錄,以 Windows `py -3 bootstrap.py` 或 Mac `python3 bootstrap.py` 修復。檢查 Python 版本、網路、代理與 pip 錯誤,不刪除其他專案環境。 8. 健康端點為 `http://127.0.0.1:8601/_stcore/health` 與 `8602` 同路徑,應回應 `ok`。健康端點確認服務可用,仍應在瀏覽器檢查資料與操作。 9. 切換 port 後,`doctor` 加上相同 port;`stop` 使用程序記錄,不需傳 port。 ## 可選的 Oracle 即時模式 必須由管理員另外提供本機受限私密目錄,詳見根目錄 `MIGRATION.txt`。此 ZIP 不含憑證、不自動從遠端下載密碼。從根目錄執行: ```powershell .venv\Scripts\python.exe launchers\control.py uc1 restart --mode live --config-dir C:\LuminaPrivate --open .venv\Scripts\python.exe launchers\control.py uc2 restart --mode live --config-dir C:\LuminaPrivate --open ``` ```bash .venv/bin/python launchers/control.py uc1 restart --mode live --config-dir "$HOME/LuminaPrivate" --open .venv/bin/python launchers/control.py uc2 restart --mode live --config-dir "$HOME/LuminaPrivate" --open ``` 私密目錄與日誌不要分享、不要放入 Git。即時模式失敗不會改成預覽模式。 ## 伺服器管理(管理員) ```bash systemctl status lumina-preview@uc1 lumina-preview@uc2 --no-pager systemctl is-enabled lumina-preview@uc1 lumina-preview@uc2 journalctl -u lumina-preview@uc1 -u lumina-preview@uc2 --since '15 minutes ago' --no-pager systemctl restart lumina-preview@uc1 lumina-preview@uc2 curl --fail http://127.0.0.1:8501/lumina-air/uc1/_stcore/health curl --fail http://127.0.0.1:8502/lumina-air/uc2/_stcore/health ``` 上述 restart 會中斷該 Demo 使用者的連線;部署器只會清理確認屬於本專案的舊手動預覽程序。遇到不明 port 擁有者會停止。沒有執行整台伺服器重新開機驗證前,不宣稱已完成 reboot 測試。 ## 驗證範圍 本機控制器與應用可在 Linux 自動測試;Windows PowerShell、Mac Finder 雙擊及瀏覽器實際操作,需在相應實機執行驗收。Linux 測試通過不代表 Windows / Mac 已實機驗收。