-
-
Notifications
You must be signed in to change notification settings - Fork 1
217 lines (181 loc) · 7.28 KB
/
Copy pathwindows_daemon_debug.yml
File metadata and controls
217 lines (181 loc) · 7.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: "Windows Daemon Test - Improved"
on:
workflow_dispatch:
push:
branches: ['**']
paths:
- 'omnipkg/**'
- '.github/workflows/windows_daemon.yml'
jobs:
windows-daemon-test:
name: "Windows Daemon Diagnostic Test"
runs-on: windows-latest
timeout-minutes: 15
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Configure UTF-8 Environment
shell: pwsh
run: |
# Force UTF-8 for all Python I/O operations
[System.Console]::OutputEncoding = [System.Text.Encoding]::UTF8
[System.Console]::InputEncoding = [System.Text.Encoding]::UTF8
echo "PYTHONIOENCODING=utf-8" >> $env:GITHUB_ENV
echo "PYTHONUTF8=1" >> $env:GITHUB_ENV
echo "PYTHONLEGACYWINDOWSSTDIO=utf-8" >> $env:GITHUB_ENV
Write-Host "UTF-8 encoding configured"
- name: Install Omnipkg
shell: pwsh
run: |
python -m pip install --upgrade pip
pip install -e .
Write-Host "Omnipkg installed"
- name: Generate Config (No Emojis)
shell: pwsh
run: |
$configDir = "$env:USERPROFILE\.config\omnipkg"
New-Item -ItemType Directory -Force -Path $configDir | Out-Null
$config = @{
interactive = $false
auto_confirm = $true
daemon_port = 5678
log_level = "DEBUG"
}
$config | ConvertTo-Json | Out-File -FilePath "$configDir\config.json" -Encoding utf8
Write-Host "Config created at: $configDir\config.json"
Get-Content "$configDir\config.json"
- name: Pre-create Log Directory
shell: pwsh
run: |
# Create potential log directories ahead of time
$logDirs = @(
"$env:USERPROFILE\.omnipkg\logs",
"$env:USERPROFILE\.config\omnipkg\logs",
"$env:LOCALAPPDATA\omnipkg\logs",
"$env:TEMP\omnipkg"
)
foreach ($dir in $logDirs) {
New-Item -ItemType Directory -Force -Path $dir | Out-Null
Write-Host "Created: $dir"
}
- name: Start Daemon with Verbose Output
id: start_daemon
continue-on-error: true
shell: pwsh
run: |
Write-Host "============================================"
Write-Host "Starting Omnipkg Daemon"
Write-Host "============================================"
# Capture both stdout and stderr
$output = omnipkg daemon start 2>&1
$exitCode = $LASTEXITCODE
Write-Host "Output:"
Write-Host $output
Write-Host "Exit Code: $exitCode"
# Wait for daemon initialization
Start-Sleep -Seconds 8
exit $exitCode
- name: Check Daemon Status
if: steps.start_daemon.outcome == 'success'
shell: pwsh
run: |
Write-Host "Checking daemon status..."
omnipkg daemon status
if ($LASTEXITCODE -ne 0) {
Write-Error "Daemon status check failed"
exit 1
}
Write-Host "Daemon is running"
- name: Test Daemon Functionality
if: steps.start_daemon.outcome == 'success'
continue-on-error: true
shell: pwsh
run: |
Write-Host "Testing daemon with a simple command..."
omnipkg list --limit 5
- name: Stop Daemon
if: always()
continue-on-error: true
shell: pwsh
run: |
omnipkg daemon stop 2>&1
Start-Sleep -Seconds 2
# ════════════════════════════════════════════════════════════════
# COMPREHENSIVE LOG COLLECTION
# ════════════════════════════════════════════════════════════════
- name: Collect All Logs
if: always()
shell: pwsh
run: |
Write-Host "::group::Searching for Omnipkg Logs"
$searchPaths = @(
"$env:USERPROFILE\.omnipkg\logs",
"$env:USERPROFILE\.config\omnipkg\logs",
"$env:LOCALAPPDATA\omnipkg\logs",
"$env:TEMP\omnipkg",
"$env:USERPROFILE\AppData\Local\Temp\omnipkg"
)
$allLogs = @()
foreach ($path in $searchPaths) {
if (Test-Path $path) {
Write-Host "Checking: $path"
$logs = Get-ChildItem -Path $path -Filter "*.log" -Recurse -ErrorAction SilentlyContinue
if ($logs) {
Write-Host " Found $($logs.Count) log file(s)"
$allLogs += $logs
}
} else {
Write-Host " Path does not exist: $path"
}
}
Write-Host "::endgroup::"
if ($allLogs.Count -eq 0) {
Write-Host "::warning::No log files found!"
# Try broader search as fallback
Write-Host "Attempting broader search in TEMP and AppData..."
$broadLogs = Get-ChildItem -Path $env:TEMP -Filter "*omnipkg*.log" -Recurse -ErrorAction SilentlyContinue
$allLogs += $broadLogs
}
# Display all found logs
foreach ($log in $allLogs) {
Write-Host ""
Write-Host "================================================================"
Write-Host "LOG: $($log.FullName)"
Write-Host "SIZE: $($log.Length) bytes | MODIFIED: $($log.LastWriteTime)"
Write-Host "================================================================"
try {
$content = Get-Content $log.FullName -Raw -Encoding utf8 -ErrorAction Stop
Write-Host $content
} catch {
Write-Host "::error::Failed to read log: $_"
}
Write-Host ""
}
- name: Show Process Information
if: always()
shell: pwsh
run: |
Write-Host "::group::Active Python Processes"
Get-Process | Where-Object {$_.ProcessName -like "*python*"} | Format-Table -AutoSize
Write-Host "::endgroup::"
Write-Host "::group::Network Listeners on Port 5678"
netstat -ano | Select-String "5678"
Write-Host "::endgroup::"
- name: Upload Logs as Artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-daemon-logs
path: |
${{ runner.temp }}/omnipkg/*.log
~/.omnipkg/logs/**/*.log
~/.config/omnipkg/logs/**/*.log
~/AppData/Local/omnipkg/logs/**/*.log
~/AppData/Local/Temp/omnipkg/**/*.log
if-no-files-found: warn
retention-days: 7