Skip to content

Commit 3faaec3

Browse files
authored
Cleaning up stale resources, adjusted logging (#2117)
* Global log level * Add progress bar and run the deletion script * Undo git_shallow for non-tagged versions * Install dependencies for AWS SDK CPP * Use ubuntu 22 container for the codecov * Downgrade to Ubuntu 20 * Add CD and change to bash * Install curl * Increase history for codecov * Seperate the steps for generating the report and uploading it
1 parent 021c789 commit 3faaec3

11 files changed

+111
-15
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,57 @@ env:
1515
DEBIAN_FRONTEND: noninteractive
1616

1717
jobs:
18+
check-aws-credentials:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
id-token: write
22+
contents: read
23+
24+
steps:
25+
- name: Configure AWS credentials
26+
uses: aws-actions/configure-aws-credentials@v4
27+
with:
28+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
29+
aws-region: us-west-2
30+
31+
cleanup-old-resources:
32+
needs: check-aws-credentials
33+
runs-on: ubuntu-latest
34+
permissions:
35+
id-token: write
36+
contents: read
37+
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
with:
42+
repository: 'aws-samples/amazon-kinesis-video-streams-demos'
43+
path: demos-repo
44+
45+
- name: Set up Python 3.12
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: "3.12"
49+
50+
- name: Install dependencies
51+
working-directory: ./demos-repo/python/cleanup
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install -r requirements.txt
55+
56+
- name: Setup credentials
57+
uses: aws-actions/configure-aws-credentials@v4
58+
with:
59+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
60+
aws-region: us-west-2
61+
62+
- name: Run cleanup script
63+
working-directory: ./demos-repo/python/cleanup
64+
run: |
65+
python kvs_cleanup.py
66+
1867
mac-tests:
68+
needs: cleanup-old-resources
1969
strategy:
2070
matrix:
2171
os:
@@ -142,7 +192,6 @@ jobs:
142192
env:
143193
CC: gcc
144194
CXX: g++
145-
AWS_KVS_LOG_LEVEL: 2
146195
permissions:
147196
id-token: write
148197
contents: read
@@ -161,6 +210,7 @@ jobs:
161210
make -j
162211
163212
mbedtls-ubuntu-gcc-4-4:
213+
needs: cleanup-old-resources
164214
permissions:
165215
id-token: write
166216
contents: read
@@ -210,6 +260,7 @@ jobs:
210260
timeout --signal=SIGABRT 60m ./tst/webrtc_client_test
211261
212262
ubuntu:
263+
needs: cleanup-old-resources
213264
strategy:
214265
matrix:
215266
container:
@@ -290,20 +341,14 @@ jobs:
290341
./tst/webrtc_client_test
291342
292343
windows-msvc-openssl:
344+
needs: cleanup-old-resources
293345
runs-on: windows-2022
294-
env:
295-
AWS_KVS_LOG_LEVEL: 1
296346
permissions:
297347
id-token: write
298348
contents: read
299349
steps:
300350
- name: Clone repository
301351
uses: actions/checkout@v4
302-
- name: Configure AWS Credentials
303-
uses: aws-actions/configure-aws-credentials@v4
304-
with:
305-
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
306-
aws-region: ${{ secrets.AWS_REGION }}
307352
- name: Move cloned repo
308353
shell: powershell
309354
run: |
@@ -341,6 +386,11 @@ jobs:
341386
cd C:\webrtc
342387
git config --system core.longpaths true
343388
.github\build_windows_openssl.bat
389+
- name: Configure AWS Credentials
390+
uses: aws-actions/configure-aws-credentials@v4
391+
with:
392+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
393+
aws-region: ${{ secrets.AWS_REGION }}
344394
- name: Run tests
345395
shell: powershell
346396
run: |

.github/workflows/codecov.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ on:
1111

1212
env:
1313
AWS_KVS_LOG_LEVEL: 7
14+
DEBIAN_FRONTEND: noninteractive
1415

1516
jobs:
1617
linux-gcc-codecov:
17-
if: ${{ github.repo == 'awslabs/amazon-kinesis-video-streams-webrtc-sdk-c' }}
18+
if: ${{ github.repository == 'awslabs/amazon-kinesis-video-streams-webrtc-sdk-c' }}
1819
runs-on: ubuntu-latest
20+
container: public.ecr.aws/ubuntu/ubuntu:20.04_stable
1921
timeout-minutes: 60
2022

2123
env:
@@ -28,12 +30,20 @@ jobs:
2830
steps:
2931
- name: Clone repository
3032
uses: actions/checkout@v4
31-
32-
- name: Configure AWS Credentials
33-
uses: aws-actions/configure-aws-credentials@v4
3433
with:
35-
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
36-
aws-region: ${{ secrets.AWS_REGION }}
34+
fetch-depth: 0 # fetch all history, for Codecov
35+
36+
- name: Install dependencies
37+
run: |
38+
apt-get update
39+
apt-get -y install git cmake build-essential pkg-config
40+
apt-get -y install zlib1g-dev libcurl4-openssl-dev
41+
apt-get -y install curl
42+
43+
- name: Check versions
44+
run: |
45+
gcc --version
46+
gcov --version
3747
3848
- name: Build repository
3949
run: |
@@ -42,12 +52,24 @@ jobs:
4252
cmake .. -DCODE_COVERAGE=ON -DBUILD_TEST=ON
4353
make -j
4454
55+
- name: Configure AWS Credentials
56+
uses: aws-actions/configure-aws-credentials@v4
57+
with:
58+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
59+
aws-region: ${{ secrets.AWS_REGION }}
60+
4561
- name: Run tests
4662
working-directory: ./build
4763
run: |
4864
./tst/webrtc_client_test
4965
50-
- name: Code coverage
66+
- name: Generate report
67+
working-directory: ./build
68+
shell: bash
5169
run: |
5270
for test_file in $(find CMakeFiles/kvsWebrtcClient.dir CMakeFiles/kvsWebrtcSignalingClient.dir -name '*.gcno'); do gcov $test_file; done
71+
72+
- name: Upload report
73+
shell: bash
74+
run: |
5375
bash <(curl -s https://codecov.io/bash)

CMake/Dependencies/libawscpp-CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ ExternalProject_Add(libawscpp-download
1010
-DBUILD_ONLY=kinesisvideo|kinesis-video-webrtc-storage
1111
-DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}
1212
BUILD_ALWAYS TRUE
13+
GIT_PROGRESS TRUE
14+
GIT_SHALLOW TRUE
1315
TEST_COMMAND ""
1416
)

CMake/Dependencies/libgtest-CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ include(ExternalProject)
77
ExternalProject_Add(libgtest-download
88
GIT_REPOSITORY https://github.com/google/googletest.git
99
GIT_TAG release-1.12.1
10+
GIT_PROGRESS TRUE
11+
GIT_SHALLOW TRUE
1012
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
1113
CMAKE_ARGS
1214
-DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}

CMake/Dependencies/libkvsCommonLws-CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ include(ExternalProject)
77
ExternalProject_Add(libkvsCommonLws-download
88
GIT_REPOSITORY https://github.com/awslabs/amazon-kinesis-video-streams-producer-c.git
99
GIT_TAG v1.5.4
10+
GIT_PROGRESS TRUE
11+
GIT_SHALLOW TRUE
1012
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
1113
LIST_SEPARATOR |
1214
CMAKE_ARGS

CMake/Dependencies/libmbedtls-CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ ExternalProject_Add(
2222
project_libmbedtls
2323
GIT_REPOSITORY https://github.com/ARMmbed/mbedtls.git
2424
GIT_TAG v2.28.8
25+
GIT_PROGRESS TRUE
26+
GIT_SHALLOW TRUE
2527
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
2628
CMAKE_ARGS
2729
-DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}

CMake/Dependencies/libopenssl-CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ include(ExternalProject)
4040
ExternalProject_Add(project_libopenssl
4141
GIT_REPOSITORY https://github.com/openssl/openssl.git
4242
GIT_TAG OpenSSL_1_1_1t
43+
GIT_PROGRESS TRUE
44+
GIT_SHALLOW TRUE
4345
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
4446
CONFIGURE_COMMAND ${CONFIGURE_COMMAND}
4547
BUILD_COMMAND ${MAKE_EXE}

CMake/Dependencies/libsrtp-CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ ExternalProject_Add(project_libsrtp
5959
GIT_REPOSITORY https://github.com/cisco/libsrtp.git
6060
GIT_TAG bd0f27ec0e299ad101a396dde3f7c90d48efc8fc
6161
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
62+
GIT_PROGRESS TRUE
6263
CMAKE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
6364
-DCMAKE_INSTALL_PREFIX:STRING=${OPEN_SRC_INSTALL_PREFIX}
6465
-DENABLE_OPENSSL=${LIBSRTP_ENABLE_OPENSSL}

CMake/Dependencies/libusrsctp-CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include(ExternalProject)
77
ExternalProject_Add(project_libusrsctp
88
GIT_REPOSITORY https://github.com/sctplab/usrsctp.git
99
GIT_TAG 1ade45cbadfd19298d2c47dc538962d4425ad2dd
10+
GIT_PROGRESS TRUE
1011
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
1112
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}
1213
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}

CMake/Dependencies/libwebsockets-CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ endif()
3131
ExternalProject_Add(project_libwebsockets
3232
GIT_REPOSITORY https://github.com/warmcat/libwebsockets.git
3333
GIT_TAG v4.3.3
34+
GIT_PROGRESS TRUE
35+
GIT_SHALLOW TRUE
3436
PATCH_COMMAND ${PATCH_COMMAND}
3537
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/build
3638
LIST_SEPARATOR |

tst/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ int main(int argc, char** argv)
7575
if (trial >= MAX_TRIALS) {
7676
::testing::GTEST_FLAG(break_on_failure) = breakOnFailure;
7777
}
78+
79+
// Increase logging verbosity on retry
80+
if (trial >= 1) {
81+
#ifdef _WIN32
82+
_putenv_s("AWS_KVS_LOG_LEVEL", "1");
83+
#else
84+
setenv("AWS_KVS_LOG_LEVEL", "1", 1);
85+
#endif
86+
}
87+
7888
rc = RUN_ALL_TESTS();
7989

8090
// If there were some tests failed, set googletest filter flag to those failed tests.

0 commit comments

Comments
 (0)