Skip to content

Commit

Permalink
soak webrtc native server pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
nathhB committed Jan 3, 2024
1 parent feafb39 commit 4bc7b16
Show file tree
Hide file tree
Showing 7 changed files with 937 additions and 31 deletions.
56 changes: 48 additions & 8 deletions .github/workflows/nbnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ jobs:
- name: Compile soak test
run: |
cd soak
cmake -DCMAKE_BUILD_TYPE=Debug .
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
- name: Run soak test
run: timeout 240 ./bin/github-actions/run_soak.sh
Expand All @@ -76,7 +78,9 @@ jobs:
- name: Compile soak test
run: |
cd soak
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON .
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON ..
make
- name: Run soak test
run: timeout 240 ./bin/github-actions/run_soak.sh
Expand Down Expand Up @@ -112,7 +116,7 @@ jobs:
cd emsdk
source ./emsdk_env.sh
cd ..
EMSCRIPTEN=1 timeout 240 ./bin/github-actions/run_soak.sh
WEBRTC=1 timeout 240 ./bin/github-actions/run_soak.sh
soak-test-osx-c:
runs-on: macos-latest
Expand All @@ -123,7 +127,9 @@ jobs:
- name: Compile soak test
run: |
cd soak
cmake -DCMAKE_BUILD_TYPE=Debug .
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make
- name: Run soak test
run: gtimeout 240 ./bin/github-actions/run_soak.sh
Expand All @@ -137,7 +143,9 @@ jobs:
- name: Compile soak test
run: |
cd soak
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON .
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCPP_COMPILE=ON ..
make
- name: Run soak test
run: gtimeout 240 ./bin/github-actions/run_soak.sh
Expand Down Expand Up @@ -173,8 +181,7 @@ jobs:
cd emsdk
source ./emsdk_env.sh
cd ..
EMSCRIPTEN=1 gtimeout 240 ./bin/github-actions/run_soak.sh
WEBRTC=1 gtimeout 240 ./bin/github-actions/run_soak.sh
soak-test-windows-c:
runs-on: windows-latest
Expand All @@ -184,11 +191,44 @@ jobs:
- name: Compile soak test
run: |
cd soak
cmake -G "NMake Makefiles" .
mkdir build
cd build
cmake -G "NMake Makefiles" ..
nmake
- name: Run soak test
run: ./bin/github-actions/run_soak.sh

soak-test-linux-webrtc-native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install prerequisites
run: sudo apt-get install build-essential cmake git -y
- name: Download and build libdatachannel
run: ./bin/github-actions/download_and_build_libdatachannel.sh
- name: Install emsdk
run: ./bin/github-actions/install_emsdk.sh
- name: Compile soak test (native)
run: |
cd soak
mkdir build
cd build
cmake -DLIBDATACHANNEL_LIBRARY_PATH=${{ github.workspace }}/libdatachannel/build/libdatachannel.so -DLIBDATACHANNEL_INCLUDE_PATH=${{ github.workspace }}/libdatachannel/include -DWEBRTC_C_DRIVER=ON ..
make
cd ..
npm install
- name: Compile soak test (web)
run: |
cd emsdk
source ./emsdk_env.sh
cd ../soak
mkdir build_web
cd build_web
emcmake cmake ..
make
- name: Run soak test
run: WEBRTC_NATIVE=1 timeout 240 ./bin/github-actions/run_soak.sh

compile-examples-linux-c:
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 8 additions & 0 deletions bin/github-actions/download_and_build_libdatachannel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

git clone https://github.com/paullouisageneau/libdatachannel.git
cd libdatachannel
git submodule update --init --recursive --depth 1
cmake -B build -DUSE_GNUTLS=0 -DUSE_NICE=0 -DCMAKE_BUILD_TYPE=Release
cd build
make -j2
10 changes: 5 additions & 5 deletions bin/github-actions/run_soak.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ NODE_CMD="$EMSDK_NODE --experimental-wasm-threads"
cd soak
echo "Starting soak server..."

if [ -n "$EMSCRIPTEN" ]
if [ -n "$WEBRTC" ]
then
$NODE_CMD build/server.js --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_serv_out &
else
./server --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_serv_out &
./build/server --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_serv_out &
fi

if [ $? -eq 0 ]
Expand All @@ -31,19 +31,19 @@ fi

sleep 3

if [ -n "$EMSCRIPTEN" ]
if [ -n "$WEBRTC" ]
then
$NODE_CMD build/client.js --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
else
./client --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
./build/client --message_count=$MESSAGE_COUNT --channel_count=$CHANNEL_COUNT --packet_loss=$PACKET_LOSS --packet_duplication=$PACKET_DUPLICATION --ping=$PING --jitter=$JITTER &> soak_cli_out
fi

RESULT=$?

# when running the soak test in the latest version of emscripten with node 16
# the client aborts at the end when calling emscripten_force_exit
# I could not figure out why, hence the condition
[[ -n "$EMSCRIPTEN" ]] && EXPECTED_RESULT=7 || EXPECTED_RESULT=0
[[ -n "$WEBRTC" ]] && EXPECTED_RESULT=7 || EXPECTED_RESULT=0

if [ $RESULT -eq $EXPECTED_RESULT ]
then
Expand Down
7 changes: 1 addition & 6 deletions soak/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,8 @@ if (WEBRTC_C_DRIVER)

target_compile_definitions(server PUBLIC SOAK_WEBRTC_C_DRIVER)

target_link_libraries(server ${LIBFACILIO_LIBRARY_PATH})
target_link_libraries(server ${LIBCRYPTO_LIBRARY_PATH})
target_link_libraries(server ${LIBSSL_LIBRARY_PATH})
target_link_libraries(server ${LIBDATACHANNEL_LIBRARY_PATH})
target_link_libraries(server ${LIBDATACHANNEL_LIBRARY_PATH} m)

target_include_directories(server PUBLIC "${LIBFACILIO_INCLUDE_PATH}")
target_include_directories(server PUBLIC "${OPENSSL_INCLUDE_PATH}")
target_include_directories(server PUBLIC "${LIBDATACHANNEL_INCLUDE_PATH}")

if (USE_HTTPS)
Expand Down
Loading

0 comments on commit 4bc7b16

Please sign in to comment.