Compare commits

..

1 Commits

Author SHA1 Message Date
xiaoxia adcfc1e919 perf(ci): ci-base 镜像预装 ffmpeg——消除 unit-tests 每次 24min apt 安装
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 3s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Successful in 2m27s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 2m41s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m40s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
PR Automation / Auto Approve on CI Green (pull_request) Successful in 4m57s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m5s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 1m42s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m59s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 5m6s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 7m35s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 8m15s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 16m23s
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 5m15s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 5m16s
unit-tests job 跑在全新容器里,ci-base 镜像未预装 ffmpeg,
step_install_ffmpeg.sh 每次都 apt-get update + install ffmpeg,
ffmpeg 拉取 x264/aom/systemd 等数百个编解码依赖,固定耗时约 24 分钟,
pytest 本身 21-23 分钟,导致该 job 每次 45-50 分钟。

把 ffmpeg 预装到 ci-base 镜像后,step_install_ffmpeg.sh 检测到
ffmpeg 已存在会立即退出(exit 0),unit-tests 直接省掉 ~24 分钟。

注:ci-base 镜像需重建并推送 registry 后生效。
2026-08-31 23:54:22 +08:00
2 changed files with 8 additions and 5 deletions
-5
View File
@@ -150,7 +150,6 @@ jobs:
run: bash scripts/ci/step_timer_start.sh
- name: Cache pip dependencies
uses: actions/cache@v4
continue-on-error: true
with:
path: /root/.cache/pip
key: ${{ runner.os }}-pip-style-${{ hashFiles('requirements*.txt') }}
@@ -253,7 +252,6 @@ jobs:
run: bash scripts/ci/step_timer_start.sh
- name: Cache pip dependencies
uses: actions/cache@v4
continue-on-error: true
with:
path: /root/.cache/pip
key: ${{ runner.os }}-pip-security-${{ hashFiles('requirements*.txt') }}
@@ -354,7 +352,6 @@ jobs:
run: bash scripts/ci/step_timer_start.sh
- name: Cache pip dependencies
uses: actions/cache@v4
continue-on-error: true
with:
path: /root/.cache/pip
key: ${{ runner.os }}-pip-python-${{ hashFiles('requirements*.txt') }}
@@ -459,7 +456,6 @@ jobs:
run: bash scripts/ci/step_install_ffmpeg.sh
- name: Cache pip dependencies
uses: actions/cache@v4
continue-on-error: true
with:
path: /root/.cache/pip
key: ${{ runner.os }}-pip-unittests-${{ hashFiles('requirements*.txt') }}
@@ -668,7 +664,6 @@ jobs:
run: bash scripts/ci/step_timer_start.sh
- name: Cache npm dependencies
uses: actions/cache@v4
continue-on-error: true
with:
path: /root/.npm
key: ${{ runner.os }}-npm-vitest-${{ hashFiles('apps/web/package-lock.json') }}
+8
View File
@@ -30,6 +30,14 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends docker-ce-cli docker-buildx-plugin \
&& rm -rf /var/lib/apt/lists/*
# Pre-bake ffmpeg: unit-tests run in fresh containers each time; installing ffmpeg
# on every job cost ~24 min (apt update + hundreds of codec deps). Bake it into the
# image so step_install_ffmpeg.sh detects it and exits instantly.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& ffmpeg -version | head -1 \
&& rm -rf /var/lib/apt/lists/*
# Pre-install base deps (layer cache)
COPY requirements-base.txt ./
RUN python -m venv "$VIRTUAL_ENV" \