From 4fa40f5dcda24b23a63e665ac0a12418f0f3e06f Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Fri, 22 Dec 2023 15:56:28 +0800 Subject: [PATCH] Add CI for train.py from librispeech --- .github/scripts/docker/Dockerfile | 7 +++ .github/workflows/train-librispeech.yml | 57 +++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/scripts/docker/Dockerfile create mode 100644 .github/workflows/train-librispeech.yml diff --git a/.github/scripts/docker/Dockerfile b/.github/scripts/docker/Dockerfile new file mode 100644 index 000000000..dacabf94c --- /dev/null +++ b/.github/scripts/docker/Dockerfile @@ -0,0 +1,7 @@ +FROM k2fsa/icefall:torch1.13.0-cuda11.6 + +WORKDIR /workspace/icefall + +RUN cd egs/librispeech/ASR && \ + ./prepare.sh --stop-stage 1 && \ + ls -lh download data diff --git a/.github/workflows/train-librispeech.yml b/.github/workflows/train-librispeech.yml new file mode 100644 index 000000000..a33b72cbf --- /dev/null +++ b/.github/workflows/train-librispeech.yml @@ -0,0 +1,57 @@ +name: train librispeech +on: + push: + branches: + - ci-train + workflow_dispatch: + +concurrency: + group: train-librispeech-${{ github.ref }} + cancel-in-progress: true + +jobs: + train-librispeech: + name: ${{ matrix.image }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + + steps: + # refer to https://github.com/actions/checkout + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Rename + shell: bash + run: | + cp -v .github/scripts/docker/Dockerfile ./Dockerfile + + - name: Free space + shell: bash + run: | + df -h + rm -rf /opt/hostedtoolcache + df -h + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: 'Login to GitHub Container Registry' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build docker Image + shell: bash + run: | + cp -v .github/scripts/docker/Dockerfile ./Dockerfile + docker build -t ghcr.io/k2-fsa/icefall:librispeech . + docker image ls