From 63546c8da60fd5742d80819d86a18a2cced20a63 Mon Sep 17 00:00:00 2001 From: BujSet Date: Tue, 22 Jul 2025 23:34:07 +0000 Subject: [PATCH 01/19] Adding new test for zephyr integrations --- .github/workflows/trunk.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 90120885efb..7bccd470f67 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -55,6 +55,30 @@ jobs: # Build and test executorch PYTHON_EXECUTABLE=python ${CONDA_RUN} bash .ci/scripts/test_model.sh "${MODEL_NAME}" "${BUILD_TOOL}" "${BACKEND}" + test-models-arm-zephyr: + name: test-models-arm-zephyr + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + strategy: + matrix: + model: [add] + fail-fast: false + with: + runner: linux.2xlarge + submodules: 'recursive' + ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} + timeout: 120 + script: | + MODEL_NAME=${{ matrix.model }} + CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]") + conda activate "${CONDA_ENV}" + + source .ci/scripts/utils.sh + install_executorch "--use-pt-pinned-commit" + .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr + source examples/arm/ethos-u-scratch/setup_path.sh + pwd + ls + test-models-linux-aarch64: name: test-models-linux-aarch64 uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main From 7dc4f86e090f5ee6ab2e4455761e40b175da7491 Mon Sep 17 00:00:00 2001 From: BujSet Date: Wed, 23 Jul 2025 20:36:21 +0000 Subject: [PATCH 02/19] Added in commands to run simple add model zephyr test --- .github/workflows/trunk.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 7bccd470f67..a50ff9f14f8 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -76,6 +76,28 @@ jobs: install_executorch "--use-pt-pinned-commit" .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh + + cd ../ + rm -rf executorch/ + git clone https://github.com/BujSet/zephyr.git + cd zephyr/ + git switch -c executorch-module-integration origin/executorch-module-integration + python3 -m pip install --upgrade pip + python3 -m pip install --upgrade cmake==3.31.6 + python3 -m pip install west torch numpy + python3 -m pip install -r scripts/requirements.txt + cd ../ + west init -l zephyr + west config manifest.project-filter -- +executorch + west -v update + source zephyr/zephyr-env.sh + cd modules/lib/executorch + ./install_executorch.sh + ./examples/arm/setup.sh --i-agree-to-the-contained-eula --target-toolchain zephyr + source examples/arm/ethos-u-scratch/setup_path.sh + cd ../../../zephyr/samples/modules/executorch/arm/hello_world + west build -p always -b mps3/corstone300/fvp + FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60 pwd ls From 544eef70c2e66cf9f5be3a26fbc7332fb83ac477 Mon Sep 17 00:00:00 2001 From: BujSet Date: Thu, 24 Jul 2025 17:05:45 +0000 Subject: [PATCH 03/19] Updating job to use zephyr sdk docker image --- .github/workflows/trunk.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index a50ff9f14f8..7dc51780039 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -64,6 +64,7 @@ jobs: fail-fast: false with: runner: linux.2xlarge + docker-image: ci-image:executorch-ubuntu-22.04-zephyr-sdk submodules: 'recursive' ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} timeout: 120 From 643bf6cdccf2906a9f7fdaee6f4a2ce8af3c2a4a Mon Sep 17 00:00:00 2001 From: BujSet Date: Thu, 24 Jul 2025 19:04:20 +0000 Subject: [PATCH 04/19] Changing order of pip installs to resolve dependency errors --- .github/workflows/trunk.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 7dc51780039..b33016873ae 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -74,33 +74,29 @@ jobs: conda activate "${CONDA_ENV}" source .ci/scripts/utils.sh - install_executorch "--use-pt-pinned-commit" - .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr - source examples/arm/ethos-u-scratch/setup_path.sh cd ../ - rm -rf executorch/ git clone https://github.com/BujSet/zephyr.git cd zephyr/ git switch -c executorch-module-integration origin/executorch-module-integration - python3 -m pip install --upgrade pip - python3 -m pip install --upgrade cmake==3.31.6 - python3 -m pip install west torch numpy - python3 -m pip install -r scripts/requirements.txt cd ../ west init -l zephyr west config manifest.project-filter -- +executorch west -v update - source zephyr/zephyr-env.sh cd modules/lib/executorch + python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip ./install_executorch.sh ./examples/arm/setup.sh --i-agree-to-the-contained-eula --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh - cd ../../../zephyr/samples/modules/executorch/arm/hello_world + python3 -m pip install west + cd ../ + source zephyr/zephyr-env.sh + cd /zephyr/samples/modules/executorch/arm/hello_world west build -p always -b mps3/corstone300/fvp FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60 pwd ls + cat sim.out test-models-linux-aarch64: name: test-models-linux-aarch64 From 40fc5b87c7a9dcf8c215561400332a8cd5a568d2 Mon Sep 17 00:00:00 2001 From: BujSet Date: Thu, 24 Jul 2025 19:46:05 +0000 Subject: [PATCH 05/19] Moving some of the setup logic straight into the docker build --- .ci/docker/common/install_zephyr.sh | 11 +++++++++++ .github/workflows/trunk.yml | 10 ++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.ci/docker/common/install_zephyr.sh b/.ci/docker/common/install_zephyr.sh index 99d5cc40016..a452e98df85 100644 --- a/.ci/docker/common/install_zephyr.sh +++ b/.ci/docker/common/install_zephyr.sh @@ -88,5 +88,16 @@ install_sdk() { ./setup.sh -c -t arm-zephyr-eabi } +init_zephyr() { + git clone https://github.com/BujSet/zephyr.git + cd zephyr/ + git switch -c executorch-module-integration origin/executorch-module-integration + cd ../ + west init -l zephyr + west config manifest.project-filter -- +executorch + west -v update +} + install_prerequiresites install_sdk +init_zephyr diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index b33016873ae..2412e8d8f12 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -75,14 +75,8 @@ jobs: source .ci/scripts/utils.sh - cd ../ - git clone https://github.com/BujSet/zephyr.git - cd zephyr/ - git switch -c executorch-module-integration origin/executorch-module-integration - cd ../ - west init -l zephyr - west config manifest.project-filter -- +executorch - west -v update + pwd + ls cd modules/lib/executorch python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip ./install_executorch.sh From a476c2e9421d25fca8d37c358840bda2ff156b3a Mon Sep 17 00:00:00 2001 From: BujSet Date: Thu, 24 Jul 2025 22:24:35 +0000 Subject: [PATCH 06/19] Need to figure out how to install west for ci user, testing --- .ci/docker/common/install_zephyr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/docker/common/install_zephyr.sh b/.ci/docker/common/install_zephyr.sh index a452e98df85..cb83e7bc9cf 100644 --- a/.ci/docker/common/install_zephyr.sh +++ b/.ci/docker/common/install_zephyr.sh @@ -77,7 +77,7 @@ install_prerequiresites() { chmod +x kitware-archive.sh && \ ./kitware-archive.sh && \ rm -f kitware-archive.sh - useradd -d /home/zephyruser -m -s /bin/bash zephyruser + pip_install --no-cache-dir west } install_sdk() { From 7f9608edbb13e501e3e430849926ab4558747f12 Mon Sep 17 00:00:00 2001 From: BujSet Date: Fri, 25 Jul 2025 17:28:42 +0000 Subject: [PATCH 07/19] pip_install not found, trying to source utils to use pip to install west --- .ci/docker/common/install_zephyr.sh | 3 +++ .ci/docker/ubuntu/Dockerfile | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.ci/docker/common/install_zephyr.sh b/.ci/docker/common/install_zephyr.sh index cb83e7bc9cf..20e91936385 100644 --- a/.ci/docker/common/install_zephyr.sh +++ b/.ci/docker/common/install_zephyr.sh @@ -8,6 +8,9 @@ set -ex +# shellcheck source=/dev/null +source "$(dirname "${BASH_SOURCE[0]}")/utils.sh" + # Double check if the NDK version is set [ -n "${ZEPHYR_SDK}" ] diff --git a/.ci/docker/ubuntu/Dockerfile b/.ci/docker/ubuntu/Dockerfile index 324d41d4f23..fddd7e6df36 100644 --- a/.ci/docker/ubuntu/Dockerfile +++ b/.ci/docker/ubuntu/Dockerfile @@ -86,8 +86,9 @@ ARG ARM_SDK ARG ZEPHYR_SDK COPY ./common/install_zephyr.sh install_zephyr.sh +COPY ./common/utils.sh utils.sh RUN if [ -n "${ZEPHYR_SDK}" ]; then bash ./install_zephyr.sh; fi -RUN rm install_zephyr.sh +RUN rm install_zephyr.sh utils.sh ARG QNN_SDK From eb158a656b641bdf2d99809583da7e729bcc3c2a Mon Sep 17 00:00:00 2001 From: BujSet Date: Fri, 25 Jul 2025 20:36:16 +0000 Subject: [PATCH 08/19] Seems like I can git clone in the docker build process, moving it directly to the trunk test --- .ci/docker/common/install_zephyr.sh | 11 ----------- .github/workflows/trunk.yml | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.ci/docker/common/install_zephyr.sh b/.ci/docker/common/install_zephyr.sh index 20e91936385..3992074ae2c 100644 --- a/.ci/docker/common/install_zephyr.sh +++ b/.ci/docker/common/install_zephyr.sh @@ -91,16 +91,5 @@ install_sdk() { ./setup.sh -c -t arm-zephyr-eabi } -init_zephyr() { - git clone https://github.com/BujSet/zephyr.git - cd zephyr/ - git switch -c executorch-module-integration origin/executorch-module-integration - cd ../ - west init -l zephyr - west config manifest.project-filter -- +executorch - west -v update -} - install_prerequiresites install_sdk -init_zephyr diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 2412e8d8f12..f926057cd2e 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -74,11 +74,23 @@ jobs: conda activate "${CONDA_ENV}" source .ci/scripts/utils.sh - pwd ls + cd ../ + pwd + ls + git clone https://github.com/BujSet/zephyr.git + cd zephyr/ + git switch -c executorch-module-integration origin/executorch-module-integration + cd ../ + west init -l zephyr + west config manifest.project-filter -- +executorch + west -v update + pwd + ls + cd modules/lib/executorch - python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip + #python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip ./install_executorch.sh ./examples/arm/setup.sh --i-agree-to-the-contained-eula --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh From 250fbe32bf5919f95e9a98a827f99e02006e0ddc Mon Sep 17 00:00:00 2001 From: BujSet Date: Fri, 25 Jul 2025 21:29:30 +0000 Subject: [PATCH 09/19] Seems like CI runner doesn't have write permissions to top level directory, moving all zpehyr stuff into the et repo (not ideal) --- .github/workflows/trunk.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index f926057cd2e..1a5f661d4e6 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -76,9 +76,6 @@ jobs: source .ci/scripts/utils.sh pwd ls - cd ../ - pwd - ls git clone https://github.com/BujSet/zephyr.git cd zephyr/ git switch -c executorch-module-integration origin/executorch-module-integration From 9649620abb90e595b4a8b8407710a4c3baa4460c Mon Sep 17 00:00:00 2001 From: BujSet Date: Fri, 25 Jul 2025 21:49:16 +0000 Subject: [PATCH 10/19] Forgot that zephyr folder already exists in et repo, making a zephyr_scratch dir for zephyr CI tests (again, not ideal) --- .github/workflows/trunk.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 1a5f661d4e6..82d9eeb9bfb 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -74,8 +74,10 @@ jobs: conda activate "${CONDA_ENV}" source .ci/scripts/utils.sh + mkdir -p zephyr_scratch/ pwd ls + cd zephyr_scratch git clone https://github.com/BujSet/zephyr.git cd zephyr/ git switch -c executorch-module-integration origin/executorch-module-integration From 0d4344e078ce101922bb5a32f54dc953ea916faf Mon Sep 17 00:00:00 2001 From: BujSet Date: Fri, 25 Jul 2025 22:30:07 +0000 Subject: [PATCH 11/19] Almost made it to build, reusing exisitng scripts as much as possible --- .github/workflows/trunk.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 82d9eeb9bfb..b423c5ae3f2 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -90,10 +90,9 @@ jobs: cd modules/lib/executorch #python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip - ./install_executorch.sh - ./examples/arm/setup.sh --i-agree-to-the-contained-eula --target-toolchain zephyr + install_executorch "--use-pt-pinned-commit" + .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh - python3 -m pip install west cd ../ source zephyr/zephyr-env.sh cd /zephyr/samples/modules/executorch/arm/hello_world From 21cf931ea7e71d232643f0798bbadd91e2e0a686 Mon Sep 17 00:00:00 2001 From: BujSet Date: Fri, 25 Jul 2025 23:20:29 +0000 Subject: [PATCH 12/19] Relative pathing is killing me, setting some path variables to help --- .github/workflows/trunk.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index b423c5ae3f2..c646f66d281 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -78,24 +78,30 @@ jobs: pwd ls cd zephyr_scratch + export ZEPHYR_PROJ_ROOT=$(realpath $(pwd)) + git clone https://github.com/BujSet/zephyr.git cd zephyr/ git switch -c executorch-module-integration origin/executorch-module-integration - cd ../ + cd $ZEPHYR_PROJ_ROOT west init -l zephyr west config manifest.project-filter -- +executorch west -v update pwd ls - cd modules/lib/executorch + cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch #python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip install_executorch "--use-pt-pinned-commit" .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh - cd ../ + pwd + ls + cd $ZEPHYR_PROJ_ROOT + pwd + ls source zephyr/zephyr-env.sh - cd /zephyr/samples/modules/executorch/arm/hello_world + cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world west build -p always -b mps3/corstone300/fvp FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60 pwd From 464987cebe39e549d54711649445219287cd75f7 Mon Sep 17 00:00:00 2001 From: BujSet Date: Mon, 28 Jul 2025 16:55:20 +0000 Subject: [PATCH 13/19] SDK setup is not visible when set up in docker image, moving setup to run script --- .ci/docker/common/install_zephyr.sh | 9 --------- .github/workflows/trunk.yml | 7 +++++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.ci/docker/common/install_zephyr.sh b/.ci/docker/common/install_zephyr.sh index 3992074ae2c..6b727353acf 100644 --- a/.ci/docker/common/install_zephyr.sh +++ b/.ci/docker/common/install_zephyr.sh @@ -83,13 +83,4 @@ install_prerequiresites() { pip_install --no-cache-dir west } -install_sdk() { - wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \ - tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \ - rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz && \ - cd zephyr-sdk-0.16.0/ && \ - ./setup.sh -c -t arm-zephyr-eabi -} - install_prerequiresites -install_sdk diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index c646f66d281..58be807f1b8 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -80,6 +80,13 @@ jobs: cd zephyr_scratch export ZEPHYR_PROJ_ROOT=$(realpath $(pwd)) + wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz + tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz + rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz + cd zephyr-sdk-0.16.0/ + ./setup.sh -c -t arm-zephyr-eabi + + cd $ZEPHYR_PROJ_ROOT git clone https://github.com/BujSet/zephyr.git cd zephyr/ git switch -c executorch-module-integration origin/executorch-module-integration From d7c9740204981b9b15b0758fbffe15af8d93bbd0 Mon Sep 17 00:00:00 2001 From: BujSet Date: Mon, 28 Jul 2025 21:10:09 +0000 Subject: [PATCH 14/19] Adding missing dependency of elftools to zephyr docker image --- .ci/docker/common/install_zephyr.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci/docker/common/install_zephyr.sh b/.ci/docker/common/install_zephyr.sh index 6b727353acf..c24bb5aa8f1 100644 --- a/.ci/docker/common/install_zephyr.sh +++ b/.ci/docker/common/install_zephyr.sh @@ -81,6 +81,7 @@ install_prerequiresites() { ./kitware-archive.sh && \ rm -f kitware-archive.sh pip_install --no-cache-dir west + pip_install pyelftools } install_prerequiresites From 59324acf7a87edcfb6d001b58187ad48aa402b67 Mon Sep 17 00:00:00 2001 From: BujSet Date: Mon, 28 Jul 2025 22:24:09 +0000 Subject: [PATCH 15/19] Test seems to have passed, adding some error checking and clean up --- .github/workflows/trunk.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 58be807f1b8..f5ff4c657b2 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -75,8 +75,6 @@ jobs: source .ci/scripts/utils.sh mkdir -p zephyr_scratch/ - pwd - ls cd zephyr_scratch export ZEPHYR_PROJ_ROOT=$(realpath $(pwd)) @@ -94,26 +92,21 @@ jobs: west init -l zephyr west config manifest.project-filter -- +executorch west -v update - pwd - ls cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch - #python3 -m venv .venv && source .venv/bin/activate && pip install --upgrade pip install_executorch "--use-pt-pinned-commit" .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh - pwd - ls cd $ZEPHYR_PROJ_ROOT - pwd - ls source zephyr/zephyr-env.sh cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world west build -p always -b mps3/corstone300/fvp FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60 - pwd - ls + cat sim.out + grep -q "Output[0][0]: (float) 2.000000" sim.out; then + exit_status=$? #store 0 if found (success), 1 if not (failure) + exit $exit_status test-models-linux-aarch64: name: test-models-linux-aarch64 From 3eae2680936af7dafdc36b5afc0e821ba4a4a5e6 Mon Sep 17 00:00:00 2001 From: BujSet Date: Mon, 28 Jul 2025 23:15:27 +0000 Subject: [PATCH 16/19] Refactor CI job to decompose test steps into reusable script functions --- .ci/scripts/zephyr-utils.sh | 19 +++++++++++++++++++ .github/workflows/trunk.yml | 33 +++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 .ci/scripts/zephyr-utils.sh diff --git a/.ci/scripts/zephyr-utils.sh b/.ci/scripts/zephyr-utils.sh new file mode 100644 index 00000000000..2b36c6b0427 --- /dev/null +++ b/.ci/scripts/zephyr-utils.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +download_arm_zephyr_sdk () { + wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz + tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz + rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz +} + +setup_zephyr_et_module () { + git clone --branch executorch-module-integration https://github.com/BujSet/zephyr.git + west init -l zephyr + west config manifest.project-filter -- +executorch + west -v update +} diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index f5ff4c657b2..e06c190fc8d 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -74,31 +74,36 @@ jobs: conda activate "${CONDA_ENV}" source .ci/scripts/utils.sh + source .ci/scripts/zephyr-utils.sh mkdir -p zephyr_scratch/ cd zephyr_scratch export ZEPHYR_PROJ_ROOT=$(realpath $(pwd)) - wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz - tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz - rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz - cd zephyr-sdk-0.16.0/ - ./setup.sh -c -t arm-zephyr-eabi + download_arm_zephyr_sdk + ./zephyr-sdk-0.16.0/setup.sh -c -t arm-zephyr-eabi + + #wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz + #tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz + #rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz + #cd zephyr-sdk-0.16.0/ + #./setup.sh -c -t arm-zephyr-eabi cd $ZEPHYR_PROJ_ROOT - git clone https://github.com/BujSet/zephyr.git - cd zephyr/ - git switch -c executorch-module-integration origin/executorch-module-integration - cd $ZEPHYR_PROJ_ROOT - west init -l zephyr - west config manifest.project-filter -- +executorch - west -v update + setup_zephyr_et_module + #git clone https://github.com/BujSet/zephyr.git + #cd zephyr/ + #git switch -c executorch-module-integration origin/executorch-module-integration + #cd $ZEPHYR_PROJ_ROOT + #west init -l zephyr + #west config manifest.project-filter -- +executorch + #west -v update cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch install_executorch "--use-pt-pinned-commit" .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh - cd $ZEPHYR_PROJ_ROOT - source zephyr/zephyr-env.sh + #cd $ZEPHYR_PROJ_ROOT + source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world west build -p always -b mps3/corstone300/fvp FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60 From a7389d37ec5c0e5db1aea85b614bbb4685e17cc3 Mon Sep 17 00:00:00 2001 From: BujSet Date: Tue, 29 Jul 2025 00:05:45 +0000 Subject: [PATCH 17/19] Removing comments --- .github/workflows/trunk.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index e06c190fc8d..391a24e081a 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -82,33 +82,18 @@ jobs: download_arm_zephyr_sdk ./zephyr-sdk-0.16.0/setup.sh -c -t arm-zephyr-eabi - #wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz - #tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz - #rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz - #cd zephyr-sdk-0.16.0/ - #./setup.sh -c -t arm-zephyr-eabi - cd $ZEPHYR_PROJ_ROOT setup_zephyr_et_module - #git clone https://github.com/BujSet/zephyr.git - #cd zephyr/ - #git switch -c executorch-module-integration origin/executorch-module-integration - #cd $ZEPHYR_PROJ_ROOT - #west init -l zephyr - #west config manifest.project-filter -- +executorch - #west -v update cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch install_executorch "--use-pt-pinned-commit" .ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr source examples/arm/ethos-u-scratch/setup_path.sh - #cd $ZEPHYR_PROJ_ROOT source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world west build -p always -b mps3/corstone300/fvp FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60 - cat sim.out grep -q "Output[0][0]: (float) 2.000000" sim.out; then exit_status=$? #store 0 if found (success), 1 if not (failure) exit $exit_status From 364ffc3c7caa68200ed5854a1846af6e23aeff26 Mon Sep 17 00:00:00 2001 From: BujSet Date: Tue, 29 Jul 2025 03:29:51 +0000 Subject: [PATCH 18/19] Minor typo fix in zephyr add ci test --- .github/workflows/trunk.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index 391a24e081a..c4565ef07d4 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -92,9 +92,9 @@ jobs: source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world west build -p always -b mps3/corstone300/fvp - FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60 + FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 120 - grep -q "Output[0][0]: (float) 2.000000" sim.out; then + grep -q "Output[0][0]: (float) 2.000000" sim.out exit_status=$? #store 0 if found (success), 1 if not (failure) exit $exit_status From 5e1a389e6e311eac0ac64a8e648496b37dff967b Mon Sep 17 00:00:00 2001 From: BujSet Date: Tue, 29 Jul 2025 05:27:10 +0000 Subject: [PATCH 19/19] Using grep to test for correctness, need to look for fixed string result --- .github/workflows/trunk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index c4565ef07d4..e90ede58f40 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -94,7 +94,7 @@ jobs: west build -p always -b mps3/corstone300/fvp FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 120 - grep -q "Output[0][0]: (float) 2.000000" sim.out + grep -qF "Output[0][0]: (float) 2.000000" sim.out exit_status=$? #store 0 if found (success), 1 if not (failure) exit $exit_status