forked from ggerganov/whisper.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ggerganov:master' into master
- Loading branch information
Showing
80 changed files
with
15,400 additions
and
3,747 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ARG UBUNTU_VERSION=22.04 | ||
# This needs to generally match the container host's environment. | ||
ARG CUDA_VERSION=12.3.1 | ||
# Target the CUDA build image | ||
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} | ||
# Target the CUDA runtime image | ||
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION} | ||
|
||
FROM ${BASE_CUDA_DEV_CONTAINER} AS build | ||
WORKDIR /app | ||
|
||
# Unless otherwise specified, we make a fat build. | ||
ARG CUDA_DOCKER_ARCH=all | ||
# Set nvcc architecture | ||
ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH} | ||
# Enable cuBLAS | ||
ENV WHISPER_CUBLAS=1 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* | ||
|
||
# Ref: https://stackoverflow.com/a/53464012 | ||
ENV CUDA_MAIN_VERSION=12.3 | ||
ENV LD_LIBRARY_PATH /usr/local/cuda-${CUDA_MAIN_VERSION}/compat:$LD_LIBRARY_PATH | ||
|
||
COPY .. . | ||
RUN make | ||
|
||
FROM ${BASE_CUDA_RUN_CONTAINER} AS runtime | ||
WORKDIR /app | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl ffmpeg \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* | ||
|
||
COPY --from=build /app /app | ||
ENTRYPOINT [ "bash", "-c" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM ubuntu:22.04 AS build | ||
WORKDIR /app | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* | ||
|
||
COPY .. . | ||
RUN make | ||
|
||
FROM ubuntu:22.04 AS runtime | ||
WORKDIR /app | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl ffmpeg \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* | ||
|
||
COPY --from=build /app /app | ||
ENTRYPOINT [ "bash", "-c" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Publish Docker image | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to Docker Hub | ||
if: github.event.pull_request.draft == false | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
COMMIT_SHA: ${{ github.sha }} | ||
strategy: | ||
matrix: | ||
config: | ||
- { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64,linux/arm64" } | ||
- { tag: "main-cuda", dockerfile: ".devops/main-cuda.Dockerfile", platform: "linux/amd64" } | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image (versioned) | ||
if: github.event_name == 'push' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
platforms: ${{ matrix.config.platforms }} | ||
tags: "ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}" | ||
file: ${{ matrix.config.dockerfile }} | ||
|
||
- name: Build and push Docker image (tagged) | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: ${{ github.event_name == 'push' }} | ||
platforms: ${{ matrix.config.platforms }} | ||
tags: "ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}" | ||
file: ${{ matrix.config.dockerfile }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.