Skip to content

[RSDK-11420] - Use conan for cpp-sdk dep#40

Merged
seanavery merged 27 commits intoviam-modules:mainfrom
seanavery:RSDK-11420
Apr 1, 2026
Merged

[RSDK-11420] - Use conan for cpp-sdk dep#40
seanavery merged 27 commits intoviam-modules:mainfrom
seanavery:RSDK-11420

Conversation

@seanavery
Copy link
Copy Markdown
Collaborator

@seanavery seanavery commented Feb 19, 2026

Summary

Replace the viam-cpp-sdk bundled in Docker base images with Conan package management for both Jetson and Pi targets.

  • Add conanfile.py pinning viam-cpp-sdk/0.20.1
  • All builds (make build, make package) now go through Conan (conan install + conan build)
  • Remove SDK source install from both Dockerfiles (Dockerfile.base, Dockerfile.base.bullseye)
  • Remove SDK-only apt deps from Pi image (libboost-all-dev, libgrpc++-dev, libprotobuf-dev, etc.)
  • AppImage packaging and release artifact format unchanged

CI Changes

  • Bumped all ARM runners from buildjet-2vcpu to buildjet-8vcpu (SDK builds from source, OOMs on 2vcpu)
  • Added actions/cache for .conan-home across build.yml, unit.yml, deploy.yml — first build is ~20min, cached builds are fast
  • Merged conan-build.yml smoke check into build.yml and deleted the redundant workflow
  • Unit tests now use make conan-test which chains install → build → test
  • Cache keys are per-target (jetson/pi) to avoid GCC 10/11 cache conflicts

Bullseye (Pi) Linker Fix

The SDK libviam_rust_utils.a references POSIX AIO symbols (aio_read, aio_write, etc.) that live in librt on Debian Bullseye (glibc 2.31). On Jammy (glibc 2.34+) these are merged into libc. The SDK Conan package declares -lrt but places libviam_rust_utils.a last in link order, after -lrt is already discarded. Fixed with -Wl,--no-as-needed in CMakeLists.txt.

Base Images

New base images pushed to ghcr.io with SDK removed (image size ~70% smaller):

Pi image retains libssl-dev — required by libcamera's meson build to compile IPA module signature verification (libcrypto). Without it, IPA modules can only run in isolated proxy mode, which fails inside AppImages.

Test Plan

  • Jetson: make buildmake package → ldd clean (no libviam deps) — Canon + CI
  • Pi: make buildmake package → ldd clean — Canon + CI
  • Unit tests green in CI
  • Lint green
  • Build Latest green (both targets)
  • Build and push new base images (0.0.8) with SDK removed
  • CI green with new 0.0.8 base images
  • Deploy Pi AppImage to hardware, verify module starts and connects to CSI camera
  • Deploy Jetson AppImage to hardware, verify module starts and connects to CSI camera
  • Follow up with SDK team on missing Linux arm64 prebuilt binaries in viamconan

@seanavery seanavery marked this pull request as draft February 19, 2026 20:17
@seanavery seanavery changed the title [RSDK-11420] - Use conan for jetson targets [RSDK-11420] - Use conan for cpp-sdk dep Mar 24, 2026
@seanavery seanavery marked this pull request as ready for review March 25, 2026 13:52
@seanavery seanavery requested a review from hexbabe March 25, 2026 13:54
@seanavery
Copy link
Copy Markdown
Collaborator Author

NOTE: need to upload new pi base image with ssl

@seanavery seanavery requested a review from oliviamiller March 25, 2026 19:09
matrix:
include:
- container: ghcr.io/viam-modules/csi-camera/viam-cpp-base-jetson:0.0.6
- container: ghcr.io/viam-modules/csi-camera/viam-cpp-base-jetson:0.0.8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you use latest tag so you don't have to change if the image gets updated?

Copy link
Copy Markdown
Collaborator Author

@seanavery seanavery Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, created a ticket. Will do in a follow-up PR.

Comment thread .github/workflows/build.yml Outdated
- name: Verify no dynamic viam library deps
run: |
if ldd build-conan/build/Release/viam-csi | grep -i 'libviam'; then
echo "Unexpected dynamic viam library dependency found"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when would this happen?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using this to make sure libviam is statically linked. CI should fail if we have a missing libviam so dep.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ldd check

RUN mkdir -p ${HOME}/opt/src
RUN apt-get install fakeroot libgtk-3-bin squashfs-tools -y
RUN apt install python3-pip -y
RUN apt install python3-pip python3-venv -y
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need both a bullseye and bookworm docker container? if we just had the bullseye it would be compatiable with both bullseye and bookworm.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have bullseye for pi targets and l4t flavored ubuntu for jetson targets

(Eventually want to unify to a single path once all deps are statically linked)

@seanavery seanavery mentioned this pull request Mar 31, 2026
@seanavery seanavery requested a review from oliviamiller March 31, 2026 16:22
@oliviamiller
Copy link
Copy Markdown

Known Constraint
No Linux arm64 prebuilt binaries exist on viamconan for any viam-cpp-sdk version. The SDK conan-publish.yml has an arm64 runner in its matrix but packages are not appearing — likely silent CI failure. Every CI run builds the full SDK dep chain from source; actions/cache amortizes this after the first run.

Should we investigate this/let SDK team know?

@oliviamiller
Copy link
Copy Markdown

Are there plans to remove the use of appimage in this module?

@seanavery
Copy link
Copy Markdown
Collaborator Author

No Linux arm64 prebuilt binaries exist on viamconan for any viam-cpp-sdk version. The SDK conan-publish.yml has an arm64 runner in its matrix but packages are not appearing — likely silent CI failure. Every CI run builds the full SDK dep chain from source; actions/cache amortizes this after the first run.

Should we investigate this/let SDK team know?

Forgot to update the description. I am on an older version of the sdk which does not have the dependencies uploaded to conan. Bumping the SDK after this is merged which should fix the slow build issue. PR

@seanavery seanavery merged commit 9abd670 into viam-modules:main Apr 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants