Skip to content

Commit 71133a8

Browse files
committed
Move from s3-hosted media and factor out common code
1 parent 7a9834d commit 71133a8

File tree

2 files changed

+61
-15
lines changed

2 files changed

+61
-15
lines changed

.github/workflows/kvssink.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ jobs:
2222
run-config:
2323
- os: Ubuntu 22.04
2424
image: public.ecr.aws/ubuntu/ubuntu:22.04_stable
25-
- os: Ubuntu 20.04
26-
image: public.ecr.aws/ubuntu/ubuntu:20.04_stable
25+
# - os: Ubuntu 20.04
26+
# image: public.ecr.aws/ubuntu/ubuntu:20.04_stable
2727
fail-fast: false
2828

29+
env:
30+
DEBIAN_FRONTEND: noninteractive
31+
2932
name: kvssink unit tests on ${{ matrix.run-config.os }}
3033
container: ${{ matrix.run-config.image }}
3134
steps:
@@ -225,6 +228,8 @@ jobs:
225228
env:
226229
AWS_KVS_LOG_LEVEL: 1
227230
STREAM_NAME: cpp-kvssink-debug-dump-dir-windows-2022
231+
GST_PLUGIN_PATH: D:\producer\build\
232+
KVS_DEBUG_DUMP_DATA_FILE_DIR: D:\producer\build\debug_output
228233
permissions:
229234
id-token: write
230235
contents: read
@@ -255,9 +260,6 @@ jobs:
255260
aws-region: ${{ secrets.AWS_REGION }}
256261
role-duration-seconds: 900
257262
- name: Run kvssink with dump dir
258-
env:
259-
GST_PLUGIN_PATH: D:\producer\build\
260-
KVS_DEBUG_DUMP_DATA_FILE_DIR: D:\producer\build\debug_output
261263
working-directory: D:\producer\build\
262264
run: |
263265
$env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin;D:\gstreamer\1.0\msvc_x86_64\bin'
@@ -266,7 +268,7 @@ jobs:
266268
New-Item -ItemType Directory -Path "D:\producer\build\debug_output" -Force
267269
268270
# Stream for 15 seconds (450 frames @ 30 fps)
269-
gst-launch-1.0.exe videotestsrc is-live=true num-buffers=450 ! video/x-raw,framerate=30/1,width=640,height=480 ! videoconvert ! x264enc tune=zerolatency key-int-max=45 ! h264parse ! kvssink stream-name="$STREAM_NAME"
271+
gst-launch-1.0.exe videotestsrc is-live=true num-buffers=450 ! video/x-raw,framerate=30/1,width=640,height=480 ! videoconvert ! x264enc tune=zerolatency key-int-max=45 ! h264parse ! kvssink stream-name="$env:STREAM_NAME"
270272
- name: Verify MKV dump
271273
working-directory: D:\producer\build
272274
run: |
@@ -402,8 +404,8 @@ jobs:
402404
deps:
403405
- name: Deps-ON
404406
cmake_flags: -DBUILD_DEPENDENCIES=ON
405-
- name: Deps-OFF
406-
cmake_flags: -DBUILD_DEPENDENCIES=OFF
407+
# - name: Deps-OFF
408+
# cmake_flags: -DBUILD_DEPENDENCIES=OFF
407409

408410
fail-fast: false
409411

.github/workflows/samples.yml

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,41 @@ on:
1010
- develop
1111
- master
1212

13+
env:
14+
SAMPLE_MP4_LOCATION: https://raw.githubusercontent.com/aws-samples/amazon-kinesis-video-streams-demos/refs/heads/master/sample-video/sample.mp4
15+
1316
jobs:
17+
prep-assets:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
sample-artifact-name: ${{ steps.set-output.outputs.artifact-name }}
21+
steps:
22+
- name: Restore cached sample.mp4
23+
uses: actions/cache@v4
24+
with:
25+
path: sample.mp4
26+
key: sample-mp4-v1
27+
28+
- name: Download sample.mp4 if not cached
29+
if: steps.cache.outputs.cache-hit != 'true'
30+
run: curl -fsSL -o sample.mp4 "$SAMPLE_MP4_LOCATION"
31+
32+
- name: Save to cache
33+
if: steps.cache.outputs.cache-hit != 'true'
34+
uses: actions/cache@v4
35+
with:
36+
path: sample.mp4
37+
key: sample-mp4-v1
38+
39+
- name: Upload artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: sample-mp4
43+
path: sample.mp4
44+
1445
sample-checks:
1546
name: ${{ matrix.runner.id }} - ${{ matrix.sample.name }}
47+
needs: prep-assets
1648

