Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CTC decoder builds for more Python versions #3596

Open
lissyx opened this issue Apr 1, 2021 · 55 comments
Open

Add CTC decoder builds for more Python versions #3596

lissyx opened this issue Apr 1, 2021 · 55 comments

Comments

@lissyx
Copy link
Collaborator

lissyx commented Apr 1, 2021

We hard-coded the action call with one version

build-ctc-decoder:
name: "Build CTC decoder Python package for testing"
needs: [ swig_macOS ]
runs-on: macos-10.15
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: ./.github/actions/install-python-upstream
with:
version: 3.6.8
- run: |
python --version
pip --version
- uses: actions/download-artifact@v2
with:
name: "swig_macOS"
path: ${{ github.workspace }}/native_client/ds-swig/
- run: |
ls -hal ${{ github.workspace }}/native_client/ds-swig/bin
ln -s ds-swig ${{ github.workspace }}/native_client/ds-swig/bin/swig
chmod +x ${{ github.workspace }}/native_client/ds-swig/bin/ds-swig ${{ github.workspace }}/native_client/ds-swig/bin/swig
- run: |
make -C native_client/ctcdecode/ \
NUM_PROCESSES=$(sysctl hw.ncpu |cut -d' ' -f2) \
bindings
- uses: actions/upload-artifact@v2
with:
name: "ds_ctcdecoder-test.whl"
path: ${{ github.workspace }}/native_client/ctcdecode/dist/*.whl
- run: |
make -C native_client/ctcdecode clean-keep-third-party
it would be nice to:

  • use a matrix for all versions we can
  • add new train-test-model jobs using a matrix as well to ensure test coverage
@lissyx
Copy link
Collaborator Author

lissyx commented Apr 1, 2021

@Ayushsunny This might be easier, if you are still willing to learn GitHub Actions at the same time

@Ayushsunny
Copy link

Ayushsunny commented Apr 1, 2021

@Ayushsunny This might be easier, if you are still willing to learn GitHub Actions at the same time

Thank you so much as you want me to learn. It's so nice of you Sir @lissyx .
and yes I want to learn, So what I have to do first is to understand this specific topic to fix this issue

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 1, 2021

So what I have to do first to understand this specific topic to fix this issue

Read this code, get yourself into https://docs.github.com/en/actions/guides :)

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 7, 2021

@Ayushsunny Have you been able to get a grasp of what needs to be done ?

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 13, 2021

@Ayushsunny Ping?

@Ayushsunny
Copy link

I'm really sorry Sir @lissyx
I was studying for my University Exam.
Now I'm free and from tomorrow I'll start working on it.

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 14, 2021

I'm really sorry Sir @lissyx
I was studying for my University Exam.
Now I'm free and from tomorrow I'll start working on it.

Thanks, I don't want to pressure you, it's fine if you can't take it, but we just need to know :)

@Ayushsunny
Copy link

So Sir, as per my understanding I think this should be the code which I have to add. @lissyx ?

jobs:
  build:
    runs-on: macos-10.15
    strategy:
      matrix:
        python-version: [ '2.x', '3.x', 'pypy-2.7', 'pypy-3.6', 'pypy-3.7' ]
    name: Python ${{ matrix.python-version }} sample
    steps:
      - uses: actions/checkout@v2
      - name: Setup python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
          architecture: x64
      - run: python my_script.py `

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 16, 2021

@Ayushsunny Sorry looks like my reply got lost ; that's the good basis, you'll have to build on top of that.

@Ayushsunny
Copy link

@Ayushsunny Sorry looks like my reply got lost ; that's the good basis, you'll have to build on top of that.

Which reply Sir? @lissyx
and, may make a PR for this? or I need to improve the last code which I've sent .

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 16, 2021

Which reply Sir? @lissyx

One I thought I had sent

and, may make a PR for this? or I need to improve the last code which I've sent .

What you shared is not what we need, but it's on the right path.

We need a job like the one I shared earlier, but on more versions of python.

@Ayushsunny
Copy link

Which reply Sir? @lissyx

One I thought I had sent

and, may make a PR for this? or I need to improve the last code which I've sent .

What you shared is not what we need, but it's on the right path.

We need a job like the one I shared earlier, but on more versions of python.

Okay @lissyx Sir I got it do we need like this right ?

  build-ctc-decoder: 
     name: "Build CTC decoder Python package for testing" 
     needs: [ swig_macOS ] 
     runs-on: macos-10.15 
     strategy:
      matrix:
        python-version: [3.6.8, 3.7.9, 3.8.8, 3.9.2]
     if: ${{ github.event_name == 'pull_request' }} 
     steps: 
       - uses: actions/checkout@v2 
         with: 
           fetch-depth: 0 
       - uses: ./.github/actions/install-python-upstream 
         with: 
           version:  ${{ matrix.python-version }}
       - run: | 
           python --version 
           pip --version 
       - uses: actions/download-artifact@v2 
         with: 
           name: "swig_macOS" 
           path: ${{ github.workspace }}/native_client/ds-swig/ 
       - run: | 
           ls -hal ${{ github.workspace }}/native_client/ds-swig/bin 
           ln -s ds-swig ${{ github.workspace }}/native_client/ds-swig/bin/swig 
           chmod +x ${{ github.workspace }}/native_client/ds-swig/bin/ds-swig ${{ github.workspace }}/native_client/ds-swig/bin/swig 
       - run: | 
           make -C native_client/ctcdecode/ \ 
             NUM_PROCESSES=$(sysctl hw.ncpu |cut -d' ' -f2) \ 
             bindings 
       - uses: actions/upload-artifact@v2 
         with: 
           name: "ds_ctcdecoder-test.whl" 
           path: ${{ github.workspace }}/native_client/ctcdecode/dist/*.whl 
       - run: | 
           make -C native_client/ctcdecode clean-keep-third-party 

@Ayushsunny
Copy link

Ayushsunny commented Apr 23, 2021

But sir How I am supposed to fix this if I am not able to find this /macOS-amd64.yml file in master branch for more knowledge I am sticking the screenshots here :

Not available in the master branch -

Screenshot from 2021-04-23 12-01-37

see this is available in your branch -

Screenshot from 2021-04-23 12-01-58

@dijksterhuis
Copy link

dijksterhuis commented Apr 26, 2021

@Ayushsunny looks like the original file has been renamed to build-and-test.yml.

I think this is the section you want to be looking at (it looks like what was originally posted by @lissyx after a very brief inspection).

@Ayushsunny
Copy link

Yes @dijksterhuis, Thank you so much.
@lissyx Can I make a PR with matrix for all versions here

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 26, 2021

Yes @dijksterhuis, Thank you so much.
@lissyx Can I make a PR with matrix for all versions here

Yes. The whole idea of our switching to Github Actions is to allow people to run CI easily on their account as well:

  • fork deepspeech to your github account
  • make a new branch on your local copy of your fork
  • push your branch to your fork and open a PR against your fork

Tada, things runs :). Experiment, ask us help and we can move forward.

@Ayushsunny
Copy link

Hello @lissyx Sir I have made a PR as a Demo Which I am going to add matrix version in every CTC decoders.
could you please review and guide me that I am going right or not please?
#3640

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 28, 2021

Hello @lissyx Sir I have made a PR as a Demo Which I am going to add matrix version in every CTC decoders.
could you please review and guide me that I am going right or not please?
#3640

I see you opened the PR against our repo ; if you open it against your repo, then you can run GitHub Actions without our approval and debug on your own side ;)

@lissyx
Copy link
Collaborator Author

lissyx commented Apr 28, 2021

@Ayushsunny That's a good start, you might want to add / experiment more test coverage on all those versions now

@Ayushsunny
Copy link

@Ayushsunny That's a good start, you might want to add / experiment more test coverage on all those versions now

Yes Sir, Thank you so much for your review

@Ayushsunny
Copy link

Sir I have also made a PR against my repo and I think I have updated all what we need Ayushsunny#2

@Ayushsunny
Copy link

Sir @lissyx ?

@lissyx
Copy link
Collaborator Author

lissyx commented May 3, 2021

Sir @lissyx ?

It looks good but I don't see any CI run ?

@Ayushsunny
Copy link

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

@Ayushsunny
Copy link

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

No, it is already NOT working on your own repo, please have a look at your Actions page, you have errors to fix.

Sir, Everything is looking fine my side.
I have added python version with matrix and changed versions of python that's it.

@lissyx
Copy link
Collaborator Author

lissyx commented May 3, 2021

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

No, it is already NOT working on your own repo, please have a look at your Actions page, you have errors to fix.

Sir, Everything is looking fine my side.
I have added python version with matrix and changed versions of python that's it.

No, it is not:

@Ayushsunny
Copy link

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

No, it is already NOT working on your own repo, please have a look at your Actions page, you have errors to fix.

Sir, Everything is looking fine my side.
I have added python version with matrix and changed versions of python that's it.

No, it is not:

* [Ayushsunny#2](https://github.com/Ayushsunny/DeepSpeech/pull/2) does not show any build and tests running

* https://github.com/Ayushsunny/DeepSpeech/actions/runs/793109099 shows failure: ` The workflow is not valid. .github/workflows/build-and-test.yml (Line: 169, Col: 27): A sequence was not expected .github/workflows/build-and-test.yml (Line: 710, Col: 27): A sequence was not expected`

Sir, even after updating as you've said, it's again throwing error something like that installer: Error - the package path specified was invalid: 'python.pkg'. here

@lissyx
Copy link
Collaborator Author

lissyx commented May 3, 2021

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

No, it is already NOT working on your own repo, please have a look at your Actions page, you have errors to fix.

Sir, Everything is looking fine my side.
I have added python version with matrix and changed versions of python that's it.

No, it is not:

* [Ayushsunny#2](https://github.com/Ayushsunny/DeepSpeech/pull/2) does not show any build and tests running

* https://github.com/Ayushsunny/DeepSpeech/actions/runs/793109099 shows failure: ` The workflow is not valid. .github/workflows/build-and-test.yml (Line: 169, Col: 27): A sequence was not expected .github/workflows/build-and-test.yml (Line: 710, Col: 27): A sequence was not expected`

Sir, even after updating as you've said, it's again throwing error something like that installer: Error - the package path specified was invalid: 'python.pkg'. here

This is specific to macOS that does not use the same action. You need three-digits versions number for it.

@Ayushsunny
Copy link

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

No, it is already NOT working on your own repo, please have a look at your Actions page, you have errors to fix.

Sir, Everything is looking fine my side.
I have added python version with matrix and changed versions of python that's it.

No, it is not:

* [Ayushsunny#2](https://github.com/Ayushsunny/DeepSpeech/pull/2) does not show any build and tests running

* https://github.com/Ayushsunny/DeepSpeech/actions/runs/793109099 shows failure: ` The workflow is not valid. .github/workflows/build-and-test.yml (Line: 169, Col: 27): A sequence was not expected .github/workflows/build-and-test.yml (Line: 710, Col: 27): A sequence was not expected`

Sir, even after updating as you've said, it's again throwing error something like that installer: Error - the package path specified was invalid: 'python.pkg'. here

This is specific to macOS that does not use the same action. You need three-digits versions number for it.

Hello Sir, I'm bothering you too much today see again it throws some new error which was not added by me https://github.com/Ayushsunny/DeepSpeech/runs/2492609550?check_suite_focus=true

@lissyx
Copy link
Collaborator Author

lissyx commented May 3, 2021

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

No, it is already NOT working on your own repo, please have a look at your Actions page, you have errors to fix.

Sir, Everything is looking fine my side.
I have added python version with matrix and changed versions of python that's it.

No, it is not:

* [Ayushsunny#2](https://github.com/Ayushsunny/DeepSpeech/pull/2) does not show any build and tests running

* https://github.com/Ayushsunny/DeepSpeech/actions/runs/793109099 shows failure: ` The workflow is not valid. .github/workflows/build-and-test.yml (Line: 169, Col: 27): A sequence was not expected .github/workflows/build-and-test.yml (Line: 710, Col: 27): A sequence was not expected`

Sir, even after updating as you've said, it's again throwing error something like that installer: Error - the package path specified was invalid: 'python.pkg'. here

This is specific to macOS that does not use the same action. You need three-digits versions number for it.

Hello Sir, I'm bothering you too much today see again it throws some new error which was not added by me https://github.com/Ayushsunny/DeepSpeech/runs/2492609550?check_suite_focus=true

it is failing because trying to rebuild numpy

Please investigate what versions of numpy provides a wheel on pypi that works for python 3.8 and then update the env variables NUMPY_BUILD_VERSION / NUMPY_DEP_VERSION in https://github.com/mozilla/DeepSpeech/blob/master/.github/actions/numpy_vers/action.yml

@Ayushsunny
Copy link

Sir @lissyx ?

It looks good but I don't see any CI run ?

Sir, Can you approve the PR which was made against the Original Repo.
then I think it will run

No, it is already NOT working on your own repo, please have a look at your Actions page, you have errors to fix.

Sir, Everything is looking fine my side.
I have added python version with matrix and changed versions of python that's it.

No, it is not:

* [Ayushsunny#2](https://github.com/Ayushsunny/DeepSpeech/pull/2) does not show any build and tests running

* https://github.com/Ayushsunny/DeepSpeech/actions/runs/793109099 shows failure: ` The workflow is not valid. .github/workflows/build-and-test.yml (Line: 169, Col: 27): A sequence was not expected .github/workflows/build-and-test.yml (Line: 710, Col: 27): A sequence was not expected`

Sir, even after updating as you've said, it's again throwing error something like that installer: Error - the package path specified was invalid: 'python.pkg'. here

This is specific to macOS that does not use the same action. You need three-digits versions number for it.

Hello Sir, I'm bothering you too much today see again it throws some new error which was not added by me https://github.com/Ayushsunny/DeepSpeech/runs/2492609550?check_suite_focus=true

it is failing because trying to rebuild numpy

Please investigate what versions of numpy provides a wheel on pypi that works for python 3.8 and then update the env variables NUMPY_BUILD_VERSION / NUMPY_DEP_VERSION in https://github.com/mozilla/DeepSpeech/blob/master/.github/actions/numpy_vers/action.yml

Sir, I have tried to find out every solution for this but I am not able to.

are we going to add this version ??
Screenshot from 2021-05-04 18-08-20

@lissyx
Copy link
Collaborator Author

lissyx commented May 4, 2021

@Ayushsunny Do you understand the problems stated in https://github.com/mozilla/DeepSpeech/blob/master/.github/actions/numpy_vers/README.md and how we solve them ?

@Ayushsunny
Copy link

@lissyx , Yes Sir that we have to avoid having to rebuild numpy so we stick to versions where there is an existing upstream wheel file.

@lissyx
Copy link
Collaborator Author

lissyx commented May 12, 2021

Hello @lissyx Sir are you free to guide me now for this ? Please

I have already explained to you, I can't explain more if you don't tell precisely what you don't understand.
You need to find the existing wheels for that platform that are ABI compatible and available for the matching python version

@hmen97
Copy link

hmen97 commented Jun 9, 2021

@lissyx I went through this thread, spent some time looking at github actions, came up with this pull request hmen97#2.

CTC decoder has been built for

  • [3.6, 3.7, 3.8, 3.9] build-ctc-decoder-Linux
  • [3.6.8, 3.7.9, 3.8.8, 3.9.2] build-ctc-decoder-Windows
  • [3.6.8, 3.7.9, 3.8.8, 3.9.2] build-ctc-decoder-macos

The test python bindings step for each platform is running into an error or being skipped, logs below:

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://lissyx.github.io/deepspeech-python-wheels/ Processing /home/runner/work/DeepSpeech/DeepSpeech/tmp/deepspeech_tflite-0.10.0a3-cp37-cp37m-linux_aarch64.whl Collecting numpy>=1.19.3 (from deepspeech-tflite==0.10.0a3) Could not find a version that satisfies the requirement numpy>=1.19.3 (from deepspeech-tflite==0.10.0a3) (from versions: 1.17.0) No matching distribution found for numpy>=1.19.3 (from deepspeech-tflite==0.10.0a3)

Will it be solved if I add the required prebuilt numpy wheel from pypi(for each python version) in this project or does some other change have to be made while saving artifacts?

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 9, 2021

@lissyx I went through this thread, spent some time looking at github actions, came up with this pull request hmen97#2.

This change does not look super good at a first glance, you bump the minimal versions on many linux versions for example, this is going to break backward compatibility

CTC decoder has been built for

* [3.6, 3.7, 3.8, 3.9] build-ctc-decoder-Linux

* [3.6.8, 3.7.9, 3.8.8, 3.9.2] build-ctc-decoder-Windows

* [3.6.8, 3.7.9, 3.8.8, 3.9.2] build-ctc-decoder-macos

The test python bindings step for each platform is running into an error or being skipped, logs below:

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://lissyx.github.io/deepspeech-python-wheels/ Processing /home/runner/work/DeepSpeech/DeepSpeech/tmp/deepspeech_tflite-0.10.0a3-cp37-cp37m-linux_aarch64.whl Collecting numpy>=1.19.3 (from deepspeech-tflite==0.10.0a3) Could not find a version that satisfies the requirement numpy>=1.19.3 (from deepspeech-tflite==0.10.0a3) (from versions: 1.17.0) No matching distribution found for numpy>=1.19.3 (from deepspeech-tflite==0.10.0a3)

I can't give any definitive answer only from that line, I need to know how you repro that ...

Will it be solved if I add the required prebuilt numpy wheel from pypi(for each python version) in this project or does some other change have to be made while saving artifacts?

Those prebuilt wheels were for Aarch64 only. Without context, I have no idea what you are doing.

@hmen97
Copy link

hmen97 commented Jun 9, 2021

This change does not look super good at a first glance, you bump the minimal versions on many linux versions for example, this is going to break backward compatibility

Used this repo for minimum recommended version of numpy. I can run more tests to find the minimum stable version for each platform&py-version combination.

I can't give any definitive answer only from that line, I need to know how you repro that ...

I just changed the numpy versions in .github/actions/numpy_vers/action.yml and in github/workflows/build-and-test.yml I added python versions in the build ctc decoder matrix strategy. On creating a pull request to my forked master branch, the checks are triggered. Basically was checking how everything works, or rather where and why it breaks for different versions.

Those prebuilt wheels were for Aarch64 only. Without context, I have no idea what you are doing

My bad the wheels are already present here, when I checked it was down yesterday probably because of the outage. But let's say we need a lower version of aarch64 numpy wheel, do we stick to what numpy has wheels for(1.19.2 onwards) or build our own like you did

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 9, 2021

This change does not look super good at a first glance, you bump the minimal versions on many linux versions for example, this is going to break backward compatibility

Used this repo for minimum recommended version of numpy. I can run more tests to find the minimum stable version for each platform&py-version combination.

nice repo, is this official? it seems to only focus on arm/aarch64 though

it still does not explain why you push everything with a bare minimum of 1.19.x on linux for example

I can't give any definitive answer only from that line, I need to know how you repro that ...

I just changed the numpy versions in .github/actions/numpy_vers/action.yml and in github/workflows/build-and-test.yml I added python versions in the build ctc decoder matrix strategy. On creating a pull request to my forked master branch, the checks are triggered. Basically was checking how everything works, or rather where and why it breaks for different versions.

Please give me a link to the errors ?

Those prebuilt wheels were for Aarch64 only. Without context, I have no idea what you are doing

My bad the wheels are already present here, when I checked it was down yesterday probably because of the outage. But let's say we need a lower version of aarch64 numpy wheel, do we stick to what numpy has wheels for(1.19.2 onwards) or build our own like you did

aarch64 wheels is complicated, the packages built are there for automation purpose only ; it is up to the users to handle the situation, because pypi does not accept aarch64 wheels for linux

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 9, 2021

So: https://github.com/hmen97/DeepSpeech/runs/2781014601?check_suite_focus=true#step:10:152

This is exactly what I was telling, you bumped linux minimal deps with no justifications, so the packages on https://github.com/lissyx/deepspeech-python-wheels built only for CI are not met.

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 9, 2021

I can run more tests to find the minimum stable version for each platform&py-version combination.

At some point, I think what should be done is using this to replace the hard-coded list as much as possible, instead. And have ways to reproduce what you did ; because so far, I only see versions being changed with nothing to justify, and breaking backward compat.

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 9, 2021

aarch64 wheels is complicated, the packages built are there for automation purpose only ; it is up to the users to handle the situation, because pypi does not accept aarch64 wheels for linux

Looks like now PyPi accepts aarch64 for wheels on linux. If you feel up to it, please:

  • file an issue to fix that
  • add proper manylinux support to ensure we meet the requirements

@hmen97
Copy link

hmen97 commented Jun 10, 2021

This is exactly what I was telling, you bumped linux minimal deps with no justifications, so the packages on https://github.com/lissyx/deepspeech-python-wheels built only for CI are not met

Oh yeah, I just bumped that up to the min numpy version from the versions in specific platform & instruction set combination. Will revert that to what it was before.

Looks like now PyPi accepts aarch64 for wheels on linux. If you feel up to it, please
file an issue to fix that
add proper manylinux support to ensure we meet the requirements

Yeah I can do that, but I just need one clarification, the host system is a ubuntu 20.04 x86_64 , the arm7 and aarch64 are mounts. When building python bindings I can only see is the numpy build and dep version being passed as params, how does the right wheel get selected in case of varying architectures?

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 10, 2021

Yeah I can do that, but I just need one clarification, the host system is a ubuntu 20.04 x86_64 , the arm7 and aarch64 are mounts. When building python bindings I can only see is the numpy build and dep version being passed as params, how does the right wheel get selected in case of varying architectures?

I'm not sure I get your question. Python wheel are cross-compiled, as libdeepspeech is

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 10, 2021

it is built here for linux/armv7 for example:

build-python-LinuxArmv7:
name: "LinArmv7|Build python bindings"
runs-on: ubuntu-20.04
needs: [ build-lib_LinuxArmv7, swig_Linux, tensorflow_opt-LinuxArmv7 ]
strategy:
matrix:
build-flavor: ["tflite"]
python-version: [3.7]
arch: [ "armv7" ]
env:
DEBIAN_FRONTEND: "noninteractive"
SYSTEM_TARGET: rpi3
SYSTEM_RASPBIAN: ${{ github.workspace }}/multistrap-raspbian-buster
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/download-artifact@v2
with:
name: "native_client.${{ matrix.build-flavor }}.linux.${{ matrix.arch }}.tar.xz"
path: ${{ github.workspace }}/tensorflow/bazel-bin/native_client/
- run: |
cd ${{ github.workspace }}/tensorflow/bazel-bin/native_client/
tar xf native_client.tar.xz
ls -hal
cd ${{ github.workspace }}/
- uses: actions/download-artifact@v2
with:
name: "swig_Linux"
path: ${{ github.workspace }}/native_client/ds-swig/
- name: Link ds-swig into swig
run: |
ls -hal ${{ github.workspace }}/native_client/ds-swig/bin
ln -s ds-swig ${{ github.workspace }}/native_client/ds-swig/bin/swig
chmod +x ${{ github.workspace }}/native_client/ds-swig/bin/ds-swig ${{ github.workspace }}/native_client/ds-swig/bin/swig
- uses: actions/download-artifact@v2
with:
name: ${{ needs.tensorflow_opt-LinuxArmv7.outputs.cache_key }}
path: ${{ github.workspace }}/
if: needs.tensorflow_opt-LinuxArmv7.outputs.status == 'missing'
- uses: ./.github/actions/check_artifact_exists
with:
name: ${{ needs.tensorflow_opt-LinuxArmv7.outputs.cache_key }}
path: ${{ github.workspace }}/
download: true
if: needs.tensorflow_opt-LinuxArmv7.outputs.status == 'found'
- run: |
tar -xf ${{ github.workspace }}/home.tar.xz --skip-old-files
rm ${{ github.workspace }}/home.tar.xz
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: ./.github/actions/install-xldd
with:
target: ${{ env.SYSTEM_TARGET }}
- name: "Install chroot"
uses: ./.github/actions/multistrap
with:
arch: ${{ matrix.arch }}
- id: get_numpy
uses: ./.github/actions/numpy_vers
with:
pyver: ${{ matrix.python-version }}
- uses: ./.github/actions/python-build
with:
build_flavor: ${{ matrix.build-flavor }}
numpy_build: "${{ steps.get_numpy.outputs.build_version }}"
numpy_dep: "${{ steps.get_numpy.outputs.dep_version }}"
target: ${{ env.SYSTEM_TARGET }}
chroot: ${{ env.SYSTEM_RASPBIAN }}
- uses: actions/upload-artifact@v2
with:
name: "deepspeech-${{ matrix.build-flavor }}-${{ matrix.python-version }}-${{ matrix.arch }}.whl"
path: ${{ github.workspace }}/wheels/*.whl

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 10, 2021

And specifics are handled in

- uses: ./.github/actions/python-build
with:
build_flavor: ${{ matrix.build-flavor }}
numpy_build: "${{ steps.get_numpy.outputs.build_version }}"
numpy_dep: "${{ steps.get_numpy.outputs.dep_version }}"
target: ${{ env.SYSTEM_TARGET }}
chroot: ${{ env.SYSTEM_RASPBIAN }}

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 10, 2021

The action is here https://github.com/mozilla/DeepSpeech/blob/master/.github/actions/python-build/action.yml and it relies on makefile level abstraction of the cross-compilation of the bindings

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 10, 2021

The build is done here https://github.com/mozilla/DeepSpeech/blob/master/native_client/python/Makefile#L13 and you can see we depend on a lot of env variables

they are being set in https://github.com/mozilla/DeepSpeech/blob/master/native_client/definitions.mk and for example you can see the ones for linux/armv7 in https://github.com/mozilla/DeepSpeech/blob/master/native_client/definitions.mk#L72-L92

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 10, 2021

The build is done here https://github.com/mozilla/DeepSpeech/blob/master/native_client/python/Makefile#L13 and you can see we depend on a lot of env variables

they are being set in https://github.com/mozilla/DeepSpeech/blob/master/native_client/definitions.mk and for example you can see the ones for linux/armv7 in https://github.com/mozilla/DeepSpeech/blob/master/native_client/definitions.mk#L72-L92

And as you can see, this is where we set some PYTHON_ variables to properly cross-compile:

  • PYTHON_PATH
  • NUMPY_INCLUDE
  • PYTHON_SYSCONFIGDATA
  • PYTHON_PLATFORM_NAME

@hmen97
Copy link

hmen97 commented Jun 10, 2021

they are being set in https://github.com/mozilla/DeepSpeech/blob/master/native_client/definitions.mk and for example you can see the ones for linux/armv7 in https://github.com/mozilla/DeepSpeech/blob/master/native_client/definitions.mk#L72-L92

I followed the calls all the way to the native_client/python/Makefile , didn't notice the definitions.mk. Ok so I think I get it now, correct me if I'm wrong, you set the architecture to linux_aarch64 here but since PyPi didn't have any numpy wheel for aarch64, it gets the wheel from here only supporting 1.14.2 or 1.17.0 for linux aarch64 which also explains this

So based on the os and architecture, if I create another case for Linux:aarch64 here, and change linux_aarch64 to manylinux2014_aarch64, we will be using the PyPi supported wheels for numpy

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 10, 2021

BTW, the original issue was about the CTC decoder python binding, not the DeepSpeech python binding

@hmen97
Copy link

hmen97 commented Jun 11, 2021

BTW, the original issue was about the CTC decoder python binding, not the DeepSpeech python binding

Yeah sorry for deviating, I got through a few levels of understanding because of that. Anyway please check this pull request. The Win|Build Tensorflow (opt) test is failing in master too, here are the logs, looks like Bazel isn't able to find some Visual C++ build tools.

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 11, 2021

BTW, the original issue was about the CTC decoder python binding, not the DeepSpeech python binding

Yeah sorry for deviating, I got through a few levels of understanding because of that. Anyway please check this pull request. The Win|Build Tensorflow (opt) test is failing in master too, here are the logs, looks like Bazel isn't able to find some Visual C++ build tools.

I'm sorry but:

  • I dont have time to check PR on your repo, there might be too many changes i'm unaware of
  • I don't have time to investigate Bazel, Windows and GitHub Actions
  • Try and repro with an empty PR, if it fails the same way then something changed on GitHub Actions and I'm afraid you will have to debug that

@hmen97
Copy link

hmen97 commented Jun 20, 2021

Hey @lissyx I checked the successful pull requests, looks like they were using an artifact, which is missing in my run, so this Win|Build Tensorflow (opt) is passed without actually running any of the build instructions in the test. Can you check if that artifact still exists in the CI_ARTIFACTS_DIR? or maybe there is some config I'm missing... here are some logs for ref...

2021-06-20T12:34:40.8675106Z HEAD is now at 6f9dee7 Merge 5f1a600 into 9e67724
2021-06-20T12:34:40.8676006Z ##[endgroup]
2021-06-20T12:34:40.8676682Z [command]/usr/bin/git log -1 --format='%H'
2021-06-20T12:34:40.8677557Z '6f9dee7bfee62e87a15adab7271055a9a2c8da58'
2021-06-20T12:34:40.8864765Z ##[group]Run ./.github/actions/get_cache_key
2021-06-20T12:34:40.8865287Z with:
2021-06-20T12:34:40.8865690Z extras: 7
2021-06-20T12:34:40.8866092Z env:
2021-06-20T12:34:40.8866651Z CI_TASK_DIR: /home/runner/work/DeepSpeech/DeepSpeech
2021-06-20T12:34:40.8867442Z CI_ARTIFACTS_DIR: /home/runner/work/DeepSpeech/DeepSpeech/artifacts
2021-06-20T12:34:40.8868137Z MACOSX_DEPLOYMENT_TARGET: 10.10
2021-06-20T12:34:40.8868642Z CI_NODE_MODULES_NTH: 1
2021-06-20T12:34:40.8869150Z CI_MSYS_VERSION: MSYS_NT-10.0-17763
2021-06-20T12:34:40.8869719Z MSYS2_SHELL_PATH: D:\a_temp\msys\msys64\usr\bin
2021-06-20T12:34:40.8870247Z ##[endgroup]
2021-06-20T12:34:40.9374241Z ##[group]Run ./.github/actions/check_artifact_exists
2021-06-20T12:34:40.9374854Z with:
2021-06-20T12:34:40.9375587Z name: tensorflow-opt_Windows_23ad988fcde60fb01f9533e95004bbc4877a9143_7
2021-06-20T12:34:40.9377197Z github_token: ***
2021-06-20T12:34:40.9377766Z download: false
2021-06-20T12:34:40.9378302Z path: ./
2021-06-20T12:34:40.9378784Z repo: hmen97/DeepSpeech
2021-06-20T12:34:40.9379322Z env:
2021-06-20T12:34:40.9379898Z CI_TASK_DIR: /home/runner/work/DeepSpeech/DeepSpeech
2021-06-20T12:34:40.9380732Z CI_ARTIFACTS_DIR: /home/runner/work/DeepSpeech/DeepSpeech/artifacts
2021-06-20T12:34:40.9381493Z MACOSX_DEPLOYMENT_TARGET: 10.10
2021-06-20T12:34:40.9382019Z CI_NODE_MODULES_NTH: 1
2021-06-20T12:34:40.9382602Z CI_MSYS_VERSION: MSYS_NT-10.0-17763
2021-06-20T12:34:40.9383198Z MSYS2_SHELL_PATH: D:\a_temp\msys\msys64\usr\bin
2021-06-20T12:34:40.9383772Z ##[endgroup]
2021-06-20T12:34:41.0056481Z ==> Repo: hmen97/DeepSpeech
2021-06-20T12:34:41.9702165Z ==> maybe goodRepoArtifacts: []
2021-06-20T12:34:41.9703889Z ==> goodArtifacts: []
2021-06-20T12:34:41.9705943Z ==> Artifact tensorflow-opt_Windows_23ad988fcde60fb01f9533e95004bbc4877a9143_7 missing
2021-06-20T12:34:41.9739080Z ==> download false
2021-06-20T12:34:41.9869993Z Post job cleanup.

@lissyx
Copy link
Collaborator Author

lissyx commented Jun 21, 2021

Hey @lissyx I checked the successful pull requests, looks like they were using an artifact, which is missing in my run, so this Win|Build Tensorflow (opt) is passed without actually running any of the build instructions in the test. Can you check if that artifact still exists in the CI_ARTIFACTS_DIR? or maybe there is some config I'm missing... here are some logs for ref...

2021-06-20T12:34:40.8675106Z HEAD is now at 6f9dee7 Merge 5f1a600 into 9e67724 2021-06-20T12:34:40.8676006Z ##[endgroup] 2021-06-20T12:34:40.8676682Z [command]/usr/bin/git log -1 --format='%H' 2021-06-20T12:34:40.8677557Z '6f9dee7bfee62e87a15adab7271055a9a2c8da58' 2021-06-20T12:34:40.8864765Z ##[group]Run ./.github/actions/get_cache_key 2021-06-20T12:34:40.8865287Z with: 2021-06-20T12:34:40.8865690Z extras: 7 2021-06-20T12:34:40.8866092Z env: 2021-06-20T12:34:40.8866651Z CI_TASK_DIR: /home/runner/work/DeepSpeech/DeepSpeech 2021-06-20T12:34:40.8867442Z CI_ARTIFACTS_DIR: /home/runner/work/DeepSpeech/DeepSpeech/artifacts 2021-06-20T12:34:40.8868137Z MACOSX_DEPLOYMENT_TARGET: 10.10 2021-06-20T12:34:40.8868642Z CI_NODE_MODULES_NTH: 1 2021-06-20T12:34:40.8869150Z CI_MSYS_VERSION: MSYS_NT-10.0-17763 2021-06-20T12:34:40.8869719Z MSYS2_SHELL_PATH: D:\a_temp\msys\msys64\usr\bin 2021-06-20T12:34:40.8870247Z ##[endgroup] 2021-06-20T12:34:40.9374241Z ##[group]Run ./.github/actions/check_artifact_exists 2021-06-20T12:34:40.9374854Z with: 2021-06-20T12:34:40.9375587Z name: tensorflow-opt_Windows_23ad988fcde60fb01f9533e95004bbc4877a9143_7 2021-06-20T12:34:40.9377197Z github_token: *** 2021-06-20T12:34:40.9377766Z download: false 2021-06-20T12:34:40.9378302Z path: ./ 2021-06-20T12:34:40.9378784Z repo: hmen97/DeepSpeech 2021-06-20T12:34:40.9379322Z env: 2021-06-20T12:34:40.9379898Z CI_TASK_DIR: /home/runner/work/DeepSpeech/DeepSpeech 2021-06-20T12:34:40.9380732Z CI_ARTIFACTS_DIR: /home/runner/work/DeepSpeech/DeepSpeech/artifacts 2021-06-20T12:34:40.9381493Z MACOSX_DEPLOYMENT_TARGET: 10.10 2021-06-20T12:34:40.9382019Z CI_NODE_MODULES_NTH: 1 2021-06-20T12:34:40.9382602Z CI_MSYS_VERSION: MSYS_NT-10.0-17763 2021-06-20T12:34:40.9383198Z MSYS2_SHELL_PATH: D:\a_temp\msys\msys64\usr\bin 2021-06-20T12:34:40.9383772Z ##[endgroup] 2021-06-20T12:34:41.0056481Z ==> Repo: hmen97/DeepSpeech 2021-06-20T12:34:41.9702165Z ==> maybe goodRepoArtifacts: [] 2021-06-20T12:34:41.9703889Z ==> goodArtifacts: [] 2021-06-20T12:34:41.9705943Z ==> Artifact tensorflow-opt_Windows_23ad988fcde60fb01f9533e95004bbc4877a9143_7 missing 2021-06-20T12:34:41.9739080Z ==> download false 2021-06-20T12:34:41.9869993Z Post job cleanup.

The artifact is missing because previous builds expired after the 90 days, and your logs shows something is broken on Windows builds.

You need to investigate this, I can't do more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants