Skip to content

WebRTC Load Test production 10m {"asia-southeast1":800} #28

WebRTC Load Test production 10m {"asia-southeast1":800}

WebRTC Load Test production 10m {"asia-southeast1":800} #28

name: Run a WebRTC Load Test
run-name: WebRTC Load Test ${{ inputs.environment }} ${{ inputs.duration }} ${{ inputs.playback-region-viewers-json }}
on:
workflow_dispatch:
inputs:
environment:
description: Environment to load test
required: true
type: choice
options: [ "production", "staging" ]
default: "staging"
duration:
description: Duration of the test
required: true
type: string
default: 5m
streamer-region:
description: Google Cloud region to stream from
type: string
required: true
default: us-central1
playback-region-viewers-json:
description: Map of Google Cloud region to desired number of viewers
type: string
required: true
default: '{"us-central1":20,"europe-west2":20,"asia-southeast1":20}'
streamer-input-file:
description: File to ingest
type: string
required: true
default: 'https://storage.googleapis.com/lp_testharness_assets/countdown_720p_30fps_2sGOP_noBframes_5min.mp4'
playback-protocol:
description: Playback protocol
required: true
type: choice
options: [ "WebRTC", "HLS" ]
default: "WebRTC"
region:
description: "(Optional) Single-node test: Region of node to be tested (also needs pod index below). e.g.: mdw"
type: string
required: false
pod-index:
description: "(Optional) Single-node test: Index of the Catalyst pod to be tested (also needs region above). e.g.: 0"
type: string
required: false
default: ''
jobs:
load-test:
name: Run WebRTC load test
runs-on: ubuntu-latest
container:
image: livepeer/webrtc-load-tester:master
steps:
- name: calculate-dates-and-times
id: timestamp
uses: lee-dohm/[email protected]
with:
format: ""
- name: Discord start notification
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: ${{ github.triggering_actor }}
DISCORD_EMBEDS: >
[{
"title": "WebRTC load test starting",
"description": "A load test is starting (env=${{ inputs.environment }})",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"timestamp": "${{ steps.timestamp.outputs.date }}",
"author": {
"name": "${{ github.triggering_actor }}",
"url": "${{ github.server_url }}/${{ github.triggering_actor }}",
"icon_url": "${{ github.server_url }}/${{ github.triggering_actor }}.png?s=32"
},
"fields": [{
"name": "Environment",
"value": "${{ inputs.environment }}",
"inline": true
}, {
"name": "Triggered timestamp",
"value": "${{ steps.timestamp.outputs.date }}",
"inline": true
}, {
"name": "Duration",
"value": "${{ inputs.duration }}",
"inline": true
}, {
"name": "Streamer region",
"value": "${{ inputs.streamer-region }}",
"inline": true
}, {
"name": "Viewers regions",
"value": ${{ toJSON(inputs.playback-region-viewers-json) }},
"inline": true
}, {
"name": "Single-node target",
"value": "${{ inputs.region }}-${{ inputs.pod-index }}",
"inline": true
}]
}]
- name: Prepare environment
id: env
run: |
# Base configs
if [ "${{ inputs.environment }}" = "production" ]; then
API_SERVER="livepeer.com"
API_TOKEN="${{ secrets.LOAD_TEST_PROD_API_KEY }}"
STREAMER_BASE_URL="rtmp://rtmp.livepeer.com/live/"
PLAYBACK_BASE_URL="https://lvpr.tv/"
else
API_SERVER="livepeer.monster"
API_TOKEN="${{ secrets.LOAD_TEST_STAGING_API_KEY }}"
STREAMER_BASE_URL="rtmp://rtmp.livepeer.monster/live/"
PLAYBACK_BASE_URL="https://monster.lvpr.tv/"
fi
# Override with inputs
if [ -n "${{ inputs.region }}" ] && [ -n "${{ inputs.pod-index }}" ]; then
if [ "${{ inputs.environment }}" = "production" ]; then
STREAMER_BASE_URL="rtmp://${{ inputs.region }}-prod-catalyst-${{ inputs.pod-index }}.lp-playback.studio/live"
PLAYBACK_MANIFEST_URL="https://${{ inputs.region }}-prod-catalyst-${{ inputs.pod-index }}.lp-playback.studio/webrtc/video+%s"
if [ "${{ inputs.playback-protocol }}" = "HLS" ]; then
PLAYBACK_BASE_URL="${PLAYBACK_BASE_URL}?lowLatency=false"
PLAYBACK_MANIFEST_URL="https://${{ inputs.region }}-prod-catalyst-${{ inputs.pod-index }}.lp-playback.studio/hls/video+%s/index.m3u8"
fi
else
STREAMER_BASE_URL="rtmp://${{ inputs.region }}-staging-staging-catalyst-${{ inputs.pod-index }}.livepeer.monster/live"
PLAYBACK_MANIFEST_URL="https://${{ inputs.region }}-staging-staging-catalyst-${{ inputs.pod-index }}.livepeer.monster/webrtc/video+%s"
if [ "${{ inputs.playback-protocol }}" = "HLS" ]; then
PLAYBACK_BASE_URL="${PLAYBACK_BASE_URL}?lowLatency=false"
PLAYBACK_MANIFEST_URL="https://${{ inputs.region }}-prod-catalyst-${{ inputs.pod-index }}.livepeer.monster/hls/video+%s/index.m3u8"
fi
fi
fi
echo "::set-output name=api-server::${API_SERVER}"
echo "::set-output name=api-token::${API_TOKEN}"
echo "::set-output name=streamer-base-url::${STREAMER_BASE_URL}"
echo "::set-output name=playback-base-url::${PLAYBACK_BASE_URL}"
echo "::set-output name=playback-manifest-url::${PLAYBACK_MANIFEST_URL}"
- name: Load Test
run: webrtc-load-tester orchestrator
env:
LT_WEBRTC_DURATION: ${{ inputs.duration }}
LT_WEBRTC_API_SERVER: ${{ steps.env.outputs.api-server }}
LT_WEBRTC_API_TOKEN: ${{ steps.env.outputs.api-token }}
LT_WEBRTC_STREAMER_REGION: ${{ inputs.streamer-region }}
LT_WEBRTC_STREAMER_BASE_URL: ${{ steps.env.outputs.streamer-base-url }}
LT_WEBRTC_STREAMER_INPUT_FILE: ${{ inputs.streamer-input-file }}
LT_WEBRTC_PLAYBACK_BASE_URL: ${{ steps.env.outputs.playback-base-url }}
LT_WEBRTC_PLAYBACK_MANIFEST_URL: "${{ steps.env.outputs.playback-manifest-url }}"
LT_WEBRTC_PLAYBACK_VIEWERS_PER_WORKER: 10
LT_WEBRTC_PLAYBACK_VIEWERS_PER_CPU: 2
LT_WEBRTC_PLAYBACK_MEMORY_PER_VIEWER_MIB: 400
LT_WEBRTC_PLAYBACK_REGION_VIEWERS_JSON: '${{ inputs.playback-region-viewers-json }}'
LT_WEBRTC_PLAYBACK_BASE_SCREENSHOT_FOLDER_OS: ${{ secrets.LOAD_TEST_SCREENSHOT_FOLDER_OS }}
LT_WEBRTC_GOOGLE_CREDENTIALS_JSON: '${{ secrets.LOAD_TEST_GOOGLE_CREDENTIALS_JSON }}'
- name: Discord finish notification
uses: Ilshidur/[email protected]
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: ${{ github.triggering_actor }}
DISCORD_EMBEDS: >
[{
"title": " WebRTC load test finished successfully",
"description": "The load test (env=${{ inputs.environment }}) has finished successfully",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"color": 24576,
"author": {
"name": "${{ github.triggering_actor }}",
"url": "${{ github.server_url }}/${{ github.triggering_actor }}",
"icon_url": "${{ github.server_url }}/${{ github.triggering_actor }}.png?s=32"
},
"fields": [{
"name": "Environment",
"value": "${{ inputs.environment }}",
"inline": true
}, {
"name": "Triggered timestamp",
"value": "${{ steps.timestamp.outputs.date }}",
"inline": true
}]
}]
- name: Discord failure notification
uses: Ilshidur/[email protected]
if: failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: ${{ github.triggering_actor }}
DISCORD_EMBEDS: >
[{
"title": "WebRTC load test has failed! (env=${{ inputs.environment }})",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"color": 8388608,
"author": {
"name": "${{ github.triggering_actor }}",
"url": "${{ github.server_url }}/${{ github.triggering_actor }}",
"icon_url": "${{ github.server_url }}/${{ github.triggering_actor }}.png?s=32"
},
"fields": [{
"name": "Environment",
"value": "${{ inputs.environment }}",
"inline": true
}, {
"name": "Triggered timestamp",
"value": "${{ steps.timestamp.outputs.date }}",
"inline": true
}]
}]
- name: Discord cancel notification
uses: Ilshidur/[email protected]
if: cancelled()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: ${{ github.triggering_actor }}
DISCORD_EMBEDS: >
[{
"title": "WebRTC load test was cancelled! (env=${{ inputs.environment }})",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"color": 11778048,
"author": {
"name": "${{ github.triggering_actor }}",
"url": "${{ github.server_url }}/${{ github.triggering_actor }}",
"icon_url": "${{ github.server_url }}/${{ github.triggering_actor }}.png?s=32"
},
"fields": [{
"name": "Environment",
"value": "${{ inputs.environment }}",
"inline": true
}, {
"name": "Triggered timestamp",
"value": "${{ steps.timestamp.outputs.date }}",
"inline": true
}]
}]