Merge pull request #1998 from coqui-ai/aar-pack-deps

Package dynamic deps in AAR
This commit is contained in:
Reuben Morais 2021-10-29 20:48:43 +02:00 committed by GitHub
commit 65e66117e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 360 additions and 64 deletions

View File

@ -0,0 +1,77 @@
name: "NodeJS binding"
description: "Binding a nodejs binding"
inputs:
nodejs_versions:
description: "NodeJS versions supported"
required: true
electronjs_versions:
description: "ElectronJS versions supported"
required: true
local_cflags:
description: "CFLAGS for NodeJS package"
required: false
default: ""
local_ldflags:
description: "LDFLAGS for NodeJS package"
required: false
default: ""
local_libs:
description: "LIBS for NodeJS package"
required: false
default: ""
target:
description: "TARGET value"
required: false
default: "host"
chroot:
description: "RASPBIAN value"
required: false
default: ""
runs:
using: "composite"
steps:
- run: |
node --version
npm --version
shell: msys2 {0}
- run: |
npm update
shell: msys2 {0}
- run: |
mkdir -p tmp/headers/nodejs tmp/headers/electronjs
shell: msys2 {0}
- run: |
for node in ${{ inputs.nodejs_versions }}; do
EXTRA_CFLAGS=${{ inputs.local_cflags }} \
EXTRA_LDFLAGS=${{ inputs.local_ldflags }} \
EXTRA_LIBS=${{ inputs.local_libs }} \
make -C native_client/javascript \
TARGET=${{ inputs.target }} \
RASPBIAN=${{ inputs.chroot }} \
NODE_ABI_TARGET=--target=${node} \
NODE_DEVDIR=--devdir=headers/nodejs \
clean node-wrapper
done;
shell: msys2 {0}
- run: |
for electron in ${{ inputs.electronjs_versions }}; do
EXTRA_CFLAGS=${{ inputs.local_cflags }} \
EXTRA_LDFLAGS=${{ inputs.local_ldflags }} \
EXTRA_LIBS=${{ inputs.local_libs }} \
make -C native_client/javascript \
TARGET=${{ inputs.target }} \
RASPBIAN=${{ inputs.chroot }} \
NODE_ABI_TARGET=--target=${electron} \
NODE_DIST_URL=--disturl=https://electronjs.org/headers \
NODE_RUNTIME=--runtime=electron \
NODE_DEVDIR=--devdir=headers/electronjs \
clean node-wrapper
done;
shell: msys2 {0}
- run: |
make -C native_client/javascript clean npm-pack
shell: msys2 {0}
- run: |
tar -czf native_client/javascript/wrapper.tar.gz \
-C native_client/javascript/ lib/
shell: msys2 {0}

View File

@ -0,0 +1,14 @@
GitHub Action to set NumPy versions
===================================
This actions aims at computing correct values for NumPy dependencies:
- `NUMPY_BUILD_VERSION`: range of accepted versions at Python binding build time
- `NUMPY_DEP_VERSION`: range of accepted versions for execution time
Versions are set considering several factors:
- API and ABI compatibility ; otherwise we can have the binding wrapper
throwing errors like "Illegal instruction", or computing wrong values
because of changed memory layout
- Wheels availability: for CI and end users, we want to avoid having to
rebuild numpy so we stick to versions where there is an existing upstream
`wheel` file

View File

