Skip to content

Commit 301499b

Browse files
authored
Update workflow to include artifacts uploads. (#315)
* Update workflow to include artifacts uploads. * Add a release workflow * Add copilot instructions * add documenting instructions * Upload fixed yaml file for JP6.1 & JP6.2
1 parent 6575973 commit 301499b

6 files changed

Lines changed: 412 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Copilot Instructions for realsense_mipi_platform_driver
2+
3+
## Project Overview
4+
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.
5+
6+
## Architecture & Key Components
7+
- **hardware/**: Device tree overlays and platform-specific configuration files for NVIDIA and RealSense hardware.
8+
- **kernel/**: Kernel patches and sources for different JetPack and kernel versions.
9+
- **nvidia-oot/**: Out-of-tree NVIDIA kernel modules and related patches.
10+
- **scripts/**: Build, patch, and utility scripts for workspace setup, compilation, and firmware management.
11+
- **test/**: Test scripts and metadata validation tools.
12+
- **utilities/**: Example applications, parsers, and stream utilities for RealSense cameras.
13+
14+
## Developer Workflows
15+
### 1. Workspace Setup & Build
16+
- Use `setup_workspace.sh [JetPack_version]` to prepare sources and toolchains.
17+
- Apply kernel and driver patches with `apply_patches.sh [--one-cam|--dual-cam] apply [JetPack_version]`.
18+
- For CI/external builds, use `apply_patches_ext.sh`.
19+
- Build all components with `build_all.sh [--dev-dbg] [JetPack_version]`.
20+
- Example:
21+
```sh
22+
./setup_workspace.sh 6.2
23+
./apply_patches.sh 6.2
24+
./build_all.sh 6.2
25+
```
26+
- For debug logging, add `--dev-dbg` to build scripts.
27+
28+
### 2. Testing & Validation
29+
- Use `test/` scripts for firmware and metadata validation.
30+
- After installation, verify driver and video devices:
31+
```sh
32+
sudo dmesg | grep d4xx
33+
ls -l /dev/video*
34+
```
35+
- Use V4L2 utilities for device checks: `sudo apt install v4l-utils`
36+
37+
### 3. Device Tree & Kernel Integration
38+
- Device tree overlays are in `hardware/realsense/` and `hardware/nvidia/platform/`.
39+
- Kernel patches are versioned under `kernel/` and must match JetPack version.
40+
- Out-of-tree modules are managed in `nvidia-oot/`.
41+
42+
## Project-Specific Conventions
43+
- JetPack version is a required argument for most scripts and build steps.
44+
- Patch scripts support single/dual camera configuration for JetPack 5.x (`--one-cam`, `--dual-cam`).
45+
- Kernel versioning and file paths must be updated per JetPack release.
46+
- Artifacts (modules, images, dtb, etc.) are archived under `images/[JetPack_version]/`.
47+
48+
## Integration Points & External Dependencies
49+
- Relies on NVIDIA Jetson Linux BSP sources and toolchains (see README_JP6.md, README_JP5.md, README_JP4.md).
50+
- Uses RealSense de-serialize hardware and Leopard Imaging adapter boards.
51+
- Artifactory integration for CI/CD and artifact uploads (see Jenkins pipeline scripts).
52+
53+
## Example: CI Pipeline Highlights
54+
55+
## CI Pipeline: GitHub Actions & Jenkins
56+
57+
### GitHub Actions Workflows
58+
- Located in `.github/workflows/`, these YAML files automate build and release for each JetPack version:
59+
- `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.
60+
- `release-jp6.yml`: Publishes release artifacts for JetPack 6.x.
61+
- Each workflow:
62+
- Checks out code
63+
- Runs setup (`setup_workspace.sh [version]`), applies patches, builds (`build_all.sh [version]`)
64+
- Archives build outputs (modules, dtb, rootfs, etc.)
65+
- Uploads artifacts (via `actions/upload-artifact` or `softprops/action-gh-release`)
66+
- Example build steps:
67+
```yaml
68+
- name: setup workspace
69+
run: yes | ./setup_workspace.sh 6.2
70+
- name: apply patches
71+
run: ./apply_patches.sh 6.2
72+
- name: build
73+
run: ./build_all.sh 6.2
74+
```
75+
- Artifacts are found in `images/[JetPack_version]/` and uploaded for CI/release consumption.
76+
77+
### Jenkins Pipeline
78+
- `LRS_Jetson_mipi_usb_driver_jp6.groovy` (legacy/optional): Automates checkout, patching, build, artifact archiving, and upload to Artifactory.
79+
- Environment variables and parameters control build options, JetPack version, and artifact destinations.
80+
- Artifacts are uploaded to Artifactory and notification emails are sent on build completion/failure.
81+
82+
## References
83+
- See `README.md` for overall project intro and hardware requirements.
84+
- See `README_JP6.md`, `README_JP5.md`, `README_JP4.md` for JetPack-specific build instructions.
85+
- See `README_tools.md` for build script usage and options.
86+
- See `README_driver.md` for driver API and validation steps.
87+
88+
---
89+
**Feedback Requested:**
90+
If any section is unclear or missing key details, please specify which workflows, conventions, or integration points need further documentation for AI agents.

.github/workflows/build-jp6.1.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,64 @@ jobs:
2323
run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh 6.1
2424
- name: build
2525
run: ./build_all.sh 6.1
26+
27+
- name: Create artifact archives
28+
run: |
29+
JETPACK_VER="6.1"
30+
KERNEL_VERSION="5.15.148-tegra"
31+
32+
# Create nvidia-oot modules archive
33+
echo "Creating nvidia-oot modules archive"
34+
tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/updates"
35+
36+
# Create kernel HID modules archive
37+
echo "Creating kernel HID modules archive"
38+
tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra"
39+
40+
# Create rootfs archive
41+
echo "Creating rootfs archive"
42+
tar -cjf "./images/${JETPACK_VER}/rootfs.tar.bz2" -C "./images/${JETPACK_VER}/rootfs/" .
43+
44+
- name: Upload nvidia-oot modules
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: nvidia-oot-modules
48+
path: ./images/6.1/nvidia-oot-modules.tar.gz
49+
retention-days: 30
50+
51+
- name: Upload kernel HID modules
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: kernel-hid-modules
55+
path: ./images/6.1/kernel-hid-modules.tar.gz
56+
retention-days: 30
57+
58+
- name: Upload d4xx.ko
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: d4xx-ko
62+
path: ./images/6.1/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/i2c/d4xx.ko
63+
retention-days: 30
64+
65+
- name: Upload rootfs
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: rootfs
69+
path: ./images/6.1/rootfs.tar.bz2
70+
retention-days: 30
71+
72+
- name: Upload dtbo files
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: dtbo-files
76+
path: |
77+
./images/6.1/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo
78+
./images/6.1/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb
79+
retention-days: 30
80+
81+
- name: Upload kernel Image
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: kernel-image
85+
path: ./images/6.1/rootfs/boot/Image
86+
retention-days: 30

.github/workflows/build-jp6.2.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,64 @@ jobs:
2323
run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh 6.2
2424
- name: build
2525
run: ./build_all.sh 6.2
26+
27+
- name: Create artifact archives
28+
run: |
29+
JETPACK_VER="6.2"
30+
KERNEL_VERSION="5.15.148-tegra"
31+
32+
# Create nvidia-oot modules archive
33+
echo "Creating nvidia-oot modules archive"
34+
tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/updates"
35+
36+
# Create kernel HID modules archive
37+
echo "Creating kernel HID modules archive"
38+
tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra"
39+
40+
# Create rootfs archive
41+
echo "Creating rootfs archive"
42+
tar -cjf "./images/${JETPACK_VER}/rootfs.tar.bz2" -C "./images/${JETPACK_VER}/rootfs/" .
43+
44+
- name: Upload nvidia-oot modules
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: nvidia-oot-modules
48+
path: ./images/6.2/nvidia-oot-modules.tar.gz
49+
retention-days: 30
50+
51+
- name: Upload kernel HID modules
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: kernel-hid-modules
55+
path: ./images/6.2/kernel-hid-modules.tar.gz
56+
retention-days: 30
57+
58+
- name: Upload d4xx.ko
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: d4xx-ko
62+
path: ./images/6.2/rootfs/lib/modules/5.15.148-tegra/updates/drivers/media/i2c/d4xx.ko
63+
retention-days: 30
64+
65+
- name: Upload rootfs
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: rootfs
69+
path: ./images/6.2/rootfs.tar.bz2
70+
retention-days: 30
71+
72+
- name: Upload dtbo files
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: dtbo-files
76+
path: |
77+
./images/6.2/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo
78+
./images/6.2/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb
79+
retention-days: 30
80+
81+
- name: Upload kernel Image
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: kernel-image
85+
path: ./images/6.2/rootfs/boot/Image
86+
retention-days: 30

.github/workflows/build-jp6.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,64 @@ jobs:
2323
run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh 6.0
2424
- name: build
2525
run: ./build_all.sh 6.0
26+
27+
- name: Create artifact archives
28+
run: |
29+
JETPACK_VER="6.0"
30+
KERNEL_VERSION="5.15.136-tegra"
31+
32+
# Create nvidia-oot modules archive
33+
echo "Creating nvidia-oot modules archive"
34+
tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/updates"
35+
36+
# Create kernel HID modules archive
37+
echo "Creating kernel HID modules archive"
38+
tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra"
39+
40+
# Create rootfs archive
41+
echo "Creating rootfs archive"
42+
tar -cjf "./images/${JETPACK_VER}/rootfs.tar.bz2" -C "./images/${JETPACK_VER}/rootfs/" .
43+
44+
- name: Upload nvidia-oot modules
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: nvidia-oot-modules
48+
path: ./images/6.0/nvidia-oot-modules.tar.gz
49+
retention-days: 30
50+
51+
- name: Upload kernel HID modules
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: kernel-hid-modules
55+
path: ./images/6.0/kernel-hid-modules.tar.gz
56+
retention-days: 30
57+
58+
- name: Upload d4xx.ko
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: d4xx-ko
62+
path: ./images/6.0/rootfs/lib/modules/5.15.136-tegra/updates/drivers/media/i2c/d4xx.ko
63+
retention-days: 30
64+
65+
- name: Upload rootfs
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: rootfs
69+
path: ./images/6.0/rootfs.tar.bz2
70+
retention-days: 30
71+
72+
- name: Upload dtbo files
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: dtbo-files
76+
path: |
77+
./images/6.0/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo
78+
./images/6.0/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb
79+
retention-days: 30
80+
81+
- name: Upload kernel Image
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: kernel-image
85+
path: ./images/6.0/rootfs/boot/Image
86+
retention-days: 30

.github/workflows/release-jp6.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release JP 6.0
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3
16+
- name: setup workspace
17+
run: yes | ./setup_workspace.sh 6.0
18+
- name: apply patches
19+
run: git config --global user.email "builder@example.com" && git config --global user.name "builder" && ./apply_patches.sh 6.0
20+
- name: build
21+
run: ./build_all.sh 6.0
22+
- name: Create artifact archives
23+
run: |
24+
JETPACK_VER="6.0"
25+
KERNEL_VERSION="5.15.136-tegra"
26+
# Create nvidia-oot modules archive
27+
echo "Creating nvidia-oot modules archive"
28+
tar -czf "./images/${JETPACK_VER}/nvidia-oot-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/updates"
29+
# Create kernel HID modules archive
30+
echo "Creating kernel HID modules archive"
31+
tar -czf "./images/${JETPACK_VER}/kernel-hid-modules.tar.gz" -C "./images/${JETPACK_VER}/rootfs/" "./lib/modules/${KERNEL_VERSION}/extra"
32+
# Create rootfs archive
33+
echo "Creating rootfs archive"
34+
tar -cjf "./images/${JETPACK_VER}/rootfs.tar.bz2" -C "./images/${JETPACK_VER}/rootfs/" .
35+
- name: Upload artifacts to GitHub Release
36+
uses: softprops/action-gh-release@v1
37+
with:
38+
files: |
39+
./images/6.0/nvidia-oot-modules.tar.gz
40+
./images/6.0/kernel-hid-modules.tar.gz
41+
./images/6.0/rootfs/lib/modules/5.15.136-tegra/updates/drivers/media/i2c/d4xx.ko
42+
./images/6.0/rootfs.tar.bz2
43+
./images/6.0/rootfs/boot/tegra234-camera-d4xx-overlay.dtbo
44+
./images/6.0/rootfs/boot/dtb/tegra234-p3737-0000+p3701-0000-nv.dtb
45+
./images/6.0/rootfs/boot/Image
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)