Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
BUILDKIT_STEP_LOG_MAX_SIZE: 10485760
# These environment variables will override the defaults within docker-bake.hcl
VERSION: ${{ needs.prepare-release.outputs.version_tag }} # Use tag version (vX.Y.Z) for bake
strategy:
matrix:
build_target: ["cpu", "cpu-arm64", "gpu-arm64", "gpu"]
REGISTRY: ${{ vars.REGISTRY || 'ghcr.io' }} # Override with GitHub Action Environment Variable
OWNER: ${{ vars.OWNER || 'remsky' }}
REPO: ${{ vars.REPO || 'kokoro-fastapi' }}
Expand Down Expand Up @@ -88,7 +91,7 @@ jobs:
run: |
echo "Building and pushing images for version ${{ needs.prepare-release.outputs.version_tag }}"
# The VERSION env var above sets the tag for the bake file targets
docker buildx bake --push
docker buildx bake ${{ matrix.build_target }} --push

create-release:
needs: [prepare-release, build-images]
Expand Down
39 changes: 36 additions & 3 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,41 @@ target "gpu" {
}

# Default group to build both CPU and GPU versions
group "default" {
targets = ["cpu", "gpu"]
target "cpu" {
inherits = ["_cpu_base"]
platforms = ["linux/amd64"]
tags = [
"${REGISTRY}/${OWNER}/${REPO}-cpu:${VERSION}",
"${REGISTRY}/${OWNER}/${REPO}-cpu:latest"
]
}

target "cpu-arm64" {
inherits = ["_cpu_base"]
platforms = ["linux/arm64"]
tags = [
"${REGISTRY}/${OWNER}/${REPO}-cpu:${VERSION}",
"${REGISTRY}/${OWNER}/${REPO}-cpu:latest"
]
}

# GPU target with multi-platform support
target "gpu" {
inherits = ["_gpu_base"]
platforms = ["linux/amd64"]
tags = [
"${REGISTRY}/${OWNER}/${REPO}-gpu:${VERSION}",
"${REGISTRY}/${OWNER}/${REPO}-gpu:latest"
]
}

target "gpu-arm64" {
inherits = ["_gpu_base"]
platforms = ["linux/arm64"]
tags = [
"${REGISTRY}/${OWNER}/${REPO}-gpu:${VERSION}",
"${REGISTRY}/${OWNER}/${REPO}-gpu:latest"
]
}

# Development targets for faster local builds
Expand All @@ -80,4 +113,4 @@ target "gpu-dev" {

group "dev" {
targets = ["cpu-dev", "gpu-dev"]
}
}