From 53fcfd50967818dbfb245005fe887477785f6a5d Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Fri, 6 Dec 2019 18:43:47 +0100 Subject: [PATCH] Build and publish Python TFLite package as deepspeech-tflite --- taskcluster/host-build.sh | 6 +++++- taskcluster/scriptworker-task-github.yml | 5 +++++ taskcluster/scriptworker-task-pypi.yml | 4 ++++ taskcluster/tc-tests-utils.sh | 6 ++++-- taskcluster/win-build.sh | 6 +++++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/taskcluster/host-build.sh b/taskcluster/host-build.sh index 2488a14a..ac01f2f5 100755 --- a/taskcluster/host-build.sh +++ b/taskcluster/host-build.sh @@ -25,7 +25,11 @@ do_bazel_build do_deepspeech_binary_build -do_deepspeech_python_build +if [ "${runtime}" = "tflite" ]; then + do_deepspeech_python_build "--tflite" +else + do_deepspeech_python_build +fi do_deepspeech_nodejs_build diff --git a/taskcluster/scriptworker-task-github.yml b/taskcluster/scriptworker-task-github.yml index 38fdf561..9729732c 100644 --- a/taskcluster/scriptworker-task-github.yml +++ b/taskcluster/scriptworker-task-github.yml @@ -4,7 +4,9 @@ build: # Make sure builds are ready - "linux-arm64-cpu-opt" - "darwin-amd64-cpu-opt" + - "darwin-amd64-tflite-opt" - "linux-amd64-cpu-opt" + - "linux-amd64-tflite-opt" - "linux-amd64-gpu-opt" - "linux-rpi3-cpu-opt" - "node-package-gpu" @@ -25,11 +27,14 @@ build: artifacts_deps: python: - "darwin-amd64-cpu-opt" + - "darwin-amd64-tflite-opt" - "linux-amd64-cpu-opt" + - "linux-amd64-tflite-opt" - "linux-amd64-gpu-opt" - "linux-rpi3-cpu-opt" - "linux-arm64-cpu-opt" - "win-amd64-cpu-opt" + - "win-amd64-tflite-opt" - "win-amd64-gpu-opt" javascript: # GPU package diff --git a/taskcluster/scriptworker-task-pypi.yml b/taskcluster/scriptworker-task-pypi.yml index 4b068d28..1d586afc 100644 --- a/taskcluster/scriptworker-task-pypi.yml +++ b/taskcluster/scriptworker-task-pypi.yml @@ -4,7 +4,9 @@ build: # Make sure builds are ready # - "linux-arm64-cpu-opt" Aarch64 packages are refused by upload.pypi.org - "darwin-amd64-cpu-opt" + - "darwin-amd64-tflite-opt" - "linux-amd64-cpu-opt" + - "linux-amd64-tflite-opt" - "linux-amd64-gpu-opt" - "linux-rpi3-cpu-opt" - "win-amd64-cpu-opt" @@ -23,7 +25,9 @@ build: java_aar: [] python: - "darwin-amd64-cpu-opt" + - "darwin-amd64-tflite-opt" - "linux-amd64-cpu-opt" + - "linux-amd64-tflite-opt" - "linux-amd64-gpu-opt" - "linux-rpi3-cpu-opt" - "win-amd64-cpu-opt" diff --git a/taskcluster/tc-tests-utils.sh b/taskcluster/tc-tests-utils.sh index 2cacaa43..efd1283f 100755 --- a/taskcluster/tc-tests-utils.sh +++ b/taskcluster/tc-tests-utils.sh @@ -1149,7 +1149,7 @@ do_deepspeech_python_build() { cd ${DS_DSDIR} - rename_to_gpu=$1 + package_option=$1 unset PYTHON_BIN_PATH unset PYTHONPATH @@ -1169,8 +1169,10 @@ do_deepspeech_python_build() mkdir -p wheels SETUP_FLAGS="" - if [ "${rename_to_gpu}" = "--cuda" ]; then + if [ "${package_option}" = "--cuda" ]; then SETUP_FLAGS="--project_name deepspeech-gpu" + elif [ "${package_option}" = "--tflite" ]; then + SETUP_FLAGS="--project_name deepspeech-tflite" fi for pyver_conf in ${SUPPORTED_PYTHON_VERSIONS}; do diff --git a/taskcluster/win-build.sh b/taskcluster/win-build.sh index a0ce9d90..ddb6e35a 100755 --- a/taskcluster/win-build.sh +++ b/taskcluster/win-build.sh @@ -41,7 +41,11 @@ do_deepspeech_binary_build # Those are the versions available on NuGet.org export SUPPORTED_PYTHON_VERSIONS="3.5.4 3.6.7 3.7.1 3.8.0" -do_deepspeech_python_build "${cuda}" +if [ "${runtime}" = "tflite" ]; then + do_deepspeech_python_build "--tflite" +else + do_deepspeech_python_build "${cuda}" +fi do_deepspeech_nodejs_build "${cuda}"