Skip to content

Commit

Permalink
ml-apps: Add CI support for Corstone-300 and Corstone-310
Browse files Browse the repository at this point in the history
Add keyword-detection and speech-recognition testing with the
available configuration (ETHOS/SOFTWARE) to the CI.

Increase the timeout to accommodate the applications
execution time as it takes longer.

Signed-off-by: Ahmed Ismail <[email protected]>
  • Loading branch information
hugueskamba committed Jan 15, 2024
1 parent ef63637 commit 2c558fd
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 22 deletions.
33 changes: 33 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@

aesni
AESNI
armar
Armv
ASYM
BBOOL
blinky
Blinky
BWCAP
cbor
cborencoder
cborerrorstrings
Expand All @@ -17,13 +19,19 @@ CMAC
cmsis
CMSIS
CMSIS's
compatibil
coremqtt
COSE
CSRS
Customisation
DACTIVATION
DARM
DCMAKE
DCONFIG
demultiplexing
DETHOS
DETHOSU
DFLASH
dgst
DMCUBOOT
docuemnt
Expand All @@ -32,6 +40,7 @@ DPROJECT
drbg
Drbg
DRBG
DSPML
DTFM
eabi
ecjpake
Expand All @@ -40,22 +49,37 @@ ecdh
ECDH
ECKEY
endpointid
FIFOS
fftr
fftwrap
fsanitize
FVPs
gemmlowp
havege
hkdf
HKDF
IDAQAB
indet
inkey
iotdeviceadvisor
ISRAM
istty
JITP
JITR
Jytl
NBNS
leds
LEDS
libcmsis
libkws
libspeex
libspeexdsp
Libseepx
LLMNR
lltoa
MAXR
MAXW
MAXRW
mcuboot
MCUBOOT
mbed
Expand All @@ -64,13 +88,16 @@ mbedcrypto
MBEDTLSSL
mbedx509
Merkle
Mfcc
MFCC
MFLN
mqtt
mqttconfig
Mqtt
MQTT
MQTT's
mqttexample
MVEI
Mzrdfkvi
NSPE
NVIC
Expand All @@ -92,9 +119,14 @@ pyproject
Retarget
Rfbo
RIHN
RLATENCY
RSAES
RSASSA
SECP
speex
Speex
SPEEX
speexdsp
srecord
srtp
SRTP
Expand All @@ -111,6 +143,7 @@ unusued
USART
venv
vsocket
WLATENCY
xtea
zeroize
ZEROIZE
71 changes: 49 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,14 @@ variables:

# Those fragments contain base variables required by pipelines for applications.
# They can be used to set matrix parameters and extended using << : .anchor syntax
.pipeline_config_applications: &pipeline_config_applications
TARGET: [corstone300, corstone310]
.pipeline_config_applications_ethos: &pipeline_config_applications_ethos
TARGET: [corstone310, corstone300]
TOOLCHAIN: [ARMCLANG, GNU]
INFERENCE: [ETHOS]
.pipeline_config_applications_sw: &pipeline_config_applications_sw
TARGET: [corstone310, corstone300]
TOOLCHAIN: [ARMCLANG, GNU]
INFERENCE: [SOFTWARE]

stages:
- quality-check
Expand Down Expand Up @@ -54,7 +59,8 @@ workflow:
fi
parallel:
matrix:
- *pipeline_config_applications
- *pipeline_config_applications_ethos
- *pipeline_config_applications_sw
variables:
PYTHONUNBUFFERED: 1