@ -0,0 +1,93 @@
name: "get numpy versions"
description: "Get proper NumPy build and runtime versions dependencies range"
inputs:
pyver:
description: "Python version"
required: true
outputs:
build_version:
description: "NumPy build dependency"
value: ${{ steps.numpy.outputs.build }}
dep_version:
description: "NumPy runtime dependency"
value: ${{ steps.numpy.outputs.dep }}
runs:
using: "composite"
steps:
- id: numpy
run: |
set -ex
NUMPY_BUILD_VERSION="==1.7.0"
NUMPY_DEP_VERSION=">=1.7.0"
OS=$(uname -s)
ARCH=$(uname -m)
case "${OS}:${ARCH}" in
Linux:x86_64)
case "${{ inputs.pyver }}" in
3.7*)
NUMPY_BUILD_VERSION="==1.14.5"
NUMPY_DEP_VERSION=">=1.14.5,<=1.19.4"
;;
3.8*)
NUMPY_BUILD_VERSION="==1.17.3"
NUMPY_DEP_VERSION=">=1.17.3,<=1.19.4"
;;
3.9*)
NUMPY_BUILD_VERSION="==1.19.4"
NUMPY_DEP_VERSION=">=1.19.4,<=1.19.4"
;;
esac
;;
Darwin:*)
case "${{ inputs.pyver }}" in
3.6*)
NUMPY_BUILD_VERSION="==1.9.0"
NUMPY_DEP_VERSION=">=1.9.0"
;;
3.7*)
NUMPY_BUILD_VERSION="==1.14.5"
NUMPY_DEP_VERSION=">=1.14.5,<=1.17.0"
;;
3.8*)
NUMPY_BUILD_VERSION="==1.17.3"
NUMPY_DEP_VERSION=">=1.17.3,<=1.17.3"
;;
3.9*)
NUMPY_BUILD_VERSION="==1.19.4"
NUMPY_DEP_VERSION=">=1.19.4,<=1.19.4"
;;
esac
;;
${CI_MSYS_VERSION}:x86_64)
case "${{ inputs.pyver }}" in
3.5*)
NUMPY_BUILD_VERSION="==1.11.0"
NUMPY_DEP_VERSION=">=1.11.0,<1.12.0"
;;
3.6*)
NUMPY_BUILD_VERSION="==1.12.0"
NUMPY_DEP_VERSION=">=1.12.0,<1.14.5"
;;
3.7*)
NUMPY_BUILD_VERSION="==1.14.5"
NUMPY_DEP_VERSION=">=1.14.5,<=1.17.0"
;;
3.8*)
NUMPY_BUILD_VERSION="==1.17.3"
NUMPY_DEP_VERSION=">=1.17.3,<=1.17.3"
;;
3.9*)
NUMPY_BUILD_VERSION="==1.19.4"
NUMPY_DEP_VERSION=">=1.19.4,<=1.19.4"
;;
esac
;;
esac
echo "::set-output name=build::${NUMPY_BUILD_VERSION}"
echo "::set-output name=dep::${NUMPY_DEP_VERSION}"
shell: msys2 {0}

View File

@ -0,0 +1,31 @@
name: "Python binding"
description: "Binding a python binding"
inputs:
numpy_build:
description: "NumPy build dependecy"
required: true
numpy_dep:
description: "NumPy runtime dependecy"
required: true
runs:
using: "composite"
steps:
- run: |
set -xe
python3 --version
pip3 --version
PROJECT_NAME="stt"
NUMPY_BUILD_VERSION="${{ inputs.numpy_build }}" \
NUMPY_DEP_VERSION="${{ inputs.numpy_dep }}" \
EXTRA_CFLAGS=${{ inputs.local_cflags }} \
EXTRA_LDFLAGS=${{ inputs.local_ldflags }} \
EXTRA_LIBS=${{ inputs.local_libs }} \
make -C native_client/python/ \
TARGET=${{ inputs.target }} \
RASPBIAN=${{ inputs.chroot }} \
SETUP_FLAGS="--project_name ${PROJECT_NAME}" \
bindings-clean bindings
shell: msys2 {0}

View File

@ -0,0 +1,35 @@
name: "Tests execution"
description: "Running tests"
inputs:
runtime:
description: "Runtime to use for running test"
required: true
model-kind:
description: "Running against CI baked or production model"
required: true
bitrate:
description: "Bitrate for testing"
required: true
chroot:
description: "Run using a chroot"
required: false
runs:
using: "composite"
steps:
- run: |
set -xe
build="_tflite"
model_kind=""
if [ "${{ inputs.model-kind }}" = "prod" ]; then
model_kind="-prod"
fi
prefix="."
if [ ! -z "${{ inputs.chroot }}" ]; then
prefix="${{ inputs.chroot }}"
fi
${prefix}/ci_scripts/${{ inputs.runtime }}${build}-tests${model_kind}.sh ${{ inputs.bitrate }}
shell: msys2 {0}

