Skip to content

Commit bcc08ed

Browse files
committed
merge v3 into zoo
2 parents f2a9760 + c4d74cf commit bcc08ed

File tree

287 files changed

+12904
-3980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+12904
-3980
lines changed

.github/workflows/python-main.yml

Lines changed: 87 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ name: Depthai Python CI/CD
22

33
# Controls when the action will run. Triggers the workflow on push
44

5-
###################################
6-
# WARNING #########################
7-
# as self-hosted runners are used, and security policy for them has not been yet determined by GitHub
8-
# pay close attention to not enable workflows on pull_request events
9-
# TLDR: do NOT add 'pull_request' here for the time being
105
on:
116
workflow_dispatch:
7+
pull_request:
8+
branches:
9+
- v3_develop
1210
push:
1311
branches:
1412
- v3_develop*
@@ -27,6 +25,8 @@ jobs:
2725
# Job which builds docstrings for the rest of the wheel builds
2826
build-docstrings:
2927
runs-on: ubuntu-latest
28+
env:
29+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
3030
steps:
3131
- name: Cache .hunter folder
3232
uses: actions/cache@v3
@@ -35,6 +35,12 @@ jobs:
3535
key: hunter-ubuntu-latest-v3-develop
3636
- name: List .hunter cache directory
3737
run: ls -a -l ~/.hunter/_Base/ || true
38+
- name: Export GitHub Actions cache environment variables
39+
uses: actions/github-script@v7
40+
with:
41+
script: |
42+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
43+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
3844
- uses: actions/checkout@v3
3945
with:
4046
submodules: 'recursive'
@@ -46,7 +52,7 @@ jobs:
4652
run: |
4753
sudo apt update
4854
python -m pip install --upgrade pip
49-
sudo apt install libusb-1.0-0-dev libopencv-dev libpcl-dev
55+
sudo apt install libusb-1.0-0-dev pkg-config bison autoconf libtool libxi-dev libxtst-dev libxrandr-dev libx11-dev libxft-dev libxext-dev nasm flex libudev-dev
5056
python -m pip install -r bindings/python/docs/requirements_mkdoc.txt
5157
- name: Configure project
5258
run: cmake -S . -B build -DDEPTHAI_BUILD_PYTHON=ON -DDEPTHAI_PYTHON_FORCE_DOCSTRINGS=ON -DDEPTHAI_BASALT_SUPPORT=ON -DDEPTHAI_PCL_SUPPORT=ON -DDEPTHAI_RTABMAP_SUPPORT=ON -DDEPTHAI_PYTHON_DOCSTRINGS_OUTPUT="$PWD/bindings/python/docstrings/depthai_python_docstring.hpp"
@@ -63,6 +69,8 @@ jobs:
6369
# Build and test bindings
6470
pytest:
6571
needs: build-docstrings
72+
env:
73+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
6674
strategy:
6775
matrix:
6876
# os: [ubuntu-latest, windows-latest, macos-latest]
@@ -84,6 +92,12 @@ jobs:
8492
with:
8593
path: C:/.hunter/
8694
key: hunter-pytest-${{ matrix.os }}-v3-develop
95+
- name: Export GitHub Actions cache environment variables
96+
uses: actions/github-script@v7
97+
with:
98+
script: |
99+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
100+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
87101
88102
- uses: actions/checkout@v3
89103
with:
@@ -105,28 +119,22 @@ jobs:
105119
if: matrix.os == 'ubuntu-latest'
106120
run: |
107121
python -m pip install --upgrade pip
108-
sudo apt install libusb-1.0-0-dev libopencv-dev
122+
sudo apt install libusb-1.0-0-dev pkg-config bison autoconf libtool libxi-dev libxtst-dev libxrandr-dev libx11-dev libxft-dev libxext-dev nasm flex libudev-dev
109123
110124
- name: Install dependencies (MacOS)
111125
if: matrix.os == 'macos-latest'
112126
run: |
113127
python -m pip install --upgrade pip
114128
brew install libusb
115-
brew install opencv
116129
117130
- name: Setup cmake
118131
if: matrix.os == 'macos-latest'
119132
uses: jwlawson/[email protected]
120133