Expand All @@ -76,51 +82,70 @@ build-applications:
- ./tools/ci/generate_credentials.sh -f -p applications/${APP_UNDERSCORED}/configs/aws_configs
- git config --global user.email "[email protected]"
- git config --global user.name "ci"
- ./tools/scripts/build.sh ${APP} --target $TARGET --toolchain $TOOLCHAIN --certificate_path $PWD/certificate.pem --private_key_path $PWD/private_key.pem
- |
if [ $APP == "aws-iot-example" ];then
tar -czf ${TARGET}_${APP}_${TOOLCHAIN}_build.tar.gz \
./tools/scripts/build.sh ${APP} \
--target $TARGET \
--inference $INFERENCE \
--toolchain $TOOLCHAIN \
--certificate_path $PWD/certificate.pem \
--private_key_path $PWD/private_key.pem
- |
if [ $APP == "blinky" ];then
tar -czf ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_build.tar.gz \
build/${APP}_merged.elf
else
tar -czf ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_build.tar.gz \
build/${APP}_merged.elf \
build/${APP}-update_signed.bin \
build/update-signature.txt \
applications/${APP_UNDERSCORED}/configs/aws_configs
else
tar -czf ${TARGET}_${APP}_${TOOLCHAIN}_build.tar.gz \
build/${APP}_merged.elf
fi
parallel:
matrix:
-
<< : *pipeline_config_applications
APP: [blinky, aws-iot-example]
<< : *pipeline_config_applications_ethos
APP: [blinky, aws-iot-example, keyword-detection, speech-recognition]
-
<< : *pipeline_config_applications_sw
APP: [keyword-detection]

artifacts:
paths:
- ${TARGET}_${APP}_${TOOLCHAIN}_build.tar.gz
- ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_build.tar.gz
expire_in: 1 week

test-applications-output:
extends: .test_job
script:
- tar xf ${TARGET}_${APP}_${TOOLCHAIN}_build.tar.gz
- tar xf ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_build.tar.gz
- export APP_UNDERSCORED=$(echo ${APP} | tr '-' '_')
- |
pytest -s tools/tests/test_application_output.py \
--build-artefacts-path "build" \
--fvp $FVP_BIN \
--merged-elf-name "${APP}_merged.elf" \
--timeout-seconds 600 \
--timeout-seconds 900 \
--pass-output-file "applications/${APP_UNDERSCORED}/tests/pass_output.log" \
--fail-output-file "applications/${APP_UNDERSCORED}/tests/fail_output.log"
parallel:
matrix:
-
<< : *pipeline_config_applications
APP: [blinky]
<< : *pipeline_config_applications_ethos
APP: [blinky, keyword-detection, speech-recognition]

# The test-ota job should wait for build-applications job to finish as
# test-ota job uses the output build artifacts from build-applications job.
# The test-ota job should also wait for test-applications-output job to finish
# to prevent conflicts when doing both jobs at the same time as they both
# use the same credentials for the same target platform and application.
test-ota:
extends: .test_job
needs:
- job: build-applications
artifacts: true
- job: test-applications-output
script:
- tar xf ${TARGET}_${APP}_${TOOLCHAIN}_build.tar.gz
- tar xf ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_build.tar.gz
- export APP_UNDERSCORED=$(echo ${APP} | tr '-' '_')
- |
pytest -s tools/tests/test_ota.py \
Expand All @@ -129,15 +154,17 @@ test-ota:
--credentials-path "applications/${APP_UNDERSCORED}/configs/aws_configs" \
--merged-elf-name "${APP}_merged.elf" \
--signed-update-bin-name "${APP}-update_signed.bin" \
--timeout-seconds 900 \
--timeout-seconds 1800 \
--pass-ota-output-file "applications/${APP_UNDERSCORED}/tests/pass_ota_output.log" \
--fail-ota-output-file "applications/${APP_UNDERSCORED}/tests/fail_ota_output.log"
parallel:
matrix:
-
<< : *pipeline_config_applications
APP: [aws-iot-example]

<< : *pipeline_config_applications_ethos
APP: [aws-iot-example, keyword-detection, speech-recognition]
-
<< : *pipeline_config_applications_sw
APP: [keyword-detection]

integration-tests:
stage: test
Expand All @@ -164,7 +191,7 @@ integration-tests:
parallel:
matrix:
-
<< : *pipeline_config_applications
<< : *pipeline_config_applications_ethos
APP: [aws-iot-example]

# The clean up only happens once daily when the `Daily OTA cleanup`
Expand Down
2 changes: 2 additions & 0 deletions tools/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ def fvp_process(fvp_path, merged_elf_name, fvp_options):
"mps3_board.hostbridge.userNetworking=1",
"-C",
"mps3_board.DISABLE_GATING=1",
"-C",
"ethosu.extra_args=--fast",
]

cmdline.extend(fvp_options)
Expand Down

0 comments on commit 2c558fd

Please sign in to comment.