1749
strategy:
1850
matrix:
@@ -106,13 +138,19 @@ jobs:
106138
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
107139
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
108140
aws-region: ${{ secrets.AWS_REGION }}
109-
role-duration-seconds: 10800
141+
role-duration-seconds: 900
142+
143+
- name: Download sample.mp4 artifact
144+
uses: actions/download-artifact@v4
145+
with:
146+
name: sample-mp4
147+
path: ./assets
110148

111149
- name: Run ${{ matrix.sample.name }} (Linux & Mac)
112150
if: runner.os == 'Linux' || runner.os == 'macOS'
113151
working-directory: ./build
114152
run: |
115-
curl -fsSL -o sample.mp4 https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4
153+
mv ../assets/*.mp4 .
116154
./${{ matrix.sample.name }} demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample.name }} ${{ matrix.sample.args }}
117155
118156
- name: Run ${{ matrix.sample.name }} (Windows)
@@ -129,7 +167,7 @@ jobs:
129167
130168
mkdir D:\producer\debug_output
131169
132-
Invoke-WebRequest -Uri https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4 -OutFile sample.mp4
170+
cp -r D:\a\amazon-kinesis-video-streams-producer-sdk-cpp\amazon-kinesis-video-streams-producer-sdk-cpp\assets\*.mp4 .
133171
dir
134172
$exePath = Join-Path $PWD ${{ matrix.sample.name }}.exe
135173
& $exePath demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample.name }} ${{ matrix.sample.args }}
@@ -225,7 +263,7 @@ jobs:
225263
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
226264
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
227265
aws-region: ${{ secrets.AWS_REGION }}
228-
role-duration-seconds: 10800
266+
role-duration-seconds: 900
229267

230268
- name: Run multistream sample
231269
working-directory: ./build
@@ -310,6 +348,7 @@ jobs:
310348

311349
wsl-sample-checks:
312350
name: WSL ${{ matrix.image }} - ${{ matrix.sample.name }}
351+
needs: prep-assets
313352

314353
strategy:
315354
matrix:
@@ -365,16 +404,23 @@ jobs:
365404
- name: Clone repository
366405
uses: actions/checkout@v4
367406

407+
- name: Download sample.mp4 artifact
408+
uses: actions/download-artifact@v4
409+
with:
410+
name: sample-mp4
411+
path: ./assets
412+
368413
- name: Move repository in WSL
369414
run: |
370415
# Copy to ~/kvs-cpp-repo for simplicity
371416
# Note: Can't move due to no permissions
372417
REPO_NAME=$(basename ${{ github.repository }})
373418
cp -r /mnt/d/a/$REPO_NAME/$REPO_NAME ~/kvs-cpp-repo
419+
mkdir -p ~/kvs-cpp-repo/build
420+
cp -r /mnt/d/a/$REPO_NAME/$REPO_NAME/assets/*.mp4 ~/kvs-cpp-repo/build
374421
375422
- name: Build samples in WSL
376423
run: |
377-
mkdir -p ~/kvs-cpp-repo/build
378424
cd ~/kvs-cpp-repo/build
379425
cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DALIGNED_MEMORY_MODEL=ON -DBUILD_DEPENDENCIES=OFF
380426
make -j$(nproc)
@@ -395,8 +441,6 @@ jobs:
395441
export GST_PLUGIN_PATH=~/kvs-cpp-repo/build
396442
export AWS_KVS_LOG_LEVEL=2
397443
398-
curl -fsSL -o sample.mp4 https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4
399-
400444
# Note: `env.` syntax to reference credentials to have GitHub Actions inject
401445
# the secret values into these environment variables before the command runs,
402446
# since the WSL shell doesn't have access to GitHub's environment variables

0 commit comments

Comments
 (0)