Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and publish CPU only Docker image #1573

Merged
merged 1 commit into from
May 12, 2022
Merged
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
11 changes: 10 additions & 1 deletion .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
strategy:
matrix:
arch: ["amd64"]
base:
- "nvcr.io/nvidia/pytorch:22.03-py3" # GPU enabled
- "ubuntu:20.04" # CPU only
steps:
- uses: actions/checkout@v2
- name: Log in to the Container registry
Expand All @@ -28,6 +31,11 @@ jobs:
set -ex
base="ghcr.io/coqui-ai/tts"
tags="" # PR build

if [[ ${{ matrix.base }} = "ubuntu:20.04" ]]; then
base="ghcr.io/coqui-ai/tts-cpu"
fi

if [[ "${{ startsWith(github.ref, 'refs/heads/') }}" = "true" ]]; then
# Push to branch
github_ref="${{ github.ref }}"
Expand All @@ -53,4 +61,5 @@ jobs:
context: .
platforms: linux/${{ matrix.arch }}
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.compute-tag.outputs.tags }}
build-args: "BASE=${{ matrix.base }}"
tags: ${{ steps.compute-tag.outputs.tags }}
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
FROM nvcr.io/nvidia/pytorch:22.03-py3
RUN apt-get update && apt-get install -y --no-install-recommends espeak espeak-ng && rm -rf /var/lib/apt/lists/*
ARG BASE=nvcr.io/nvidia/pytorch:22.03-py3
FROM ${BASE}
RUN apt-get update && apt-get install -y --no-install-recommends gcc g++ make python3 python3-dev python3-pip python3-venv python3-wheel espeak espeak-ng libsndfile1-dev && rm -rf /var/lib/apt/lists/*
RUN pip install llvmlite --ignore-installed

# Create and activate virtual env
ENV VIRTUAL_ENV=/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install -U pip setuptools wheel

WORKDIR /root
COPY requirements.txt /root
COPY requirements.dev.txt /root
Expand All @@ -9,4 +17,4 @@ RUN ["/bin/bash", "-c", "pip install -r <(cat requirements.txt requirements.dev.
COPY . /root
RUN make install
ENTRYPOINT ["tts"]
CMD ["--help"]
CMD ["--help"]