Skip to content

Fix 5 HIL CI issues found during real-world bench setup#3

Merged
daharoni merged 10 commits intomainfrom
fix/hil-ci-issues
Mar 13, 2026
Merged

Fix 5 HIL CI issues found during real-world bench setup#3
daharoni merged 10 commits intomainfrom
fix/hil-ci-issues

Conversation

@daharoni
Copy link
Copy Markdown
Member

@daharoni daharoni commented Mar 13, 2026

Summary

Fixes 5 issues discovered while setting up HIL CI on the Pi for miniscope-firmware, plus adds an update mechanism.

  • Runner labels: install_runner.sh used tr '-' ',' which split hil-bench-01 into hil,bench,01 — now reads labels from config and always includes bench_name
  • benchctl not found in CI: Runner .env didn't have venv on PATH — now written by shared write_runner_env.sh
  • Work dir permission error: /opt/hil-bench/_work was never created — now mkdir -p in install_runner.sh
  • benchctl health fails on missing serial: Added --check / -c repeatable option to run a subset of checks (e.g. --check config --check probe)
  • benchctl flash can't find artifact: Relative paths resolved against workspace only — now tries CWD first (where GHA downloads artifacts)
  • Update mechanism: Added bootstrap/update.sh for lightweight git pull + update flow
  • Example workflow: Simplified runs-on labels, added health check step, better concurrency group
  • Code cleanup: Deduplicated .env generation, tightened type annotations in health checks, derived CHECK_CATEGORIES from registry

Test plan

  • pytest -v passes in Linux CI (gpiod is Linux-only)
  • On the Pi: git pull && sudo ./bootstrap/update.sh
  • benchctl health --check config --check probe passes (serial skipped)
  • benchctl flash --firmware /tmp/test.elf --target grand_central_m4 --verify works if .elf available

🤖 Generated with Claude Code

daharoni and others added 10 commits March 12, 2026 22:22
Read the GitHub org from config instead of hardcoding in
install_runner.sh. Defaults to "Aharoni-Lab" for backwards compat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… writes .env

- Read runner.org and runner.labels from config via venv Python instead
  of hardcoding ORG and using tr to split bench name into labels
- Always append bench_name to labels if not already present
- mkdir -p /opt/hil-bench/_work to avoid permission errors
- Write .env with venv on PATH so benchctl is available in runner jobs
- Pass config path from bootstrap_pi.sh

Fixes: runner label mangling, benchctl not found, workdir missing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add repeatable --check option to run a subset of health checks.
Valid categories: config, probe, serial, gpio_chip, runner_service.
When omitted, all checks run (existing behavior).

This allows CI workflows to skip checks that require hardware not
available in all contexts (e.g. serial device).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GitHub Actions downloads artifacts into the job's working directory,
not the runner workspace. Try CWD first, then fall back to workspace.
Glob resolution follows the same order.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Idempotent script to run after git pull:
1. pip install -e to update benchctl
2. Ensure work directory exists
3. Refresh runner .env (if installed)
4. Refresh systemd health timer

Does NOT touch config or runner registration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Simplify runs-on to use bench_name label (added automatically by runner)
- Add benchctl health --check config --check probe step before flashing
- Update concurrency group to be repo+ref scoped
- Add comment explaining bench_name as concurrency key

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Merge two Python subprocess calls in install_runner.sh into one
- Extract duplicated .env heredoc into shared write_runner_env.sh
- Cache Path.cwd() in resolve_firmware_path instead of calling 3x
- Derive CHECK_CATEGORIES from _CHECK_RUNNERS keys to prevent divergence
- Replace dict[str, Any] with proper Callable type for _CHECK_RUNNERS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Take main's bootstrap_pi.sh and install_runner.sh (org is a required
CLI argument, non-root runner support via SUDO_USER).  Remove the
now-unused RunnerConfig.org field, config template entry, and test
fixture reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@daharoni daharoni merged commit 66e783c into main Mar 13, 2026
2 checks passed
@daharoni daharoni deleted the fix/hil-ci-issues branch March 13, 2026 05:52
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.

1 participant