Repository navigation
[MATTER-4641] Phase 2: Build and publish renode simulation #1094
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
Open
Michael Duggan (miduggan24)
wants to merge
19
commits into
matter-4641-inputs
from
matter-4641-pipeline
+1,547
−0
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0fe1bfa
build and publish renode simulation
miduggan24 02251c4
address review comments
miduggan24 4b7d064
fix bugbot findings
miduggan24 a41ff02
use compiler that otbr specifies
miduggan24 41e1729
drive harness through pyrenode3
miduggan24 d1e9da0
fix portable renode build
miduggan24 1711d1a
pass args to WaitFor properly
miduggan24 2f63abc
introduce proper concurrency handling when publish is enabled
miduggan24 c052281
use tar to preserve executable permissions in container
miduggan24 b64aa4d
push associated workflow change
miduggan24 9515e7a
publish contents rather than symlinks from the runner
miduggan24 eb7abc7
update renode executable command instruction in documentation
miduggan24 049cdc1
rm unnecessary overrides
miduggan24 836cc38
some cleanup
miduggan24 3dc9cfe
some documentation cleanup
miduggan24 ae47f5c
upload test_lib from latest renode q3 release for use in pipeline
miduggan24 0541873
fix install deps
miduggan24 1e5f31b
integrate test_lib in checkpoint harness
miduggan24 e6b17bc
update BUNDLE_VERSION to 26q4 rather than arbitrary v1, can track ren…
miduggan24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,325 @@ | ||
| name: Renode Sim Artifacts | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| publish: | ||
| description: "Publish artifacts to GHCR" | ||
| required: true | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: renode-sim-artifacts | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build-rcps: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
| submodules: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Initialize Simplicity SDK | ||
| run: git submodule update --init third_party/simplicity_sdk | ||
|
|
||
| - name: Install tools | ||
| uses: ./.github/actions/install-tools | ||
|
|
||
| - name: Build RCPs | ||
| run: python3 renode_integration/scripts/build_rcps.py | ||
|
|
||
| - name: Upload RCP artifacts | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: renode-rcps | ||
| path: renode_integration/out/rcp/*.out | ||
| if-no-files-found: error | ||
|
|
||
| build-rootfs-dtb: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install dependencies | ||
| run: sudo apt-get update -qq && sudo apt-get install -y -qq --no-install-recommends e2fsprogs device-tree-compiler curl | ||
|
|
||
| - name: Build rootfs and DTB | ||
| run: | | ||
| python3 renode_integration/scripts/build_rootfs_image.py | ||
| mkdir -p renode_integration/out/guest-rootfs | ||
| dtc -I dts -O dtb \ | ||
| -o renode_integration/out/guest-rootfs/zynqmp-matter-linux.dtb \ | ||
| renode_integration/guest/dts/zynqmp-matter-linux.dts | ||
|
|
||
| - name: Upload guest images | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: renode-guest-rootfs | ||
| path: | | ||
| renode_integration/out/guest-rootfs/matter-rootfs.ext2 | ||
| renode_integration/out/guest-rootfs/zynqmp-matter-linux.dtb | ||
| if-no-files-found: error | ||
|
|
||
| build-tools-image: | ||
| runs-on: ubuntu-24.04-arm | ||
| env: | ||
| CHIP_TOOL: ${{ github.workspace }}/third_party/matter_sdk/out/linux-arm64-chip-tool-ipv6only-clang/chip-tool | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
| submodules: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Initialize matter_sdk | ||
| run: git submodule update --init third_party/matter_sdk | ||
|
|
||
| - name: Checkout matter_sdk submodules | ||
| run: | | ||
| cd third_party/matter_sdk | ||
| ./scripts/checkout_submodules.py --platform linux | ||
|
|
||
| - name: Bootstrap Matter build env | ||
| uses: SiliconLabsSoftware/matter_build_action/bootstrap@v2 | ||
|
|
||
| - name: Install chip-tool build packages | ||
| 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: Build chip-tool | ||
| run: | | ||
| cd third_party/matter_sdk | ||
| ./scripts/run_in_build_env.sh \ | ||
| "./scripts/build/build_examples.py --target linux-arm64-chip-tool-ipv6only-clang build" | ||
|
|
||
| - name: Build tools image | ||
| run: python3 renode_integration/scripts/build_tools_image.py | ||
|
|
||
| - name: Upload tools image | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: renode-tools-image | ||
| path: renode_integration/out/guest-rootfs/matter-tools.ext2 | ||
| if-no-files-found: error | ||
|
|
||
| assemble-common: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - build-rcps | ||
| - build-rootfs-dtb | ||
| - build-tools-image | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Download RCP artifacts | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: renode-rcps | ||
| path: renode_integration/out/rcp | ||
|
|
||
| - name: Download guest rootfs artifacts | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: renode-guest-rootfs | ||
| path: renode_integration/out/guest-rootfs | ||
|
|
||
| - name: Download tools image | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: renode-tools-image | ||
| path: renode_integration/out/guest-rootfs | ||
|
|
||
| - name: Assemble common bundle | ||
| run: python3 renode_integration/scripts/assemble_bundle.py | ||
|
|
||
| - name: Upload common bundle | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: renode-common-bundle | ||
| path: renode_integration/out/bundle | ||
| if-no-files-found: error | ||
|
|
||
| publish-common: | ||
| needs: assemble-common | ||
| if: inputs.publish | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Download common bundle | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: renode-common-bundle | ||
| path: renode_integration/out/bundle | ||
|
|
||
| - name: Install ORAS | ||
| uses: oras-project/setup-oras@v2 | ||
|
|
||
| - name: Publish common to GHCR | ||
| run: | | ||
| echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u "${{ github.actor }}" --password-stdin | ||
| python3 renode_integration/scripts/publish_bundle.py common | ||
|
|
||
| build-runtime: | ||
| needs: | ||
| - assemble-common | ||
| - publish-common | ||
| if: >- | ||
| ${{ | ||
| !cancelled() && | ||
| needs.assemble-common.result == 'success' && | ||
| (needs.publish-common.result == 'success' || needs.publish-common.result == 'skipped') | ||
| }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - host: linux-x64 | ||
| runner: ubuntu-latest | ||
| - host: osx-arm64 | ||
| runner: macos-26 | ||
| runs-on: ${{ matrix.runner }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Setup .NET SDK | ||
| uses: actions/setup-dotnet@v6 | ||
| with: | ||
| dotnet-version: "8.0.x" | ||
|
|
||
| - name: Download common bundle | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: renode-common-bundle | ||
| path: renode_integration/out/bundle | ||
|
|
||
| - name: Build Renode | ||
| run: | | ||
| python3 renode_integration/scripts/build_renode.py | ||
| python3 renode_integration/scripts/assemble_bundle.py | ||
|
|
||
| - name: Install harness dependencies | ||
| run: | | ||
| python3 -m pip install -r renode_integration/harness/requirements.txt | ||
| python3 -m pip install --no-deps -e renode_integration/out/bundle/test_lib | ||
|
|
||
| - name: Generate checkpoint | ||
| env: | ||
| PYTHONPATH: ${{ github.workspace }}/renode_integration/harness | ||
| run: python3 renode_integration/harness/generate_checkpoint.py | ||
|
|
||
| # Test checkpoint load on macOS to verify that the bundle is working | ||
| # Not needed on Linux (will be tested in CI commissioning tests) | ||
| - name: Smoke test checkpoint load | ||
| if: matrix.host == 'osx-arm64' | ||
| env: | ||
| PYTHONPATH: ${{ github.workspace }}/renode_integration/harness | ||
| run: python3 renode_integration/harness/smoke_test_checkpoint.py | ||
|
|
||
| - name: Package runtime bundle | ||
| run: python3 renode_integration/scripts/publish_bundle.py prepare runtime | ||
|
|
||
| - name: Upload runtime bundle | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: renode-runtime-${{ matrix.host }} | ||
| path: renode_integration/out/publish/runtime/runtime.tar | ||
| if-no-files-found: error | ||
|
|
||
| publish-runtime: | ||
| needs: | ||
| - build-runtime | ||
| - publish-common | ||
| if: inputs.publish | ||
|
miduggan24 marked this conversation as resolved.
|
||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - host: linux-x64 | ||
| runner: ubuntu-latest | ||
| - host: osx-arm64 | ||
| runner: macos-26 | ||
| runs-on: ${{ matrix.runner }} | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Download runtime bundle | ||
| uses: actions/download-artifact@v7 | ||
| with: | ||
| name: renode-runtime-${{ matrix.host }} | ||
| path: renode_integration/out/publish/runtime | ||
|
|
||
| - name: Install ORAS | ||
| uses: oras-project/setup-oras@v2 | ||
|
|
||
| - name: Publish runtime to GHCR | ||
| run: | | ||
| echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u "${{ github.actor }}" --password-stdin | ||
| python3 renode_integration/scripts/publish_bundle.py push runtime | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.