feat: 배포 파이프라인 — Ollama/sidecar 번들 + NSIS 자동 VC++ + GitLab CI + 온보딩 모달

- sidecar 슬림화: torch/pyannote 제거, ctranslate2 GPU 감지, /diarize 삭제
- Ollama 번들: resources/ollama/에 포터블 바이너리 배치, LocalLLMService 1순위 탐색
- installer.nsh: VC++ 재배포 x64 자동 다운로드(aka.ms 경유) + 사일런트 설치
- electron-builder: extraResources에 ollama 추가, nsis.include로 installer.nsh 연결
- scripts: download-ollama.ps1/sh 신규
- LLM.PULL_MODEL IPC 핸들러 + LocalLLMService.pullModel() 구현 (api/pull 스트리밍)
- 온보딩 모달: gemma4:e4b 미설치 감지 시 자동 표시, 진행률 UI, i18n(ko/en) 키 추가
- .gitlab-ci.yml: Windows 러너에서 sidecar/sox/ollama 준비 후 NSIS 패키징, 태그 시 Release 자동 생성
This commit is contained in:
yunchan8804 2026-04-15 19:47:27 +09:00
parent d1edad6727
commit aa65e710ec
16 changed files with 725 additions and 500 deletions

View file

@ -1,14 +1,17 @@
stages:
- check
- test
- prepare
- build
- package
- release
variables:
NODE_VERSION: "20"
PYTHON_VERSION: "3.11"
OLLAMA_VERSION: "v0.5.7"
npm_config_cache: "$CI_PROJECT_DIR/.npm"
# Node.js 캐시
.node-cache: &node-cache
cache:
key:
@ -18,8 +21,9 @@ variables:
- .npm/
- node_modules/
# ── Check Stage ──────────────────────────────────────────
# ────────────────────────────────────────────────────────────────────
# Check
# ────────────────────────────────────────────────────────────────────
lint:
stage: check
image: node:${NODE_VERSION}
@ -31,6 +35,7 @@ lint:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
typecheck:
stage: check
@ -43,9 +48,11 @@ typecheck:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
# ── Test Stage ───────────────────────────────────────────
# ────────────────────────────────────────────────────────────────────
# Test
# ────────────────────────────────────────────────────────────────────
unit-test:
stage: test
image: node:${NODE_VERSION}
@ -58,42 +65,74 @@ unit-test:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# ── Build Stage ──────────────────────────────────────────
build:
stage: build
image: node:${NODE_VERSION}
<<: *node-cache
before_script:
- npm ci
script:
- npm run build
artifacts:
paths:
- out/
expire_in: 1 day
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# ── Release Stage (태그 푸시 시만 실행) ──────────────────
# ────────────────────────────────────────────────────────────────────
# Package Windows (태그 푸시 또는 수동 트리거 시만 실행)
# - PyInstaller sidecar 빌드 → SoX/Ollama 다운로드 → electron-builder --win
# - Windows self-hosted runner 필요 (native 모듈 + PyInstaller 네이티브 빌드)
# ────────────────────────────────────────────────────────────────────
package-windows:
stage: release
stage: package
tags:
- windows # Windows 러너 필요 (native 모듈 빌드)
- windows
- shell # self-hosted Windows runner (shell executor)
variables:
CI_RUNNER_PROTECTED: "false"
before_script:
# Node 20 + Python 3.11이 러너에 사전 설치되어 있어야 함
- node --version
- python --version
- npm ci
script:
- npm run build
- npm run dist
# 1) Python sidecar 의존성 설치 + PyInstaller 빌드
- python -m pip install --upgrade pip
- python -m pip install pyinstaller
- python -m pip install -r apps/desktop/sidecar/requirements.txt
- python apps/desktop/scripts/build-sidecar.py
# 2) SoX 다운로드
- powershell -ExecutionPolicy Bypass -File apps/desktop/scripts/download-sox.ps1
# 3) Ollama 다운로드
- powershell -ExecutionPolicy Bypass -File apps/desktop/scripts/download-ollama.ps1
# 4) electron-vite 빌드 + electron-builder NSIS 패키징
- npm run build --workspace=@d3ro/desktop
- npm run dist --workspace=@d3ro/desktop
artifacts:
name: "d3ro-voice-windows-${CI_COMMIT_SHORT_SHA}"
paths:
- release/
expire_in: 30 days
- apps/desktop/release/
expire_in: 90 days
expose_as: "Windows Installer"
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
allow_failure: true
# Docker 러너에서 Windows 빌드가 불가한 경우 아래 대안 사용:
# Wine + electron-builder --linux 크로스빌드 또는
# Windows self-hosted runner 등록
# ────────────────────────────────────────────────────────────────────
# Release (태그 시 GitLab Releases 페이지에 자동 첨부)
# ────────────────────────────────────────────────────────────────────
release-create:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: package-windows
artifacts: true
script:
- echo "Creating GitLab Release for tag $CI_COMMIT_TAG"
release:
name: "D3RO Voice $CI_COMMIT_TAG"
tag_name: "$CI_COMMIT_TAG"
description: |
## D3RO Voice $CI_COMMIT_TAG
Windows 설치 파일은 **Job artifacts**에서 다운로드하거나 아래 링크에서 받을 수 있습니다.
- 기본 LLM 모델: `gemma4:e4b` (첫 실행 시 자동 다운로드, ~9.6GB)
- Whisper 모델: `large-v3` (첫 실행 시 자동 다운로드, ~3GB)
- VC++ 재배포 패키지 선행 설치 필요 (설치 마법사에서 안내)
assets:
links:
- name: "Windows Installer (artifacts)"
url: "$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/browse/apps/desktop/release?job=package-windows"
link_type: package
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+/