-
Notifications
You must be signed in to change notification settings - Fork 30
Update workflow to include artifacts uploads. #315
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
Changes from all commits
caa46b7
60bcbfb
c158e24
35c58c7
df59711
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Copilot Instructions for realsense_mipi_platform_driver | ||
|
|
||
| ## Project Overview | ||
| This repository provides the RealSense™ camera driver for GMSL/MIPI interfaces, targeting NVIDIA® Jetson platforms (AGX Xavier, AGX Orin) and supporting multiple JetPack versions (6.x, 5.x, 4.6.1). It enables control and streaming of RealSense™ 3D MIPI cameras via custom kernel drivers, device trees, and build scripts. | ||
|
|
||
| ## Architecture & Key Components | ||
| - **hardware/**: Device tree overlays and platform-specific configuration files for NVIDIA and RealSense hardware. | ||
| - **kernel/**: Kernel patches and sources for different JetPack and kernel versions. | ||
| - **nvidia-oot/**: Out-of-tree NVIDIA kernel modules and related patches. | ||
| - **scripts/**: Build, patch, and utility scripts for workspace setup, compilation, and firmware management. | ||
| - **test/**: Test scripts and metadata validation tools. | ||
| - **utilities/**: Example applications, parsers, and stream utilities for RealSense cameras. | ||
|
|
||
| ## Developer Workflows | ||
| ### 1. Workspace Setup & Build | ||
| - Use `setup_workspace.sh [JetPack_version]` to prepare sources and toolchains. | ||
| - Apply kernel and driver patches with `apply_patches.sh [--one-cam|--dual-cam] apply [JetPack_version]`. | ||
| - For CI/external builds, use `apply_patches_ext.sh`. | ||
| - Build all components with `build_all.sh [--dev-dbg] [JetPack_version]`. | ||
| - Example: | ||
| ```sh | ||
| ./setup_workspace.sh 6.2 | ||
| ./apply_patches.sh 6.2 | ||
| ./build_all.sh 6.2 | ||
| ``` | ||
| - For debug logging, add `--dev-dbg` to build scripts. | ||
|
|
||
| ### 2. Testing & Validation | ||
| - Use `test/` scripts for firmware and metadata validation. | ||
| - After installation, verify driver and video devices: | ||
| ```sh | ||
| sudo dmesg | grep d4xx | ||
| ls -l /dev/video* | ||
| ``` | ||
| - Use V4L2 utilities for device checks: `sudo apt install v4l-utils` | ||
|
|
||
| ### 3. Device Tree & Kernel Integration | ||
| - Device tree overlays are in `hardware/realsense/` and `hardware/nvidia/platform/`. | ||
| - Kernel patches are versioned under `kernel/` and must match JetPack version. | ||
| - Out-of-tree modules are managed in `nvidia-oot/`. | ||
|
|
||
| ## Project-Specific Conventions | ||
| - JetPack version is a required argument for most scripts and build steps. | ||
| - Patch scripts support single/dual camera configuration for JetPack 5.x (`--one-cam`, `--dual-cam`). | ||
| - Kernel versioning and file paths must be updated per JetPack release. | ||
| - Artifacts (modules, images, dtb, etc.) are archived under `images/[JetPack_version]/`. | ||
|
|
||
| ## Integration Points & External Dependencies | ||
| - Relies on NVIDIA Jetson Linux BSP sources and toolchains (see README_JP6.md, README_JP5.md, README_JP4.md). | ||
| - Uses RealSense de-serialize hardware and Leopard Imaging adapter boards. | ||
| - Artifactory integration for CI/CD and artifact uploads (see Jenkins pipeline scripts). | ||
|
|
||
| ## Example: CI Pipeline Highlights | ||
|
|
||
| ## CI Pipeline: GitHub Actions & Jenkins | ||
|
|
||
| ### GitHub Actions Workflows | ||
| - Located in `.github/workflows/`, these YAML files automate build and release for each JetPack version: | ||
| - `build-jp6.yml`, `build-jp6.2.yml`, `build-jp6.1.yml`, `build-jp512.yml`, `build-jp502.yml`: Build/test for JetPack 6.x/5.x/4.x on push/PR. | ||
| - `release-jp6.yml`: Publishes release artifacts for JetPack 6.x. | ||
| - Each workflow: | ||
| - Checks out code | ||
| - Runs setup (`setup_workspace.sh [version]`), applies patches, builds (`build_all.sh [version]`) | ||
| - Archives build outputs (modules, dtb, rootfs, etc.) | ||
| - Uploads artifacts (via `actions/upload-artifact` or `softprops/action-gh-release`) | ||
| - Example build steps: | ||
| ```yaml | ||
| - name: setup workspace | ||
| run: yes | ./setup_workspace.sh 6.2 | ||
| - name: apply patches | ||
| run: ./apply_patches.sh 6.2 | ||
| - name: build | ||
| run: ./build_all.sh 6.2 | ||
| ``` | ||
| - Artifacts are found in `images/[JetPack_version]/` and uploaded for CI/release consumption. | ||
|
|
||
| ### Jenkins Pipeline | ||
| - `LRS_Jetson_mipi_usb_driver_jp6.groovy` (legacy/optional): Automates checkout, patching, build, artifact archiving, and upload to Artifactory. | ||
| - Environment variables and parameters control build options, JetPack version, and artifact destinations. | ||
| - Artifacts are uploaded to Artifactory and notification emails are sent on build completion/failure. | ||
|
|
||
| ## References | ||
| - See `README.md` for overall project intro and hardware requirements. | ||
| - See `README_JP6.md`, `README_JP5.md`, `README_JP4.md` for JetPack-specific build instructions. | ||
| - See `README_tools.md` for build script usage and options. | ||
| - See `README_driver.md` for driver API and validation steps. | ||
|
|
||
| --- | ||
| **Feedback Requested:** | ||
| If any section is unclear or missing key details, please specify which workflows, conventions, or integration points need further documentation for AI agents. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,3 +23,64 @@ jobs: | |||||||||||||||||||||||||
| run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh 6.0 | ||||||||||||||||||||||||||
| - name: build | ||||||||||||||||||||||||||
| run: ./build_all.sh 6.0 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Create artifact archives | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| JETPACK_VER="6.0" | ||||||||||||||||||||||||||
| KERNEL_VERSION="5.15.136-tegra" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Create nvidia-oot modules archive | ||||||||||||||||||||||||||
| echo "Creating nvidia-oot modules archive" | ||||||||||||||||||||||||||
| tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/updates" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # Create kernel HID modules archive | ||||||||||||||||||||||||||
| echo "Creating kernel HID modules archive" | ||||||||||||||||||||||||||
| tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra" | ||||||||||||||||||||||||||
|
Comment on lines
+34
to
+38
|
||||||||||||||||||||||||||
| tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/updates" | |
| # Create kernel HID modules archive | |
| echo "Creating kernel HID modules archive" | |
| tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra" | |
| tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "lib/modules/${KERNEL_VERSION}/updates" | |
| # Create kernel HID modules archive | |
| echo "Creating kernel HID modules archive" | |
| tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "lib/modules/${KERNEL_VERSION}/extra" |
Copilot
AI
Dec 7, 2025
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.
The tar command uses a relative path for the archive target './lib/modules/${KERNEL_VERSION}/extra' which may not work as intended. When using '-C' to change directory, the path should be relative to that new directory. This should likely be 'lib/modules/${KERNEL_VERSION}/extra' without the leading './'.
| tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra" | |
| tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "lib/modules/${KERNEL_VERSION}/extra" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Release JP 6.0 | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3 | ||
| - name: setup workspace | ||
| run: yes | ./setup_workspace.sh 6.0 | ||
| - name: apply patches | ||
| run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh 6.0 | ||
| - name: build | ||
| run: ./build_all.sh 6.0 | ||
| - name: Create artifact archives | ||
| run: | | ||
| JETPACK_VER="6.0" | ||
| KERNEL_VERSION="5.15.136-tegra" | ||
| # Create nvidia-oot modules archive | ||
| echo "Creating nvidia-oot modules archive" | ||
| tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/updates" | ||
| # Create kernel HID modules archive | ||
| echo "Creating kernel HID modules archive" | ||
| tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra" | ||
| # Create rootfs archive | ||
| echo "Creating rootfs archive" | ||
| tar -cjf "./images/${JETPACK_VER}/rootfs.tar.bz2" -C "./images/${JETPACK_VER}/rootfs/" . | ||
| - name: Upload artifacts to GitHub Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| files: | | ||
| ./images/6.0/nvidia-oot-modules.tar.gz | ||
| ./images/6.0/kernel-hid-modules.tar.gz | ||
| ./images/6.0/rootfs/lib/modules/5.15.136-tegra/updates/drivers/media/i2c/d4xx.ko | ||
| ./images/6.0/rootfs.tar.bz2 | ||
| ./images/6.0/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo | ||
| ./images/6.0/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb | ||
| ./images/6.0/rootfs/boot/Image | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
The hardcoded version values '6.0' and '5.15.136-tegra' create duplication with the '6.0' parameter passed to build scripts in line 25. Consider extracting these as workflow-level environment variables or job outputs to maintain consistency and avoid version mismatches.