mirror of https://github.com/coqui-ai/TTS.git
build: update development dockerfile and test it in ci
This commit is contained in:
parent
e3fed5cf70
commit
20e82bc92d
|
@ -63,3 +63,58 @@ jobs:
|
|||
push: ${{ github.event_name == 'push' }}
|
||||
build-args: "BASE=${{ matrix.base }}"
|
||||
tags: ${{ steps.compute-tag.outputs.tags }}
|
||||
docker-dev-build:
|
||||
name: "Build the development Docker image"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ["amd64"]
|
||||
base:
|
||||
- "nvidia/cuda:11.8.0-base-ubuntu22.04" # GPU enabled
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Compute Docker tags, check VERSION file matches tag
|
||||
id: compute-tag
|
||||
run: |
|
||||
set -ex
|
||||
base="ghcr.io/idiap/coqui-tts-dev"
|
||||
tags="" # PR build
|
||||
|
||||
if [[ ${{ matrix.base }} = "python:3.10.8-slim" ]]; then
|
||||
base="ghcr.io/idiap/coqui-tts-dev-cpu"
|
||||
fi
|
||||
|
||||
if [[ "${{ startsWith(github.ref, 'refs/heads/') }}" = "true" ]]; then
|
||||
# Push to branch
|
||||
github_ref="${{ github.ref }}"
|
||||
branch=${github_ref#*refs/heads/} # strip prefix to get branch name
|
||||
tags="${base}:${branch},${base}:${{ github.sha }},"
|
||||
elif [[ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]]; then
|
||||
VERSION="v$(grep -m 1 version pyproject.toml | grep -P '\d+\.\d+\.\d+' -o)"
|
||||
if [[ "${{ github.ref }}" != "refs/tags/${VERSION}" ]]; then
|
||||
echo "Pushed tag does not match VERSION file. Aborting push."
|
||||
exit 1
|
||||
fi
|
||||
tags="${base}:${VERSION},${base}:latest,${base}:${{ github.sha }}"
|
||||
fi
|
||||
echo "::set-output name=tags::${tags}"
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: dockerfiles/Dockerfile.dev
|
||||
platforms: linux/${{ matrix.arch }}
|
||||
push: false
|
||||
build-args: "BASE=${{ matrix.base }}"
|
||||
tags: ${{ steps.compute-tag.outputs.tags }}
|
||||
|
|
|
@ -16,29 +16,8 @@ RUN pip3 install llvmlite --ignore-installed
|
|||
RUN pip3 install torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu118
|
||||
RUN rm -rf /root/.cache/pip
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
# Copy Dependency Lock Files:
|
||||
COPY \
|
||||
Makefile \
|
||||
pyproject.toml \
|
||||
setup.py \
|
||||
requirements.dev.txt \
|
||||
requirements.ja.txt \
|
||||
requirements.notebooks.txt \
|
||||
requirements.txt \
|
||||
/root/
|
||||
|
||||
# Install Project Dependencies
|
||||
# Separate stage to limit re-downloading:
|
||||
RUN pip install \
|
||||
-r requirements.txt \
|
||||
-r requirements.dev.txt \
|
||||
-r requirements.ja.txt \
|
||||
-r requirements.notebooks.txt
|
||||
|
||||
# Copy TTS repository contents:
|
||||
WORKDIR /root
|
||||
COPY . /root
|
||||
|
||||
# Installing the TTS package itself:
|
||||
RUN make install_dev
|
||||
RUN make install
|
||||
|
|
Loading…
Reference in New Issue