121-
- name: Install dependencies (Windows)
122-
if: matrix.os == 'windows-latest'
123-
run: |
124-
choco install opencv
125-
echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
126134

127135
- name: Install pytest
128136
run: |
129-
python -m pip install pytest numpy opencv-python
137+
python -m pip install pytest numpy opencv-python jinja2
130138
131139
- name: Compile
132140
run: |
@@ -191,12 +199,15 @@ jobs:
191199
runs-on: windows-latest
192200
strategy:
193201
matrix:
194-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']
202+
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13']
195203
# python-architecture: [x64, x86]
196204
python-architecture: [x64] # TODO(Morato) - re-enable x86 - it complains that OpenCV even though it's 32 bit is not compatible
197205
fail-fast: false
198206
env:
199-
DEPTHAI_BUILD_BASALT: ON
207+
DEPTHAI_BUILD_BASALT: OFF
208+
DEPTHAI_BUILD_PCL: ON
209+
DEPTHAI_BUILD_RTABMAP: ON
210+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
200211
steps:
201212
- name: Cache .hunter folder
202213
uses: actions/cache@v3
@@ -206,6 +217,12 @@ jobs:
206217
- uses: actions/checkout@v3
207218
with:
208219
submodules: 'recursive'
220+
- name: Export GitHub Actions cache environment variables
221+
uses: actions/github-script@v7
222+
with:
223+
script: |
224+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
225+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
209226
210227
- uses: actions/download-artifact@v3
211228
with:
@@ -214,18 +231,6 @@ jobs:
214231
- name: Specify docstring to use while building the wheel
215232
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
216233

217-
- name: Install dependencies for x86
218-
if: matrix.python-architecture == 'x86'
219-
run: |
220-
choco install opencv --x86
221-
echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
222-
223-
- name: Install dependencies for x64
224-
if: matrix.python-architecture == 'x64'
225-
run: |
226-
choco install opencv
227-
echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
228-
229234
- name: Select Windows SDK
230235
run: echo "CMAKE_ARGS=-DCMAKE_SYSTEM_VERSION=${{ env.CMAKE_WINDOWS_SDK_VERSION }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
231236

@@ -260,14 +265,15 @@ jobs:
260265
needs: build-docstrings
261266
strategy:
262267
matrix:
263-
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
268+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']
264269
os: [macos-13, macos-14] # macos-13 is x64, macos-14 is arm64
265270
fail-fast: false
266271
runs-on: ${{ matrix.os }}
267-
#env:
268-
# DEPTHAI_BUILD_BASALT: ON
269-
# DEPTHAI_BUILD_PCL: ON
270-
# DEPTHAI_BUILD_RTABMAP: ON
272+
env:
273+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
274+
DEPTHAI_BUILD_BASALT: ON
275+
DEPTHAI_BUILD_PCL: ON
276+
DEPTHAI_BUILD_RTABMAP: ON
271277
steps:
272278
- name: Cache .hunter folder
273279
uses: actions/cache@v3
@@ -278,6 +284,12 @@ jobs:
278284
run: |
279285
ls -a -l ~/.hunter/_Base/ || true
280286
echo "PATH=$PATH"
287+
- name: Export GitHub Actions cache environment variables
288+
uses: actions/github-script@v7
289+
with:
290+
script: |
291+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
292+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
281293
282294
- uses: actions/checkout@v3
283295
with:
@@ -301,8 +313,7 @@ jobs:
301313
run: |
302314
python -m pip install --upgrade pip
303315
brew install libusb
304-
brew install opencv
305-
# brew install pcl
316+
brew install nasm
306317
python -m pip install delocate
307318
- name: Building wheels
308319
run: cd bindings/python && python -m pip wheel . -w ./wheelhouse/ --verbose
@@ -389,30 +400,34 @@ jobs:
389400
needs: build-docstrings
390401
runs-on: ubuntu-latest
391402
container:
392-
image: mmorato/depthai-manylinux2014:0.4 # TODO(mmorato) temporary location, push to luxonis namespace
403+
image: quay.io/pypa/manylinux_2_28_x86_64
393404
env:
394-
PLAT: manylinux2014_x86_64
405+
PLAT: manylinux_2_28_x86_64
395406
strategy:
396407
matrix:
397-
python-set: ["7..9", "10..12"]
408+
python-set: ["cp37-cp37m", "cp38-cp38", "cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312", "cp313-cp313"]
398409
env:
399-
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
400-
# to be removed when upgrading the manylinux image
401-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
402410
DEPTHAI_BUILD_BASALT: ON
403411
DEPTHAI_BUILD_PCL: ON
404412
DEPTHAI_BUILD_RTABMAP: ON
413+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
405414
steps:
406415
- name: Cache .hunter folder
407416
uses: actions/cache@v3
408417
with:
409418
path: ~/.hunter
410419
key: hunter-x86_64-v3-develop
420+
- name: Export GitHub Actions cache environment variables
421+
uses: actions/github-script@v7
422+
with:
423+
script: |
424+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
425+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
411426
- uses: actions/checkout@v3
412427
with:
413428
submodules: 'recursive'
414429
- name: Installing libusb1-devel dependency
415-
run: yum install -y --disableplugin=fastestmirror libusb1-devel perl-core curl zip unzip tar ninja-build
430+
run: yum install -y libusb1-devel perl-core curl zip unzip tar ninja-build zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel libXrandr-devel libXtst-devel libudev-devel lapack-devel nasm libtool autoconf automake
416431
- name: Installing cmake dependency
417432
run: |
418433
cd bindings/python
@@ -428,12 +443,15 @@ jobs:
428443
- name: Specify docstring to use while building the wheel
429444
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
430445

