From 2164352e19a6894c7f6f09f346ff2cc50a065b63 Mon Sep 17 00:00:00 2001 From: Christopher Aedo Date: Sat, 6 Jan 2024 16:18:34 -0800 Subject: [PATCH] Add cuda container --- .github/workflows/docker-publish.yml | 35 +++++++++++++++++++++++++++- Dockerfile.cuda12 | 15 ++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.cuda12 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 876b23d..8c04625 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -47,4 +47,37 @@ jobs: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} + + build-and-push-cuda12-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + file: Dockerfile.cuda12 + push: true + tags: ghcr.io/aedocw/epub2tts:release-cuda12 + labels: epub2tts-cuda12 + diff --git a/Dockerfile.cuda12 b/Dockerfile.cuda12 new file mode 100644 index 0000000..147c65a --- /dev/null +++ b/Dockerfile.cuda12 @@ -0,0 +1,15 @@ +FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-devel +ARG DEBIAN_FRONTEND=noninteractive + +ENV BOOK=mybook.epub + +RUN mkdir /opt/epub2tts && \ + apt-get update && \ + apt install --no-install-recommends -y espeak-ng ffmpeg +ADD requirements.txt /opt/epub2tts/. +ADD epub2tts.py /opt/epub2tts/. +RUN pip3 install -r /opt/epub2tts/requirements.txt + +ENTRYPOINT ["python3", "/opt/epub2tts/epub2tts.py"] + +CMD ["--help"]