Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cociweb committed Jan 25, 2024
1 parent 03eff5c commit 9489661
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/addon-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Test Add-on

on:
push:
branches-ignore:
- main
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
addon: ["custom_whisper"]
arch: ["aarch64", "amd64"]

steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]

- name: Get information
id: info
uses: home-assistant/actions/helpers/info@master
with:
path: ./${{ matrix.addon }}

- name: Build ${{ matrix.arch }} add-on
# if: github.event_name == 'push' && contains(github.ref, '/tags/v')
uses: home-assistant/[email protected]
with:
args: |
--${{ matrix.arch }} \
--target ${{matrix.addon}} \
--image "${{ matrix.arch }}-addon-whisper" \
--docker-hub "ghcr.io/${{ github.repository_owner }}"
--test
2 changes: 1 addition & 1 deletion .github/workflows/addon.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Add-on
name: Build and Publish Add-on

on:
push:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Lint Add-on
on:
push:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/standalone-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Test Standalone

on:
push:
branches-ignore:
- main
pull_request:
workflow_dispatch:

jobs:
push_to_registries:
name: Build Standalone
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
matrix:
addon: ["standalone_whisper"]
device: ["cpu", "cuda"]
type: [ {arch: "aarch64", platform: "linux/arm64"}, {arch: "amd64", platform: "linux/amd64"} ]


steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.ACTION_TOKEN }}

-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.type.arch }}

- uses: mr-smithers-excellent/docker-build-push@v6
name: "Build & push Standalone Docker image: ${{ matrix.type.arch }}-${{ matrix.device }}"
with:
image: "${{ matrix.type.arch }}_${{ matrix.device }}-${{ matrix.addon }}"
dockerfile: "${{ matrix.addon }}/${{ matrix.device }}/${{ matrix.type.arch }}-Dockerfile"
tags: latest
registry: ghcr.io
platform: ${{ matrix.type.platform }}
username: ${{ github.repository_owner }}
password: ${{ secrets.ACTION_TOKEN }}
pushImage: false
2 changes: 1 addition & 1 deletion .github/workflows/standalone.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Standalone
name: Build and Publish Standalone

on:
push:
Expand Down
4 changes: 3 additions & 1 deletion custom_whisper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ RUN pip3 install --no-cache-dir -U --upgrade wyoming ctranslate2 tokenizers

WORKDIR /
ADD https://github.com/rhasspy/wyoming-faster-whisper/archive/refs/tags/v${WYOMING_FASTER_WHISPER_VERSION}.tar.gz wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
RUN ls -lah
RUN pip3 install --no-cache-dir wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
# "wyoming-faster-whisper==${WYOMING_FASTER_WHISPER_VERSION}"
WORKDIR /usr/local/lib/python3.11/dist-packages/wyoming_faster_whisper-1.1.0.dist-info/
WORKDIR /usr/local/lib/python3.11/dist-packages/wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.dist-info/
RUN ls -lah
RUN sed -i -e 's/==1.5.2/>=1.5.2/g' \
-e 's/==0.15.1/>=0.15.1/g' \
METADATA
Expand Down
2 changes: 2 additions & 0 deletions standalone_whisper/cpu/aarch64-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ RUN pip3 install --no-cache-dir -U --upgrade wyoming ctranslate2 tokenizers

WORKDIR /
ADD https://github.com/rhasspy/wyoming-faster-whisper/archive/refs/tags/v${WYOMING_FASTER_WHISPER_VERSION}.tar.gz wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
RUN ls -lah
RUN pip3 install --no-cache-dir wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
# "wyoming-faster-whisper==1.1.0"
WORKDIR /usr/local/lib/python3.11/site-packages/wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.dist-info/
RUN ls -lah
RUN sed -i -e 's/==1.5.2/>=1.5.2/g' \
-e 's/==0.15.1/>=0.15.1/g' \
METADATA
Expand Down
2 changes: 2 additions & 0 deletions standalone_whisper/cpu/amd64-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ RUN pip3 install --no-cache-dir -U --upgrade wyoming ctranslate2 tokenizers

WORKDIR /
ADD https://github.com/rhasspy/wyoming-faster-whisper/archive/refs/tags/v${WYOMING_FASTER_WHISPER_VERSION}.tar.gz wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
RUN ls -lah
RUN pip3 install --no-cache-dir wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
# "wyoming-faster-whisper==1.1.0"
WORKDIR /usr/local/lib/python3.11/site-packages/wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.dist-info/
RUN ls -lah
RUN sed -i -e 's/==1.5.2/>=1.5.2/g' \
-e 's/==0.15.1/>=0.15.1/g' \
METADATA
Expand Down
2 changes: 2 additions & 0 deletions standalone_whisper/cuda/aarch64-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ RUN pip3 install --no-cache-dir -U --upgrade wyoming ctranslate2 tokenizers

WORKDIR /
ADD https://github.com/rhasspy/wyoming-faster-whisper/archive/refs/tags/v${WYOMING_FASTER_WHISPER_VERSION}.tar.gz wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
RUN ls -lah
RUN pip3 install --no-cache-dir wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
# "wyoming-faster-whisper==1.1.0"
WORKDIR /usr/local/lib/python3.10/dist-packages/wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.dist-info/
RUN ls -lah
RUN sed -i -e 's/==1.5.2/>=1.5.2/g' \
-e 's/==0.15.1/>=0.15.1/g' \
METADATA
Expand Down
2 changes: 2 additions & 0 deletions standalone_whisper/cuda/amd64-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ RUN pip3 install --no-cache-dir -U --upgrade wyoming ctranslate2 tokenizers

WORKDIR /
ADD https://github.com/rhasspy/wyoming-faster-whisper/archive/refs/tags/v${WYOMING_FASTER_WHISPER_VERSION}.tar.gz wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
RUN ls -lah
RUN pip3 install --no-cache-dir wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.tar.gz
# "wyoming-faster-whisper==1.1.0"
WORKDIR /usr/local/lib/python3.10/dist-packages/wyoming_faster_whisper-${WYOMING_FASTER_WHISPER_VERSION}.dist-info/
RUN ls -lah
RUN sed -i -e 's/==1.5.2/>=1.5.2/g' \
-e 's/==0.15.1/>=0.15.1/g' \
METADATA
Expand Down

0 comments on commit 9489661

Please sign in to comment.