Repository navigation
[MATTER-4641] Phase 2: Build and publish renode simulation - #1094
Michael Duggan (miduggan24) wants to merge 19 commits into
Conversation
|
bugbot run |
PR SummaryMedium Risk Overview The workflow runs parallel jobs for Thread/BLE RCPs (Simplicity SDK), guest Local/CI consumers get Reviewed by Cursor Bugbot for commit 1e5f31b. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
- ✅ Fixed: Login wait ignores prompt text
- Modified wait_for_line to check buffer content without requiring newline termination, allowing it to detect prompts like 'buildroot login:' and '#'.
- ✅ Fixed: Smoke test can hang forever
- Replaced blocking readline() with select() to properly respect the 180s timeout while reading Renode output.
- ✅ Fixed: Chip-tool job missing build packages
- Added installation of libgirepository, libglib2.0-dev, and libevent-dev packages before chip-tool build step.
Or push these changes by commenting:
@cursor push a37318aa82
Preview (a37318aa82)
diff --git a/.github/workflows/renode-sim-artifacts.yaml b/.github/workflows/renode-sim-artifacts.yaml
--- a/.github/workflows/renode-sim-artifacts.yaml
+++ b/.github/workflows/renode-sim-artifacts.yaml
@@ -104,6 +104,14 @@
cd third_party/matter_sdk
./scripts/checkout_submodules.py --platform linux
+ - name: Install build dependencies
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -y -qq --no-install-recommends \
+ libgirepository-1.0-1 libgirepository1.0-dev \
+ libglib2.0-dev libglib2.0-dev-bin \
+ libevent-dev
+
- name: Bootstrap Matter build env
uses: SiliconLabsSoftware/matter_build_action/bootstrap@v2
diff --git a/renode_integration/harness/renode_harness.py b/renode_integration/harness/renode_harness.py
--- a/renode_integration/harness/renode_harness.py
+++ b/renode_integration/harness/renode_harness.py
@@ -128,6 +128,10 @@
line, self.buffer = self.buffer.split("\n", 1)
if regex.search(line):
return line
+ if regex.search(self.buffer):
+ match = self.buffer
+ self.buffer = ""
+ return match
self._read_more()
time.sleep(0.1)
raise TimeoutError(f"timed out waiting for /{pattern}/ in console output")
diff --git a/renode_integration/harness/smoke_test_checkpoint.py b/renode_integration/harness/smoke_test_checkpoint.py
--- a/renode_integration/harness/smoke_test_checkpoint.py
+++ b/renode_integration/harness/smoke_test_checkpoint.py
@@ -5,6 +5,7 @@
import argparse
import re
+import select
import subprocess
import sys
import time
@@ -50,14 +51,15 @@
if proc.poll() is not None:
output = "".join(output_lines)
raise RuntimeError(f"Renode exited with code {proc.returncode}\n{output}")
- line = proc.stdout.readline()
- if line:
- output_lines.append(line)
- if re.search(r"Starting emulation", line):
- print(f"Checkpoint loaded: {checkpoint}")
- return 0
- else:
- time.sleep(0.1)
+ timeout = max(0, deadline - time.time())
+ ready, _, _ = select.select([proc.stdout], [], [], min(timeout, 0.1))
+ if ready:
+ line = proc.stdout.readline()
+ if line:
+ output_lines.append(line)
+ if re.search(r"Starting emulation", line):
+ print(f"Checkpoint loaded: {checkpoint}")
+ return 0
raise TimeoutError("checkpoint load did not complete within 180s")
finally:
proc.terminate()You can send follow-ups to the cloud agent here.
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Monitor reads swallow command timeouts
- Modified _read_until_prompt to raise TimeoutError when socket timeout occurs without receiving a monitor prompt, preventing incomplete checkpoint saves from being treated as successful.
- ✅ Fixed: Runtime publish allows missing checkpoint
- Modified stage function to require linux-booted-thread.save file existence before allowing runtime bundle publication, preventing incomplete bundles from reaching GHCR.
Or push these changes by commenting:
@cursor push f680f71e38
Preview (f680f71e38)
diff --git a/renode_integration/harness/renode_harness.py b/renode_integration/harness/renode_harness.py
--- a/renode_integration/harness/renode_harness.py
+++ b/renode_integration/harness/renode_harness.py
@@ -84,6 +84,9 @@
try:
data = sock.recv(4096)
except socket.timeout:
+ combined = "".join(chunks)
+ if not _MONITOR_PROMPT.search(combined):
+ raise TimeoutError("monitor prompt not received before timeout")
break
if not data:
break
diff --git a/renode_integration/scripts/publish_bundle.py b/renode_integration/scripts/publish_bundle.py
--- a/renode_integration/scripts/publish_bundle.py
+++ b/renode_integration/scripts/publish_bundle.py
@@ -46,10 +46,13 @@
return
if kind == "runtime":
copy_tree(os.path.join(bundle, "renode"), os.path.join(staging, "renode"))
- for name in ("linux-booted-thread.save", "runtime-manifest.json"):
- src = os.path.join(bundle, name)
- if os.path.isfile(src):
- shutil.copy2(src, os.path.join(staging, name))
+ checkpoint_src = os.path.join(bundle, "linux-booted-thread.save")
+ if not os.path.isfile(checkpoint_src):
+ common.die("linux-booted-thread.save is required for runtime bundle")
+ shutil.copy2(checkpoint_src, os.path.join(staging, "linux-booted-thread.save"))
+ manifest_src = os.path.join(bundle, "runtime-manifest.json")
+ if os.path.isfile(manifest_src):
+ shutil.copy2(manifest_src, os.path.join(staging, "runtime-manifest.json"))
return
common.die(f"unknown kind: {kind}")You can send follow-ups to the cloud agent here.
|
bugbot run |
97b7f1d to
c3cfc88
Compare
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Portable Renode missing CoreCLR runtime
- Added PYRENODE_RUNTIME=coreclr environment variable in MatterSim.init to ensure pyrenode3 uses the correct runtime for portable Renode builds.
Or push these changes by commenting:
@cursor push 816251dfe4
Preview (816251dfe4)
diff --git a/renode_integration/harness/matter_sim.py b/renode_integration/harness/matter_sim.py
--- a/renode_integration/harness/matter_sim.py
+++ b/renode_integration/harness/matter_sim.py
@@ -41,8 +41,9 @@
def __init__(self, bundle_dir: Path) -> None:
self.bundle_dir = bundle_dir.resolve()
- # pyrenode3 reads PYRENODE_PATH at import time.
+ # pyrenode3 reads PYRENODE_PATH and PYRENODE_RUNTIME at import time.
os.environ["PYRENODE_PATH"] = str(resolve_renode(self.bundle_dir))
+ os.environ["PYRENODE_RUNTIME"] = "coreclr"
from pyrenode3.wrappers import Emulation, Monitor, TerminalTester
self._terminal_tester = TerminalTesterYou can send follow-ups to the cloud agent here.
d1864c8 to
a05b3e5
Compare
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Publish runtime ignores needed results
- Added dependency result checks to publish-runtime job to ensure build-runtime succeeded and publish-common succeeded before running, preventing execution when dependencies fail or are skipped.
Or push these changes by commenting:
@cursor push 2ddc95c60e
Preview (2ddc95c60e)
diff --git a/.github/workflows/renode-sim-artifacts.yaml b/.github/workflows/renode-sim-artifacts.yaml
--- a/.github/workflows/renode-sim-artifacts.yaml
+++ b/.github/workflows/renode-sim-artifacts.yaml
@@ -297,7 +297,13 @@
needs:
- build-runtime
- publish-common
- if: inputs.publish
+ if: >-
+ ${{
+ inputs.publish &&
+ !cancelled() &&
+ needs.build-runtime.result == 'success' &&
+ needs.publish-common.result == 'success'
+ }}
strategy:
fail-fast: false
matrix:You can send follow-ups to the cloud agent here.
3127fd9 to
c6ffdbe
Compare
|
bugbot run |
104bb4e to
92cc6ce
Compare
31fb3ed to
9d10061
Compare
aba9e43 to
9d10061
Compare
9d10061 to
1159db4
Compare
1159db4 to
3dc9cfe
Compare
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1e5f31b. Configure here.
…ode push to public fork (quarterly)

Issue Link:
MATTER-4641
Description of Problem/Feature:
Phase 2 of Matter Renode CI artifact work. Phase 1 checks in the guest and simulation inputs.
This PR builds inputs and publishes bundles that CI and local development workflows fetch. Matter app binaries are left out and will come from CI or a local build.
Description of Fix/Solution:
Introduce manual workflow
renode-sim-artifacts(along with accompanying python scripts):sim-manifest.jsonto disable flow control (since we don't emulate WPK in renode)matter-rootfs.ext2from pinned antmicro rootfs plus overlay files from phase 1 implementationzynqmp-matter-linux.dtbfrom device tree in phase 1matter-tools.ext2on arm linux runner (simulated Matter Hub runs on Linux Arm platform)Also add some documentation to outline implementation and directions on how to use
Testing Done:
Tested the following in fork repo:
python3 scripts/fetch_bundle.py)matter-sim-full.resc(full linux boot process, thread initialization, etc)matter-sim.resc(start from snapshot after boot and thread init)Linux testing will be done in later PR to introduce commissioning tests to CI