Prerelease: Baked in models to docker files

This commit is contained in:
remsky 2025-01-12 06:13:35 -07:00
parent 3d0ca2a8c2
commit efb84753e8
3 changed files with 34 additions and 50 deletions

View file

@ -28,41 +28,31 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata for GPU image # Set up image names
- name: Extract metadata (tags, labels) for GPU Docker - name: Set image names
id: meta-gpu run: |
uses: docker/metadata-action@v5 echo "GPU_IMAGE_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-gpu" >> $GITHUB_ENV
with: echo "CPU_IMAGE_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-cpu" >> $GITHUB_ENV
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} echo "UI_IMAGE_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ui" >> $GITHUB_ENV
tags: | echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=raw,value=latest
# Extract metadata for CPU image # Extract version tag if it exists
- name: Extract metadata (tags, labels) for CPU Docker - name: Set version tag
id: meta-cpu if: startsWith(github.ref, 'refs/tags/')
uses: docker/metadata-action@v5 run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
suffix=-cpu
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=raw,value=latest
# Build and push GPU version # Build and push GPU version
- name: Build and push GPU Docker image - name: Build and push GPU Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: ./Dockerfile file: ./docker/gpu/Dockerfile
push: true push: true
tags: ${{ steps.meta-gpu.outputs.tags }} tags: |
labels: ${{ steps.meta-gpu.outputs.labels }} ${{ env.GPU_IMAGE_NAME }}:latest
${{ env.GPU_IMAGE_NAME }}:${{ env.VERSION }}
build-args: |
DOCKER_BUILDKIT=1
platforms: linux/amd64 platforms: linux/amd64
# Build and push CPU version # Build and push CPU version
@ -70,25 +60,14 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: ./Dockerfile.cpu file: ./docker/cpu/Dockerfile
push: true push: true
tags: ${{ steps.meta-cpu.outputs.tags }}
labels: ${{ steps.meta-cpu.outputs.labels }}
platforms: linux/amd64
# Extract metadata for UI image
- name: Extract metadata (tags, labels) for UI Docker
id: meta-ui
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
suffix=-ui
tags: | tags: |
type=semver,pattern=v{{version}} ${{ env.CPU_IMAGE_NAME }}:latest
type=semver,pattern=v{{major}}.{{minor}} ${{ env.CPU_IMAGE_NAME }}:${{ env.VERSION }}
type=semver,pattern=v{{major}} build-args: |
type=raw,value=latest DOCKER_BUILDKIT=1
platforms: linux/amd64
# Build and push UI version # Build and push UI version
- name: Build and push UI Docker image - name: Build and push UI Docker image
@ -97,8 +76,11 @@ jobs:
context: ./ui context: ./ui
file: ./ui/Dockerfile file: ./ui/Dockerfile
push: true push: true
tags: ${{ steps.meta-ui.outputs.tags }} tags: |
labels: ${{ steps.meta-ui.outputs.labels }} ${{ env.UI_IMAGE_NAME }}:latest
${{ env.UI_IMAGE_NAME }}:${{ env.VERSION }}
build-args: |
DOCKER_BUILDKIT=1
platforms: linux/amd64 platforms: linux/amd64
create-release: create-release:
@ -114,7 +96,9 @@ jobs:
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
env:
IS_PRERELEASE: ${{ contains(github.ref, '-pre') }}
with: with:
generate_release_notes: true generate_release_notes: true
draft: false draft: false
prerelease: false prerelease: ${{ contains(github.ref, '-pre') }}

View file

@ -1,6 +1,6 @@
services: services:
kokoro-tts: kokoro-tts:
# image: ghcr.io/remsky/kokoro-fastapi:latest-cpu # image: ghcr.io/remsky/kokoro-fastapi-cpu:latest
# Uncomment below (and comment out above) to build from source instead of using the released image # Uncomment below (and comment out above) to build from source instead of using the released image
build: build:
context: ../.. context: ../..

View file

@ -32,7 +32,7 @@ services:
# start_period: 1s # start_period: 1s
kokoro-tts: kokoro-tts:
# image: ghcr.io/remsky/kokoro-fastapi:latest # image: ghcr.io/remsky/kokoro-fastapi-gpu:latest
# Uncomment below to build from source instead of using the released image # Uncomment below to build from source instead of using the released image
build: build:
context: ../.. context: ../..
@ -57,7 +57,7 @@ services:
# Gradio UI service [Comment out everything below if you don't need it] # Gradio UI service [Comment out everything below if you don't need it]
# gradio-ui: # gradio-ui:
# image: ghcr.io/remsky/kokoro-fastapi:latest-ui # image: ghcr.io/remsky/kokoro-fastapi-ui:latest
# Uncomment below to build from source instead of using the released image # Uncomment below to build from source instead of using the released image
# build: # build:
# context: ./ui # context: ./ui