Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Test stand deployment on docker host from the scratch

To deploy test stand on docker host, do the following

1. Unpack build archive

Code Block
languagebash
themeRDark
tar -xzf WCSTestStand-1.XXX.tar.gz

2. Configure main stand parameters in stand.conf/wcs-stand.conf file

  • docker network
  • list test CDN nodes (or leave the only one if separate server testing is planned)
Warning
Out of the box settings should be used as an example only

3. Configure stand nodes in  stand.conf/node_name folders

  • set WCS download links for every WCS node (different builds can be tested on different nodes)
  • set license number for every WCS
  • set every node IP address
  • set WCS parameters for every server
  • set the folder containing media files for publishing if ffmpeg node is planned to be used
Warning

Out of the box settings should be used as an example only

4. Build docker images

Code Block
languagebash
themeRDark
cd images
chmod +x build.sh
sudo ./build.sh
cd ..

5. Launch the stand

Code Block
languagebash
themeRDark
sudo ./wcs-stand start all

Main stand configuration

Main stand configuration parameters are set in stand.conf/wcs-stand.conf file as environment variables:

Code Block
languagebash
themeRDark
CONTAINER_PREFIX=wcs-oam-test
IMAGE_PREFIX=wcs_oam_test
DOCKER_NETWORK=bridge

CDN_NODES=o-test1,o-test2,e-test1,e-test2,e-test3,e-test4,t-test1,t-test2
CDN_ENTRY_POINT=o-test1
FFMPEG_NODE=ffmpeg

WCS_PATH=/usr/local/FlashphonerWebCallServer

Where

  • CONTAINER_PREFIX - container name prefix
  • IMAGE_PREFIX - docker image prefix
  • DOCKER_NETWORK - docker network
  • CDN_NODES - test WCS CDN node names
  • CDN_ENTRY_POINT - CDN entry point node
  • FFMPEG_NODE - node name to publish RTMP streams to CDN using ffmpeg
  • WCS_PATH - WCS installation path

Docker network configuration

To set IP addresses explicitly to test nodes, a separate docker network should be set in main stand configuration file

Code Block
languagebash
themeRDark
DOCKER_NETWORK=stand
DOCKER_SUBNET=172.16.11.1/24
DOCKER_GATEWAY=172.16.11.1
DOCKER_HOST_IFACE=iface

Where

  • DOCKER_NETWORK - docker network
  • DOCKER_SUBNET - docker network IP subnet
  • DOCKER_GATEWAY - docker network gateway
  • DOCKER_HOST_IFACE - external docker host interface

The network should be created using stand-network script

Code Block
languagebash
themeRDark
sudo ./stand-network start

Docker netwrok interface will be set as br-$DOCKER_NETWORK, br-stand for example. Packet forwarding rules will be added to iptables:

Code Block
languagebash
themeRDark
iptables -A FORWARD -i br-$DOCKER_NETWORK -o $DOCKER_HOST_IFACE -j ACCEPT
iptables -A FORWARD -i $DOCKER_HOST_IFACE -o br-$DOCKER_NETWORK -j ACCEPT

Node configuration

Node configuration file `node.conf` should be placed to `stand.conf` folder, to subfolder named as node. The node settings are environment variables depending on node type. Also, there can be addition configuration files placed to node subfolder, those files will be copied to node container

The following parameters are mandatory for all the nodes

  • NODE_IP - node IP address
  • NODE_PORTS - node ports available from docker host and external networks

Additional parameter can be set

  • CHECK_PORT - TCP port to check node availability

WCS node configuration

WCS node configuration file node.conf

Code Block
languagebash
themeRDark
NODE_IP=""
NODE_PORTS=22,554,1935,8080-8084,8443-8445,8888,9091,30000-33000/tcp,30000-33000/udp
JAVA_VERSION=8
JAVA_GC=CMS
JAVA_HEAP=2g
WCS_LICENSE="Put-your-license-key-here"
CDN_ROLE=origin
PRODUCT_LINK="https://flashphoner.com/downloads/builds/WCS/5.2/FlashphonerWebCallServer-5.2.XXX.tar.gz"
PRODUCT_ACCESS_LOGIN=staff
PRODUCT_ACCESS_PASSWORD=X5RLgmrTiK25

