mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: unified Docker image with GPU auto-detection (#37)
Merge CPU, CUDA, and lite Docker images into a single unified image. One tag (latest) works on all platforms: amd64 (NVIDIA CUDA) and arm64 (CPU). GPU auto-detected at runtime. All ML models and packages baked in. Key changes: - Platform-conditional Dockerfile (nvidia/cuda on amd64, node on arm64) - tini as PID 1 for proper signal handling - Fix FILES_STORAGE_PATH data loss bug - Fix RealESRGAN upscaler (was broken, always fell back to Lanczos) - Fix PaddleOCR language codes and stdout corruption - Simplified CI/CD (single build, single tag) - Expanded model pre-download with verification - Shutdown timeout, improved health endpoint - Remove unused lama-cleaner
This commit is contained in:
@@ -80,20 +80,8 @@ jobs:
|
||||
- run: pnpm build
|
||||
|
||||
docker:
|
||||
name: Docker Build Test (${{ matrix.tag }})
|
||||
name: Docker Build Test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- tag: full
|
||||
variant: full
|
||||
gpu: "false"
|
||||
- tag: lite
|
||||
variant: lite
|
||||
gpu: "false"
|
||||
- tag: cuda
|
||||
variant: full
|
||||
gpu: "true"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -104,9 +92,6 @@ jobs:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
push: false
|
||||
build-args: |
|
||||
VARIANT=${{ matrix.variant }}
|
||||
GPU=${{ matrix.gpu }}
|
||||
tags: stirling-image:ci-${{ matrix.tag }}
|
||||
cache-from: type=gha,scope=${{ matrix.tag }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.tag }}
|
||||
tags: stirling-image:ci
|
||||
cache-from: type=gha,scope=unified
|
||||
cache-to: type=gha,mode=max,scope=unified
|
||||
|
||||
@@ -49,28 +49,10 @@ jobs:
|
||||
fi
|
||||
|
||||
docker:
|
||||
name: Docker (${{ matrix.tag }})
|
||||
name: Docker Build & Push
|
||||
needs: release
|
||||
if: needs.release.outputs.new_version != ''
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- tag: full
|
||||
variant: full
|
||||
gpu: "false"
|
||||
suffix: ""
|
||||
platforms: "linux/amd64,linux/arm64"
|
||||
- tag: lite
|
||||
variant: lite
|
||||
gpu: "false"
|
||||
suffix: "-lite"
|
||||
platforms: "linux/amd64,linux/arm64"
|
||||
- tag: cuda
|
||||
variant: full
|
||||
gpu: "true"
|
||||
suffix: "-cuda"
|
||||
platforms: "linux/amd64"
|
||||
steps:
|
||||
- name: Checkout release tag
|
||||
uses: actions/checkout@v4
|
||||
@@ -104,10 +86,10 @@ jobs:
|
||||
stirlingimage/stirling-image
|
||||
ghcr.io/${{ github.repository }}
|
||||
tags: |
|
||||
type=semver,pattern={{version}}${{ matrix.suffix }},value=v${{ needs.release.outputs.new_version }}
|
||||
type=semver,pattern={{major}}.{{minor}}${{ matrix.suffix }},value=v${{ needs.release.outputs.new_version }}
|
||||
type=semver,pattern={{major}}${{ matrix.suffix }},value=v${{ needs.release.outputs.new_version }}
|
||||
type=raw,value=${{ matrix.tag == 'full' && 'latest' || matrix.tag }}
|
||||
type=semver,pattern={{version}},value=v${{ needs.release.outputs.new_version }}
|
||||
type=semver,pattern={{major}}.{{minor}},value=v${{ needs.release.outputs.new_version }}
|
||||
type=semver,pattern={{major}},value=v${{ needs.release.outputs.new_version }}
|
||||
type=raw,value=latest
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
@@ -115,11 +97,8 @@ jobs:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
push: true
|
||||
build-args: |
|
||||
VARIANT=${{ matrix.variant }}
|
||||
GPU=${{ matrix.gpu }}
|
||||
platforms: ${{ matrix.platforms }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha,scope=${{ matrix.tag }}
|
||||
cache-to: type=gha,mode=max,scope=${{ matrix.tag }}
|
||||
cache-from: type=gha,scope=unified
|
||||
cache-to: type=gha,mode=max,scope=unified
|
||||
|
||||
Reference in New Issue
Block a user