Skip to content

Commit

Permalink
Fix and improve workflows
Browse files Browse the repository at this point in the history
Extend desktop matrix to run on macOS 12, 13, 14 and ubuntu 20 and 22

Simplify rpi matrix to only run on raspios/raspbian/dietpi

Adapt to bookworm RaspberryPi images by installing Python2.7 using
bullseye binaries

Adapt to newer macOS images by using MacPorts to install python2.7

Simplify build by reducing the installed dependencies to build
OpenBLAS and OpenFST

Simplify build by avoiding installing OpenBLAS on macOS as it uses
Accelerate framework

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
  • Loading branch information
pguyot committed May 1, 2024
1 parent 2d7b1a2 commit 52a8c31
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 124 deletions.
242 changes: 133 additions & 109 deletions .github/workflows/build-kaldi-rpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi, raspi_1_bullseye, raspi_2_bullseye, raspi_3_bullseye, raspi_4_bullseye]
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi]
include:
- target: armv6l_raspbian
cpu: arm1176
Expand Down Expand Up @@ -37,22 +37,6 @@ jobs:
cpu: cortex-a53
base_image: dietpi:rpi_armv8_bullseye
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
- target: raspi_1_bullseye
cpu: arm1176
base_image: raspi_1_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
- id: define-openblas-archive-name
Expand All @@ -76,7 +60,7 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool make
apt-get install --no-install-recommends -y gfortran python3 make zlib1g-dev
apt-get upgrade -y wget ca-certificates
cd tools
bash extras/install_openblas.sh
Expand All @@ -103,7 +87,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi, raspi_1_bullseye, raspi_2_bullseye, raspi_3_bullseye, raspi_4_bullseye]
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi]
include:
- target: armv6l_raspbian
cpu: arm1176
Expand Down Expand Up @@ -133,22 +117,6 @@ jobs:
cpu: cortex-a53
base_image: dietpi:rpi_armv8_bullseye
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
- target: raspi_1_bullseye
cpu: arm1176
base_image: raspi_1_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
- id: get-openfst-version
Expand All @@ -174,7 +142,7 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool make
apt-get install --no-install-recommends -y gawk g++ make
apt-get upgrade -y wget ca-certificates
cd tools
make openfst-1.7.2
Expand Down Expand Up @@ -204,7 +172,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi, raspi_1_bullseye, raspi_2_bullseye, raspi_3_bullseye, raspi_4_bullseye]
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi]
include:
- target: armv6l_raspbian
cpu: arm1176
Expand Down Expand Up @@ -234,22 +202,6 @@ jobs:
cpu: cortex-a53
base_image: dietpi:rpi_armv8_bullseye
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
- target: raspi_1_bullseye
cpu: arm1176
base_image: raspi_1_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
- id: define-tools
Expand Down Expand Up @@ -312,7 +264,37 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool zlib1g-dev g++ make patch
if [ -e /etc/apt/sources.list -a `grep -c bookworm /etc/apt/sources.list` -gt 0 ]; then
apt-get install --no-install-recommends -y wget mime-support
if [ `uname -m` = "aarch64" ]; then
arch=arm64
dist=http://ftp.debian.org/debian/
else
arch=armhf
dist=http://raspbian.raspberrypi.com/raspbian/
fi
wget ${dist}pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/libf/libffi/libffi7_3.3-6_${arch}.deb
wget ${dist}pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_${arch}.deb
dpkg -i libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
rm libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
else
apt-get install --no-install-recommends -y python2.7
fi
cd tools
bash extras/check_dependencies.sh
make cub sctk_made sph2pipe -j 4
Expand All @@ -336,7 +318,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi, raspi_1_bullseye, raspi_2_bullseye, raspi_3_bullseye, raspi_4_bullseye]
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi]
include:
- target: armv6l_raspbian
cpu: arm1176
Expand Down Expand Up @@ -366,22 +348,6 @@ jobs:
cpu: cortex-a53
base_image: dietpi:rpi_armv8_bullseye
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
- target: raspi_1_bullseye
cpu: arm1176
base_image: raspi_1_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
- id: define-step1
Expand Down Expand Up @@ -437,7 +403,37 @@ jobs:
OPENFST_VERSION=${{ steps.get-openfst-version.outputs.OPENFST_VERSION }}
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool zlib1g-dev g++ make patch
if [ -e /etc/apt/sources.list -a `grep -c bookworm /etc/apt/sources.list` -gt 0 ]; then
apt-get install --no-install-recommends -y wget mime-support
if [ `uname -m` = "aarch64" ]; then
arch=arm64
dist=http://ftp.debian.org/debian/
else
arch=armhf
dist=http://raspbian.raspberrypi.com/raspbian/
fi
wget ${dist}pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/libf/libffi/libffi7_3.3-6_${arch}.deb
wget ${dist}pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_${arch}.deb
dpkg -i libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
rm libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
else
apt-get install --no-install-recommends -y python2.7
fi
cd src
OPENFST_VER=${OPENFST_VERSION} ./configure --shared
make depend -j 4
Expand All @@ -462,7 +458,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi, raspi_1_bullseye, raspi_2_bullseye, raspi_3_bullseye, raspi_4_bullseye]
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi]
include:
- target: armv6l_raspbian
cpu: arm1176
Expand Down Expand Up @@ -492,22 +488,6 @@ jobs:
cpu: cortex-a53
base_image: dietpi:rpi_armv8_bullseye
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
- target: raspi_1_bullseye
cpu: arm1176
base_image: raspi_1_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
- id: define-step2
Expand Down Expand Up @@ -580,7 +560,37 @@ jobs:
/opt/kaldi
commands: |
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool zlib1g-dev g++ make patch
if [ -e /etc/apt/sources.list -a `grep -c bookworm /etc/apt/sources.list` -gt 0 ]; then
apt-get install --no-install-recommends -y wget mime-support
if [ `uname -m` = "aarch64" ]; then
arch=arm64
dist=http://ftp.debian.org/debian/
else
arch=armhf
dist=http://raspbian.raspberrypi.com/raspbian/
fi
wget ${dist}pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/libf/libffi/libffi7_3.3-6_${arch}.deb
wget ${dist}pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_${arch}.deb
dpkg -i libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
rm libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
else
apt-get install --no-install-recommends -y python2.7
fi
cd src
make chainbin featbin fgmmbin fstbin gmmbin ivectorbin kwsbin latbin lmbin -j 4
- name: Create tarball for step 1
Expand All @@ -603,7 +613,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi, raspi_1_bullseye, raspi_2_bullseye, raspi_3_bullseye, raspi_4_bullseye]
target: [armv6l_raspbian, armv6l_raspios, armv7l_raspios, aarch64_raspios, armv6l_dietpi, armv7l_dietpi, aarch64_dietpi]
include:
- target: armv6l_raspbian
cpu: arm1176
Expand Down Expand Up @@ -633,22 +643,6 @@ jobs:
cpu: cortex-a53
base_image: dietpi:rpi_armv8_bullseye
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
- target: raspi_1_bullseye
cpu: arm1176
base_image: raspi_1_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero_w
- target: raspi_2_bullseye
cpu: cortex-a7
base_image: raspi_2_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_3_bullseye
cpu: cortex-a53
base_image: raspi_3_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_3b
- target: raspi_4_bullseye
cpu: cortex-a53
base_image: raspi_4_bullseye:20220121
cpu_info: cpuinfo/raspberrypi_zero2_w_arm64
steps:
- uses: actions/checkout@v2
- name: Define the release name
Expand Down Expand Up @@ -724,7 +718,37 @@ jobs:
commands: |
. /etc/os-release && echo "$ID$VERSION_ID-`uname -m`" > release_name
apt-get update -y --allow-releaseinfo-change
apt-get install --no-install-recommends -y subversion gawk python python3 automake autoconf git sox gfortran libtool
apt-get install --no-install-recommends -y subversion gawk python3 automake autoconf git sox gfortran libtool zlib1g-dev g++ make patch
if [ -e /etc/apt/sources.list -a `grep -c bookworm /etc/apt/sources.list` -gt 0 ]; then
apt-get install --no-install-recommends -y wget mime-support
if [ `uname -m` = "aarch64" ]; then
arch=arm64
dist=http://ftp.debian.org/debian/
else
arch=armhf
dist=http://raspbian.raspberrypi.com/raspbian/
fi
wget ${dist}pool/main/p/python2.7/libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/p/python2.7/python2.7_2.7.18-8+deb11u1_${arch}.deb
wget ${dist}pool/main/libf/libffi/libffi7_3.3-6_${arch}.deb
wget ${dist}pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_${arch}.deb
dpkg -i libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
rm libffi7_3.3-6_${arch}.deb \
libssl1.1_1.1.1w-0+deb11u1_${arch}.deb \
libpython2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
python2.7-minimal_2.7.18-8+deb11u1_${arch}.deb \
libpython2.7-stdlib_2.7.18-8+deb11u1_${arch}.deb \
python2.7_2.7.18-8+deb11u1_${arch}.deb
else
apt-get install --no-install-recommends -y python2.7
fi
cd src
make -j 4
- name: Create tarballs with files
Expand All @@ -738,7 +762,7 @@ jobs:
sudo cp -a {INSTALL,README.md,COPYING,src} dist/opt/kaldi/
mkdir -p dist/opt/kaldi/tools/OpenBLAS/
sudo cp -a tools/OpenBLAS/install dist/opt/kaldi/tools/OpenBLAS/
sudo cp -a tools/openfst-${OPENFST_VERSION} dist/opt/kaldi/tools
sudo cp -a tools/openfst-${OPENFST_VERSION} dist/opt/kaldi/tools/openfst-${OPENFST_VERSION}
sudo cp -a tools/openfst dist/opt/kaldi/tools
sudo find dist/opt/kaldi -type f ! -regex '^.*\.\(h\|so.*\)$' -delete
sudo find dist/opt/kaldi -type d -empty -delete
Expand Down
Loading

0 comments on commit 52a8c31

Please sign in to comment.