View File

@ -18,7 +18,6 @@ env:
# Windows specific # Windows specific
CI_MSYS_VERSION: MSYS_NT-10.0-17763 CI_MSYS_VERSION: MSYS_NT-10.0-17763
MSYS2_SHELL_PATH: D:\a\_temp\msys\msys64\usr\bin
defaults: defaults:
run: run:
shell: bash shell: bash
@ -98,7 +97,7 @@ jobs:
sudo apt-get install -y --no-install-recommends autoconf automake bison build-essential mingw-w64 sudo apt-get install -y --no-install-recommends autoconf automake bison build-essential mingw-w64
if: steps.swig-build-cache.outputs.cache-hit != 'true' if: steps.swig-build-cache.outputs.cache-hit != 'true'
- run: | - run: |
curl -sSL https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz > pcre-8.43.tar.gz curl -sSL https://github.com/coqui-ai/STT/releases/download/v0.10.0-alpha.7/pcre-8.43.tar.gz > pcre-8.43.tar.gz
if: steps.swig-build-cache.outputs.cache-hit != 'true' if: steps.swig-build-cache.outputs.cache-hit != 'true'
- run: | - run: |
./Tools/pcre-build.sh --host=x86_64-w64-mingw32 ./Tools/pcre-build.sh --host=x86_64-w64-mingw32
@ -144,7 +143,7 @@ jobs:
path: build-static/ path: build-static/
key: swig-4-${{ runner.os }}-${{ env.swig_hash }} key: swig-4-${{ runner.os }}-${{ env.swig_hash }}
- run: | - run: |
curl -sSL https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz > pcre-8.43.tar.gz curl -sSL https://github.com/coqui-ai/STT/releases/download/v0.10.0-alpha.7/pcre-8.43.tar.gz > pcre-8.43.tar.gz
if: steps.swig-build-cache.outputs.cache-hit != 'true' if: steps.swig-build-cache.outputs.cache-hit != 'true'
- run: | - run: |
./Tools/pcre-build.sh ./Tools/pcre-build.sh
@ -1161,7 +1160,7 @@ jobs:
brew install automake brew install automake
if: steps.swig-build-cache.outputs.cache-hit != 'true' if: steps.swig-build-cache.outputs.cache-hit != 'true'
- run: | - run: |
curl -sSL https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz > pcre-8.43.tar.gz curl -sSL https://github.com/coqui-ai/STT/releases/download/v0.10.0-alpha.7/pcre-8.43.tar.gz > pcre-8.43.tar.gz
if: steps.swig-build-cache.outputs.cache-hit != 'true' if: steps.swig-build-cache.outputs.cache-hit != 'true'
- run: | - run: |
./Tools/pcre-build.sh ./Tools/pcre-build.sh
@ -1668,9 +1667,10 @@ jobs:
name: "Win|Build CTC decoder Python package" name: "Win|Build CTC decoder Python package"
needs: [swig_Windows_crosscompiled] needs: [swig_Windows_crosscompiled]
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -1693,15 +1693,22 @@ jobs:
with: with:
name: "swig_Windows_crosscompiled" name: "swig_Windows_crosscompiled"
path: ${{ github.workspace }}/native_client/ds-swig/ path: ${{ github.workspace }}/native_client/ds-swig/
- name: Remove /usr/bin/link conflicting with MSVC link.exe
run: |
set -ex
which link
rm /usr/bin/link
- name: Remove mingw32-make conflicting with MSYS make
run: |
set -ex
which mingw32-make
rm /c/ProgramData/Chocolatey/bin/mingw32-make
- name: Link ds-swig into swig - name: Link ds-swig into swig
run: | run: |
set -ex set -ex
ls -hal native_client/ds-swig/bin ls -hal native_client/ds-swig/bin
ln -s ds-swig.exe native_client/ds-swig/bin/swig.exe ln -s ds-swig.exe native_client/ds-swig/bin/swig.exe
chmod +x native_client/ds-swig/bin/ds-swig.exe native_client/ds-swig/bin/swig.exe chmod +x native_client/ds-swig/bin/ds-swig.exe native_client/ds-swig/bin/swig.exe
- name: Remove /usr/bin/link conflicting with MSVC link.exe
run: |
rm /usr/bin/link
- run: | - run: |
make -C native_client/ctcdecode/ \ make -C native_client/ctcdecode/ \
NUM_PROCESSES=$(nproc) \ NUM_PROCESSES=$(nproc) \
@ -1725,7 +1732,7 @@ jobs:
- id: get_cache_key - id: get_cache_key
uses: ./.github/actions/get_cache_key uses: ./.github/actions/get_cache_key
with: with:
extras: "9" extras: "10"
- id: check_artifact_exists - id: check_artifact_exists
uses: ./.github/actions/check_artifact_exists uses: ./.github/actions/check_artifact_exists
with: with:
@ -1734,10 +1741,17 @@ jobs:
name: "Win|Build TensorFlow (opt)" name: "Win|Build TensorFlow (opt)"
needs: tensorflow_opt-Windows needs: tensorflow_opt-Windows
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps: steps:
- run: true - run: true
shell: bash
if: needs.tensorflow_opt-Windows.outputs.status == 'found' if: needs.tensorflow_opt-Windows.outputs.status == 'found'
- uses: ilammy/msvc-dev-cmd@v1 - uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'recursive'
if: needs.tensorflow_opt-Windows.outputs.status == 'missing' if: needs.tensorflow_opt-Windows.outputs.status == 'missing'
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
@ -1751,20 +1765,16 @@ jobs:
unzip unzip
zip zip
if: needs.tensorflow_opt-Windows.outputs.status == 'missing' if: needs.tensorflow_opt-Windows.outputs.status == 'missing'
- uses: ilammy/msvc-dev-cmd@v1
if: needs.tensorflow_opt-Windows.outputs.status == 'missing'
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: 3.7.9 python-version: 3.7.9
if: needs.tensorflow_opt-Windows.outputs.status == 'missing' if: needs.tensorflow_opt-Windows.outputs.status == 'missing'
- uses: actions/checkout@v2 - name: Workaround bazel bug when LLVM is installed https://github.com/bazelbuild/bazel/issues/12144
with: run: |
fetch-depth: 0 rm -f /c/msys64/mingw64/clang-cl*
submodules: 'recursive' rm -rf "/c/Program Files/LLVM"
if: needs.tensorflow_opt-Windows.outputs.status == 'missing'
# It's important that this PATH change only happens *after* the checkout
# above, because otherwise the checkout fails when persisisting the
# credentials for submodules due to using MSYS2 Git
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
if: needs.tensorflow_opt-Windows.outputs.status == 'missing' if: needs.tensorflow_opt-Windows.outputs.status == 'missing'
- run: ./ci_scripts/tf-setup.sh - run: ./ci_scripts/tf-setup.sh
if: needs.tensorflow_opt-Windows.outputs.status == 'missing' if: needs.tensorflow_opt-Windows.outputs.status == 'missing'
@ -1780,14 +1790,14 @@ jobs:
build-lib_Windows: build-lib_Windows:
name: "Win|Build libstt+client" name: "Win|Build libstt+client"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [build-tensorflow-Windows, tensorflow_opt-Windows] needs: [build-tensorflow-Windows, tensorflow_opt-Windows]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: ilammy/msvc-dev-cmd@v1
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -1800,6 +1810,7 @@ jobs:
tar tar
unzip unzip
zip zip
- uses: ilammy/msvc-dev-cmd@v1
- uses: ./.github/actions/check_artifact_exists - uses: ./.github/actions/check_artifact_exists
with: with:
name: ${{ needs.tensorflow_opt-Windows.outputs.cache_key }}.tar.xz name: ${{ needs.tensorflow_opt-Windows.outputs.cache_key }}.tar.xz
@ -1808,8 +1819,10 @@ jobs:
- run: | - run: |
"C:/Program Files/7-Zip/7z.exe" x ${{ needs.tensorflow_opt-Windows.outputs.cache_key }}.tar.xz -so | "C:/Program Files/7-Zip/7z.exe" x -aos -si -ttar -o`pwd` "C:/Program Files/7-Zip/7z.exe" x ${{ needs.tensorflow_opt-Windows.outputs.cache_key }}.tar.xz -so | "C:/Program Files/7-Zip/7z.exe" x -aos -si -ttar -o`pwd`
rm ${{ needs.tensorflow_opt-Windows.outputs.cache_key }}.tar.xz rm ${{ needs.tensorflow_opt-Windows.outputs.cache_key }}.tar.xz
- run: | - name: Workaround bazel bug when LLVM is installed https://github.com/bazelbuild/bazel/issues/12144
git status run: |
rm -f /c/msys64/mingw64/clang-cl*
rm -rf "/c/Program Files/LLVM"
- run: ./ci_scripts/host-build.sh - run: ./ci_scripts/host-build.sh
- run: ./ci_scripts/package.sh - run: ./ci_scripts/package.sh
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
@ -1823,6 +1836,9 @@ jobs:
build-python-Windows: build-python-Windows:
name: "Win|Build Python bindings" name: "Win|Build Python bindings"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [build-lib_Windows, swig_Windows_crosscompiled] needs: [build-lib_Windows, swig_Windows_crosscompiled]
strategy: strategy:
matrix: matrix:
@ -1830,8 +1846,6 @@ jobs:
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md
python-version: [3.6.8, 3.7.9, 3.8.8, 3.9.4] python-version: [3.6.8, 3.7.9, 3.8.8, 3.9.4]
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -1871,13 +1885,16 @@ jobs:
run: | run: |
rm /usr/bin/link rm /usr/bin/link
- id: get_numpy - id: get_numpy
uses: ./.github/actions/numpy_vers uses: ./.github/actions/win-numpy-vers
with: with:
pyver: ${{ matrix.python-version }} pyver: ${{ matrix.python-version }}
- uses: ./.github/actions/python-build - uses: ./.github/actions/win-python-build
with: with:
numpy_build: "${{ steps.get_numpy.outputs.build_version }}" numpy_build: "${{ steps.get_numpy.outputs.build_version }}"
numpy_dep: "${{ steps.get_numpy.outputs.dep_version }}" numpy_dep: "${{ steps.get_numpy.outputs.dep_version }}"
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: failure()
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: "stt-tflite-${{ matrix.python-version }}-Windows.whl" name: "stt-tflite-${{ matrix.python-version }}-Windows.whl"
@ -1885,10 +1902,11 @@ jobs:
build-nodejs-Windows: build-nodejs-Windows:
name: "Win|Build NodeJS/ElectronJS" name: "Win|Build NodeJS/ElectronJS"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [build-lib_Windows, swig_Windows_crosscompiled] needs: [build-lib_Windows, swig_Windows_crosscompiled]
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -1935,7 +1953,7 @@ jobs:
with: with:
path: native_client/javascript/headers/electronjs/ path: native_client/javascript/headers/electronjs/
key: electron-headers-win-5.0.13_12.0.0 key: electron-headers-win-5.0.13_12.0.0
- uses: ./.github/actions/node-build - uses: ./.github/actions/win-node-build
with: with:
nodejs_versions: "10.0.0 11.0.0 12.7.0 13.0.0 14.0.0 15.0.0 16.0.0" nodejs_versions: "10.0.0 11.0.0 12.7.0 13.0.0 14.0.0 15.0.0 16.0.0"
electronjs_versions: "5.0.13 6.0.12 6.1.7 7.0.1 7.1.8 8.0.1 9.0.1 9.1.0 9.2.0 10.0.0 10.1.0 11.0.0 12.0.0" electronjs_versions: "5.0.13 6.0.12 6.1.7 7.0.1 7.1.8 8.0.1 9.0.1 9.1.0 9.2.0 10.0.0 10.1.0 11.0.0 12.0.0"
@ -1950,17 +1968,19 @@ jobs:
test-cpp-Windows: test-cpp-Windows:
name: "Win|Test C++ binary" name: "Win|Test C++ binary"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [build-lib_Windows, train-test-model-Linux] needs: [build-lib_Windows, train-test-model-Linux]
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
env: env:
CI_TMP_DIR: tmp/ CI_TMP_DIR: tmp/
STT_TEST_MODEL: tmp/output_graph.pb STT_TEST_MODEL: tmp/output_graph.pb
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
path-type: inherit
update: true update: true
install: >- install: >-
vim vim
@ -1986,7 +2006,7 @@ jobs:
path: ${{ env.CI_TMP_DIR }} path: ${{ env.CI_TMP_DIR }}
- run: | - run: |
ls -hal ${{ env.CI_TMP_DIR }}/ ls -hal ${{ env.CI_TMP_DIR }}/
- uses: ./.github/actions/run-tests - uses: ./.github/actions/win-run-tests
with: with:
runtime: "cppwin" runtime: "cppwin"
bitrate: "16k" bitrate: "16k"
@ -1994,6 +2014,9 @@ jobs:
test-py-Windows: test-py-Windows:
name: "Win|Test Python bindings" name: "Win|Test Python bindings"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [ build-python-Windows, train-test-model-Linux ] needs: [ build-python-Windows, train-test-model-Linux ]
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
strategy: strategy:
@ -2009,8 +2032,6 @@ jobs:
STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm
STT_TEST_MODEL: tmp/output_graph.pb STT_TEST_MODEL: tmp/output_graph.pb
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -2040,7 +2061,7 @@ jobs:
- run: | - run: |
ls -hal ${{ env.CI_TMP_DIR }}/ ls -hal ${{ env.CI_TMP_DIR }}/
python -m pip install --only-binary :all: --upgrade ${{ env.CI_TMP_DIR }}/stt*.whl python -m pip install --only-binary :all: --upgrade ${{ env.CI_TMP_DIR }}/stt*.whl
- uses: ./.github/actions/run-tests - uses: ./.github/actions/win-run-tests
with: with:
runtime: "python" runtime: "python"
bitrate: ${{ matrix.bitrate }} bitrate: ${{ matrix.bitrate }}
@ -2048,6 +2069,9 @@ jobs:
test-nodejs-Windows: test-nodejs-Windows:
name: "Win|Test NodeJS bindings" name: "Win|Test NodeJS bindings"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [ build-nodejs-Windows, train-test-model-Linux ] needs: [ build-nodejs-Windows, train-test-model-Linux ]
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
strategy: strategy:
@ -2062,8 +2086,6 @@ jobs:
STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm
STT_TEST_MODEL: tmp/output_graph.pb STT_TEST_MODEL: tmp/output_graph.pb
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -2103,7 +2125,7 @@ jobs:
run: | run: |
ls -hal ${{ env.CI_TMP_DIR }}/ ls -hal ${{ env.CI_TMP_DIR }}/
npm install ${{ env.CI_TMP_DIR }}/stt*.tgz npm install ${{ env.CI_TMP_DIR }}/stt*.tgz
- uses: ./.github/actions/run-tests - uses: ./.github/actions/win-run-tests
with: with:
runtime: "node" runtime: "node"
bitrate: ${{ matrix.bitrate }} bitrate: ${{ matrix.bitrate }}
@ -2111,6 +2133,9 @@ jobs:
test-electronjs-Windows: test-electronjs-Windows:
name: "Win|Test ElectronJS bindings" name: "Win|Test ElectronJS bindings"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [ build-nodejs-Windows, train-test-model-Linux ] needs: [ build-nodejs-Windows, train-test-model-Linux ]
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
strategy: strategy:
@ -2124,8 +2149,6 @@ jobs:
STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm
STT_TEST_MODEL: tmp/output_graph.pb STT_TEST_MODEL: tmp/output_graph.pb
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -2167,7 +2190,7 @@ jobs:
npm install ${{ env.CI_TMP_DIR }}/stt*.tgz npm install ${{ env.CI_TMP_DIR }}/stt*.tgz
- run: | - run: |
npm install electron@${{ matrix.electronjs-version }} npm install electron@${{ matrix.electronjs-version }}
- uses: ./.github/actions/run-tests - uses: ./.github/actions/win-run-tests
with: with:
runtime: "electronjs" runtime: "electronjs"
bitrate: ${{ matrix.bitrate }} bitrate: ${{ matrix.bitrate }}
@ -2433,6 +2456,9 @@ jobs:
test-nodejs_all-Windows: test-nodejs_all-Windows:
name: "Win|Test MultiArchPlatform NodeJS bindings" name: "Win|Test MultiArchPlatform NodeJS bindings"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [repackage-nodejs-allplatforms, train-test-model-Linux] needs: [repackage-nodejs-allplatforms, train-test-model-Linux]
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
strategy: strategy:
@ -2448,8 +2474,6 @@ jobs:
STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm
STT_TEST_MODEL: tmp/output_graph.pb STT_TEST_MODEL: tmp/output_graph.pb
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -2489,7 +2513,7 @@ jobs:
run: | run: |
ls -hal ${{ env.CI_TMP_DIR }}/ ls -hal ${{ env.CI_TMP_DIR }}/
npm install --verbose ${{ env.CI_TMP_DIR }}/stt*.tgz npm install --verbose ${{ env.CI_TMP_DIR }}/stt*.tgz
- uses: ./.github/actions/run-tests - uses: ./.github/actions/win-run-tests
with: with:
runtime: "node" runtime: "node"
bitrate: ${{ matrix.bitrate }} bitrate: ${{ matrix.bitrate }}
@ -2497,6 +2521,9 @@ jobs:
test-electronjs_all-Windows: test-electronjs_all-Windows:
name: "Win|Test MultiArchPlatform ElectronJS bindings" name: "Win|Test MultiArchPlatform ElectronJS bindings"
runs-on: windows-2019 runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
needs: [repackage-nodejs-allplatforms, train-test-model-Linux] needs: [repackage-nodejs-allplatforms, train-test-model-Linux]
if: ${{ github.event_name == 'pull_request' }} if: ${{ github.event_name == 'pull_request' }}
strategy: strategy:
@ -2511,8 +2538,6 @@ jobs:
STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm STT_PROD_MODEL_MMAP: https://github.com/reuben/STT/releases/download/v0.7.0-alpha.3/output_graph.pbmm
STT_TEST_MODEL: tmp/output_graph.pb STT_TEST_MODEL: tmp/output_graph.pb
steps: steps:
- name: Switch git-bash shell to MSYS2 shell by adding MSYS2 path to PATH front
run: echo "$MSYS2_SHELL_PATH" >> $GITHUB_PATH
- uses: msys2/setup-msys2@v2 - uses: msys2/setup-msys2@v2
with: with:
msystem: MSYS msystem: MSYS
@ -2554,7 +2579,7 @@ jobs:
npm install --verbose ${{ env.CI_TMP_DIR }}/stt*.tgz npm install --verbose ${{ env.CI_TMP_DIR }}/stt*.tgz
- run: | - run: |
npm install electron@${{ matrix.electronjs-version }} npm install electron@${{ matrix.electronjs-version }}
- uses: ./.github/actions/run-tests - uses: ./.github/actions/win-run-tests
with: with:
runtime: "electronjs" runtime: "electronjs"
bitrate: ${{ matrix.bitrate }} bitrate: ${{ matrix.bitrate }}
@ -3493,7 +3518,7 @@ jobs:
mkdir -p native_client/java/libstt/libs/armeabi-v7a mkdir -p native_client/java/libstt/libs/armeabi-v7a
cd /tmp/nc cd /tmp/nc
tar xvf native_client.tar.xz tar xvf native_client.tar.xz
mv libstt.so ${CI_TASK_DIR}/native_client/java/libstt/libs/armeabi-v7a/libstt.so mv libstt.so libtensorflowlite.so libkenlm.so libtflitedelegates.so ${CI_TASK_DIR}/native_client/java/libstt/libs/armeabi-v7a/
rm -f * rm -f *
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
@ -3503,7 +3528,7 @@ jobs:
mkdir -p native_client/java/libstt/libs/arm64-v8a mkdir -p native_client/java/libstt/libs/arm64-v8a
cd /tmp/nc cd /tmp/nc
tar xvf native_client.tar.xz tar xvf native_client.tar.xz
mv libstt.so ${CI_TASK_DIR}/native_client/java/libstt/libs/arm64-v8a/libstt.so mv libstt.so libtensorflowlite.so libkenlm.so libtflitedelegates.so ${CI_TASK_DIR}/native_client/java/libstt/libs/arm64-v8a/
rm -f * rm -f *
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
@ -3513,7 +3538,7 @@ jobs:
mkdir -p native_client/java/libstt/libs/x86_64 mkdir -p native_client/java/libstt/libs/x86_64
cd /tmp/nc cd /tmp/nc
tar xvf native_client.tar.xz tar xvf native_client.tar.xz
mv libstt.so ${CI_TASK_DIR}/native_client/java/libstt/libs/x86_64/libstt.so mv libstt.so libtensorflowlite.so libkenlm.so libtflitedelegates.so ${CI_TASK_DIR}/native_client/java/libstt/libs/x86_64/
rm -f * rm -f *
- name: Use Java 8 instead of Java 11 - name: Use Java 8 instead of Java 11
run: echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV run: echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV

