From 2fda10f2bd57433259b40ca941044150b3365e30 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 11 Dec 2023 12:59:14 +0300 Subject: [PATCH 01/67] Add CI/CD: upgrade.sh validation test --- .github/workflows/upgrade-sh-validation.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/upgrade-sh-validation.yml diff --git a/.github/workflows/upgrade-sh-validation.yml b/.github/workflows/upgrade-sh-validation.yml new file mode 100644 index 00000000..fa35737b --- /dev/null +++ b/.github/workflows/upgrade-sh-validation.yml @@ -0,0 +1,19 @@ +name: Ant Media Server upgrade.sh Validation Test +on: [push] + +jobs: + install_and_upgrade_ant_media_server: + runs-on: ubuntu-latest + name: Install Previous Version of Ant Media Server + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Install Ant Media Server + run: | + curl --progress-bar -o ams_community.zip -L "$(curl -s -H "Accept: application/vnd.github+json" https://api.github.com/repos/ant-media/Ant-Media-Server/releases | jq -r '.[1].assets[0].browser_download_url')" + wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh + sudo bash ./install_ant-media-server.sh -i ams_community.zip + sleep 30 + - name: Upgrade Ant Media Server + run: | + DIR='/usr/local/antmedia/' sudo bash ./upgrade.sh From f5703fb6743ba42e88ab7cb91e0d50d4548f9af7 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 11 Dec 2023 13:38:36 +0300 Subject: [PATCH 02/67] Add Script URL as an environment --- .github/workflows/upgrade-sh-validation.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/upgrade-sh-validation.yml b/.github/workflows/upgrade-sh-validation.yml index fa35737b..f56ae9dd 100644 --- a/.github/workflows/upgrade-sh-validation.yml +++ b/.github/workflows/upgrade-sh-validation.yml @@ -4,6 +4,8 @@ on: [push] jobs: install_and_upgrade_ant_media_server: runs-on: ubuntu-latest + env: + SCRIPT_URL: https://raw.githubusercontent.com/ant-media/Ant-Media-Server/master/src/main/server/upgrade.sh name: Install Previous Version of Ant Media Server steps: - name: Check out repository code @@ -16,4 +18,5 @@ jobs: sleep 30 - name: Upgrade Ant Media Server run: | + wget ${{ SCRIPT_URL }} DIR='/usr/local/antmedia/' sudo bash ./upgrade.sh From a4a1c8076a1dce88be9afe7b528c289312621c13 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 11 Dec 2023 13:42:23 +0300 Subject: [PATCH 03/67] Create check-marketplace-jwt-token.yml --- .../workflows/check-marketplace-jwt-token.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/check-marketplace-jwt-token.yml diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml new file mode 100644 index 00000000..dcaf1f46 --- /dev/null +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -0,0 +1,26 @@ +name: Ant Media Server upgrade.sh Validation Test +on: [push] + +jobs: + install_and_upgrade_ant_media_server: + runs-on: ubuntu-latest + env: + SCRIPT_URL: https://raw.githubusercontent.com/ant-media/Ant-Media-Server/adc6096c54ee19e0f9aa0ee4e65e1495883ffb27/src/main/server/conf/jwt_marketplace_check.sh + name: Install Previous Version of Ant Media Server + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Install Ant Media Server + run: | + curl --progress-bar -o ant.zip ${{ secrets.LATEST_URL }} + wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh + sudo bash ./install_ant-media-server.sh -i ant.zip + sleep 30 + - name: Upgrade Ant Media Server + run: | + sudo wget -P /usr/local/antmedia/conf/ ${{ env.SCRIPT_URL }} + sudo -s + source /usr/local/antmedia/conf/jwt_marketplace_check.sh + result_marketplace=$(check_marketplace) + echo $result_marketplace + From d30015584302f0c1a202e60ace8e9f99eac59bf3 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 11 Dec 2023 13:44:54 +0300 Subject: [PATCH 04/67] Fix names --- .github/workflows/check-marketplace-jwt-token.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index dcaf1f46..4f33aa17 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest env: SCRIPT_URL: https://raw.githubusercontent.com/ant-media/Ant-Media-Server/adc6096c54ee19e0f9aa0ee4e65e1495883ffb27/src/main/server/conf/jwt_marketplace_check.sh - name: Install Previous Version of Ant Media Server + name: Install Ant Media Server steps: - name: Check out repository code uses: actions/checkout@v3 @@ -16,7 +16,7 @@ jobs: wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh sudo bash ./install_ant-media-server.sh -i ant.zip sleep 30 - - name: Upgrade Ant Media Server + - name: Test JWT run: | sudo wget -P /usr/local/antmedia/conf/ ${{ env.SCRIPT_URL }} sudo -s From 0023c96200612be827e9008f1ab56bff3a8cd3d0 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 11 Dec 2023 13:45:41 +0300 Subject: [PATCH 05/67] Fix description and Job names --- .github/workflows/check-marketplace-jwt-token.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 4f33aa17..274f19d9 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -2,11 +2,11 @@ name: Ant Media Server upgrade.sh Validation Test on: [push] jobs: - install_and_upgrade_ant_media_server: + install_ant_media_server: runs-on: ubuntu-latest env: SCRIPT_URL: https://raw.githubusercontent.com/ant-media/Ant-Media-Server/adc6096c54ee19e0f9aa0ee4e65e1495883ffb27/src/main/server/conf/jwt_marketplace_check.sh - name: Install Ant Media Server + name: Install Ant Media Server and Check JWT Token steps: - name: Check out repository code uses: actions/checkout@v3 From dec72fe8a4ade81bba756fe31c5e5d11281eb906 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 11 Dec 2023 13:45:56 +0300 Subject: [PATCH 06/67] Update check-marketplace-jwt-token.yml --- .github/workflows/check-marketplace-jwt-token.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 274f19d9..e4d64f3e 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -1,4 +1,4 @@ -name: Ant Media Server upgrade.sh Validation Test +name: Ant Media Server JWT Validation Test on: [push] jobs: From bfc2f9f453a2294e96024dda489a4c36cd3e3917 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Sun, 3 Mar 2024 10:16:18 +0300 Subject: [PATCH 07/67] Update check-marketplace-jwt-token.yml --- .../workflows/check-marketplace-jwt-token.yml | 57 ++++++++++++------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index e4d64f3e..af707e5c 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -1,26 +1,39 @@ -name: Ant Media Server JWT Validation Test -on: [push] +name: Marketplace SSL Test + +on: + schedule: + - cron: '0 0 * * 1' jobs: - install_ant_media_server: + run_build: + name: Marketplace SSL Test runs-on: ubuntu-latest - env: - SCRIPT_URL: https://raw.githubusercontent.com/ant-media/Ant-Media-Server/adc6096c54ee19e0f9aa0ee4e65e1495883ffb27/src/main/server/conf/jwt_marketplace_check.sh - name: Install Ant Media Server and Check JWT Token + steps: - - name: Check out repository code - uses: actions/checkout@v3 - - name: Install Ant Media Server - run: | - curl --progress-bar -o ant.zip ${{ secrets.LATEST_URL }} - wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh - sudo bash ./install_ant-media-server.sh -i ant.zip - sleep 30 - - name: Test JWT - run: | - sudo wget -P /usr/local/antmedia/conf/ ${{ env.SCRIPT_URL }} - sudo -s - source /usr/local/antmedia/conf/jwt_marketplace_check.sh - result_marketplace=$(check_marketplace) - echo $result_marketplace - + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Run enable_ssl.sh for marketplace + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.OVH_REMOTE_HOST }} + username: ${{ secrets.OVH_REMOTE_USERNAME }} + key: ${{ secrets.OVH_SSH_PRIVATE_KEY }} + port: ${{ secrets.OVH_REMOTE_PORT }} + script: | + SECRET_KEY=$(openssl rand -base64 32 | head -c 32) + sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties + sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties + sudo service antmedia restart + sudo wget -P /usr/local/antmedia/conf/ https://raw.githubusercontent.com/ant-media/Ant-Media-Server/72bbc6735f9da3c53c5590d87c122baf64e32c7e/src/main/server/conf/jwt_marketplace_check.sh + sudo wget -O /usr/local/antmedia/enable_ssl.sh https://raw.githubusercontent.com/ant-media/Ant-Media-Server/72bbc6735f9da3c53c5590d87c122baf64e32c7e/src/main/server/enable_ssl.sh + sudo bash -x /usr/local/antmedia/enable_ssl.sh + - name: Run enable_ssl.sh for existing domain + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.OVH_REMOTE_HOST }} + username: ${{ secrets.OVH_REMOTE_USERNAME }} + key: ${{ secrets.OVH_SSH_PRIVATE_KEY }} + port: ${{ secrets.OVH_REMOTE_PORT }} + script: | + sudo bash /usr/local/antmedia/enable_ssl.sh -d ${{ secrets.OVH_REMOTE_HOST }} From 0d9b7bc356125df94b61e8ddba1200a1bd73b0f4 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 4 Mar 2024 09:57:52 +0300 Subject: [PATCH 08/67] Update check-marketplace-jwt-token.yml --- .github/workflows/check-marketplace-jwt-token.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index af707e5c..8213d7bb 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -27,7 +27,7 @@ jobs: sudo service antmedia restart sudo wget -P /usr/local/antmedia/conf/ https://raw.githubusercontent.com/ant-media/Ant-Media-Server/72bbc6735f9da3c53c5590d87c122baf64e32c7e/src/main/server/conf/jwt_marketplace_check.sh sudo wget -O /usr/local/antmedia/enable_ssl.sh https://raw.githubusercontent.com/ant-media/Ant-Media-Server/72bbc6735f9da3c53c5590d87c122baf64e32c7e/src/main/server/enable_ssl.sh - sudo bash -x /usr/local/antmedia/enable_ssl.sh + sudo bash /usr/local/antmedia/enable_ssl.sh - name: Run enable_ssl.sh for existing domain uses: appleboy/ssh-action@master with: From f25d34bec5535c26705bf0c4fc1e8c60a69ceffe Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 4 Mar 2024 10:13:22 +0300 Subject: [PATCH 09/67] Add default server secret key --- init.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.sh b/init.sh index dadd5958..4a90ef13 100644 --- a/init.sh +++ b/init.sh @@ -46,4 +46,8 @@ then fi touch $INITIALIZED + ## Add default ServerSecretKey + SECRET_KEY=$(openssl rand -base64 32 | head -c 32) + sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties + sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties fi From 3e284e703a6fe22c9471a41c132f2ae94bfb1312 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 5 Mar 2024 22:56:51 +0300 Subject: [PATCH 10/67] Add GPU to the main template --- .../antmedia-aws-autoscale-template.yaml | 70 +++++++++++++++++-- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index 744d747f..f26a6543 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -83,6 +83,25 @@ Parameters: - r3.2xlarge - r3.4xlarge - r3.8xlarge + - p2.xlarge + - p2.8xlarge + - p2.16xlarge + - p3.2xlarge + - p3.8xlarge + - p3.16xlarge + - p3dn.24xlarge + - g4dn.xlarge + - g4dn.2xlarge + - g4dn.4xlarge + - g4dn.8xlarge + - g4dn.12xlarge + - g4dn.16xlarge + - g5.xlarge + - g5.2xlarge + - g5.4xlarge + - g5.8xlarge + - g5.12xlarge + - g5.16xlarge ConstraintDescription: must be a valid EC2 instance type. OriginInstanceType: @@ -143,6 +162,25 @@ Parameters: - r3.2xlarge - r3.4xlarge - r3.8xlarge + - p2.xlarge + - p2.8xlarge + - p2.16xlarge + - p3.2xlarge + - p3.8xlarge + - p3.16xlarge + - p3dn.24xlarge + - g4dn.xlarge + - g4dn.2xlarge + - g4dn.4xlarge + - g4dn.8xlarge + - g4dn.12xlarge + - g4dn.16xlarge + - g5.xlarge + - g5.2xlarge + - g5.4xlarge + - g5.8xlarge + - g5.12xlarge + - g5.16xlarge ConstraintDescription: must be a valid EC2 instance type. MongoDBInstanceType: @@ -232,11 +270,22 @@ Parameters: Type: String Default: '' DiskSize: - Default: '10' + Default: '16' Description: Disk size of instances Type: Number - MinValue: '10' + MinValue: '16' MaxValue: '1000' + GPUImage: + Description: If you check True, you must select one of the g and p cloud server types. + Default: false + Type: String + AllowedValues: + - true + - false +Conditions: + UseGPUImage: !Equals + - !Ref GPUImage + - true Resources: DescribeImagesRole: @@ -332,10 +381,19 @@ Resources: Type: Custom::FindAMI Properties: ServiceToken: !Sub ${AMSGetLatestAMI.Arn} - ProductId: "4wh7rhpic3wfwamyp5905tsbt" - Name: "AntMedia-AWS-Marketplace-EE-*" + ProductId: "8kf9kapq2qbo37fuekp8k7o6r" + Name: "AntMedia-AWS-Marketplace-GPU-*" Architecture: "x86_64" + AntMediaGPUAmi: + Condition: UseGPUImage + Type: Custom::FindAMI + Properties: + ServiceToken: !Sub ${AMSGetLatestAMI.Arn} + ProductId: "8kf9kapq2qbo37fuekp8k7o6r" + Name: "AntMedia-AWS-Marketplace-GPU-*" + Architecture: "x86_64" + UbuntuAmi: Type: Custom::FindAMI Properties: @@ -518,7 +576,7 @@ Resources: LaunchTemplateData: InstanceType: !Ref OriginInstanceType KeyName: !Ref KeyName - ImageId: !Ref AntMediaAmi + ImageId: !If [UseGPUImage, !Ref AntMediaGPUAmi, !Ref AntMediaAmi] SecurityGroupIds: - !GetAtt "InstanceSecurityGroup.GroupId" BlockDeviceMappings: @@ -594,7 +652,7 @@ Resources: LaunchTemplateData: InstanceType: !Ref EdgeInstanceType KeyName: !Ref KeyName - ImageId: !Ref AntMediaAmi + ImageId: !If [UseGPUImage, !Ref AntMediaGPUAmi, !Ref AntMediaAmi] SecurityGroupIds: - !GetAtt "InstanceSecurityGroup.GroupId" BlockDeviceMappings: From 44d841805290d69acfb45e6acfbc31e31d9a0983 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 5 Mar 2024 23:00:13 +0300 Subject: [PATCH 11/67] Fix description --- cloudformation/antmedia-aws-autoscale-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index f26a6543..588f7e4b 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -276,7 +276,7 @@ Parameters: MinValue: '16' MaxValue: '1000' GPUImage: - Description: If you check True, you must select one of the g and p cloud server types. + Description: If you select True, you must select one of the g and p instance types. Default: false Type: String AllowedValues: From 440fb193cc16d61f008cb500dae88e37c7f43620 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 5 Mar 2024 23:05:23 +0300 Subject: [PATCH 12/67] Fix description --- cloudformation/antmedia-aws-autoscale-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index 588f7e4b..99364a77 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -276,7 +276,7 @@ Parameters: MinValue: '16' MaxValue: '1000' GPUImage: - Description: If you select True, you must select one of the g and p instance types. + Description: Select "true" to install the GPU Image. You must select one of the g and p instance types. Default: false Type: String AllowedValues: From 0e95a6e6aedc28917424291d20da2dda8718d88f Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Wed, 6 Mar 2024 09:48:38 +0300 Subject: [PATCH 13/67] Update check-marketplace-jwt-token.yml --- .github/workflows/check-marketplace-jwt-token.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 8213d7bb..b275efdc 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -25,8 +25,6 @@ jobs: sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart - sudo wget -P /usr/local/antmedia/conf/ https://raw.githubusercontent.com/ant-media/Ant-Media-Server/72bbc6735f9da3c53c5590d87c122baf64e32c7e/src/main/server/conf/jwt_marketplace_check.sh - sudo wget -O /usr/local/antmedia/enable_ssl.sh https://raw.githubusercontent.com/ant-media/Ant-Media-Server/72bbc6735f9da3c53c5590d87c122baf64e32c7e/src/main/server/enable_ssl.sh sudo bash /usr/local/antmedia/enable_ssl.sh - name: Run enable_ssl.sh for existing domain uses: appleboy/ssh-action@master From 38cafc8b64fd922e178a29ca5861a151c15d6b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20O=C4=9Fuz=20Mermerkaya?= Date: Wed, 6 Mar 2024 11:07:48 +0300 Subject: [PATCH 14/67] Update check-marketplace-jwt-token.yml Add comments --- .github/workflows/check-marketplace-jwt-token.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index b275efdc..7f704f1a 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -1,5 +1,6 @@ name: Marketplace SSL Test +#run tests on schedule because we don't want to generate a subdomain everytime on: schedule: - cron: '0 0 * * 1' @@ -16,10 +17,12 @@ jobs: - name: Run enable_ssl.sh for marketplace uses: appleboy/ssh-action@master with: + #OVH_REMOTE_HOST has marketplace version deployed host: ${{ secrets.OVH_REMOTE_HOST }} username: ${{ secrets.OVH_REMOTE_USERNAME }} key: ${{ secrets.OVH_SSH_PRIVATE_KEY }} port: ${{ secrets.OVH_REMOTE_PORT }} + # If the version is not marketplace, following enable_ssl.sh script fails script: | SECRET_KEY=$(openssl rand -base64 32 | head -c 32) sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties @@ -33,5 +36,6 @@ jobs: username: ${{ secrets.OVH_REMOTE_USERNAME }} key: ${{ secrets.OVH_SSH_PRIVATE_KEY }} port: ${{ secrets.OVH_REMOTE_PORT }} + #restore the old domain to not encounter any issue script: | sudo bash /usr/local/antmedia/enable_ssl.sh -d ${{ secrets.OVH_REMOTE_HOST }} From 6ac823046697715855e6797c584997b56f0c2042 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 15:30:51 +0300 Subject: [PATCH 15/67] Improve test code for enable.sh marketplace edition --- .../workflows/check-marketplace-jwt-token.yml | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 7f704f1a..1a71cb3f 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -1,9 +1,12 @@ name: Marketplace SSL Test #run tests on schedule because we don't want to generate a subdomain everytime -on: - schedule: - - cron: '0 0 * * 1' +#on: +# schedule: +# - cron: '0 0 * * 1' + +on: [push] + jobs: run_build: @@ -28,7 +31,17 @@ jobs: sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart - sudo bash /usr/local/antmedia/enable_ssl.sh + HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh | grep 'You can use this url: ' | grep -o 'https://[^ ]*') + sleep 20 + status_code=$(curl -o /dev/null -s -I -w "%{http_code}" "$HTTPS_URL") + if [ "$status_code" -eq 200 ]; then + echo "URL($HTTPS_URL) is working: $status_code" + else + echo "URL is not working: $status_code" + exit 1; + fi + + - name: Run enable_ssl.sh for existing domain uses: appleboy/ssh-action@master with: From e70697592d597fe306d8f3386fae5b1d7c3cfca7 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 15:33:51 +0300 Subject: [PATCH 16/67] Log the https url --- .github/workflows/check-marketplace-jwt-token.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 1a71cb3f..832d766d 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -37,7 +37,7 @@ jobs: if [ "$status_code" -eq 200 ]; then echo "URL($HTTPS_URL) is working: $status_code" else - echo "URL is not working: $status_code" + echo "URL($HTTPS_URL) is not working: $status_code" exit 1; fi From 77cde755bca0dfd10dbb195beb06421b82537a03 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 15:38:06 +0300 Subject: [PATCH 17/67] Log the output fully --- .github/workflows/check-marketplace-jwt-token.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 832d766d..71c98f0f 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -32,6 +32,7 @@ jobs: sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh | grep 'You can use this url: ' | grep -o 'https://[^ ]*') + echo "HTTPS_URL -> $HTTPS_URL" sleep 20 status_code=$(curl -o /dev/null -s -I -w "%{http_code}" "$HTTPS_URL") if [ "$status_code" -eq 200 ]; then From cb0020fba4e748761ebe8bb2194eef31f5c00481 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 15:39:03 +0300 Subject: [PATCH 18/67] Log the enable_ssl output --- .github/workflows/check-marketplace-jwt-token.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 71c98f0f..4ce0d894 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -31,7 +31,7 @@ jobs: sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart - HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh | grep 'You can use this url: ' | grep -o 'https://[^ ]*') + HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh) # | grep 'You can use this url: ' | grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 status_code=$(curl -o /dev/null -s -I -w "%{http_code}" "$HTTPS_URL") From 446e0a96810a1f145c3100f7792fa5d4e7b133ce Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 15:44:00 +0300 Subject: [PATCH 19/67] Log remote host --- .github/workflows/check-marketplace-jwt-token.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 4ce0d894..bdbedf7c 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -31,6 +31,7 @@ jobs: sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart + echo "Remote host: ${{ secrets.OVH_REMOTE_HOST }}" HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh) # | grep 'You can use this url: ' | grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 From 4abcb04a45f484d2a057d800a48a00851f51ff32 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 15:46:59 +0300 Subject: [PATCH 20/67] Write secret key for validity check --- .github/workflows/check-marketplace-jwt-token.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index bdbedf7c..d9f133fd 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -30,6 +30,7 @@ jobs: SECRET_KEY=$(openssl rand -base64 32 | head -c 32) sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties + echo "SECRET_KEY -> $SECRET_KEY" sudo service antmedia restart echo "Remote host: ${{ secrets.OVH_REMOTE_HOST }}" HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh) # | grep 'You can use this url: ' | grep -o 'https://[^ ]*') From e4d635329795bbee4546eae7082cc48ec6baaa62 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 15:53:41 +0300 Subject: [PATCH 21/67] Output the enable_ssl.sh because it's not working --- .github/workflows/check-marketplace-jwt-token.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index d9f133fd..8ac020c9 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -30,9 +30,8 @@ jobs: SECRET_KEY=$(openssl rand -base64 32 | head -c 32) sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties - echo "SECRET_KEY -> $SECRET_KEY" sudo service antmedia restart - echo "Remote host: ${{ secrets.OVH_REMOTE_HOST }}" + cat /usr/local/antmedia/enable_ssl.sh HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh) # | grep 'You can use this url: ' | grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 From 81cdf6ea7834573c916848f755fb61a3c59ec701 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:14:59 +0300 Subject: [PATCH 22/67] cat jwt_marketplace_check.sh file --- .github/workflows/check-marketplace-jwt-token.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 8ac020c9..9fe968a4 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -32,6 +32,7 @@ jobs: sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart cat /usr/local/antmedia/enable_ssl.sh + cat /usr/local/antmedia/conf/jwt_marketplace_check.sh HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh) # | grep 'You can use this url: ' | grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 From 6739305e93a1bf2b4e96af674aa3c1a07b24768d Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:18:38 +0300 Subject: [PATCH 23/67] Enable grep again --- .github/workflows/check-marketplace-jwt-token.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 9fe968a4..e7c2edea 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -33,7 +33,7 @@ jobs: sudo service antmedia restart cat /usr/local/antmedia/enable_ssl.sh cat /usr/local/antmedia/conf/jwt_marketplace_check.sh - HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh) # | grep 'You can use this url: ' | grep -o 'https://[^ ]*') + HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh | grep 'You can use this url: ' | grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 status_code=$(curl -o /dev/null -s -I -w "%{http_code}" "$HTTPS_URL") From d132eb34a165dd1bb0229995a71d0421b9644200 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:21:40 +0300 Subject: [PATCH 24/67] Run bash command and log output again --- .github/workflows/check-marketplace-jwt-token.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index e7c2edea..2363925b 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -27,13 +27,16 @@ jobs: port: ${{ secrets.OVH_REMOTE_PORT }} # If the version is not marketplace, following enable_ssl.sh script fails script: | + bash SECRET_KEY=$(openssl rand -base64 32 | head -c 32) sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart cat /usr/local/antmedia/enable_ssl.sh cat /usr/local/antmedia/conf/jwt_marketplace_check.sh - HTTPS_URL=$(sudo bash /usr/local/antmedia/enable_ssl.sh | grep 'You can use this url: ' | grep -o 'https://[^ ]*') + OUTPUT=$(sudo bash /usr/local/antmedia/enable_ssl.sh) + echo "$OUTPUT"; + HTTPS_URL=$(echo $OUTPUT | grep 'You can use this url: '| grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 status_code=$(curl -o /dev/null -s -I -w "%{http_code}" "$HTTPS_URL") From 046d4d35c0a73145c80d64b4ffbbd79fdfb1b899 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:23:52 +0300 Subject: [PATCH 25/67] Wait before running enable_ssl to let the server restart --- .github/workflows/check-marketplace-jwt-token.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 2363925b..48bb6b82 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -32,6 +32,7 @@ jobs: sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart + sleep 20 cat /usr/local/antmedia/enable_ssl.sh cat /usr/local/antmedia/conf/jwt_marketplace_check.sh OUTPUT=$(sudo bash /usr/local/antmedia/enable_ssl.sh) From 6e93761a066dedd8a4713c763a19388b9b8b522a Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:30:15 +0300 Subject: [PATCH 26/67] Remove cat commands --- .github/workflows/check-marketplace-jwt-token.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 48bb6b82..4f8937de 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -33,10 +33,8 @@ jobs: sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart sleep 20 - cat /usr/local/antmedia/enable_ssl.sh - cat /usr/local/antmedia/conf/jwt_marketplace_check.sh OUTPUT=$(sudo bash /usr/local/antmedia/enable_ssl.sh) - echo "$OUTPUT"; + echo "OUTPUT -> $OUTPUT"; HTTPS_URL=$(echo $OUTPUT | grep 'You can use this url: '| grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 From a787e7a81256488714a1e91959767a207842b164 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:36:40 +0300 Subject: [PATCH 27/67] Add double quota for parsing --- .github/workflows/check-marketplace-jwt-token.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 4f8937de..64e6c938 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -33,9 +33,9 @@ jobs: sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart sleep 20 - OUTPUT=$(sudo bash /usr/local/antmedia/enable_ssl.sh) + OUTPUT=$(sudo /usr/local/antmedia/enable_ssl.sh) echo "OUTPUT -> $OUTPUT"; - HTTPS_URL=$(echo $OUTPUT | grep 'You can use this url: '| grep -o 'https://[^ ]*') + HTTPS_URL=$(echo "$OUTPUT" | grep 'You can use this url: '| grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" sleep 20 status_code=$(curl -o /dev/null -s -I -w "%{http_code}" "$HTTPS_URL") From a12a47feeea86d755e2e9658340e8dc2d5884a11 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:39:34 +0300 Subject: [PATCH 28/67] Remove bash command --- .github/workflows/check-marketplace-jwt-token.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 64e6c938..927ed1f4 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -27,13 +27,12 @@ jobs: port: ${{ secrets.OVH_REMOTE_PORT }} # If the version is not marketplace, following enable_ssl.sh script fails script: | - bash SECRET_KEY=$(openssl rand -base64 32 | head -c 32) sudo sed -i "/^server.jwtServerControlEnabled=/s|.*|server.jwtServerControlEnabled=true|" /usr/local/antmedia/conf/red5.properties sudo sed -i "/^server.jwtServerSecretKey=/s|.*|server.jwtServerSecretKey=$SECRET_KEY|" /usr/local/antmedia/conf/red5.properties sudo service antmedia restart sleep 20 - OUTPUT=$(sudo /usr/local/antmedia/enable_ssl.sh) + OUTPUT=$(sudo bash /usr/local/antmedia/enable_ssl.sh) echo "OUTPUT -> $OUTPUT"; HTTPS_URL=$(echo "$OUTPUT" | grep 'You can use this url: '| grep -o 'https://[^ ]*') echo "HTTPS_URL -> $HTTPS_URL" From d689781eea6c8245763d3325c996920019534b49 Mon Sep 17 00:00:00 2001 From: mekya Date: Wed, 6 Mar 2024 16:42:21 +0300 Subject: [PATCH 29/67] Re-enable schedule --- .github/workflows/check-marketplace-jwt-token.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-marketplace-jwt-token.yml b/.github/workflows/check-marketplace-jwt-token.yml index 927ed1f4..18fbcfb5 100644 --- a/.github/workflows/check-marketplace-jwt-token.yml +++ b/.github/workflows/check-marketplace-jwt-token.yml @@ -1,11 +1,10 @@ name: Marketplace SSL Test #run tests on schedule because we don't want to generate a subdomain everytime -#on: -# schedule: -# - cron: '0 0 * * 1' +on: + schedule: + - cron: '0 0 * * 1' -on: [push] jobs: From a3d6190d8e2ff74420f71adf6ae591c05153f0ac Mon Sep 17 00:00:00 2001 From: mekya Date: Thu, 7 Mar 2024 19:22:44 +0300 Subject: [PATCH 30/67] Confirm the version differences in upgrade --- .github/workflows/upgrade-sh-validation.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upgrade-sh-validation.yml b/.github/workflows/upgrade-sh-validation.yml index f56ae9dd..a97b0d4d 100644 --- a/.github/workflows/upgrade-sh-validation.yml +++ b/.github/workflows/upgrade-sh-validation.yml @@ -16,7 +16,17 @@ jobs: wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh sudo bash ./install_ant-media-server.sh -i ams_community.zip sleep 30 - - name: Upgrade Ant Media Server - run: | + PREVIOUS_VERSION=$(unzip -p /usr/local/antmedia/ant-media-server.jar | grep -a "Implementation-Version"|cut -d' ' -f2 | tr -d '\r') + echo "Previous Version: $PREVIOUS_VERSION" wget ${{ SCRIPT_URL }} DIR='/usr/local/antmedia/' sudo bash ./upgrade.sh + wget http://localhost:5080 -O index.html + CURRENT_VERSION=$(unzip -p /usr/local/antmedia/ant-media-server.jar | grep -a "Implementation-Version"|cut -d' ' -f2 | tr -d '\r') + (if [ "$(printf "%s\n" "$PREVIOUS_VERSION" "$CURRENT_VERSION" | sort -V | tail -n 1)" = "$PREVIOUS_VERSION" ]; + then + echo "It's not upgraded to the latest release.PREVIOUS_VERSION-> $PREVIOUS_VERSION and CURRENT_VERSION-> $CURRENT_VERSION "; + exit 1; + elif [ "$VERSION_PREVIOUS_THAN_LATEST_RELEASE" != "$CURRENT_VERSION" ]; then + echo "Version upgraded to the latest release -> from PREVIOUS_VERSION-> $PREVIOUS_VERSION to CURRENT_VERSION->$CURRENT_VERSION "; + fi) + From c688e0d13b961a8565466ada8d8b9774c4e659e3 Mon Sep 17 00:00:00 2001 From: mekya Date: Sun, 10 Mar 2024 20:33:23 +0300 Subject: [PATCH 31/67] Fix syntax --- .github/workflows/upgrade-sh-validation.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upgrade-sh-validation.yml b/.github/workflows/upgrade-sh-validation.yml index a97b0d4d..7f522e9a 100644 --- a/.github/workflows/upgrade-sh-validation.yml +++ b/.github/workflows/upgrade-sh-validation.yml @@ -1,11 +1,9 @@ -name: Ant Media Server upgrade.sh Validation Test +name: upgrade.sh Validation Test on: [push] jobs: install_and_upgrade_ant_media_server: runs-on: ubuntu-latest - env: - SCRIPT_URL: https://raw.githubusercontent.com/ant-media/Ant-Media-Server/master/src/main/server/upgrade.sh name: Install Previous Version of Ant Media Server steps: - name: Check out repository code @@ -18,7 +16,7 @@ jobs: sleep 30 PREVIOUS_VERSION=$(unzip -p /usr/local/antmedia/ant-media-server.jar | grep -a "Implementation-Version"|cut -d' ' -f2 | tr -d '\r') echo "Previous Version: $PREVIOUS_VERSION" - wget ${{ SCRIPT_URL }} + wget https://raw.githubusercontent.com/ant-media/Ant-Media-Server/master/src/main/server/upgrade.sh DIR='/usr/local/antmedia/' sudo bash ./upgrade.sh wget http://localhost:5080 -O index.html CURRENT_VERSION=$(unzip -p /usr/local/antmedia/ant-media-server.jar | grep -a "Implementation-Version"|cut -d' ' -f2 | tr -d '\r') From b9dd864a75d6a95b825a3eea4bc9c2218e6860bb Mon Sep 17 00:00:00 2001 From: mekya Date: Sun, 10 Mar 2024 20:36:20 +0300 Subject: [PATCH 32/67] Let server get started before check url --- .github/workflows/upgrade-sh-validation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/upgrade-sh-validation.yml b/.github/workflows/upgrade-sh-validation.yml index 7f522e9a..7620bf16 100644 --- a/.github/workflows/upgrade-sh-validation.yml +++ b/.github/workflows/upgrade-sh-validation.yml @@ -18,6 +18,7 @@ jobs: echo "Previous Version: $PREVIOUS_VERSION" wget https://raw.githubusercontent.com/ant-media/Ant-Media-Server/master/src/main/server/upgrade.sh DIR='/usr/local/antmedia/' sudo bash ./upgrade.sh + sleep 20 wget http://localhost:5080 -O index.html CURRENT_VERSION=$(unzip -p /usr/local/antmedia/ant-media-server.jar | grep -a "Implementation-Version"|cut -d' ' -f2 | tr -d '\r') (if [ "$(printf "%s\n" "$PREVIOUS_VERSION" "$CURRENT_VERSION" | sort -V | tail -n 1)" = "$PREVIOUS_VERSION" ]; From 857e83b18f04dbd017b55735e698223c6c247613 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 11 Mar 2024 11:31:17 +0300 Subject: [PATCH 33/67] Update GPU Images for only Origin cluster --- cloudformation/antmedia-aws-autoscale-template.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index 99364a77..afbc2858 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -276,7 +276,7 @@ Parameters: MinValue: '16' MaxValue: '1000' GPUImage: - Description: Select "true" to install the GPU Image. You must select one of the g and p instance types. + Description: Select "true" to use GPU Image in Origin Cluster. You must select one of the g and p instance types. Default: false Type: String AllowedValues: @@ -652,7 +652,7 @@ Resources: LaunchTemplateData: InstanceType: !Ref EdgeInstanceType KeyName: !Ref KeyName - ImageId: !If [UseGPUImage, !Ref AntMediaGPUAmi, !Ref AntMediaAmi] + ImageId: !Ref AntMediaAmi SecurityGroupIds: - !GetAtt "InstanceSecurityGroup.GroupId" BlockDeviceMappings: From fc4fda4d8e746219c2af65e0126cc84fec24b76d Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 12 Mar 2024 08:30:28 +0300 Subject: [PATCH 34/67] Remove p and g instances types from Edge --- .../antmedia-aws-autoscale-template.yaml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index afbc2858..54e66b51 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -83,25 +83,6 @@ Parameters: - r3.2xlarge - r3.4xlarge - r3.8xlarge - - p2.xlarge - - p2.8xlarge - - p2.16xlarge - - p3.2xlarge - - p3.8xlarge - - p3.16xlarge - - p3dn.24xlarge - - g4dn.xlarge - - g4dn.2xlarge - - g4dn.4xlarge - - g4dn.8xlarge - - g4dn.12xlarge - - g4dn.16xlarge - - g5.xlarge - - g5.2xlarge - - g5.4xlarge - - g5.8xlarge - - g5.12xlarge - - g5.16xlarge ConstraintDescription: must be a valid EC2 instance type. OriginInstanceType: From 6413fd84259f15968cfab97f6cf688473a6106ff Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Fri, 15 Mar 2024 18:28:23 +0300 Subject: [PATCH 35/67] Fix AntMediaAmi product name --- cloudformation/antmedia-aws-autoscale-template.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index 54e66b51..6c46c9a1 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -362,8 +362,8 @@ Resources: Type: Custom::FindAMI Properties: ServiceToken: !Sub ${AMSGetLatestAMI.Arn} - ProductId: "8kf9kapq2qbo37fuekp8k7o6r" - Name: "AntMedia-AWS-Marketplace-GPU-*" + ProductId: "4wh7rhpic3wfwamyp5905tsbt" + Name: "AntMedia-AWS-Marketplace-EE-*" Architecture: "x86_64" AntMediaGPUAmi: From fc30fdf08a211ca4e66331b1d83999fe760445b1 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Thu, 21 Mar 2024 17:32:16 +0300 Subject: [PATCH 36/67] Fix image name --- kubernetes/ams-with-turn-server/ams-k8s-deployment-origin.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/ams-with-turn-server/ams-k8s-deployment-origin.yaml b/kubernetes/ams-with-turn-server/ams-k8s-deployment-origin.yaml index cc503fe8..5146252e 100644 --- a/kubernetes/ams-with-turn-server/ams-k8s-deployment-origin.yaml +++ b/kubernetes/ams-with-turn-server/ams-k8s-deployment-origin.yaml @@ -28,7 +28,7 @@ spec: containers: - name: ant-media-server imagePullPolicy: IfNotPresent # change this value accordingly. It can be Never, Always or IfNotPresent - image: muratugureminoglu/antmedia:2.4.3-coturn-1 #change this value according to your image. + image: antmedia/enterprise:latest #change this value according to your image. # By default, mongodb deployment is used. If you're using mongodb somewhere else, specify it with server url(-h) below. # You may also need to add -u and -p parameters for # specifying mongodb username and passwords respectively From 71a5a4189dfa5ed83ba96faba86ce41c118e464a Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Thu, 21 Mar 2024 17:32:53 +0300 Subject: [PATCH 37/67] Fix image name --- kubernetes/ams-with-turn-server/ams-k8s-deployment-edge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/ams-with-turn-server/ams-k8s-deployment-edge.yaml b/kubernetes/ams-with-turn-server/ams-k8s-deployment-edge.yaml index 972c03b6..9b6130b9 100644 --- a/kubernetes/ams-with-turn-server/ams-k8s-deployment-edge.yaml +++ b/kubernetes/ams-with-turn-server/ams-k8s-deployment-edge.yaml @@ -28,7 +28,7 @@ spec: containers: - name: ant-media-server imagePullPolicy: IfNotPresent # change this value accordingly. It can be Never, Always or IfNotPresent - image: muratugureminoglu/antmedia:2.4.3-coturn-1 #change this value according to your image. + image: antmedia/enterprise:latest #change this value according to your image. # By default, mongodb deployment is used. If you're using mongodb somewhere else, specify it with server url(-h) below. # You may also need to add -u and -p parameters for # specifying mongodb username and passwords respectively From 559ae0f6c49ba808fce431dc18657907b9845807 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 25 Mar 2024 12:55:03 +0300 Subject: [PATCH 38/67] Add Antmedia Azure ARM Autoscale Template --- .../antmedia-azure-autoscale.yaml | 757 ++++++++++++++++++ 1 file changed, 757 insertions(+) create mode 100644 azure-arm-template/antmedia-azure-autoscale.yaml diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml new file mode 100644 index 00000000..e846b4f5 --- /dev/null +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -0,0 +1,757 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "projectName": { + "defaultValue": "antmedia-cluster", + "type": "String" + }, + "OriginInstanceCapacity": { + "type": "int", + "defaultValue": 1, + "metadata": { + "description": "Number of VM instances (100 or less)." + }, + "minValue": 1, + "maxValue": 100 + }, + "OriginInstanceType": { + "type": "string", + "defaultValue": "Standard_D2s_v3", + "metadata": { + "description": "Size of Origin VMs in the VM Scale Set." + } + }, + "EdgeInstanceCapacity": { + "type": "int", + "defaultValue": 2, + "metadata": { + "description": "Number of VM instances (100 or less)." + }, + "minValue": 1, + "maxValue": 100 + }, + "EdgeInstanceType": { + "type": "string", + "defaultValue": "Standard_D2s_v3", + "metadata": { + "description": "Type of Edge VMs in the VM Scale Set." + } + }, + "MongoDBInstanceType": { + "defaultValue": "Standard_D2s_v3", + "type": "String", + "metadata": { + "description": "The instance type of the MongoDB Instance" + } + }, + "certData": { + "type": "securestring", + "metadata": { + "description": "Base-64 encoded form of the .pfx file" + } + }, + "certPassword": { + "type": "securestring", + "metadata": { + "description": "Password for .pfx certificate" + } + }, + "InstanceUsername": { + "type": "String", + "metadata": { + "description": "Username for the Virtual Machine." + } + }, + "authenticationType": { + "defaultValue": "password", + "allowedValues": [ + "sshPublicKey", + "password" + ], + "type": "String", + "metadata": { + "description": "Type of authentication to use on the Virtual Machine. SSH key is recommended." + } + }, + "InstancePassword": { + "type": "SecureString", + "metadata": { + "description": "SSH Key or password for the Virtual Machine. SSH key is recommended." + } + } + }, + "variables": { + "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", + "appGwPublicIPAddressName": "app-gw-ip", + "osDiskType": "Standard_LRS", + "applicationGateWayName": "antmedia-app-gw", + "virtualNetworks_antmedia_cluster_vnet_name": "antmedia-cluster-vnet", + + "linuxConfiguration": { + "disablePasswordAuthentication": true, + "ssh": { + "publicKeys": [ + { + "path": "[format('/home/{0}/.ssh/authorized_keys', parameters('InstanceUsername'))]", + "keyData": "[parameters('InstancePassword')]" + } + ] + } + } + }, + "resources": [ + { + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2023-09-01", + "name": "[variables('virtualNetworks_antmedia_cluster_vnet_name')]", + "location": "[resourceGroup().location]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "10.0.0.0/16" + ] + }, + "encryption": { + "enabled": false, + "enforcement": "AllowUnencrypted" + }, + "subnets": [ + { + "name": "origin", + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]", + "properties": { + "addressPrefixes": [ + "10.0.1.0/24" + ], + "delegations": [], + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled" + }, + "type": "Microsoft.Network/virtualNetworks/subnets" + }, + { + "name": "edge", + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]", + "properties": { + "addressPrefixes": [ + "10.0.2.0/24" + ], + "delegations": [], + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled" + }, + "type": "Microsoft.Network/virtualNetworks/subnets" + }, + { + "name": "app-gw", + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'app-gw')]", + "properties": { + "addressPrefixes": [ + "10.0.0.0/24" + ], + "delegations": [], + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled" + }, + "type": "Microsoft.Network/virtualNetworks/subnets" + } + ], + "virtualNetworkPeerings": [], + "enableDdosProtection": false + } + }, + { + "type": "Microsoft.Network/networkSecurityGroups", + "apiVersion": "2020-05-01", + "name": "MongoDB-Security-Group", + "location": "[resourceGroup().location]", + "properties": { + "securityRules": [ + { + "name": "ssh_rule", + "properties": { + "description": "Locks inbound down to ssh default port 22.", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "22", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 100, + "direction": "Inbound" + } + }, + { + "name": "mongodb_rule", + "properties": { + "description": "Locks inbound down to MongoDB default port 27017.", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "27017", + "sourceAddressPrefix": "10.0.0.0/16", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 101, + "direction": "Inbound" + } + } + ] + } + }, + { + "type": "Microsoft.Network/networkSecurityGroups", + "apiVersion": "2020-05-01", + "name": "AMSScaleSet-Security-Group", + "location": "[resourceGroup().location]", + "properties": { + "securityRules": [ + { + "name": "ssh_rule", + "properties": { + "description": "Locks inbound down to ssh default port 22.", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "22", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 100, + "direction": "Inbound" + } + }, + { + "name": "cluster_rule1", + "properties": { + "description": "Locks inbound down to Cluster default port 5000.", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "5000", + "sourceAddressPrefix": "10.0.0.0/16", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 101, + "direction": "Inbound" + } + }, + { + "name": "cluster_rule2", + "properties": { + "description": "Locks inbound down to Cluster default port 5000.", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "5000", + "sourceAddressPrefix": "10.0.0.0/16", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 102, + "direction": "Inbound" + } + }, + { + "name": "cluster_rule3", + "properties": { + "description": "Locks inbound down to Cluster default port 5080.", + "protocol": "Tcp", + "sourcePortRange": "*", + "destinationPortRange": "5080", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 103, + "direction": "Inbound" + } + }, + { + "name": "cluster_rule4", + "properties": { + "description": "Locks inbound down to Cluster default port 50000-60000.", + "protocol": "Udp", + "sourcePortRange": "*", + "destinationPortRange": "50000-60000", + "sourceAddressPrefix": "*", + "destinationAddressPrefix": "*", + "access": "Allow", + "priority": 104, + "direction": "Inbound" + } + } + ] + } + }, + { + "type": "Microsoft.Network/publicIPAddresses", + "name": "[variables('appGwPublicIPAddressName')]", + "location": "[resourceGroup().location]", + "apiVersion": "2020-06-01", + "sku": { + "name": "Standard" + }, + "properties": { + "publicIPAllocationMethod": "Static" + } + }, + { + "type": "Microsoft.Network/publicIPAddresses", + "apiVersion": "2020-05-01", + "name": "[variables('publicIPAddressName')]", + "location": "[resourceGroup().location]", + "sku": { + "name": "Basic" + }, + "properties": { + "publicIPAllocationMethod": "Dynamic" + } + }, + { + "type": "Microsoft.Network/virtualNetworks/subnets", + "apiVersion": "2023-09-01", + "name": "[concat(variables('virtualNetworks_antmedia_cluster_vnet_name'), '/app-gw')]", + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]" + ], + "properties": { + "addressPrefixes": [ + "10.0.0.0/24" + ], + "delegations": [], + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled" + } + }, + { + "type": "Microsoft.Network/virtualNetworks/subnets", + "apiVersion": "2023-09-01", + "name": "[concat(variables('virtualNetworks_antmedia_cluster_vnet_name'), '/edge')]", + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]" + ], + "properties": { + "addressPrefixes": [ + "10.0.2.0/24" + ], + "delegations": [], + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled" + } + }, + { + "type": "Microsoft.Network/virtualNetworks/subnets", + "apiVersion": "2023-09-01", + "name": "[concat(variables('virtualNetworks_antmedia_cluster_vnet_name'), '/origin')]", + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworks_antmedia_cluster_vnet_name'))]" + ], + "properties": { + "addressPrefixes": [ + "10.0.1.0/24" + ], + "delegations": [], + "privateEndpointNetworkPolicies": "Disabled", + "privateLinkServiceNetworkPolicies": "Enabled" + } + }, + { + "type": "Microsoft.Network/applicationGateways", + "apiVersion": "2021-05-01", + "name": "[variables('applicationGateWayName')]", + "location": "[resourceGroup().location]", + "properties": { + "sku": { + "name": "Standard_v2", + "tier": "Standard_v2" + }, + "sslCertificates": [ + { + "name": "appGatewaySslCert", + "properties": { + "data": "[parameters('certData')]", + "password": "[parameters('certPassword')]" + } + } + ], + "gatewayIPConfigurations": [ + { + "name": "appGatewayIpConfig", + "properties": { + "subnet": { + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'app-gw')]" + } + } + } + ], + "frontendIPConfigurations": [ + { + "name": "appGwPublicFrontendIp", + "properties": { + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('appGwPublicIPAddressName'))]" + } + } + } + ], + "frontendPorts": [ + { + "name": "port_443", + "properties": { + "port": 443 + } + }, + { + "name": "port_5443", + "properties": { + "port": 5443 + } + } + ], + "backendAddressPools": [ + { + "name": "OriginBackendPool", + "properties": {} + }, + { + "name": "EdgeBackendPool", + "properties": {} + } + ], + "backendHttpSettingsCollection": [ + { + "name": "myHTTPSetting", + "properties": { + "port": 5080, + "protocol": "Http", + "cookieBasedAffinity": "Disabled", + "pickHostNameFromBackendAddress": false, + "requestTimeout": 20 + } + } + ], + "httpListeners": [ + { + "name": "443Listener", + "properties": { + "frontendIPConfiguration": { + "id": "[resourceId('Microsoft.Network/applicationGateways/frontendIPConfigurations', variables('applicationGateWayName'), 'appGwPublicFrontendIp')]" + }, + "frontendPort": { + "id": "[resourceId('Microsoft.Network/applicationGateways/frontendPorts', variables('applicationGateWayName'), 'port_443')]" + }, + "Protocol": "Https", + "SslCertificate": { + "Id": "[resourceId('Microsoft.Network/applicationGateways/sslCertificates',variables('applicationGatewayName'), 'appGatewaySslCert')]" + } + } + }, + { + "name": "5443Listener", + "properties": { + "frontendIPConfiguration": { + "id": "[resourceId('Microsoft.Network/applicationGateways/frontendIPConfigurations', variables('applicationGateWayName'), 'appGwPublicFrontendIp')]" + }, + "frontendPort": { + "id": "[resourceId('Microsoft.Network/applicationGateways/frontendPorts', variables('applicationGateWayName'), 'port_5443')]" + }, + "Protocol": "Https", + "SslCertificate": { + "Id": "[resourceId('Microsoft.Network/applicationGateways/sslCertificates',variables('applicationGatewayName'), 'appGatewaySslCert')]" + } + } + } + ], + "requestRoutingRules": [ + { + "name": "443RoutingRule", + "properties": { + "ruleType": "Basic", + "httpListener": { + "id": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', variables('applicationGateWayName'), '443Listener')]" + }, + "backendAddressPool": { + "id": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', variables('applicationGateWayName'), 'OriginBackendPool')]" + }, + "backendHttpSettings": { + "id": "[resourceId('Microsoft.Network/applicationGateways/backendHttpSettingsCollection', variables('applicationGateWayName'), 'myHTTPSetting')]" + } + } + }, + { + "name": "5443RoutingRule", + "properties": { + "ruleType": "Basic", + "httpListener": { + "id": "[resourceId('Microsoft.Network/applicationGateways/httpListeners', variables('applicationGateWayName'), '5443Listener')]" + }, + "backendAddressPool": { + "id": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', variables('applicationGateWayName'), 'EdgeBackendPool')]" + }, + "backendHttpSettings": { + "id": "[resourceId('Microsoft.Network/applicationGateways/backendHttpSettingsCollection', variables('applicationGateWayName'), 'myHTTPSetting')]" + } + } + } + ], + "enableHttp2": false, + "autoscaleConfiguration": { + "minCapacity": 0, + "maxCapacity": 10 + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Network/publicIPAddresses', variables('appGwPublicIPAddressName'))]", + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'app-gw')]" + ] + }, + { + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2023-09-01", + "name": "antmedia-mongodb", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]", + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]" + ], + "properties": { + "hardwareProfile": { + "vmSize": "[parameters('MongoDBInstanceType')]" + }, + "storageProfile": { + "osDisk": { + "createOption": "FromImage", + "managedDisk": { + "storageAccountType": "[variables('osDiskType')]" + } + }, + "imageReference": { + "publisher": "Canonical", + "offer": "0001-com-ubuntu-server-jammy", + "sku": "22_04-lts-gen2", + "version": "latest" + } + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces', 'antmedia-mongodb-NIC')]" + } + ] + }, + "osProfile": { + "computerName": "antmedia-mongodb", + "adminUsername": "[parameters('InstanceUsername')]", + "adminPassword": "[parameters('InstancePassword')]", + "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), null(), variables('linuxConfiguration'))]", + "customData": "[base64('#!/bin/bash\nwget -O install_mongodb.sh https://raw.githubusercontent.com/ant-media/Scripts/master/install_mongodb.sh\nchmod +x install_mongodb.sh\n./install_mongodb.sh')]" + + } + } + }, + { + "type": "Microsoft.Network/networkInterfaces", + "apiVersion": "2023-09-01", + "name": "antmedia-mongodb-NIC", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworks_antmedia_cluster_vnet_name'))]" + ], + "properties": { + "ipConfigurations": [ + { + "name": "antmedia-mongodb-IPConfig", + "properties": { + "privateIPAllocationMethod": "Static", + "privateIPAddress": "10.0.1.99", + "publicIPAddress": { + "id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]" + }, + "subnet": { + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]" + } + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', 'MongoDB-Security-Group')]" + } + } + }, + { + "type": "Microsoft.Compute/virtualMachineScaleSets", + "apiVersion": "2023-03-01", + "name": "antmedia-origin", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]", + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]", + "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]" + + ], + "sku": { + "name": "[parameters('OriginInstanceType')]", + "tier": "Standard", + "capacity": "[parameters('OriginInstanceCapacity')]" + }, + "plan": { + "name": "enterprise_edition", + "product": "ant_media_server_enterprise", + "publisher": "antmedia" + }, + "properties": { + "platformFaultDomainCount": 1, + "singlePlacementGroup": false, + "orchestrationMode": "Flexible", + "virtualMachineProfile": { + "osProfile": { + "computerNamePrefix": "antmedia-", + "adminUsername": "[parameters('InstanceUsername')]", + "adminPassword": "[parameters('InstancePassword')]", + "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), null(), variables('linuxConfiguration'))]", + "customData": "[base64('#!/bin/bash\nsudo sed -i \"/org.apache.catalina.valves.RemoteIpValve/d\" /usr/local/antmedia/conf/jee-container.xml\n/usr/local/antmedia/change_server_mode.sh cluster 10.0.1.99')]" + }, + "storageProfile": { + "osDisk": { + "createOption": "FromImage", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + }, + "imageReference": { + "publisher": "antmedia", + "offer": "ant_media_server_enterprise", + "sku": "enterprise_edition", + "version": "latest" + } + }, + "networkProfile": { + "networkApiVersion": "2020-11-01", + "networkInterfaceConfigurations": [ + { + "name": "nicConfig", + "properties": { + "primary": true, + "ipConfigurations": [ + { + "name": "antmedia-cluster-vnet-nic01-defaultIpConfiguration", + "properties": { + "privateIPAddressVersion": "IPv4", + "subnet": { + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]" + }, + "applicationGatewayBackendAddressPools": [ + { + "id": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', variables('applicationGateWayName'), 'OriginBackendPool')]" + } + ], + "primary": true, + "publicIPAddressConfiguration": { + "name": "publicIp-antmedia-cluster-vnet-nic01", + "properties": { + "idleTimeoutInMinutes": 15, + "ipTags": [], + "publicIPAddressVersion": "IPv4" + } + } + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]" + } + } + } + ] + } + } + } + }, + { + "type": "Microsoft.Compute/virtualMachineScaleSets", + "apiVersion": "2023-03-01", + "name": "antmedia-edge", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]", + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]", + "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]" + + ], + "sku": { + "name": "[parameters('EdgeInstanceType')]", + "tier": "Standard", + "capacity": "[parameters('EdgeInstanceCapacity')]" + }, + "plan": { + "name": "enterprise_edition", + "product": "ant_media_server_enterprise", + "publisher": "antmedia" + }, + "properties": { + "platformFaultDomainCount": 1, + "singlePlacementGroup": false, + "orchestrationMode": "Flexible", + "virtualMachineProfile": { + "osProfile": { + "computerNamePrefix": "antmedia-", + "adminUsername": "[parameters('InstanceUsername')]", + "adminPassword": "[parameters('InstancePassword')]", + "linuxConfiguration": "[if(equals(parameters('authenticationType'), 'password'), null(), variables('linuxConfiguration'))]", + "customData": "[base64('#!/bin/bash\nsudo sed -i \"/org.apache.catalina.valves.RemoteIpValve/d\" /usr/local/antmedia/conf/jee-container.xml\n/usr/local/antmedia/change_server_mode.sh cluster 10.0.1.99')]" + }, + "storageProfile": { + "osDisk": { + "createOption": "FromImage", + "managedDisk": { + "storageAccountType": "Premium_LRS" + } + }, + "imageReference": { + "publisher": "antmedia", + "offer": "ant_media_server_enterprise", + "sku": "enterprise_edition", + "version": "latest" + } + }, + "networkProfile": { + "networkApiVersion": "2020-11-01", + "networkInterfaceConfigurations": [ + { + "name": "nicConfig", + "properties": { + "primary": true, + "ipConfigurations": [ + { + "name": "antmedia-cluster-vnet-nic01-defaultIpConfiguration", + "properties": { + "privateIPAddressVersion": "IPv4", + "subnet": { + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]" + }, + "applicationGatewayBackendAddressPools": [ + { + "id": "[resourceId('Microsoft.Network/applicationGateways/backendAddressPools', variables('applicationGateWayName'), 'EdgeBackendPool')]" + } + ], + "primary": true, + "publicIPAddressConfiguration": { + "name": "publicIp-antmedia-cluster-vnet-nic01", + "properties": { + "idleTimeoutInMinutes": 15, + "ipTags": [], + "publicIPAddressVersion": "IPv4" + } + } + } + } + ], + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]" + } + } + } + ] + } + } + } + } + ] +} From 3338b277f0e1031066f8d56374d386ffd146cbbc Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Wed, 27 Mar 2024 01:19:55 +0300 Subject: [PATCH 39/67] Update depency issues --- .../antmedia-azure-autoscale.yaml | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml index e846b4f5..bc2d9520 100644 --- a/azure-arm-template/antmedia-azure-autoscale.yaml +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -508,8 +508,8 @@ "name": "antmedia-mongodb", "location": "[resourceGroup().location]", "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]", - "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]" + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworks_antmedia_cluster_vnet_name'))]", + "[resourceId('Microsoft.Network/networkSecurityGroups', 'MongoDB-Security-Group')]" ], "properties": { "hardwareProfile": { @@ -552,7 +552,9 @@ "name": "antmedia-mongodb-NIC", "location": "[resourceGroup().location]", "dependsOn": [ - "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworks_antmedia_cluster_vnet_name'))]" + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworks_antmedia_cluster_vnet_name'))]", + "[resourceId('Microsoft.Network/networkSecurityGroups', 'MongoDB-Security-Group')]" + ], "properties": { "ipConfigurations": [ @@ -581,9 +583,9 @@ "name": "antmedia-origin", "location": "[resourceGroup().location]", "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]", - "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]", - "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]" + "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]", + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworks_antmedia_cluster_vnet_name'))]", + "[resourceId('Microsoft.Network/applicationGateways/', variables('applicationGateWayName'))]" ], "sku": { @@ -670,9 +672,10 @@ "name": "antmedia-edge", "location": "[resourceGroup().location]", "dependsOn": [ - "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'origin')]", - "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'edge')]", - "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]" + "[resourceId('Microsoft.Network/networkSecurityGroups', 'AMSScaleSet-Security-Group')]", + "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworks_antmedia_cluster_vnet_name'))]", + "[resourceId('Microsoft.Network/applicationGateways/', variables('applicationGateWayName'))]" + ], "sku": { From 069b321d37dff0389033621f05edb7e4e26ec1df Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Wed, 27 Mar 2024 16:26:34 +0300 Subject: [PATCH 40/67] Add Autoscale Policy --- .../antmedia-azure-autoscale.yaml | 97 ++++++++++++++++++- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml index bc2d9520..79cdaef7 100644 --- a/azure-arm-template/antmedia-azure-autoscale.yaml +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -509,7 +509,8 @@ "location": "[resourceGroup().location]", "dependsOn": [ "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworks_antmedia_cluster_vnet_name'))]", - "[resourceId('Microsoft.Network/networkSecurityGroups', 'MongoDB-Security-Group')]" + "[resourceId('Microsoft.Network/networkSecurityGroups', 'MongoDB-Security-Group')]", + "[resourceId('Microsoft.Network/networkInterfaces', 'antmedia-mongodb-NIC')]" ], "properties": { "hardwareProfile": { @@ -666,7 +667,54 @@ } } }, - { + + { + "type": "Microsoft.Insights/autoscaleSettings", + "apiVersion": "2022-10-01", + "name": "AMSScaleSetAutoscaleSettings-Origin", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.Compute/virtualMachineScaleSets', 'antmedia-origin')]" + ], + "properties": { + "name": "AMSScaleSetAutoscaleSettings-Origin", + "targetResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', 'antmedia-origin')]", + "enabled": true, + "profiles": [ + { + "name": "DefaultProfile", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricNamespace": "", + "metricResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', 'antmedia-origin')]", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 60 + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + } + ] + } + ] + } + }, + + { "type": "Microsoft.Compute/virtualMachineScaleSets", "apiVersion": "2023-03-01", "name": "antmedia-edge", @@ -755,6 +803,51 @@ } } } + }, + { + "type": "Microsoft.Insights/autoscaleSettings", + "apiVersion": "2022-10-01", + "name": "AMSScaleSetAutoscaleSettings-Edge", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.Compute/virtualMachineScaleSets', 'antmedia-edge')]" + ], + "properties": { + "name": "AMSScaleSetAutoscaleSettings-Edge", + "targetResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', 'antmedia-edge')]", + "enabled": true, + "profiles": [ + { + "name": "DefaultProfile", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricNamespace": "", + "metricResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets', 'antmedia-edge')]", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 60 + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + } + ] + } + ] + } } ] } From c9ee03d4db59ad3ebd77f9bc6df8909e94004303 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Wed, 27 Mar 2024 17:06:02 +0300 Subject: [PATCH 41/67] Fix AutoScale policy size --- azure-arm-template/antmedia-azure-autoscale.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml index 79cdaef7..cde85dc3 100644 --- a/azure-arm-template/antmedia-azure-autoscale.yaml +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -684,9 +684,9 @@ { "name": "DefaultProfile", "capacity": { - "minimum": "1", + "minimum": "[parameters('EdgeInstanceCapacity')]", "maximum": "10", - "default": "1" + "default": "[parameters('EdgeInstanceCapacity')]" }, "rules": [ { @@ -820,9 +820,9 @@ { "name": "DefaultProfile", "capacity": { - "minimum": "1", + "minimum": "[parameters('EdgeInstanceCapacity')]", "maximum": "10", - "default": "1" + "default": "[parameters('EdgeInstanceCapacity')]" }, "rules": [ { From 1837367ef776a06bba6cf2bae84b49ce5dbec952 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Wed, 27 Mar 2024 19:09:04 +0300 Subject: [PATCH 42/67] Add changeable CPU threshould --- azure-arm-template/antmedia-azure-autoscale.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml index cde85dc3..87a82f13 100644 --- a/azure-arm-template/antmedia-azure-autoscale.yaml +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -38,6 +38,13 @@ "description": "Type of Edge VMs in the VM Scale Set." } }, + "CPUPolicyTargetValue": { + "type": "int", + "defaultValue": 60, + "metadata": { + "description": "This parameter for creates new Instances when CPU load exceed to %60." + } + }, "MongoDBInstanceType": { "defaultValue": "Standard_D2s_v3", "type": "String", @@ -699,7 +706,7 @@ "timeWindow": "PT5M", "timeAggregation": "Average", "operator": "GreaterThan", - "threshold": 60 + "threshold": "[parameters('CPUPolicyTargetValue')]" }, "scaleAction": { "direction": "Increase", From 7839efa478682456c1103270202bb52a0bf952f5 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 1 Apr 2024 13:42:49 +0300 Subject: [PATCH 43/67] Update antmedia-azure-autoscale.yaml From 4fee1e750c8d41ba459380ffc298aa22ee147d13 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 1 Apr 2024 16:52:25 +0300 Subject: [PATCH 44/67] Add Inbound RTMP Port --- azure-arm-template/antmedia-azure-autoscale.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml index 87a82f13..34f7ead4 100644 --- a/azure-arm-template/antmedia-azure-autoscale.yaml +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -244,11 +244,11 @@ { "name": "cluster_rule2", "properties": { - "description": "Locks inbound down to Cluster default port 5000.", + "description": "Locks inbound down to Cluster default port 1935.", "protocol": "Tcp", "sourcePortRange": "*", - "destinationPortRange": "5000", - "sourceAddressPrefix": "10.0.0.0/16", + "destinationPortRange": "1935", + "sourceAddressPrefix": "0.0.0.0/0", "destinationAddressPrefix": "*", "access": "Allow", "priority": 102, From 8883be711c5f3d50a706dad52a6a685a27ed0e2c Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 1 Apr 2024 17:01:16 +0300 Subject: [PATCH 45/67] Update dependsOn for application gateway --- azure-arm-template/antmedia-azure-autoscale.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml index 34f7ead4..d29bdb3e 100644 --- a/azure-arm-template/antmedia-azure-autoscale.yaml +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -506,7 +506,8 @@ }, "dependsOn": [ "[resourceId('Microsoft.Network/publicIPAddresses', variables('appGwPublicIPAddressName'))]", - "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'app-gw')]" + "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworks_antmedia_cluster_vnet_name'), 'app-gw')]", + "[resourceId('Microsoft.Compute/virtualMachines', 'antmedia-mongodb')]" ] }, { From 72e2228045621179ac54165076d990704c388b39 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 1 Apr 2024 17:25:00 +0300 Subject: [PATCH 46/67] Update default instance types --- azure-arm-template/antmedia-azure-autoscale.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-arm-template/antmedia-azure-autoscale.yaml b/azure-arm-template/antmedia-azure-autoscale.yaml index d29bdb3e..6319e36a 100644 --- a/azure-arm-template/antmedia-azure-autoscale.yaml +++ b/azure-arm-template/antmedia-azure-autoscale.yaml @@ -17,7 +17,7 @@ }, "OriginInstanceType": { "type": "string", - "defaultValue": "Standard_D2s_v3", + "defaultValue": "Standard_F2s_v2", "metadata": { "description": "Size of Origin VMs in the VM Scale Set." } @@ -33,7 +33,7 @@ }, "EdgeInstanceType": { "type": "string", - "defaultValue": "Standard_D2s_v3", + "defaultValue": "Standard_F4s_v2", "metadata": { "description": "Type of Edge VMs in the VM Scale Set." } From abff539f383becec8f3ba8d82f5717af8b61ae94 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 1 Apr 2024 20:38:59 +0300 Subject: [PATCH 47/67] Add debug parameter --- .github/workflows/install-latest-to-ubuntu-22-04.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-latest-to-ubuntu-22-04.yml b/.github/workflows/install-latest-to-ubuntu-22-04.yml index 665d6780..6709c9c4 100644 --- a/.github/workflows/install-latest-to-ubuntu-22-04.yml +++ b/.github/workflows/install-latest-to-ubuntu-22-04.yml @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v3 - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." #Get latest version - - run: ./install_ant-media-server.sh -l"${{ secrets.ENTERPRISE_LICENSE }}" + - run: bash -x ./install_ant-media-server.sh -l"${{ secrets.ENTERPRISE_LICENSE }}" - run: sleep 30 - run: cat /usr/local/antmedia/log/ant-media-server.log - run: | From 53ffcafad733c493b01e01af134c293aeb1830e6 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 8 Apr 2024 12:36:58 +0300 Subject: [PATCH 48/67] Update image version to Ubuntu 22.04 --- docker/Dockerfile_Process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile_Process b/docker/Dockerfile_Process index 0da258bb..946836d2 100644 --- a/docker/Dockerfile_Process +++ b/docker/Dockerfile_Process @@ -2,7 +2,7 @@ # It accepts all cluster related parameters at run time. # It means it's very easy to add new containers to the cluster -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG AntMediaServer ARG LicenseKey From 14982844396bd1f3efce9b8ec0de253f35d776a2 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 9 Apr 2024 19:03:46 +0300 Subject: [PATCH 49/67] Add retry download function --- install_ant-media-server.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/install_ant-media-server.sh b/install_ant-media-server.sh index 9e994309..d16cf088 100755 --- a/install_ant-media-server.sh +++ b/install_ant-media-server.sh @@ -204,6 +204,31 @@ check_version() { fi } +check_enterprise_file() { + local retry_count=0 + local max_retries=3 + local remote_file + local local_file + + while [ $retry_count -lt $max_retries ]; do + + remote_file="$(curl -sL https://antmedia.io/download/latest-version.md5 | cut -d ' ' -f 1)" + local_file="$(md5sum "$ANT_MEDIA_SERVER_ZIP_FILE" | cut -d ' ' -f 1)" + + if [ "$local_file" != "$remote_file" ]; then + echo "Downloaded file MD5 checksum is different from remote file MD5 checksum. Retrying download. Attempt: $((retry_count+1))" + curl --progress-bar -o "$ANT_MEDIA_SERVER_ZIP_FILE" "$check_license" + ((retry_count++)) + else + echo "Downloaded file MD5 checksum matches remote file MD5 checksum." + return 0 + fi + done + + echo "Failed to download the file after $max_retries attempts. Please re-run script again or check the internet connection" + exit 1 +} + #Just checks if the latest ioperation is successfull check() { OUT=$? @@ -258,6 +283,7 @@ if [ -z "$ANT_MEDIA_SERVER_ZIP_FILE" ]; then echo "The license key is valid. Downloading the latest version of Ant Media Server Enterprise Edition." curl --progress-bar -o ams_enterprise.zip "$check_license" ANT_MEDIA_SERVER_ZIP_FILE="ams_enterprise.zip" + check_enterprise_file fi fi fi From d1c38f1a3cdbafab1457ae80a0220b055f943291 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 9 Apr 2024 19:19:55 +0300 Subject: [PATCH 50/67] Add the version number as an info --- install_ant-media-server.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_ant-media-server.sh b/install_ant-media-server.sh index d16cf088..76ad259c 100755 --- a/install_ant-media-server.sh +++ b/install_ant-media-server.sh @@ -25,6 +25,7 @@ RED='\033[0;31m' NC='\033[0m' #version that is being installed. It's get filled below VERSION= +VERSION_NAME=$(curl -s https://antmedia.io/download/latest-version.json | jq -r '.versionName') update_script () { SCRIPT_NAME="$0" @@ -280,7 +281,7 @@ if [ -z "$ANT_MEDIA_SERVER_ZIP_FILE" ]; then echo "Invalid license key. Please check your license key." exit 1 else - echo "The license key is valid. Downloading the latest version of Ant Media Server Enterprise Edition." + echo "The license key is valid. Downloading the latest version ($VERSION_NAME) of Ant Media Server Enterprise Edition." curl --progress-bar -o ams_enterprise.zip "$check_license" ANT_MEDIA_SERVER_ZIP_FILE="ams_enterprise.zip" check_enterprise_file From 78488e6d2a57cb6ade34e9b5a19403be90021577 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Wed, 17 Apr 2024 08:59:08 +0300 Subject: [PATCH 51/67] fix json --- install_ant-media-server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ant-media-server.sh b/install_ant-media-server.sh index 76ad259c..91d8f803 100755 --- a/install_ant-media-server.sh +++ b/install_ant-media-server.sh @@ -25,7 +25,6 @@ RED='\033[0;31m' NC='\033[0m' #version that is being installed. It's get filled below VERSION= -VERSION_NAME=$(curl -s https://antmedia.io/download/latest-version.json | jq -r '.versionName') update_script () { SCRIPT_NAME="$0" @@ -281,6 +280,7 @@ if [ -z "$ANT_MEDIA_SERVER_ZIP_FILE" ]; then echo "Invalid license key. Please check your license key." exit 1 else + VERSION_NAME=$(curl -s https://antmedia.io/download/latest-version.json | jq -r '.versionName') echo "The license key is valid. Downloading the latest version ($VERSION_NAME) of Ant Media Server Enterprise Edition." curl --progress-bar -o ams_enterprise.zip "$check_license" ANT_MEDIA_SERVER_ZIP_FILE="ams_enterprise.zip" From ec76b41d147ec17855433f741e8ec79012d652f4 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 23 Apr 2024 08:01:16 +0300 Subject: [PATCH 52/67] Add Ubuntu 24.04 support --- install_ant-media-server.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_ant-media-server.sh b/install_ant-media-server.sh index 91d8f803..655b8a24 100755 --- a/install_ant-media-server.sh +++ b/install_ant-media-server.sh @@ -161,7 +161,7 @@ distro () { os_release="/etc/os-release" if [ -f "$os_release" ]; then . $os_release - msg="We are supporting Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Centos 8, Centos 9, RockyLinux 8, RockyLinux 9, AlmaLinux 8 and AlmaLinux 9" + msg="We are supporting Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Ubuntu 22.04, Centos 8, Centos 9, RockyLinux 8, RockyLinux 9, AlmaLinux 8 and AlmaLinux 9" if [ "$OTHER_DISTRO" == "true" ]; then echo -e """\n- OpenJDK 11 (openjdk-11-jdk)\n- De-archiver (unzip)\n- Commons Daemon (jsvc)\n- Apache Portable Runtime Library (libapr1)\n- SSL Development Files (libssl-dev)\n- Video Acceleration (VA) API (libva-drm2)\n- Video Acceleration (VA) API - X11 runtime (libva-x11-2)\n- Video Decode and Presentation API Library (libvdpau-dev)\n- Crystal HD Video Decoder Library (libcrystalhd-dev)\n""" read -p 'Are you sure that the above packages are installed? Y/N ' CUSTOM_PACKAGES @@ -182,7 +182,7 @@ distro () { exit 1 fi - if [[ $VERSION_ID != 18.04 ]] && [[ $VERSION_ID != 20.04 ]] && [[ $VERSION_ID != 22.04 ]] && [[ $VERSION_ID != 8* ]] && [[ $VERSION_ID != 9* ]]; then + if [[ $VERSION_ID != 18.04 ]] && [[ $VERSION_ID != 20.04 ]] && [[ $VERSION_ID != 22.04 ]] && [[ $VERSION_ID != 24.04 ]] && [[ $VERSION_ID != 8* ]] && [[ $VERSION_ID != 9* ]]; then echo $msg exit 1 fi From 6a61ed9073d162f3eb933d41bf0925a1b9254f87 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 23 Apr 2024 08:02:21 +0300 Subject: [PATCH 53/67] Update install_ant-media-server.sh --- install_ant-media-server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_ant-media-server.sh b/install_ant-media-server.sh index 655b8a24..164f9c5c 100755 --- a/install_ant-media-server.sh +++ b/install_ant-media-server.sh @@ -161,7 +161,7 @@ distro () { os_release="/etc/os-release" if [ -f "$os_release" ]; then . $os_release - msg="We are supporting Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Ubuntu 22.04, Centos 8, Centos 9, RockyLinux 8, RockyLinux 9, AlmaLinux 8 and AlmaLinux 9" + msg="We are supporting Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04, Centos 8, Centos 9, RockyLinux 8, RockyLinux 9, AlmaLinux 8 and AlmaLinux 9" if [ "$OTHER_DISTRO" == "true" ]; then echo -e """\n- OpenJDK 11 (openjdk-11-jdk)\n- De-archiver (unzip)\n- Commons Daemon (jsvc)\n- Apache Portable Runtime Library (libapr1)\n- SSL Development Files (libssl-dev)\n- Video Acceleration (VA) API (libva-drm2)\n- Video Acceleration (VA) API - X11 runtime (libva-x11-2)\n- Video Decode and Presentation API Library (libvdpau-dev)\n- Crystal HD Video Decoder Library (libcrystalhd-dev)\n""" read -p 'Are you sure that the above packages are installed? Y/N ' CUSTOM_PACKAGES From f98c9c0471ef5b0aed0fb0351b6792ee8d0c5082 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 23 Apr 2024 08:04:54 +0300 Subject: [PATCH 54/67] Create install-latest-to-ubuntu-24-04.yml --- .../install-latest-to-ubuntu-24-04.yml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/install-latest-to-ubuntu-24-04.yml diff --git a/.github/workflows/install-latest-to-ubuntu-24-04.yml b/.github/workflows/install-latest-to-ubuntu-24-04.yml new file mode 100644 index 00000000..7cf9f005 --- /dev/null +++ b/.github/workflows/install-latest-to-ubuntu-24-04.yml @@ -0,0 +1,53 @@ +name: Install Latest to Ubuntu 24.04 +on: [push] + +jobs: + Install-Ubuntu-24-04: + runs-on: ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + #Get latest version + - run: curl -L -o ant-media-server-community.zip $(curl -s https://api.github.com/repos/ant-media/Ant-Media-Server/releases/latest | grep "browser_download_url" | cut -d '"' -f 4) + - run: ./install_ant-media-server.sh -i ant-media-server-community.zip + - run: sleep 30 + - run: cat /usr/local/antmedia/log/ant-media-server.log + - run: | + if [ $(cat /usr/local/antmedia/log/ant-media-server.log | grep "LiveApp started" | wc -l | xargs) -eq 0 ]; then + echo "LiveApp started log does not exist. Check the logs above" + exit 1; + fi; + - run: cat /usr/local/antmedia/log/antmedia-error.log + Auto-Install-Community-: + runs-on: ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + #Get latest version + - run: ./install_ant-media-server.sh + - run: sleep 30 + - run: cat /usr/local/antmedia/log/ant-media-server.log + - run: | + if [ $(cat /usr/local/antmedia/log/ant-media-server.log | grep "LiveApp started" | wc -l | xargs) -eq 0 ]; then + echo "LiveApp started log does not exist. Check the logs above" + exit 1; + fi; + - run: cat /usr/local/antmedia/log/antmedia-error.log + Auto-Install-Enterprise-: + runs-on: ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + #Get latest version + - run: bash -x ./install_ant-media-server.sh -l"${{ secrets.ENTERPRISE_LICENSE }}" + - run: sleep 30 + - run: cat /usr/local/antmedia/log/ant-media-server.log + - run: | + if [ $(cat /usr/local/antmedia/log/ant-media-server.log | grep "LiveApp started" | wc -l | xargs) -eq 0 ]; then + echo "LiveApp started log does not exist. Check the logs above" + exit 1; + fi; + - run: cat /usr/local/antmedia/log/antmedia-error.log From eef72faff96dddba3888531001ed5cead83ead0e Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Tue, 23 Apr 2024 08:06:00 +0300 Subject: [PATCH 55/67] Create install-latest-snapshot-to-ubuntu-24-04.yml --- ...nstall-latest-snapshot-to-ubuntu-24-04.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml diff --git a/.github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml b/.github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml new file mode 100644 index 00000000..e4b2b970 --- /dev/null +++ b/.github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml @@ -0,0 +1,27 @@ +name: Install Latest Snapshot to Ubuntu 24.04 +on: [push] + +jobs: + Install-Ubuntu-24-04: + runs-on: ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + + - run: wget -O maven-metadata.xml https://oss.sonatype.org/service/local/repositories/snapshots/content/io/antmedia/ant-media-server/maven-metadata.xml + #Get latest snapshot + - run: | + export LATEST_SNAPSHOT=$(cat maven-metadata.xml | grep "" | tail -n 1 | xargs | cut -c 10-23) + echo $LATEST_SNAPSHOT + wget -O ant-media-server-community.zip "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=io.antmedia&a=ant-media-server&v=${LATEST_SNAPSHOT}&c=community&e=zip"; + - run: ./install_ant-media-server.sh -i ant-media-server-community.zip + - run: sudo service antmedia status + - run: sleep 30 + - run: cat /usr/local/antmedia/log/ant-media-server.log + - run: | + if [ $(cat /usr/local/antmedia/log/ant-media-server.log | grep "LiveApp started" | wc -l | xargs) -eq 0 ]; then + echo "LiveApp started log does not exist. Check the logs above" + exit 1; + fi; + - run: cat /usr/local/antmedia/log/antmedia-error.log From 8d1b78365783eea08063aa11efcec9080ad7c00c Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Fri, 26 Apr 2024 11:16:20 +0300 Subject: [PATCH 56/67] Refactor CF template for Ubuntu 22.04 --- cloudformation/antmedia-aws-autoscale-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index 6c46c9a1..c0aec616 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -4,7 +4,7 @@ Description: >- If you have any questions, please just drop a line to contact (at) antmedia.io Parameters: VpcCidrBlock: - Description: 'CIDR value for Wavelength Network' + Description: 'CIDR value for Network' Type: String MinLength: '9' MaxLength: '18' From 5e8fd88698cdc0a6bfa653029f5af0277be94015 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Fri, 26 Apr 2024 11:17:51 +0300 Subject: [PATCH 57/67] Update Lambda runtime --- cloudformation/antmedia-aws-autoscale-template.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index c0aec616..8fe45d7f 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -292,7 +292,7 @@ Resources: AMSGetLatestAMI: Type: AWS::Lambda::Function Properties: - Runtime: python3.11 + Runtime: python3.12 Handler: index.handler Role: !Sub ${DescribeImagesRole.Arn} Timeout: 60 @@ -326,7 +326,7 @@ Resources: UbuntuGetLatestAMI: Type: AWS::Lambda::Function Properties: - Runtime: python3.11 + Runtime: python3.12 Handler: index.handler Role: !Sub ${DescribeImagesRole.Arn} Timeout: 60 From ef890deb641cc541819d6a76720002fb10e5fe47 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Fri, 26 Apr 2024 11:23:05 +0300 Subject: [PATCH 58/67] Update helper script (cfn) --- .../antmedia-aws-autoscale-template.yaml | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index 8fe45d7f..8e84c894 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -569,15 +569,14 @@ Resources: UserData: Fn::Base64: !Sub | #!/bin/bash - touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} apt-get update - apt-get install -y python3-pip - apt-get install -y python3-setuptools + sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin - wget https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz - python3 -m easy_install --script-dir /opt/aws/bin aws-cfn-bootstrap-py3-latest.tar.gz - /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource OriginGroup --region ${AWS::Region} + sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz + sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup + /usr/local/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfigOrigin --configsets setup --region ${AWS::Region} + /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource OriginGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance Tags: @@ -648,12 +647,12 @@ Resources: touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} apt-get update - apt-get install -y python3-pip - apt-get install -y python3-setuptools + sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin - wget https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz - python3 -m easy_install --script-dir /opt/aws/bin aws-cfn-bootstrap-py3-latest.tar.gz - /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EdgeGroup --region ${AWS::Region} + sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz + sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup + /usr/local/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfigEdge --configsets setup --region ${AWS::Region} + /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EdgeGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance Tags: From 1401f26ccbbdfd462bf7024cde0c9a7f76881f4e Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Fri, 26 Apr 2024 11:46:18 +0300 Subject: [PATCH 59/67] Update MongoDB OS --- cloudformation/antmedia-aws-autoscale-template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index 8e84c894..a3edd256 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -380,7 +380,7 @@ Resources: Properties: ServiceToken: !Sub ${UbuntuGetLatestAMI.Arn} Owner: "099720109477" - Name: "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" + Name: "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*" Architecture: "x86_64" AntMediaVPC: From dd35956482694c9122ca6a1475ae4285605e2efe Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Fri, 26 Apr 2024 18:59:49 +0300 Subject: [PATCH 60/67] Fix cfn issue --- .../antmedia-aws-autoscale-template.yaml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cloudformation/antmedia-aws-autoscale-template.yaml b/cloudformation/antmedia-aws-autoscale-template.yaml index a3edd256..66ee6c40 100644 --- a/cloudformation/antmedia-aws-autoscale-template.yaml +++ b/cloudformation/antmedia-aws-autoscale-template.yaml @@ -569,13 +569,13 @@ Resources: UserData: Fn::Base64: !Sub | #!/bin/bash + touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} apt-get update sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup - /usr/local/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfigOrigin --configsets setup --region ${AWS::Region} /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource OriginGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance @@ -646,12 +646,11 @@ Resources: #!/bin/bash touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} - apt-get update + sudo apt-get update sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup - /usr/local/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfigEdge --configsets setup --region ${AWS::Region} /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EdgeGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance @@ -902,13 +901,8 @@ Resources: Fn::Base64: !Sub | #!/bin/bash -xe - wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list - sudo apt-get update - sudo apt-get install -y mongodb-org python3-pip python3-setuptools - sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mongod.conf - systemctl enable mongod - systemctl restart mongod + wget -P /tmp/ https://raw.githubusercontent.com/ant-media/Scripts/master/install_mongodb.sh + bash /tmp/install_mongodb.sh Outputs: From 6bbd7ff5364f59cc9ea76a8c8b1a65c93ff5c54e Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 6 May 2024 15:54:48 +0300 Subject: [PATCH 61/67] Disable temporary --- .github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml b/.github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml index e4b2b970..1cda503c 100644 --- a/.github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml +++ b/.github/workflows/install-latest-snapshot-to-ubuntu-24-04.yml @@ -1,5 +1,5 @@ name: Install Latest Snapshot to Ubuntu 24.04 -on: [push] +#on: [push] jobs: Install-Ubuntu-24-04: From bef4a33f3ffbf5ea7eb299e9784ef46a3412dbc0 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 6 May 2024 15:55:09 +0300 Subject: [PATCH 62/67] disable temporary --- .github/workflows/install-latest-to-ubuntu-24-04.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-latest-to-ubuntu-24-04.yml b/.github/workflows/install-latest-to-ubuntu-24-04.yml index 7cf9f005..9ca05277 100644 --- a/.github/workflows/install-latest-to-ubuntu-24-04.yml +++ b/.github/workflows/install-latest-to-ubuntu-24-04.yml @@ -1,5 +1,5 @@ name: Install Latest to Ubuntu 24.04 -on: [push] +#on: [push] jobs: Install-Ubuntu-24-04: From 6794ed05e6ea4e79f11faa5fba030b6a33dfed91 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Sun, 12 May 2024 23:42:36 +0300 Subject: [PATCH 63/67] Update cfn for Ubuntu 22.04 --- cloudformation/aws-streaming-wizard/template.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cloudformation/aws-streaming-wizard/template.yaml b/cloudformation/aws-streaming-wizard/template.yaml index 598de5d4..471d11ea 100644 --- a/cloudformation/aws-streaming-wizard/template.yaml +++ b/cloudformation/aws-streaming-wizard/template.yaml @@ -292,13 +292,12 @@ Resources: #!/bin/bash touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} - apt-get update - apt-get install -y python3-pip - apt-get install -y python3-setuptools + sudo apt-get update + sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin - wget https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz - python3 -m easy_install --script-dir /opt/aws/bin aws-cfn-bootstrap-py3-latest.tar.gz - /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource OriginGroup --region ${AWS::Region} + sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz + sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup + /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource OriginGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance Tags: From e169ed47affa3b70c8372f316e33da970b6dcbea Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Sun, 12 May 2024 23:43:21 +0300 Subject: [PATCH 64/67] Fix cfn for Ubuntu 22.04 --- cloudformation/aws-streaming-wizard/template.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cloudformation/aws-streaming-wizard/template.yaml b/cloudformation/aws-streaming-wizard/template.yaml index 471d11ea..e10e6ed3 100644 --- a/cloudformation/aws-streaming-wizard/template.yaml +++ b/cloudformation/aws-streaming-wizard/template.yaml @@ -360,13 +360,12 @@ Resources: #!/bin/bash touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} - apt-get update - apt-get install -y python3-pip - apt-get install -y python3-setuptools + sudo apt-get update + sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin - wget https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz - python3 -m easy_install --script-dir /opt/aws/bin aws-cfn-bootstrap-py3-latest.tar.gz - /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EdgeGroup --region ${AWS::Region} + sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz + sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup + /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EdgeGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance Tags: From 0463c3f04aca804f91951666ea1224bc9a2675bf Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Sun, 12 May 2024 23:44:02 +0300 Subject: [PATCH 65/67] Fix cfn for Ubuntu 22.04 --- .../template-custom-cert.yaml | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/cloudformation/aws-streaming-wizard/template-custom-cert.yaml b/cloudformation/aws-streaming-wizard/template-custom-cert.yaml index debdd014..89e4e60c 100644 --- a/cloudformation/aws-streaming-wizard/template-custom-cert.yaml +++ b/cloudformation/aws-streaming-wizard/template-custom-cert.yaml @@ -345,13 +345,12 @@ Resources: #!/bin/bash touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} - apt-get update - apt-get install -y python3-pip - apt-get install -y python3-setuptools + sudo apt-get update + sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin - wget https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz - python3 -m easy_install --script-dir /opt/aws/bin aws-cfn-bootstrap-py3-latest.tar.gz - /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource OriginGroup --region ${AWS::Region} + sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz + sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup + /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource OriginGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance Tags: @@ -414,13 +413,12 @@ Resources: #!/bin/bash touch /usr/local/antmedia/conf/initialized bash /usr/local/antmedia/change_server_mode.sh cluster ${DBInstance.PrivateIp} - apt-get update - apt-get install -y python3-pip - apt-get install -y python3-setuptools + sudo apt-get update + sudo apt-get -y install python3-pip mkdir -p /opt/aws/bin - wget https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz - python3 -m easy_install --script-dir /opt/aws/bin aws-cfn-bootstrap-py3-latest.tar.gz - /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EdgeGroup --region ${AWS::Region} + sudo pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-latest.tar.gz + sudo ln -s /usr/local/init/ubuntu/cfn-hup /etc/init.d/cfn-hup + /usr/local/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource EdgeGroup --region ${AWS::Region} TagSpecifications: - ResourceType: instance Tags: From 4603ca7af25a1d1af98267feb0b1620cd5cfb154 Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Sun, 12 May 2024 23:45:50 +0300 Subject: [PATCH 66/67] Add new mongodb script --- .../aws-streaming-wizard/template-custom-cert.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cloudformation/aws-streaming-wizard/template-custom-cert.yaml b/cloudformation/aws-streaming-wizard/template-custom-cert.yaml index 89e4e60c..a8f93707 100644 --- a/cloudformation/aws-streaming-wizard/template-custom-cert.yaml +++ b/cloudformation/aws-streaming-wizard/template-custom-cert.yaml @@ -658,13 +658,8 @@ Resources: Fn::Base64: !Sub | #!/bin/bash -xe - wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list - sudo apt-get update - sudo apt-get install -y mongodb-org python3-pip python3-setuptools - sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mongod.conf - systemctl enable mongod - systemctl restart mongod + wget -P /tmp/ https://raw.githubusercontent.com/ant-media/Scripts/master/install_mongodb.sh + bash /tmp/install_mongodb.sh Outputs: From 54149fdfdb6e27486653a8d3db2aebee2061233f Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Sun, 12 May 2024 23:46:12 +0300 Subject: [PATCH 67/67] Add new mongodb script --- cloudformation/aws-streaming-wizard/template.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cloudformation/aws-streaming-wizard/template.yaml b/cloudformation/aws-streaming-wizard/template.yaml index e10e6ed3..1d27dd61 100644 --- a/cloudformation/aws-streaming-wizard/template.yaml +++ b/cloudformation/aws-streaming-wizard/template.yaml @@ -605,13 +605,8 @@ Resources: Fn::Base64: !Sub | #!/bin/bash -xe - wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list - sudo apt-get update - sudo apt-get install -y mongodb-org python3-pip python3-setuptools - sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mongod.conf - systemctl enable mongod - systemctl restart mongod + wget -P /tmp/ https://raw.githubusercontent.com/ant-media/Scripts/master/install_mongodb.sh + bash /tmp/install_mongodb.sh Outputs: