Skip to content

chore: release 1.4.8 #684

chore: release 1.4.8

chore: release 1.4.8 #684

Workflow file for this run

name: Container Images
on:
pull_request:
types: [opened, synchronize, reopened, labeled, ready_for_review]
paths:
- .github/workflows/image.yml
- .dockerignore
- Dockerfile
- compose.yml
- "src/**"
- requirements/**
- "scripts/**"
push:
tags: ["persona-forge-v*"]
workflow_dispatch:
inputs:
no-cache:
description: "Bypass build cache (use when cached manifests are missing from GHCR)"
type: boolean
default: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: nmorgowicz-org/persona-forge
concurrency:
group: images-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: >-
github.event_name != 'pull_request' ||
(
github.event.pull_request.head.repo.full_name == github.repository &&
contains(github.event.pull_request.labels.*.name, 'ready-to-test') &&
(github.event.action != 'labeled' || github.event.label.name == 'ready-to-test')
)
runs-on: arc-general-docker
timeout-minutes: 90
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Log in to Docker Hub
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# setup-buildx bootstraps a docker-container builder by pulling this image. Retry the
# pull here so a transient Docker Hub timeout does not fail the job before the build starts.
# A persistent failure still needs runner-side Docker Hub connectivity or a registry mirror.
- name: Pre-pull BuildKit image with retries
shell: bash
run: |
set -euo pipefail
buildkit_image="moby/buildkit:buildx-stable-1"
for attempt in 1 2 3 4 5; do
if docker pull "${buildkit_image}"; then
exit 0
fi
if [ "${attempt}" -lt 5 ]; then
sleep "$((attempt * 10))"
fi
done
echo "Unable to pull ${buildkit_image} after 5 attempts" >&2
exit 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
- name: Calculate image tags
id: tags
shell: bash
run: |
image="${REGISTRY}/${IMAGE_NAME}"
{
echo 'value<<EOF'
echo "${image}:${GITHUB_SHA}"
if [[ "${GITHUB_REF}" == refs/tags/persona-forge-v* ]]; then
release_tag="${GITHUB_REF_NAME#persona-forge-}"
echo "${image}:${release_tag}"
echo "${image}:latest"
fi
echo EOF
} >> "${GITHUB_OUTPUT}"
- name: Validate Compose example
env:
REF_AUDIO_PATH: ./voice/reference.wav
REF_TEXT: Example reference transcript for configuration validation
run: |
docker run --rm \
-e REF_AUDIO_PATH \
-e REF_TEXT \
-v "${PWD}:/work:ro" \
-w /work \
docker:29.6.1-cli@sha256:862099ada15c669000bef53aa4cb9d821262829f45b0dda2159ccb276443043b \
compose -f compose.yml config --quiet
- name: Build and optionally publish image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
context: .
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
load: ${{ github.event_name == 'pull_request' }}
tags: ${{ steps.tags.outputs.value }}
no-cache: ${{ inputs.no-cache == true }}
cache-from: ${{ inputs.no-cache != true && format('type=registry,ref={0}/{1}:buildcache', env.REGISTRY, env.IMAGE_NAME) || '' }}
cache-to: ${{ inputs.no-cache != true && format('type=registry,ref={0}/{1}:buildcache,mode=min,ignore-error=true', env.REGISTRY, env.IMAGE_NAME) || '' }}
provenance: ${{ github.event_name != 'pull_request' }}
sbom: ${{ github.event_name != 'pull_request' }}
- name: Pull published image for smoke test
if: github.event_name != 'pull_request'
run: docker pull "${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}"
- name: Smoke-test image imports
shell: bash
run: |
image="${REGISTRY}/${IMAGE_NAME}:${GITHUB_SHA}"
docker run --rm --entrypoint python "${image}" -c \
'import benchmark_vocoder, export_openvino, nncf, openvino, ov_export_wrappers, parity_contract, qwen_tts, test_transformer_parity, test_vocoder_parity, torch; from persona_forge.model_config import resolve_model_repo; import scripts.download_model; assert resolve_model_repo({"MODEL_SIZE": "0.6B"}).endswith("0.6B-Base"); assert resolve_model_repo({"MODEL_SIZE": "1.7B"}).endswith("1.7B-Base"); print("image imports passed")'
cleanup:
if: >-
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/persona-forge-v')
needs: build
runs-on: arc-general
permissions:
packages: write
steps:
- name: Cleanup old container versions
uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5
with:
min-versions-to-keep: 15
package-name: persona-forge
package-type: container
token: ${{ secrets.GITHUB_TOKEN }}
ignore-versions: |
latest
buildcache