mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-30 00:33:41 +08:00
Select ION buffers for device camera builds
This commit is contained in:
@@ -45,6 +45,7 @@ jobs:
|
||||
run: |
|
||||
python3 -m unittest tools.laptop_device_build.tests.test_runtime_dependencies -v
|
||||
python3 -c 'from pathlib import Path; assert b"starting pandad (comma hardware)" in Path("openpilot/selfdrive/pandad/pandad").read_bytes(), "Shipped pandad must use the comma hardware build profile"'
|
||||
python3 -c 'from pathlib import Path; paths = ("openpilot/system/camerad/camerad", "msgq_repo/msgq/visionipc/_visionipc.so", "openpilot/system/loggerd/encoderd", "openpilot/tools/replay/replay"); assert all(b"/dev/ion\0" in Path(p).read_bytes() for p in paths), "Shipped camera buffers must use ION"'
|
||||
- name: Test one-shot branch migration
|
||||
run: python3 -m unittest discover -s scripts/tests -v
|
||||
- name: Validate tracked dependencies
|
||||
@@ -93,7 +94,7 @@ jobs:
|
||||
env:
|
||||
GOTOOLCHAIN: local
|
||||
run: |
|
||||
sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y --no-install-recommends pkg-config zlib1g-dev
|
||||
sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config zlib1g-dev
|
||||
(cd mapd_repo && go mod download)
|
||||
PYTHONPATH="$GITHUB_WORKSPACE" python3 -m openpilot.starpilot.maps.package_shadow
|
||||
- name: Build devel
|
||||
@@ -218,7 +219,7 @@ jobs:
|
||||
env:
|
||||
RAYLIB_BACKEND: headless
|
||||
STARPILOT_TEST_DIAGNOSTICS: ci-results/host-test-diagnostics/unittest
|
||||
run: tools/op.sh test --jobs 2 --json-output unit-test-results.json
|
||||
run: tools/op.sh test --json-output unit-test-results.json
|
||||
- name: Test GM vehicle configurations and CAN behavior
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
timeout-minutes: 5
|
||||
@@ -303,7 +304,7 @@ jobs:
|
||||
.venv/bin/python -c "import av; assert 'libx264' in av.codecs_available"
|
||||
- name: Provide Mesa software graphics for pixel-level tests
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
run: sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y libegl1 libgles-dev libgl1-mesa-dri
|
||||
run: sudo apt-get update && sudo apt-get install -y libegl1 libgles-dev libgl1-mesa-dri
|
||||
- name: Test every assigned custom pytest node serially
|
||||
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
|
||||
timeout-minutes: 20
|
||||
@@ -410,7 +411,7 @@ jobs:
|
||||
go-version: '1.25.1'
|
||||
cache-dependency-path: mapd_repo/go.sum
|
||||
- name: Install native build dependencies
|
||||
run: sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update && sudo apt-get -o Acquire::Retries=2 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install -y --no-install-recommends pkg-config zlib1g-dev
|
||||
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config zlib1g-dev
|
||||
- name: Test and build pinned map provider
|
||||
run: python3 tools/ci/run_map_tests.py --output ci-results/map-provider
|
||||
- name: Save test and build evidence
|
||||
|
||||
@@ -39,7 +39,7 @@ msgq_python = envNanobind.Program(f'msgq/_ipc{python_suffix}', ['msgq/ipc_py.cc'
|
||||
|
||||
# Build Vision IPC
|
||||
vipc_files = ['visionipc.cc', 'visionipc_server.cc', 'visionipc_client.cc']
|
||||
if File('/dev/ion').exists():
|
||||
if arch == "comma_arm64" or File('/dev/ion').exists():
|
||||
vipc_files += ['visionbuf_ion.cc']
|
||||
else:
|
||||
vipc_files += ['visionbuf.cc']
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "fef1c4ace34f8bfeb0f4ee4ef7c0f4ef928c9a8da6a17e559bbf76ea1a7a6f65", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "6ae9f9c3947f9fbed4e12c940e1b24c1475cdaa85bb1932a5d0d481564da6bf6", "schema_version": 1}
|
||||
|
||||
@@ -5,6 +5,7 @@ import ast
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
from unittest.mock import Mock
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
@@ -46,3 +47,23 @@ class LiveSteeringServiceInventoryTest(unittest.TestCase):
|
||||
with self.subTest(binary=binary):
|
||||
self.assertIn(service.encode(), (ROOT / binary).read_bytes(),
|
||||
f'{binary}: rebuild after changing the native service registry')
|
||||
|
||||
|
||||
class VisionBufferAllocatorTest(unittest.TestCase):
|
||||
def test_device_build_uses_ion_without_a_build_host_device_node(self):
|
||||
source = ast.parse((ROOT / 'msgq_repo/SConscript').read_text())
|
||||
first = next(i for i, node in enumerate(source.body) if isinstance(node, ast.Assign)
|
||||
and any(isinstance(target, ast.Name) and target.id == 'vipc_files' for target in node.targets))
|
||||
allocator = compile(ast.Module(body=source.body[first:first + 2], type_ignores=[]), '<visionipc build>', 'exec')
|
||||
for arch, ion_present, expected in (('comma_arm64', False, 'visionbuf_ion.cc'),
|
||||
('comma_arm64', True, 'visionbuf_ion.cc'),
|
||||
('aarch64', False, 'visionbuf.cc'),
|
||||
('x86_64', False, 'visionbuf.cc'),
|
||||
('Darwin', False, 'visionbuf.cc'),
|
||||
('aarch64', True, 'visionbuf_ion.cc')):
|
||||
with self.subTest(arch=arch, ion_present=ion_present):
|
||||
node = Mock()
|
||||
node.exists.return_value = ion_present
|
||||
context = {'arch': arch, 'File': Mock(return_value=node)}
|
||||
exec(allocator, context)
|
||||
self.assertEqual(context['vipc_files'][-1], expected)
|
||||
|
||||
Reference in New Issue
Block a user