Skip to content
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
42 changes: 42 additions & 0 deletions .github/workflows/python-api-k2-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: k2-docker-cd
on:
push:
branches:
- main
paths:
- "docker_images/k2/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Install dependencies
run: |
pip install --upgrade pip
pip install awscli
- name: Update upstream
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
DEFAULT_HOSTNAME: ${{ secrets.DEFAULT_HOSTNAME }}
run: |
python build_docker.py k2 --out out.txt
- name: Deploy on API
run: |
# Load the tags into the env
cat out.txt >> $GITHUB_ENV
export $(xargs < out.txt)
echo ${K2_CPU_TAG}
# Weird single quote escape mechanism because string interpolation does
# not work on single quote in bash
curl -H "Authorization: Bearer ${{ secrets.API_GITHUB_TOKEN }}" https://api.github.com/repos/huggingface/api-inference/actions/workflows/update_community.yaml/dispatches -d '{"ref":"main","inputs":{"framework":"K2","tag": "'"${K2_CPU_TAG}"'"}}'
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# TODO: Merge this with allenNLP to have a single workflow for all docker images.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a second workflow as this one? https://github.com/huggingface/api-inference-community/blob/main/.github/workflows/python-api-flair-cd.yml

That will enabled continuous deployment

name: k2-sherpa-docker
name: k2-docker

on:
pull_request:
paths:
- "docker_images/k2_sherpa/**"
- "docker_images/k2/**"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -24,4 +24,4 @@ jobs:
pip install --upgrade pip
pip install pytest pillow httpx
pip install -e .
- run: RUN_DOCKER_TESTS=1 pytest -sv tests/test_dockers.py::DockerImageTests::test_k2_sherpa
- run: RUN_DOCKER_TESTS=1 pytest -sv tests/test_dockers.py::DockerImageTests::test_k2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY ./requirements.txt /app
RUN pip install --no-cache-dir torch==1.11.0+cpu torchvision==0.12.0+cpu torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir k2==1.17.dev20220719+cpu.torch1.11.0 -f https://k2-fsa.org/nightly/whl/
RUN git clone --single-branch --depth 1 https://github.com/k2-fsa/sherpa && cd sherpa && pip install -r ./requirements.txt && python3 setup.py install --verbose
RUN git clone https://github.com/k2-fsa/sherpa && cd sherpa && git checkout v0.6 && pip install -r ./requirements.txt && python3 setup.py install --verbose

COPY ./prestart.sh /app/

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_dockers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def test_sklearn(self):
timeout=600,
)

def test_k2_sherpa(self):
def test_k2(self):
self.framework_docker_test(
"k2_sherpa",
"k2",
"automatic-speech-recognition",
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13",
)
Expand Down