-
Notifications
You must be signed in to change notification settings - Fork 132
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 zoo_helper CI/CD workflows for linux-x86_64 and linux-arm64 #1216
Merged
lnotspotl
merged 41 commits into
v3_develop
from
feature/zoo_helper_improvements_centos
Feb 13, 2025
Merged
Changes from 38 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
a530177
Fix zoo_helper build
lnotspotl 9802bdd
List all files
lnotspotl dad8ff5
Update github action for zoo_helper build
lnotspotl c247a72
Remove unwanted character
lnotspotl 1f3df8b
Remove REQUIRED flags
lnotspotl 73868b7
Remove find_package calls
lnotspotl 69ae368
Remove find_package calls
lnotspotl 656f933
Preserve build directory
lnotspotl 826cea3
Update python-main.yml
lnotspotl 655db3a
Create a standalone github action for zoo_helper
lnotspotl a1c3d35
Update
lnotspotl 984f1a3
Rename workflow
lnotspotl 4a6ad34
Add a little more setup
lnotspotl 2d5d0fc
Add a little more setup
lnotspotl 3b6d0f4
Add helper script for zoo helper uploading to artifactory
lnotspotl 9c68f3b
Fix: Command not found
lnotspotl 4e3ff96
Set secrets as env variables
lnotspotl 4fe7bf9
Use the entire git hash
lnotspotl d3dc996
Attempt to fix secretes
020ef19
Add automake dependency
lnotspotl 6708c2c
Try ninja-build
lnotspotl 6596517
fix?
lnotspotl 65782c6
Fix CI issues
lnotspotl 975a38e
zoo helper CI cleanup
lnotspotl 00a47ca
try centos
lnotspotl 9ed5b5c
try almalinux
lnotspotl 0179850
try almalinux
lnotspotl c5e41de
try almalinux
lnotspotl e754c9d
try almalinux
lnotspotl 47a6fa9
try almalinux
lnotspotl 2a1fa08
try almalinux
lnotspotl d17dbb0
try almalinux
lnotspotl 3714322
try almalinux
lnotspotl dc7557a
try almalinux
lnotspotl eee1a3c
fix hashes
lnotspotl e7e4045
Fix find_package error
lnotspotl 2313b9c
Set C++17 as standard
lnotspotl 76ab7b8
Don't care about perf, just minimize executable size.
lnotspotl 15f64fd
Add missing empty line
lnotspotl 997bc7d
Add defaults, format, add api_key as a parameter
lnotspotl b00218f
Merge branch 'v3_develop' into feature/zoo_helper_improvements_centos
lnotspotl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Zoo Helper | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
CMAKE_WINDOWS_SDK_VERSION: '10.0.18362.0' | ||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | ||
|
||
jobs: | ||
build-zoo-helper-linux-x86_64: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: almalinux:8 | ||
steps: | ||
- name: Cache .hunter folder | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.hunter | ||
key: hunter-almalinux-8-v3-develop-x86_64 | ||
|
||
- name: Install git | ||
run: dnf install -y git | ||
|
||
- name: Export GitHub Actions cache environment variables | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Install dependencies | ||
run: | | ||
dnf update -y | ||
dnf install -y pkgconf-pkg-config bison autoconf libtool libXi-devel libXtst-devel cmake zip perl-core python39 | ||
dnf install -y libXrandr-devel libX11-devel libXft-devel libXext-devel flex systemd-devel | ||
dnf install -y gcc-c++ automake libtool-ltdl-devel wget | ||
wget https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.gz && tar -xzf nasm-2.16.01.tar.gz && cd nasm-2.16.01 && ./configure && make && make install && cd .. # install nasm - build from source | ||
pip3 install jinja2 | ||
|
||
- name: Configure project | ||
run: cmake -S . -B build -DDEPTHAI_ENABLE_CURL=ON -DCMAKE_BUILD_TYPE=MinSizeRel | ||
|
||
- name: Build zoo_helper | ||
run: cmake --build build --target zoo_helper --parallel 4 | ||
|
||
- name: Strip zoo_helper | ||
run: strip ./build/zoo_helper # Shrinks the size of the binary a little bit by removing symbols: https://www.man7.org/linux/man-pages/man1/strip.1.html | ||
|
||
- name: Upload zoo_helper to artifactory | ||
run: | | ||
bash ./ci/upload-artifactory-zoo-helper.sh | ||
env: | ||
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }} | ||
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} | ||
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }} | ||
ZOO_HELPER_PLATFORM: linux-x86_64 | ||
|
||
build-zoo-helper-linux-arm64: | ||
runs-on: [self-hosted, linux, ARM64] | ||
container: | ||
image: arm64v8/almalinux:8 | ||
# Mount local hunter cache directory, instead of transfering to Github and back | ||
volumes: | ||
- /.hunter:/github/home/.hunter | ||
env: | ||
# workaround required for cache@v3, https://github.com/actions/cache/issues/1428 | ||
VCPKG_FORCE_SYSTEM_BINARIES: "1" # Needed so vpckg can bootstrap itself | ||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | ||
VCPKG_MAX_CONCURRENCY: "2" | ||
steps: | ||
- name: Install git | ||
run: dnf install -y git | ||
|
||
- name: Export GitHub Actions cache environment variables | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Install dependencies | ||
run: | | ||
dnf update -y | ||
dnf install -y pkgconf-pkg-config bison autoconf libtool libXi-devel libXtst-devel cmake git zip perl-core python39 | ||
dnf install -y libXrandr-devel libX11-devel libXft-devel libXext-devel flex systemd-devel | ||
dnf install -y gcc-c++ automake libtool-ltdl-devel wget | ||
wget https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.gz && tar -xzf nasm-2.16.01.tar.gz && cd nasm-2.16.01 && ./configure && make && make install && cd .. # install nasm - build from source | ||
pip3 install jinja2 | ||
pip3 install ninja # ninja is needed for cmake on arm64 | ||
|
||
- name: Configure project | ||
run: cmake -S . -B build -DDEPTHAI_ENABLE_CURL=ON -DCMAKE_BUILD_TYPE=MinSizeRel | ||
|
||
- name: Build zoo_helper | ||
run: cmake --build build --target zoo_helper --parallel 4 | ||
|
||
- name: Strip zoo_helper | ||
run: strip ./build/zoo_helper # Shrinks the size of the binary a little bit by removing symbols: https://www.man7.org/linux/man-pages/man1/strip.1.html | ||
|
||
- name: Upload zoo_helper to artifactory | ||
run: | | ||
bash ./ci/upload-artifactory-zoo-helper.sh | ||
env: | ||
ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }} | ||
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} | ||
ARTIFACTORY_PASS: ${{ secrets.ARTIFACTORY_PASS }} | ||
ZOO_HELPER_PLATFORM: linux-arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lnotspotl marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Download jfrog cli | ||
curl -fL https://getcli.jfrog.io | sh | ||
|
||
# Set paths | ||
export PATH_PREFIX=luxonis-depthai-helper-binaries/zoo_helper/$ZOO_HELPER_PLATFORM | ||
export ZOO_HELPER_BINARY_LOCAL_PATH=build/zoo_helper | ||
|
||
# Get git hash | ||
git config --global --add safe.directory $(pwd) | ||
export ZOO_HELPER_GIT_HASH=$(git rev-parse HEAD) | ||
|
||
echo "----------------------------------------" | ||
echo "PATH_PREFIX: $PATH_PREFIX" | ||
echo "ZOO_HELPER_BINARY_LOCAL_PATH: $ZOO_HELPER_BINARY_LOCAL_PATH" | ||
echo "ZOO_HELPER_GIT_HASH: $ZOO_HELPER_GIT_HASH" | ||
echo "zoo_helper binary size: $(du -sh $ZOO_HELPER_BINARY_LOCAL_PATH)" | ||
echo "----------------------------------------" | ||
|
||
# Upload binary to artifactory | ||
./jfrog config add --artifactory-url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS | ||
./jfrog rt u "$ZOO_HELPER_BINARY_LOCAL_PATH" "$PATH_PREFIX/$ZOO_HELPER_GIT_HASH/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ | |
"fp16", | ||
"mp4v2", | ||
"libnop", | ||
"argparse", | ||
"fmt", | ||
"neargye-semver", | ||
"magic-enum", | ||
{ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to separate this out in a separate folder & CMakeLists.txt and depend directly on DAI to avoid duplication.
I mean doing
target_link_libraries(zoo_helper, depthai_core)
.We should be able to get core pretty lean on size, if everything is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love to keep this the way it is and it was a deliberate decision not to have
depthai-core
library as a direct dependency. The reasoning behind this decision was thatzoo_helper
is made up of just a handful of source files, whereasdepthai-core
contains hundreds of files.If
depthai-core
was a direct dependency, every time we would be willing to buildzoo_helper
, we would have to rebuild the entirety of core. And even if all opt for a minimal build, it certainly takes longer than building just those handful of fileszoo_helper
directly depends on.What is your take on this? The goal of the above reasoning is to minimize compile times in case only the
zoo_helper
binary is to be produced.