Fix CI: lint line-length, lockfile detached HEAD, release disk exhaustion
- quality.py:122: split long tuple line to satisfy E501 (146 → ≤120) - update-lockfile.yml: add branches filter so tag pushes don't trigger the workflow (tag checkout is detached HEAD; git push has no target) - release.yml: split four Docker build steps into parallel jobs (build-gpu, build-cpu, build-rocm, build-intel), each with its own runner; previously all four ran in one job and exhausted disk after GPU+CPU builds, leaving ROCm and Intel cancelled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+129
-16
@@ -15,11 +15,13 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Create GitHub Release & Build Image
|
name: Create GitHub Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
packages: write
|
outputs:
|
||||||
|
tag: ${{ steps.tag.outputs.TAG }}
|
||||||
|
version: ${{ steps.tag.outputs.VERSION }}
|
||||||
steps:
|
steps:
|
||||||
- name: Free up disk space
|
- name: Free up disk space
|
||||||
run: |
|
run: |
|
||||||
@@ -60,12 +62,6 @@ jobs:
|
|||||||
uv lock
|
uv lock
|
||||||
rm _pyproject_orig.toml
|
rm _pyproject_orig.toml
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v4
|
|
||||||
|
|
||||||
- name: Resolve tag name
|
- name: Resolve tag name
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
@@ -131,6 +127,30 @@ jobs:
|
|||||||
prerelease: false,
|
prerelease: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
build-gpu:
|
||||||
|
name: Build GPU image
|
||||||
|
needs: release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Free up disk space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
echo "Disk space freed."
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Log in to GHCR
|
- name: Log in to GHCR
|
||||||
uses: docker/login-action@v4
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -145,12 +165,43 @@ jobs:
|
|||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
build-args: VERSION=${{ steps.tag.outputs.VERSION }}
|
build-args: VERSION=${{ needs.release.outputs.version }}
|
||||||
cache-from: type=gha,scope=release-gpu
|
cache-from: type=gha,scope=release-gpu
|
||||||
cache-to: type=gha,mode=max,scope=release-gpu
|
cache-to: type=gha,mode=max,scope=release-gpu
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/sudolulo/winnow:latest
|
ghcr.io/sudolulo/winnow:latest
|
||||||
ghcr.io/sudolulo/winnow:${{ steps.tag.outputs.TAG }}
|
ghcr.io/sudolulo/winnow:${{ needs.release.outputs.tag }}
|
||||||
|
|
||||||
|
build-cpu:
|
||||||
|
name: Build CPU image
|
||||||
|
needs: release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Free up disk space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
echo "Disk space freed."
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Log in to GHCR
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push CPU image
|
- name: Build and push CPU image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -161,12 +212,43 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
build-args: |
|
build-args: |
|
||||||
VARIANT=cpu
|
VARIANT=cpu
|
||||||
VERSION=${{ steps.tag.outputs.VERSION }}
|
VERSION=${{ needs.release.outputs.version }}
|
||||||
cache-from: type=gha,scope=release-cpu
|
cache-from: type=gha,scope=release-cpu
|
||||||
cache-to: type=gha,mode=max,scope=release-cpu
|
cache-to: type=gha,mode=max,scope=release-cpu
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/sudolulo/winnow:cpu
|
ghcr.io/sudolulo/winnow:cpu
|
||||||
ghcr.io/sudolulo/winnow:${{ steps.tag.outputs.TAG }}-cpu
|
ghcr.io/sudolulo/winnow:${{ needs.release.outputs.tag }}-cpu
|
||||||
|
|
||||||
|
build-rocm:
|
||||||
|
name: Build ROCm image
|
||||||
|
needs: release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Free up disk space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
echo "Disk space freed."
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Log in to GHCR
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push ROCm image
|
- name: Build and push ROCm image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -177,12 +259,43 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
build-args: |
|
build-args: |
|
||||||
VARIANT=rocm
|
VARIANT=rocm
|
||||||
VERSION=${{ steps.tag.outputs.VERSION }}
|
VERSION=${{ needs.release.outputs.version }}
|
||||||
cache-from: type=gha,scope=release-rocm
|
cache-from: type=gha,scope=release-rocm
|
||||||
cache-to: type=gha,mode=max,scope=release-rocm
|
cache-to: type=gha,mode=max,scope=release-rocm
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/sudolulo/winnow:rocm
|
ghcr.io/sudolulo/winnow:rocm
|
||||||
ghcr.io/sudolulo/winnow:${{ steps.tag.outputs.TAG }}-rocm
|
ghcr.io/sudolulo/winnow:${{ needs.release.outputs.tag }}-rocm
|
||||||
|
|
||||||
|
build-intel:
|
||||||
|
name: Build Intel image
|
||||||
|
needs: release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- name: Free up disk space
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf "/usr/local/share/boost"
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
echo "Disk space freed."
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Log in to GHCR
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push Intel image
|
- name: Build and push Intel image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
@@ -193,9 +306,9 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
build-args: |
|
build-args: |
|
||||||
VARIANT=intel
|
VARIANT=intel
|
||||||
VERSION=${{ steps.tag.outputs.VERSION }}
|
VERSION=${{ needs.release.outputs.version }}
|
||||||
cache-from: type=gha,scope=release-intel
|
cache-from: type=gha,scope=release-intel
|
||||||
cache-to: type=gha,mode=max,scope=release-intel
|
cache-to: type=gha,mode=max,scope=release-intel
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/sudolulo/winnow:intel
|
ghcr.io/sudolulo/winnow:intel
|
||||||
ghcr.io/sudolulo/winnow:${{ steps.tag.outputs.TAG }}-intel
|
ghcr.io/sudolulo/winnow:${{ needs.release.outputs.tag }}-intel
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ name: Update lockfiles
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
paths:
|
paths:
|
||||||
- 'pyproject.toml'
|
- 'pyproject.toml'
|
||||||
- 'pyproject-cpu.toml'
|
- 'pyproject-cpu.toml'
|
||||||
|
|||||||
+4
-1
@@ -119,7 +119,10 @@ def assess_quality(
|
|||||||
blur_score = float(cv2.Laplacian(gray, cv2.CV_64F).var())
|
blur_score = float(cv2.Laplacian(gray, cv2.CV_64F).var())
|
||||||
|
|
||||||
checks = [
|
checks = [
|
||||||
(blur_score >= blur_threshold, f"Blurry (laplacian={blur_score:.1f}, threshold={blur_threshold})" if blur_score < blur_threshold else ""),
|
(
|
||||||
|
blur_score >= blur_threshold,
|
||||||
|
f"Blurry (laplacian={blur_score:.1f}, threshold={blur_threshold})" if blur_score < blur_threshold else "",
|
||||||
|
),
|
||||||
check_grayscale(img_np),
|
check_grayscale(img_np),
|
||||||
check_exposure(img_np),
|
check_exposure(img_np),
|
||||||
check_confidence(confidence, min_confidence),
|
check_confidence(confidence, min_confidence),
|
||||||
|
|||||||
Reference in New Issue
Block a user