feat: 회의 파일 가져오기와 입력 엔진 배포 보완
This commit is contained in:
parent
5a8c5cd792
commit
b3519e5da7
54 changed files with 1129 additions and 116 deletions
|
|
@ -8,6 +8,9 @@
|
|||
// 사용: node scripts/ci/verify-sidecar-bundle.mjs
|
||||
|
||||
import { existsSync, statSync } from 'node:fs'
|
||||
import { spawn } from 'node:child_process'
|
||||
import { createServer } from 'node:net'
|
||||
import { setTimeout as delay } from 'node:timers/promises'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
|
|
@ -55,3 +58,48 @@ if (problems.length > 0) {
|
|||
|
||||
const sizeMb = statSync(exePath).size / (1024 * 1024)
|
||||
console.log(`STT 사이드카 번들 검증 통과: ${exePath} (${sizeMb.toFixed(1)} MB)`)
|
||||
|
||||
// 별도 loopback 포트에서 방금 만든 실행 파일을 검사한다. 모델이나 사용자 프로필은 열지 않는다.
|
||||
if (process.argv.includes('--smoke')) {
|
||||
const reservation = createServer()
|
||||
await new Promise((resolve, reject) => {
|
||||
reservation.once('error', reject)
|
||||
reservation.listen(0, '127.0.0.1', resolve)
|
||||
})
|
||||
const address = reservation.address()
|
||||
if (!address || typeof address === 'string') throw new Error('No smoke-test port')
|
||||
await new Promise((resolve, reject) => reservation.close((error) => error ? reject(error) : resolve()))
|
||||
const child = spawn(exePath, ['--host', '127.0.0.1', '--port', String(address.port)], {
|
||||
windowsHide: true,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
})
|
||||
let output = ''
|
||||
let launchError
|
||||
const capture = (chunk) => { output = (output + chunk.toString()).slice(-8000) }
|
||||
child.stdout.on('data', capture)
|
||||
child.stderr.on('data', capture)
|
||||
child.on('error', (error) => { launchError = error })
|
||||
let healthy = false
|
||||
try {
|
||||
const deadline = Date.now() + 30000
|
||||
while (Date.now() < deadline && child.exitCode === null && !launchError) {
|
||||
try {
|
||||
const response = await fetch(`http://127.0.0.1:${address.port}/health`, { signal: AbortSignal.timeout(500) })
|
||||
const health = await response.json()
|
||||
if (response.ok && health.status === 'no_model' && health.model_loaded === false) {
|
||||
healthy = true
|
||||
break
|
||||
}
|
||||
} catch { /* wait for this child to bind its port */ }
|
||||
await delay(100)
|
||||
}
|
||||
if (!healthy) throw new Error(`Sidecar smoke failed: ${launchError?.message ?? output}`)
|
||||
console.log(`STT 사이드카 실제 실행/health 검증 통과 (pid=${child.pid}, port=${address.port})`)
|
||||
} finally {
|
||||
if (child.pid && child.exitCode === null) {
|
||||
const exited = new Promise((resolve) => child.once('exit', resolve))
|
||||
child.kill()
|
||||
await exited
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue