Skip to content

Commit

Permalink
feat: add integration test github workflow action (#453)
Browse files Browse the repository at this point in the history
* feat: add integrationn test github workflow action

Signed-off-by: Jim Wang <[email protected]>

* fix: fix the file path for bit model

Signed-off-by: Jim Wang <[email protected]>

* fix: move the chown permission .docker/buildx folder to smoke tests

Signed-off-by: Jim Wang <[email protected]>

fix: remove -i from docker run for github action runner

Signed-off-by: Jim Wang <[email protected]>

* fix: remove unnecessary -i or -t -or -it flag from docker run for headless github action runner to work

Signed-off-by: Jim Wang <[email protected]>

* fix: clean up and add --rm back for video downloading

Signed-off-by: Jim Wang <[email protected]>

* fix: add clean-up build folder before run checkout action

Signed-off-by: Jim Wang <[email protected]>

* fix: use sudo for deletion

Signed-off-by: Jim Wang <[email protected]>

* fix: switch to run on crob job schedule

Signed-off-by: Jim Wang <[email protected]>

---------

Signed-off-by: Jim Wang <[email protected]>
  • Loading branch information
jim-wang-intel authored Jan 12, 2024
1 parent 27b858d commit 398f68c
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 16 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
name: Integration Tests

on: workflow_dispatch
# Runs on every pr pushed
# on:
# push:
# branches: [ "main" ]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ "main" ]

# Runs on schedule at 9am UTC, Monday to Friday everyday
on:
schedule:
- cron: '0 9 * * 1-5'

permissions:
contents: read

jobs:
build_OVMS_Profile_Launcher:
runs-on: [self-hosted, linux, x64, arc, integration]
run_integration_tests:
runs-on: [self-hosted, linux, x64]
steps:
- name: Cleanup repo build folder
run: |
ls -la ./
sudo rm -rf ./* || true
sudo rm -rf ./.??* || true
ls -la ./
- name: Checkout code
uses: actions/checkout@v3
- name: Build ovms profile launcher
- name: run integration tests
run: |
make build-profile-launcher
make run-smoke-tests
2 changes: 2 additions & 0 deletions benchmark-scripts/download_sample_videos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#

# up to 3 bottles and human hand
echo "in download_sample_videos.sh...."

./format_avc_mp4.sh coca-cola-4465029.mp4 https://www.pexels.com/video/4465029/download/ "$1" "$2" "$3"
./format_avc_mp4.sh vehicle-bike.mp4 https://www.pexels.com/video/853908/download/ "$1" "$2" "$3"
#./format_avc_mp4.sh grocery-items-on-the-kitchen-shelf-4983686.mp4 https://www.pexels.com/video/4983686/download/ $1 $2 $3
Expand Down
15 changes: 9 additions & 6 deletions benchmark-scripts/format_avc_mp4.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (C) 2023 Intel Corporation.
# Copyright (C) 2024 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
#
Expand Down Expand Up @@ -67,8 +67,9 @@ then
fi

if [ ! -f ../sample-media/$1 ] && [ ! -f ../sample-media/$result ]
then
then
wget -O ../sample-media/$1 $2
ls -alR ../sample-media/
fi

if [ ! -f ../sample-media/$1 ]
Expand All @@ -82,11 +83,13 @@ fi

echo "$WIDTH $HEIGHT $FPS"
SAMPLE_MEDIA_DIR="$PWD"/../sample-media
docker run --network host --privileged --user root --ipc=host -e VIDEO_FILE="$1" -e DISPLAY=:0 \
echo "SAMPLE_MEDIA_DIR:$SAMPLE_MEDIA_DIR"
docker run --privileged --user root -e VIDEO_FILE="$1" -e DISPLAY=:0 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v "$SAMPLE_MEDIA_DIR"/:/vids \
-w /vids -it --rm intel/dlstreamer:2023.0.0-ubuntu22-gpu682-dpcpp \
bash -c "if [ -f /vids/$result ]; then exit 1; else gst-launch-1.0 filesrc location=/vids/$1 ! qtdemux ! h264parse ! vaapih264dec ! vaapipostproc width=$WIDTH height=$HEIGHT ! videorate ! 'video/x-raw, framerate=$FPS/1' ! vaapih264enc ! h264parse ! mp4mux ! filesink location=/vids/$result; fi"
-w /vids -t --rm intel/dlstreamer:2023.0.0-ubuntu22-gpu682-dpcpp \
bash -c "if [ -f /vids/$result ]; then echo 'error for '$result; exit 1; else ls -al /vids/; gst-launch-1.0 filesrc location=/vids/$1 ! qtdemux ! h264parse ! vaapih264dec ! vaapipostproc width=$WIDTH height=$HEIGHT ! videorate ! 'video/x-raw, framerate=$FPS/1' ! vaapih264enc ! h264parse ! mp4mux ! filesink location=/vids/$result; fi"

echo "Result will be created in ../sample-media/$result"

rm ../sample-media/"$1"
echo "Result will be created in ../sample-media/$result"
2 changes: 1 addition & 1 deletion docs_src/OVMS/pipelinesetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
b. Here is the script to run the container that downloads the bit models:

```bash
docker run -it bit_model_downloader:dev
docker run bit_model_downloader:dev
```

7. Build the reference design images. This table shows the commands for the OpenVINO (OVMS) model Server and profile-launcher build command:
Expand Down
3 changes: 1 addition & 2 deletions download_models/downloadOVMSModels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,12 @@ if [ -f "$bitModelFile" ]; then
echo "BIT model already exists, skip downloading..."
else
echo "download BIT model..."
mkdir -p "/FP16-INT8/1"
BIT_MODEL_DOWNLOADER=$(docker images --format "{{.Repository}}" | grep "bit_model_downloader")
if [ -z "$BIT_MODEL_DOWNLOADER" ]
then
docker build -f "$MODEL_EXEC_PATH"/../Dockerfile.bitModel -t bit_model_downloader:dev "$MODEL_EXEC_PATH"/../
fi
docker run -it --rm -v "$modelDir/$bitModelDirName/$modelPrecisionFP16INT8"/1:/result bit_model_downloader:dev
docker run --rm -v "$modelDir/$bitModelDirName/$modelPrecisionFP16INT8"/1:/result bit_model_downloader:dev
# make the bitModelDirName owned by local user instead of root
sudo chown -R "${USER:=$(/usr/bin/id -run)}:$USER" "$modelDir"/"$bitModelDirName"
fi
Expand Down
2 changes: 1 addition & 1 deletion get-realsense-serialno.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ fi
# the $cameras used as command line for docker and meant to be word-splitting
# shellcheck disable=SC2086
docker run --rm -it --network host $cameras --user root --ipc=host --name automated-self-checkout0 -w /home/pipeline-server "$DLSTREAMER_REALSENSE_IMG" \
docker run --rm --network host $cameras --user root --ipc=host --name automated-self-checkout0 -w /home/pipeline-server "$DLSTREAMER_REALSENSE_IMG" \
bash -c "rs-enumerate-devices | grep -E \"^[[:space:]]+Serial Number\" | grep -o '[0-9]\+'"
5 changes: 4 additions & 1 deletion run_smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ RESULT_DIR=./results
# setup:
setup() {
make clean-all || true
sudo chown -R "${USER:=$(/usr/bin/id -run)}:$USER" ~/.docker/buildx/activity/default
echo $PWD
(
echo $PWD
cd ./benchmark-scripts
./download_sample_videos.sh
)
Expand Down Expand Up @@ -68,7 +71,7 @@ verifyNonEmptyPipelineLog() {
}

waitForLogFile() {
max_wait_time=1000
max_wait_time=300
sleep_increments=10
total_wait_time=0
while [ ! -f "$RESULT_DIR/pipeline0.log" ] || [ ! -s "$RESULT_DIR/pipeline0.log" ]
Expand Down

0 comments on commit 398f68c

Please sign in to comment.