Where

  • JAVA_VERSION - JVM version (8 or 12)
  • JAVA_GC - GC to use (CMS or ZGC)
  • JAVA_HEAP - Java heap size in Gb
  • WCS_LICENSE - WCS license number
  • CDN_ROLE - CDN node role
  • PRODUCT_LINK - WCS build download link
  • PRODUCT_ACCESS_LOGIN - login to access WCS download link (for enterprise customers only)
  • PRODUCT_ACCESS_PASSWORD - password to access WCS download link (for enterprise customers only)

Also, the following files can be placed to node configuration folder:

  • flashphoner.properties
  • wcs-core.properties
  • *.sdp
  • cdn_profiles.yml
  • wss.jks

Those files are copied to container "as is", without any changes.

The node CDN role can be set as parameter or can be detected by node name:

  • o-* - Origin

  • t-* - Transcoder

  • e-* - Edge

Also, node CDN role can be set explicitly in flashphoner.properties cile to be copied to the container

RTMP streams publisher node configuration

RTMP stream publisher node configuration file node.conf

Code Block
languagebash
themeRDark
NODE_IP=""
NODE_PORTS=22
MEDIA_MOUNT=/home/media

Where

  • MEDIA_MOUNT - docker host folder to mount to the container

A docker host folder should be set to mount to the container, the *.mp4 files to publish should be placed to this folder

Also, the following files can be placed to node configuration folder:

  • *.mp4 files to copy to MEDIA_MOUNT folder
  • *.sh files to copy to MEDIA_MOUNT folder

RTMP streams publishing to Origin servers

If there are publishing scripts in MEDIA_MOUNT folder, the scripts will be executed for every node with Origin role set by node configuration or node name. In this case, node IP address is passed to the script as parameter.

If node roles are set in flashphoner.properties files only, the publishing scripts are executed without passing node IP address. In this case, node IP addressee to publish shold be set in the script.

If there are *.mp4 files in MEDIA_MOUNT folder, and there are no any publishing script, every media file will be published to every node with Origin role set by node configuration or node name.

Stand management

Stand starting

To launch the stand, the following command should be executed

Code Block
languagebash
themeRDark
sudo ./wcs-stand start all

The stand can be partially launched if necessary. For example, to launch CDN nodes only, use the command

Code Block
languagebash
themeRDark
sudo ./wcs-stand start cdn

Also, certain node names can be listed

Code Block
languagebash
themeRDark
sudo ./wcs-stand start o-test1 e-test1 ffmpeg

CDN launch with stream publishing

Code Block
languagebash
themeRDark
sudo ./wcs-stand start cdn ffmpeg

Stand stopping

To stop the stand use the following command

Code Block
languagebash
themeRDark
sudo ./wcs-stand stop all

If certain nodes are launched, they can be stopped

Code Block
languagebash
themeRDark
sudo ./wcs-stand stop e-test1

Logging

Stand starting and stopping log is written to wcs-stand.log file. Logging level can be set to verbose with -v parameter if necessary:

Code Block
languagebash
themeRDark
sudo ./wcs-stand -v start all

SSH access to the stand containers

All the stand containers are available by SSH (port 22). Private and public SSH keys should be placed to ssh folder, in this case public SSH key will be copied to container:

Code Block
themeRDark
ssh
 |--id_rsa
 |--id_rsa.pub

Containers can be accessed with the following command

Code Block
languagebash
themeRDark
ssh -i ssh/id_rsa root@172.16.11.4

Where

...

Purpose and operation flowchart

Test stand is intended to deploy a separate WCS server or CDN in docker containers to test the following:

  • WCS functions
  • media streams distribution in planned CDN configuration
  • Backend interaction (backend containers should be deployed according to specific test case)

In addition to WCS nodes, RTMP publishing container may be deployed to publish RTMP streams to stand Origin servers from media files specified using ffmpeg


Image Added

Thestand can be deployed in docker default brige network, in this case IP addresses are set dinamically to all the containers, and CDN settings may be formed automatically. However, for deep testing WCS configuration files should be defined for every WCS node, and container IP addresses should be static. In this case, the separate docker network can be created.

While launching the stand, SSH access into the containers can be configured using private key, this allows to manage containers using Ansible for example. In this case, the containers can be accessible not only from docker host, but also from outside, the routing must be set accordingly on access points.

Known issues

1. The stand can be deployed only on Linux Docker host while WCS works only in Linux environment.

2. Currently, only the WCS environment is integrated into stand docker images, WCS builds are downloaded into containers using product links defined. Build archives downloaded are cached.

3. WCS license shoud be set for every WCS node.