automated update: 2026-06-10 22:31:20

This commit is contained in:
root
2026-06-10 22:31:20 -04:00
parent b9b734507b
commit cdf10452fb
6 changed files with 110 additions and 22 deletions
+18 -2
View File
@@ -3,6 +3,12 @@ name: Publish Docker Image
on: on:
push: push:
branches: ["main"] branches: ["main"]
paths-ignore:
- "**.md"
- "docs/**"
- ".github/workflows/release.yml"
- ".github/workflows/lint.yml"
- ".github/dependabot.yml"
jobs: jobs:
build: build:
@@ -23,17 +29,27 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true push: true
tags: ghcr.io/sudolulo/if-curator-headless:latest tags: ghcr.io/sudolulo/if-curator-headless:latest
cache-from: type=gha
cache-to: type=gha,mode=max
+2 -1
View File
@@ -19,11 +19,12 @@ jobs:
sudo rm -rf "/usr/local/share/boost" sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY" sudo rm -rf "$AGENT_TOOLSDIRECTORY"
echo "Disk space freed." echo "Disk space freed."
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Run Ruff - name: Run Ruff
uses: astral-sh/ruff-action@v3 uses: astral-sh/ruff-action@v3
with: with:
args: "check --fix" # Adding --fix here will auto-sort those imports for you! args: "check"
+19 -4
View File
@@ -2,11 +2,11 @@ name: Create GitHub Release
on: on:
push: push:
tags: [ 'v*' ] tags: ["v*"]
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: version:
description: 'Version to release (e.g., 1.0.0)' description: "Version to release (e.g., 1.0.0)"
required: true required: true
concurrency: concurrency:
@@ -35,6 +35,9 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
@@ -67,12 +70,22 @@ jobs:
id: changelog id: changelog
run: | run: |
VERSION="${{ steps.tag.outputs.VERSION }}" VERSION="${{ steps.tag.outputs.VERSION }}"
if [ ! -f CHANGELOG.md ]; then
echo "⚠️ CHANGELOG.md not found, using empty notes."
echo "NOTES=" >> "$GITHUB_OUTPUT"
exit 0
fi
NOTES=$(awk "/^## \[$VERSION\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md) NOTES=$(awk "/^## \[$VERSION\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md)
if [ -z "$NOTES" ]; then
echo "⚠️ No changelog entry found for version $VERSION."
echo "NOTES=" >> "$GITHUB_OUTPUT"
else
{ {
echo "NOTES<<CHANGELOG_EOF" echo "NOTES<<CHANGELOG_EOF"
echo "$NOTES" echo "$NOTES"
echo "CHANGELOG_EOF" echo "CHANGELOG_EOF"
} >> "$GITHUB_OUTPUT" } >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub Release - name: Create GitHub Release
uses: actions/github-script@v7 uses: actions/github-script@v7
@@ -98,12 +111,14 @@ jobs:
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true push: true
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
+27
View File
@@ -0,0 +1,27 @@
name: Test Python
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --all-extras
- name: Run tests
run: uv run pytest
+36 -6
View File
@@ -1,14 +1,27 @@
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04 # =============================================================================
# Stage 1: Base — platform-specific base image
# =============================================================================
# amd64: NVIDIA CUDA runtime (for GPU acceleration)
# arm64: Plain Ubuntu (no CUDA on ARM; CPU or media-kit only)
FROM --platform=$BUILDPLATFORM nvidia/cuda:12.4.1-runtime-ubuntu22.04 AS base-amd64
FROM --platform=$BUILDPLATFORM ubuntu:22.04 AS base-arm64
# =============================================================================
# Stage 2: Build — install system packages + Python + uv
# =============================================================================
ARG TARGETARCH
FROM base-${TARGETARCH} AS build
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# Add this BEFORE the apt-get update to handle dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \
curl \ curl \
gnupg \ gnupg \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Add deadsnakes PPA and install Python
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \ software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa -y \ && add-apt-repository ppa:deadsnakes/ppa -y \
@@ -22,14 +35,31 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
&& cp /root/.local/bin/uv /usr/local/bin/uv && cp /root/.local/bin/uv /usr/local/bin/uv
WORKDIR /app WORKDIR /app
# Copy project files instead of git clone for reproducible builds
# Copy project files first (for layer caching)
COPY pyproject.toml uv.lock* ./ COPY pyproject.toml uv.lock* ./
COPY if_curator/ if_curator/ COPY if_curator/ if_curator/
RUN uv sync --extra gpu --extra object && uv add croniter && uv cache clean COPY entrypoint.sh scheduler.py ./
# Platform-conditional Python deps:
# amd64: install GPU extras (onnxruntime-gpu + CUDA torch)
# arm64: install CPU-only (onnxruntime + torch-cpu)
RUN if [ "$(uname -m)" = "x86_64" ]; then \
uv sync --extra gpu --extra object && uv add croniter; \
else \
uv sync --extra object --no-binary torch && \
UV_TORCH_INDEX_URL=https://download.pytorch.org/whl/cpu uv pip install torch && \
uv add croniter; \
fi \
&& uv cache clean
COPY entrypoint.sh scheduler.py /app/
RUN chmod +x /app/entrypoint.sh RUN chmod +x /app/entrypoint.sh
# =============================================================================
# Stage 3: Runtime — minimal image with appuser
# =============================================================================
FROM build AS runtime
RUN groupadd -g 568 apps && useradd -u 568 -g apps -m -s /bin/bash appuser \ RUN groupadd -g 568 apps && useradd -u 568 -g apps -m -s /bin/bash appuser \
&& mkdir -p /models/.insightface /models/huggingface \ && mkdir -p /models/.insightface /models/huggingface \
&& chown -R appuser:apps /app /models && chown -R appuser:apps /app /models
-1
View File
@@ -71,7 +71,6 @@ transformers = "transformers"
ultralytics = "ultralytics" ultralytics = "ultralytics"
[tool.deptry.per_rule_ignores] [tool.deptry.per_rule_ignores]
# onnxruntime-gpu is an optional dep that replaces onnxruntime at runtime
DEP002 = ["onnxruntime-gpu"] DEP002 = ["onnxruntime-gpu"]
[build-system] [build-system]