View File

@ -31,7 +31,7 @@ elif [ "${OS}" = "${CI_MSYS_VERSION}" ]; then
export DS_ROOT_TASK=${CI_TASK_DIR} export DS_ROOT_TASK=${CI_TASK_DIR}
export BAZEL_VC="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" export BAZEL_VC="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC"
# export BAZEL_VC_FULL_VERSION="14.28.30037" export BAZEL_VC_FULL_VERSION="14.29.30133"
export MSYS2_ARG_CONV_EXCL='//' export MSYS2_ARG_CONV_EXCL='//'
mkdir -p ${CI_TASK_DIR}/tmp/ mkdir -p ${CI_TASK_DIR}/tmp/

View File

@ -19,20 +19,41 @@ add_library( # Sets the name of the library.
# Provides a relative path to your source file(s). # Provides a relative path to your source file(s).
../jni/stt_wrap.cpp ) ../jni/stt_wrap.cpp )
add_library( stt-lib add_library(stt-lib SHARED IMPORTED)
SHARED set_target_properties(stt-lib PROPERTIES
IMPORTED ) IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so)
set_target_properties( stt-lib add_library(kenlm-lib SHARED IMPORTED)
PROPERTIES set_target_properties(kenlm-lib PROPERTIES
IMPORTED_LOCATION IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libkenlm.so)
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so )
add_library(tensorflowlite-lib SHARED IMPORTED)
set_target_properties(tensorflowlite-lib PROPERTIES
IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libtensorflowlite.so)
add_library(tflitedelegates-lib SHARED IMPORTED)
set_target_properties(tflitedelegates-lib PROPERTIES
IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libtflitedelegates.so)
add_custom_command(TARGET stt-jni POST_BUILD add_custom_command(TARGET stt-jni POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libstt.so
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libstt.so) ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libstt.so)
add_custom_command(TARGET stt-jni POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libkenlm.so
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libkenlm.so)
add_custom_command(TARGET stt-jni POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libtensorflowlite.so
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtensorflowlite.so)
add_custom_command(TARGET stt-jni POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libtflitedelegates.so
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libtflitedelegates.so)
# Searches for a specified prebuilt library and stores the path as a # Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by # variable. Because CMake includes system libraries in the search path by