446+
<<<<<<< HEAD
431447
- name: Build and install depthai-core
432448
run: |
433449
cmake -S . -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
434450
cmake --build build_core --parallel 4
435451
echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV
436452
453+
=======
454+
>>>>>>> v3_develop
437455
- name: Append build hash if not a tagged commit
438456
if: startsWith(github.ref, 'refs/tags/v') != true
439457
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
@@ -444,7 +462,9 @@ jobs:
444462
/opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar
445463
mv dist/* wheelhouse/audited/
446464
- name: Build wheels
447-
run: cd bindings/python && for PYBIN in /opt/python/cp3{${{ matrix.python-set }}}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
465+
run: |
466+
cd bindings/python && for PYBIN in /opt/python/${{ matrix.python-set }}/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
467+
448468
- name: Audit wheels
449469
run: cd bindings/python && for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
450470
- name: Archive wheel artifacts
@@ -482,35 +502,47 @@ jobs:
482502
runs-on: [self-hosted, linux, ARM64]
483503
timeout-minutes: 1440 # Set timeout to 24 hours
484504
container:
485-
image: mmorato/depthai-manylinux2014_aarch64:0.4
505+
image: quay.io/pypa/manylinux_2_28_aarch64
486506
env:
487-
PLAT: manylinux2014_aarch64
507+
PLAT: manylinux_2_28_aarch64
488508
# Mount local hunter cache directory, instead of transfering to Github and back
489509
volumes:
490510
- /.hunter:/github/home/.hunter
491511
strategy:
492512
matrix:
493-
python-set: ["7..9", "10..12"]
513+
python-set: ["cp37-cp37m", "cp38-cp38", "cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312", "cp313-cp313"]
494514
env:
495515
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428
496-
# to be removed when upgrading the manylinux image
497-
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
498-
DEPTHAI_VCPKG_CFLAGS: "-std=c99" # Needed so vpckg can bootstrap itself with the old GCC on the manylinux image
499516
VCPKG_FORCE_SYSTEM_BINARIES: "1" # Needed so vpckg can bootstrap itself
500-
# DEPTHAI_BUILD_BASALT: ON
501-
# DEPTHAI_BUILD_PCL: ON
502-
# DEPTHAI_BUILD_RTABMAP: ON
517+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
518+
DEPTHAI_BUILD_BASALT: ON
519+
DEPTHAI_BUILD_PCL: ON
520+
DEPTHAI_BUILD_RTABMAP: ON
521+
VCPKG_MAX_CONCURRENCY: "2"
503522
steps:
523+
- name: Export GitHub Actions cache environment variables
524+
uses: actions/github-script@v7
525+
with:
526+
script: |
527+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
528+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
504529
- uses: actions/checkout@v3
505530
with:
506531
submodules: 'recursive'
507532
- name: Installing libusb1-devel dependency
508-
run: yum install -y --disableplugin=fastestmirror libusb1-devel perl-core curl zip unzip tar ninja-build
533+
run: yum install -y libusb1-devel perl-core curl zip unzip tar zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel libXrandr-devel libXtst-devel libudev-devel lapack-devel nasm libtool autoconf automake
509534
- name: Installing cmake dependency
510535
run: |
511536
cd bindings/python
512537
/opt/python/cp38-cp38/bin/python3.8 -m pip install cmake
513538
ln -s /opt/python/cp38-cp38/bin/cmake /bin/
539+
- name: Setup ninja required for arm64 builds
540+
run: |
541+
git clone https://github.com/ninja-build/ninja.git
542+
cd ninja
543+
git checkout v1.10.2
544+
cmake -Bbuild-cmake
545+
cmake --build build-cmake --target install
514546
- name: Create folder structure
515547
run: cd bindings/python && mkdir -p wheelhouse/audited/
516548

@@ -521,17 +553,12 @@ jobs:
521553
- name: Specify docstring to use while building the wheel
522554
run: echo "DEPTHAI_PYTHON_DOCSTRINGS_INPUT=$PWD/bindings/python/docstrings/depthai_python_docstring.hpp" >> $GITHUB_ENV
523555

524-
# - name: Build and install depthai-core
525-
# run: |
526-
# cmake -S . -B build_core -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchain/pic.cmake
527-
# cmake --build build_core --parallel 4
528-
# echo "DEPTHAI_INSTALLATION_DIR=$PWD/build_core/install/" >> $GITHUB_ENV
529-
530556
- name: Append build hash if not a tagged commit
531557
if: startsWith(github.ref, 'refs/tags/v') != true
532558
run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV
533559
- name: Building wheels
534-
run: cd bindings/python && for PYBIN in /opt/python/cp3{${{ matrix.python-set }}}*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
560+
run: |
561+
cd bindings/python && for PYBIN in /opt/python/${{ matrix.python-set }}/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/ --verbose; done
535562
- name: Auditing wheels
536563
run: cd bindings/python && for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w wheelhouse/audited/; done
537564
- name: Archive wheel artifacts

.github/workflows/test.workflow.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020

2121
# Testing
2222
test:
23+
env:
24+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
2325
strategy:
2426
matrix:
2527
# os: ['windows', 'macos', 'linux']
@@ -42,6 +44,12 @@ jobs:
4244
- uses: actions/checkout@v3
4345
with:
4446
submodules: 'recursive'
47+
- name: Export GitHub Actions cache environment variables
48+
uses: actions/github-script@v7
49+
with:
50+
script: |
51+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
52+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
4553
4654
- name: Create virtual environment
4755
run: |
@@ -72,6 +80,7 @@ jobs:
7280
export DISPLAY=:99
7381
xdpyinfo -display $DISPLAY >/dev/null 2>&1 || (Xvfb $DISPLAY &)
7482
source venv/bin/activate # Activate virtual environment
83+
python3 -m pip install jinja2
7584
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D HUNTER_ROOT=$HOME/.hun2_${{ matrix.flavor }} -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON -D DEPTHAI_TEST_EXAMPLES=ON -D DEPTHAI_BUILD_PYTHON=ON -D DEPTHAI_PYTHON_TEST_EXAMPLES=ON -D DEPTHAI_PYTHON_ENABLE_EXAMPLES=ON
7685
cmake --build build --parallel 4 --config Release
7786
cd tests

0 commit comments

Comments
 (0)