mirror of https://github.com/OpenVidu/openvidu.git
openvidu-deployment: the same defaults and parameter names on every cloud
The templates of the five clouds had drifted apart. On AWS, Azure and Google Cloud: - 200 GB disk for the single node and the Master Nodes, the default where the template sets its size: Azure and Google Cloud raise it from 100 GB, as do the AWS High Availability Master Nodes. On Google Cloud an existing single node or Elastic Master Node keeps its disk when the template is applied again. - Google Cloud boots the latest Ubuntu 24.04 (the ubuntu-2404-lts image family) instead of an image pinned in December 2024; an existing single node or Master Node is not recreated when a newer image is published. - Same parameter names on every Terraform and Bicep template, with the old names deprecated but still honored (they win when set): rtcEngine on the Google Cloud single node, whose documented name was not applied, and masterNodeInstanceType on Google Cloud High Availability. - Azure no longer opens port 9000 (MinIO) on the single node and Elastic: MinIO does not run there, and the other clouds closed it in 3.9.0. - The Media Nodes install with the same arguments on every cloud: Azure passes --master-node-private-ip and no longer --enabled-modules, and the user-data names the variable MASTER_NODE_PRIVATE_IP everywhere. The CHANGELOG also lists the DigitalOcean and Oracle Cloud changes made in their repositories (v2compatibility by default, masterNodeInstanceType, the Oracle single node size and disk, rtcEngine).chore/update-openvidu-actions-1.0.25
parent
ab32615e4e
commit
58172d785d
|
|
@ -74,6 +74,40 @@ in the [openvidu-oracle](https://github.com/OpenVidu/openvidu-oracle) and
|
||||||
- With autoscaling, an unhealthy Media Node is tagged so the autoscaler deletes it and creates a new one. With
|
- With autoscaling, an unhealthy Media Node is tagged so the autoscaler deletes it and creates a new one. With
|
||||||
a fixed number of Media Nodes, the Droplet is rebuilt in place.
|
a fixed number of Media Nodes, the Droplet is rebuilt in place.
|
||||||
|
|
||||||
|
### Improved
|
||||||
|
|
||||||
|
#### All clouds
|
||||||
|
|
||||||
|
- The single node and the Master Nodes get a 200 GB disk by default on every cloud where the template sets
|
||||||
|
its size. Azure and Google Cloud raise it from 100 GB (single node, Elastic Master Node and High
|
||||||
|
Availability Master Nodes), as do the High Availability Master Nodes on AWS and the Elastic and High
|
||||||
|
Availability Master Nodes on Oracle Cloud. Oracle Cloud single node, which used the size of the image
|
||||||
|
(about 47 GB), now sets 200 GB. AWS single node and Elastic Master Node already had 200 GB, and on
|
||||||
|
DigitalOcean the disk comes with the Droplet size. On Google Cloud and Oracle Cloud single node and the
|
||||||
|
Google Cloud Elastic Master Node, an existing deployment keeps its disk when the template is applied again.
|
||||||
|
Where the size is a parameter, set it to 100 when you apply the new template to an existing deployment
|
||||||
|
(`masterNodesDiskSize` on Google Cloud, `masterNodeDiskSize` on Oracle Cloud): Google Cloud recreates a
|
||||||
|
Master Node whose disk size changes.
|
||||||
|
- Parameter names are the same on every Terraform and Bicep template. The old names still work and take
|
||||||
|
precedence when set, but they are deprecated and will be removed in a future release:
|
||||||
|
- Google Cloud and Oracle Cloud single node: `RTCEngine` is now `rtcEngine`, as in their Elastic and High
|
||||||
|
Availability templates and on Azure and DigitalOcean.
|
||||||
|
- Google Cloud and DigitalOcean High Availability: `masterNodesInstanceType` is now
|
||||||
|
`masterNodeInstanceType`, as in every Elastic template and in Azure High Availability.
|
||||||
|
|
||||||
|
#### Google Cloud
|
||||||
|
|
||||||
|
- Every machine boots the latest Ubuntu 24.04 image (the `ubuntu-2404-lts` image family), as on the other
|
||||||
|
clouds. Before, the templates were pinned to an image from December 2024. An existing single node or Master
|
||||||
|
Node is not recreated when a newer image is published. The Media Nodes move to the image family once: the
|
||||||
|
first time the new template is applied to an existing Elastic or High Availability deployment, its Media
|
||||||
|
Nodes are replaced.
|
||||||
|
|
||||||
|
#### Oracle Cloud
|
||||||
|
|
||||||
|
- Single node defaults to 2 OCPUs and 8 GB of memory, the size of its own Elastic Master Node and of the
|
||||||
|
4 vCPU and 8 GB machines of AWS and DigitalOcean. Before, it had 4 OCPUs with only 4 GB of memory.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
#### All clouds
|
#### All clouds
|
||||||
|
|
@ -104,3 +138,17 @@ in the [openvidu-oracle](https://github.com/OpenVidu/openvidu-oracle) and
|
||||||
|
|
||||||
A redeploy still cannot set the fixed, minimum or maximum number of Media Nodes below the Media Nodes
|
A redeploy still cannot set the fixed, minimum or maximum number of Media Nodes below the Media Nodes
|
||||||
running (`UnsupportedCapacity`); the administration documentation describes how to remove them first.
|
running (`UnsupportedCapacity`); the administration documentation describes how to remove them first.
|
||||||
|
- Single node and Elastic: the network security group still allowed port 9000 (MinIO) from the Internet.
|
||||||
|
MinIO does not run in Azure deployments, which store recordings and application data in Azure Blob Storage,
|
||||||
|
and the other clouds have kept this port closed since 3.9.0. The rule is removed.
|
||||||
|
|
||||||
|
#### Google Cloud
|
||||||
|
|
||||||
|
- Single node: the documentation names the media engine variable `rtcEngine`, but the template declared
|
||||||
|
`RTCEngine`, so a value set as documented was not applied. Both names work now.
|
||||||
|
|
||||||
|
#### DigitalOcean
|
||||||
|
|
||||||
|
- Elastic and High Availability: the OpenVidu v2 compatibility module (`v2compatibility`) was not enabled by
|
||||||
|
default, unlike on every other cloud and on DigitalOcean's Professional single node. It is now enabled by
|
||||||
|
default.
|
||||||
|
|
|
||||||
|
|
@ -747,7 +747,7 @@ resource openviduServer 'Microsoft.Compute/virtualMachines@2023-09-01' = {
|
||||||
managedDisk: {
|
managedDisk: {
|
||||||
storageAccountType: openviduVMSettings.osDiskType
|
storageAccountType: openviduVMSettings.osDiskType
|
||||||
}
|
}
|
||||||
diskSizeGB: 100
|
diskSizeGB: 200
|
||||||
}
|
}
|
||||||
imageReference: openviduVMSettings.ubuntuOSVersion
|
imageReference: openviduVMSettings.ubuntuOSVersion
|
||||||
}
|
}
|
||||||
|
|
@ -955,19 +955,6 @@ resource webServerSecurityGroup 'Microsoft.Network/networkSecurityGroups@2023-11
|
||||||
direction: 'Inbound'
|
direction: 'Inbound'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
|
||||||
name: 'MinIO'
|
|
||||||
properties: {
|
|
||||||
protocol: 'Tcp'
|
|
||||||
sourceAddressPrefix: '*'
|
|
||||||
sourcePortRange: '*'
|
|
||||||
destinationAddressPrefix: '*'
|
|
||||||
destinationPortRange: '9000'
|
|
||||||
access: 'Allow'
|
|
||||||
priority: 170
|
|
||||||
direction: 'Inbound'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
name: 'WebRTC_traffic_UDP'
|
name: 'WebRTC_traffic_UDP'
|
||||||
properties: {
|
properties: {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"_generator": {
|
"_generator": {
|
||||||
"name": "bicep",
|
"name": "bicep",
|
||||||
"version": "0.46.1.21595",
|
"version": "0.46.1.21595",
|
||||||
"templateHash": "3312405466108841843"
|
"templateHash": "11383011699784191045"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
|
@ -261,7 +261,7 @@
|
||||||
"managedDisk": {
|
"managedDisk": {
|
||||||
"storageAccountType": "[variables('openviduVMSettings').osDiskType]"
|
"storageAccountType": "[variables('openviduVMSettings').osDiskType]"
|
||||||
},
|
},
|
||||||
"diskSizeGB": 100
|
"diskSizeGB": 200
|
||||||
},
|
},
|
||||||
"imageReference": "[variables('openviduVMSettings').ubuntuOSVersion]"
|
"imageReference": "[variables('openviduVMSettings').ubuntuOSVersion]"
|
||||||
},
|
},
|
||||||
|
|
@ -472,19 +472,6 @@
|
||||||
"direction": "Inbound"
|
"direction": "Inbound"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "MinIO",
|
|
||||||
"properties": {
|
|
||||||
"protocol": "Tcp",
|
|
||||||
"sourceAddressPrefix": "*",
|
|
||||||
"sourcePortRange": "*",
|
|
||||||
"destinationAddressPrefix": "*",
|
|
||||||
"destinationPortRange": "9000",
|
|
||||||
"access": "Allow",
|
|
||||||
"priority": 170,
|
|
||||||
"direction": "Inbound"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "WebRTC_traffic_UDP",
|
"name": "WebRTC_traffic_UDP",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ locals {
|
||||||
is_arm_instance = startswith(var.instanceType, "c4a-") || startswith(var.instanceType, "t2a-") || startswith(var.instanceType, "n4a-") || startswith(var.instanceType, "a4x-")
|
is_arm_instance = startswith(var.instanceType, "c4a-") || startswith(var.instanceType, "t2a-") || startswith(var.instanceType, "n4a-") || startswith(var.instanceType, "a4x-")
|
||||||
yq_arch = local.is_arm_instance ? "arm64" : "amd64"
|
yq_arch = local.is_arm_instance ? "arm64" : "amd64"
|
||||||
|
|
||||||
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-noble-arm64-v20241219" : "ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20241219"
|
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-lts-arm64" : "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
|
||||||
|
|
||||||
# C4A (Axion) does not support pd-standard boot disks — it requires Hyperdisk.
|
# C4A (Axion) does not support pd-standard boot disks — it requires Hyperdisk.
|
||||||
# Mirror the pro/elastic template's logic so ARM singlenode deploys succeed.
|
# Mirror the pro/elastic template's logic so ARM singlenode deploys succeed.
|
||||||
|
|
@ -107,11 +107,17 @@ resource "google_compute_instance" "openvidu_server" {
|
||||||
boot_disk {
|
boot_disk {
|
||||||
initialize_params {
|
initialize_params {
|
||||||
image = local.ubuntu_image
|
image = local.ubuntu_image
|
||||||
size = 100
|
size = 200
|
||||||
type = local.is_c4a_instance ? "hyperdisk-balanced" : "pd-standard"
|
type = local.is_c4a_instance ? "hyperdisk-balanced" : "pd-standard"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The image family moves to each new Ubuntu 24.04 build and the disk size can change between
|
||||||
|
# releases: both apply to new deployments only, so a re-apply never recreates this VM.
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [boot_disk[0].initialize_params[0].image, boot_disk[0].initialize_params[0].size]
|
||||||
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = "default"
|
network = "default"
|
||||||
access_config {
|
access_config {
|
||||||
|
|
|
||||||
|
|
@ -2134,7 +2134,7 @@ Resources:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get Master Node private IP
|
# Get Master Node private IP
|
||||||
MASTER_NODE_IP=${OpenViduMasterNode.PrivateIp}
|
MASTER_NODE_PRIVATE_IP=${OpenViduMasterNode.PrivateIp}
|
||||||
|
|
||||||
# Download first: sh <(curl ...) would silently run an empty script on a transient curl failure
|
# Download first: sh <(curl ...) would silently run an empty script on a transient curl failure
|
||||||
INSTALLER_SCRIPT="/tmp/install_ov_media_node.sh"
|
INSTALLER_SCRIPT="/tmp/install_ov_media_node.sh"
|
||||||
|
|
@ -2152,7 +2152,7 @@ Resources:
|
||||||
"--environment=aws"
|
"--environment=aws"
|
||||||
"--deployment-type=elastic"
|
"--deployment-type=elastic"
|
||||||
"--node-role='media-node'"
|
"--node-role='media-node'"
|
||||||
"--master-node-private-ip=$MASTER_NODE_IP"
|
"--master-node-private-ip=$MASTER_NODE_PRIVATE_IP"
|
||||||
"--private-ip=$PRIVATE_IP"
|
"--private-ip=$PRIVATE_IP"
|
||||||
"--redis-password=$REDIS_PASSWORD"
|
"--redis-password=$REDIS_PASSWORD"
|
||||||
)
|
)
|
||||||
|
|
@ -2547,10 +2547,10 @@ Resources:
|
||||||
/usr/local/bin/install.sh || ov_media_bootstrap_failed "install.sh failed"
|
/usr/local/bin/install.sh || ov_media_bootstrap_failed "install.sh failed"
|
||||||
|
|
||||||
# Wait for the master node to be healthy before starting (bounded: up to 1800s at 5s)
|
# Wait for the master node to be healthy before starting (bounded: up to 1800s at 5s)
|
||||||
MASTER_NODE_IP=${OpenViduMasterNode.PrivateIp}
|
MASTER_NODE_PRIVATE_IP=${OpenViduMasterNode.PrivateIp}
|
||||||
MASTER_HEALTHY=false
|
MASTER_HEALTHY=false
|
||||||
for i in $(seq 1 360); do
|
for i in $(seq 1 360); do
|
||||||
if curl -sf "http://$MASTER_NODE_IP:7880/health/caddy" >/dev/null 2>&1; then
|
if curl -sf "http://$MASTER_NODE_PRIVATE_IP:7880/health/caddy" >/dev/null 2>&1; then
|
||||||
MASTER_HEALTHY=true
|
MASTER_HEALTHY=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -893,7 +893,7 @@ resource openviduMasterNode 'Microsoft.Compute/virtualMachines@2023-09-01' = {
|
||||||
managedDisk: {
|
managedDisk: {
|
||||||
storageAccountType: masterNodeVMSettings.osDiskType
|
storageAccountType: masterNodeVMSettings.osDiskType
|
||||||
}
|
}
|
||||||
diskSizeGB: 100
|
diskSizeGB: 200
|
||||||
}
|
}
|
||||||
imageReference: masterNodeVMSettings.ubuntuOSVersion
|
imageReference: masterNodeVMSettings.ubuntuOSVersion
|
||||||
}
|
}
|
||||||
|
|
@ -959,11 +959,10 @@ set -e
|
||||||
DOMAIN=$(az keyvault secret show --vault-name ${keyVaultName} --name DOMAIN-NAME --query value -o tsv)
|
DOMAIN=$(az keyvault secret show --vault-name ${keyVaultName} --name DOMAIN-NAME --query value -o tsv)
|
||||||
OPENVIDU_PRO_LICENSE=$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-PRO-LICENSE --query value -o tsv)
|
OPENVIDU_PRO_LICENSE=$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-PRO-LICENSE --query value -o tsv)
|
||||||
REDIS_PASSWORD=$(az keyvault secret show --vault-name ${keyVaultName} --name REDIS-PASSWORD --query value -o tsv)
|
REDIS_PASSWORD=$(az keyvault secret show --vault-name ${keyVaultName} --name REDIS-PASSWORD --query value -o tsv)
|
||||||
ENABLED_MODULES=$(az keyvault secret show --vault-name ${keyVaultName} --name ENABLED-MODULES --query value -o tsv)
|
|
||||||
OPENVIDU_VERSION="$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-VERSION --query value -o tsv)"
|
OPENVIDU_VERSION="$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-VERSION --query value -o tsv)"
|
||||||
|
|
||||||
# Get Master Node private IP
|
# Get Master Node private IP
|
||||||
MASTER_NODE_IP=${privateIPMasterNode}
|
MASTER_NODE_PRIVATE_IP=${privateIPMasterNode}
|
||||||
|
|
||||||
# Download to a file first: process substitution would silently run an empty script on a transient curl failure
|
# Download to a file first: process substitution would silently run an empty script on a transient curl failure
|
||||||
INSTALLER_SCRIPT="/tmp/install_ov_media_node.sh"
|
INSTALLER_SCRIPT="/tmp/install_ov_media_node.sh"
|
||||||
|
|
@ -983,9 +982,8 @@ COMMON_ARGS=(
|
||||||
"--environment=azure"
|
"--environment=azure"
|
||||||
"--deployment-type=elastic"
|
"--deployment-type=elastic"
|
||||||
"--node-role='media-node'"
|
"--node-role='media-node'"
|
||||||
"--master-node-private-ip=$MASTER_NODE_IP"
|
"--master-node-private-ip=$MASTER_NODE_PRIVATE_IP"
|
||||||
"--private-ip=$PRIVATE_IP"
|
"--private-ip=$PRIVATE_IP"
|
||||||
"--enabled-modules='$ENABLED_MODULES'"
|
|
||||||
"--redis-password=$REDIS_PASSWORD"
|
"--redis-password=$REDIS_PASSWORD"
|
||||||
)
|
)
|
||||||
# Construct the final command with all arguments
|
# Construct the final command with all arguments
|
||||||
|
|
@ -1852,19 +1850,6 @@ resource openviduMasterNodeNSG 'Microsoft.Network/networkSecurityGroups@2023-11-
|
||||||
direction: 'Inbound'
|
direction: 'Inbound'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
|
||||||
name: 'MinIO'
|
|
||||||
properties: {
|
|
||||||
protocol: 'Tcp'
|
|
||||||
sourceAddressPrefix: '*'
|
|
||||||
sourcePortRange: '*'
|
|
||||||
destinationAddressPrefix: '*'
|
|
||||||
destinationPortRange: '9000'
|
|
||||||
access: 'Allow'
|
|
||||||
priority: 140
|
|
||||||
direction: 'Inbound'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"_generator": {
|
"_generator": {
|
||||||
"name": "bicep",
|
"name": "bicep",
|
||||||
"version": "0.46.1.21595",
|
"version": "0.46.1.21595",
|
||||||
"templateHash": "12314273468008882970"
|
"templateHash": "5733974944942002101"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
|
@ -286,7 +286,7 @@
|
||||||
"base64check_app_readyMaster": "[base64(variables('check_app_readyScriptMaster'))]",
|
"base64check_app_readyMaster": "[base64(variables('check_app_readyScriptMaster'))]",
|
||||||
"base64restartMaster": "[base64(variables('restartScriptMaster'))]",
|
"base64restartMaster": "[base64(variables('restartScriptMaster'))]",
|
||||||
"userDataTemplateMasterNode": "#!/bin/bash\nset -eu -o pipefail\n\n# Introduce the scripts in the instance\n# install.sh\necho ${base64install} | base64 -d > /usr/local/bin/install.sh\nchmod +x /usr/local/bin/install.sh\n\n# after_install.sh\necho ${base64after_install} | base64 -d > /usr/local/bin/after_install.sh\nchmod +x /usr/local/bin/after_install.sh\n\n# update_config_from_secret.sh\necho ${base64update_config_from_secret} | base64 -d > /usr/local/bin/update_config_from_secret.sh\nchmod +x /usr/local/bin/update_config_from_secret.sh\n\n# update_secret_from_config.sh\necho ${base64update_secret_from_config} | base64 -d > /usr/local/bin/update_secret_from_config.sh\nchmod +x /usr/local/bin/update_secret_from_config.sh\n\n# get_value_from_config.sh\necho ${base64get_value_from_config} | base64 -d > /usr/local/bin/get_value_from_config.sh\nchmod +x /usr/local/bin/get_value_from_config.sh\n\n# store_secret.sh\necho ${base64store_secret} | base64 -d > /usr/local/bin/store_secret.sh\nchmod +x /usr/local/bin/store_secret.sh\n\n# get_public_ip.sh\necho ${base64get_public_ip} | base64 -d > /usr/local/bin/get_public_ip.sh\nchmod +x /usr/local/bin/get_public_ip.sh\n\n# check_app_ready.sh\necho ${base64check_app_ready} | base64 -d > /usr/local/bin/check_app_ready.sh\nchmod +x /usr/local/bin/check_app_ready.sh\n\n# restart.sh\necho ${base64restart} | base64 -d > /usr/local/bin/restart.sh\nchmod +x /usr/local/bin/restart.sh\n\necho ${base64config_blobStorage} | base64 -d > /usr/local/bin/config_blobStorage.sh\nchmod +x /usr/local/bin/config_blobStorage.sh\n\n# Install azure cli\nAZURE_CLI_VERSION=2.90.0\napt-get install -y apt-transport-https ca-certificates gnupg lsb-release\ncurl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/microsoft.gpg\necho \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main\" | tee /etc/apt/sources.list.d/azure-cli.list\napt-get update\napt-get install -y azure-cli=${AZURE_CLI_VERSION}-1~$(lsb_release -cs)\n\naz login --identity --allow-no-subscriptions\n\necho \"DPkg::Lock::Timeout \\\"-1\\\";\" > /etc/apt/apt.conf.d/99timeout\n\nexport HOME=\"/root\"\n\n# Install OpenVidu\n/usr/local/bin/install.sh || { echo \"[OpenVidu] error installing OpenVidu\"; exit 1; }\n\n#Config blob storage\n/usr/local/bin/config_blobStorage.sh || { echo \"[OpenVidu] error configuring Blob Storage\"; exit 1; }\n\n# Start OpenVidu\nsystemctl start openvidu || { echo \"[OpenVidu] error starting OpenVidu\"; exit 1; }\n\n# Update shared secret\n/usr/local/bin/after_install.sh || { echo \"[OpenVidu] error updating shared secret\"; exit 1; }\n\n# Launch on reboot\necho \"@reboot /usr/local/bin/restart.sh >> /var/log/openvidu-restart.log\" 2>&1 | crontab\n\n# check_app_ready.sh internally caps its wait at 1200s\n/usr/local/bin/check_app_ready.sh || { echo \"[OpenVidu] master node did not become healthy\"; exit 1; }\n\naz keyvault secret set --vault-name ${keyVaultName} --name FINISH-MASTER-NODE --value \"true\"\n\nset +e\naz storage blob upload --account-name ${storageAccountName} --container-name automation-locks --name lock.txt --file /dev/null --auth-mode key\nset -e\n",
|
"userDataTemplateMasterNode": "#!/bin/bash\nset -eu -o pipefail\n\n# Introduce the scripts in the instance\n# install.sh\necho ${base64install} | base64 -d > /usr/local/bin/install.sh\nchmod +x /usr/local/bin/install.sh\n\n# after_install.sh\necho ${base64after_install} | base64 -d > /usr/local/bin/after_install.sh\nchmod +x /usr/local/bin/after_install.sh\n\n# update_config_from_secret.sh\necho ${base64update_config_from_secret} | base64 -d > /usr/local/bin/update_config_from_secret.sh\nchmod +x /usr/local/bin/update_config_from_secret.sh\n\n# update_secret_from_config.sh\necho ${base64update_secret_from_config} | base64 -d > /usr/local/bin/update_secret_from_config.sh\nchmod +x /usr/local/bin/update_secret_from_config.sh\n\n# get_value_from_config.sh\necho ${base64get_value_from_config} | base64 -d > /usr/local/bin/get_value_from_config.sh\nchmod +x /usr/local/bin/get_value_from_config.sh\n\n# store_secret.sh\necho ${base64store_secret} | base64 -d > /usr/local/bin/store_secret.sh\nchmod +x /usr/local/bin/store_secret.sh\n\n# get_public_ip.sh\necho ${base64get_public_ip} | base64 -d > /usr/local/bin/get_public_ip.sh\nchmod +x /usr/local/bin/get_public_ip.sh\n\n# check_app_ready.sh\necho ${base64check_app_ready} | base64 -d > /usr/local/bin/check_app_ready.sh\nchmod +x /usr/local/bin/check_app_ready.sh\n\n# restart.sh\necho ${base64restart} | base64 -d > /usr/local/bin/restart.sh\nchmod +x /usr/local/bin/restart.sh\n\necho ${base64config_blobStorage} | base64 -d > /usr/local/bin/config_blobStorage.sh\nchmod +x /usr/local/bin/config_blobStorage.sh\n\n# Install azure cli\nAZURE_CLI_VERSION=2.90.0\napt-get install -y apt-transport-https ca-certificates gnupg lsb-release\ncurl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/microsoft.gpg\necho \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/trusted.gpg.d/microsoft.gpg] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main\" | tee /etc/apt/sources.list.d/azure-cli.list\napt-get update\napt-get install -y azure-cli=${AZURE_CLI_VERSION}-1~$(lsb_release -cs)\n\naz login --identity --allow-no-subscriptions\n\necho \"DPkg::Lock::Timeout \\\"-1\\\";\" > /etc/apt/apt.conf.d/99timeout\n\nexport HOME=\"/root\"\n\n# Install OpenVidu\n/usr/local/bin/install.sh || { echo \"[OpenVidu] error installing OpenVidu\"; exit 1; }\n\n#Config blob storage\n/usr/local/bin/config_blobStorage.sh || { echo \"[OpenVidu] error configuring Blob Storage\"; exit 1; }\n\n# Start OpenVidu\nsystemctl start openvidu || { echo \"[OpenVidu] error starting OpenVidu\"; exit 1; }\n\n# Update shared secret\n/usr/local/bin/after_install.sh || { echo \"[OpenVidu] error updating shared secret\"; exit 1; }\n\n# Launch on reboot\necho \"@reboot /usr/local/bin/restart.sh >> /var/log/openvidu-restart.log\" 2>&1 | crontab\n\n# check_app_ready.sh internally caps its wait at 1200s\n/usr/local/bin/check_app_ready.sh || { echo \"[OpenVidu] master node did not become healthy\"; exit 1; }\n\naz keyvault secret set --vault-name ${keyVaultName} --name FINISH-MASTER-NODE --value \"true\"\n\nset +e\naz storage blob upload --account-name ${storageAccountName} --container-name automation-locks --name lock.txt --file /dev/null --auth-mode key\nset -e\n",
|
||||||
"installScriptTemplateMedia": "#!/bin/bash\nset -e\nDOMAIN=\n\n# Install dependencies\necho \"DPkg::Lock::Timeout \\\"-1\\\";\" > /etc/apt/apt.conf.d/99timeout\n\napt-get update && apt-get install -y \\\n curl \\\n unzip \\\n jq \\\n wget\n\n# Get own private IP\nPRIVATE_IP=$(curl -H Metadata:true --noproxy \"*\" \"http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-08-01&format=text\")\n\n# Gate 1: wait for master secrets before installing\nWAIT_INTERVAL=5\nMAX_RETRIES=360\nRETRIES=0\nset +e\nwhile true; do\n ALL_SECRETS_GENERATED=$(az keyvault secret show --vault-name ${keyVaultName} --name ALL-SECRETS-GENERATED --query value -o tsv 2>/dev/null)\n if [ \"$ALL_SECRETS_GENERATED\" == \"true\" ]; then\n break\n fi\n RETRIES=$((RETRIES + 1))\n if [ $RETRIES -ge $MAX_RETRIES ]; then\n echo \"[OpenVidu] timed out after 30 min waiting for ALL-SECRETS-GENERATED\"\n exit 1\n fi\n sleep $WAIT_INTERVAL\ndone\nset -e\n# Get current shared secret\nDOMAIN=$(az keyvault secret show --vault-name ${keyVaultName} --name DOMAIN-NAME --query value -o tsv)\nOPENVIDU_PRO_LICENSE=$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-PRO-LICENSE --query value -o tsv)\nREDIS_PASSWORD=$(az keyvault secret show --vault-name ${keyVaultName} --name REDIS-PASSWORD --query value -o tsv)\nENABLED_MODULES=$(az keyvault secret show --vault-name ${keyVaultName} --name ENABLED-MODULES --query value -o tsv)\nOPENVIDU_VERSION=\"$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-VERSION --query value -o tsv)\"\n\n# Get Master Node private IP\nMASTER_NODE_IP=${privateIPMasterNode}\n\n# Download to a file first: process substitution would silently run an empty script on a transient curl failure\nINSTALLER_SCRIPT=\"/tmp/install_ov_media_node.sh\"\ncurl -fsSL --retry 8 --retry-all-errors --retry-delay 5 -o \"$INSTALLER_SCRIPT\" \"https://get.openvidu.io/pro/elastic/$OPENVIDU_VERSION/install_ov_media_node.sh\"\nif [ ! -s \"$INSTALLER_SCRIPT\" ]; then\n echo \"[OpenVidu] failed to download the media node installer script\"\n exit 1\nfi\n\n# Base command\nINSTALL_COMMAND=\"sh $INSTALLER_SCRIPT\"\n\n# Common arguments\nCOMMON_ARGS=(\n \"--no-tty\"\n \"--install\"\n \"--environment=azure\"\n \"--deployment-type=elastic\"\n \"--node-role='media-node'\"\n \"--master-node-private-ip=$MASTER_NODE_IP\"\n \"--private-ip=$PRIVATE_IP\"\n \"--enabled-modules='$ENABLED_MODULES'\"\n \"--redis-password=$REDIS_PASSWORD\"\n)\n# Construct the final command with all arguments\nFINAL_COMMAND=\"$INSTALL_COMMAND $(printf \"%s \" \"${COMMON_ARGS[@]}\")\"\n\n# Install OpenVidu\nexec bash -c \"$FINAL_COMMAND\"\n",
|
"installScriptTemplateMedia": "#!/bin/bash\nset -e\nDOMAIN=\n\n# Install dependencies\necho \"DPkg::Lock::Timeout \\\"-1\\\";\" > /etc/apt/apt.conf.d/99timeout\n\napt-get update && apt-get install -y \\\n curl \\\n unzip \\\n jq \\\n wget\n\n# Get own private IP\nPRIVATE_IP=$(curl -H Metadata:true --noproxy \"*\" \"http://169.254.169.254/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-08-01&format=text\")\n\n# Gate 1: wait for master secrets before installing\nWAIT_INTERVAL=5\nMAX_RETRIES=360\nRETRIES=0\nset +e\nwhile true; do\n ALL_SECRETS_GENERATED=$(az keyvault secret show --vault-name ${keyVaultName} --name ALL-SECRETS-GENERATED --query value -o tsv 2>/dev/null)\n if [ \"$ALL_SECRETS_GENERATED\" == \"true\" ]; then\n break\n fi\n RETRIES=$((RETRIES + 1))\n if [ $RETRIES -ge $MAX_RETRIES ]; then\n echo \"[OpenVidu] timed out after 30 min waiting for ALL-SECRETS-GENERATED\"\n exit 1\n fi\n sleep $WAIT_INTERVAL\ndone\nset -e\n# Get current shared secret\nDOMAIN=$(az keyvault secret show --vault-name ${keyVaultName} --name DOMAIN-NAME --query value -o tsv)\nOPENVIDU_PRO_LICENSE=$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-PRO-LICENSE --query value -o tsv)\nREDIS_PASSWORD=$(az keyvault secret show --vault-name ${keyVaultName} --name REDIS-PASSWORD --query value -o tsv)\nOPENVIDU_VERSION=\"$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-VERSION --query value -o tsv)\"\n\n# Get Master Node private IP\nMASTER_NODE_PRIVATE_IP=${privateIPMasterNode}\n\n# Download to a file first: process substitution would silently run an empty script on a transient curl failure\nINSTALLER_SCRIPT=\"/tmp/install_ov_media_node.sh\"\ncurl -fsSL --retry 8 --retry-all-errors --retry-delay 5 -o \"$INSTALLER_SCRIPT\" \"https://get.openvidu.io/pro/elastic/$OPENVIDU_VERSION/install_ov_media_node.sh\"\nif [ ! -s \"$INSTALLER_SCRIPT\" ]; then\n echo \"[OpenVidu] failed to download the media node installer script\"\n exit 1\nfi\n\n# Base command\nINSTALL_COMMAND=\"sh $INSTALLER_SCRIPT\"\n\n# Common arguments\nCOMMON_ARGS=(\n \"--no-tty\"\n \"--install\"\n \"--environment=azure\"\n \"--deployment-type=elastic\"\n \"--node-role='media-node'\"\n \"--master-node-private-ip=$MASTER_NODE_PRIVATE_IP\"\n \"--private-ip=$PRIVATE_IP\"\n \"--redis-password=$REDIS_PASSWORD\"\n)\n# Construct the final command with all arguments\nFINAL_COMMAND=\"$INSTALL_COMMAND $(printf \"%s \" \"${COMMON_ARGS[@]}\")\"\n\n# Install OpenVidu\nexec bash -c \"$FINAL_COMMAND\"\n",
|
||||||
"stopMediaNodeParams": {
|
"stopMediaNodeParams": {
|
||||||
"subscriptionId": "[subscription().subscriptionId]",
|
"subscriptionId": "[subscription().subscriptionId]",
|
||||||
"resourceGroupName": "[resourceGroup().name]",
|
"resourceGroupName": "[resourceGroup().name]",
|
||||||
|
|
@ -392,7 +392,7 @@
|
||||||
"managedDisk": {
|
"managedDisk": {
|
||||||
"storageAccountType": "[variables('masterNodeVMSettings').osDiskType]"
|
"storageAccountType": "[variables('masterNodeVMSettings').osDiskType]"
|
||||||
},
|
},
|
||||||
"diskSizeGB": 100
|
"diskSizeGB": 200
|
||||||
},
|
},
|
||||||
"imageReference": "[variables('masterNodeVMSettings').ubuntuOSVersion]"
|
"imageReference": "[variables('masterNodeVMSettings').ubuntuOSVersion]"
|
||||||
},
|
},
|
||||||
|
|
@ -811,19 +811,6 @@
|
||||||
"priority": 130,
|
"priority": 130,
|
||||||
"direction": "Inbound"
|
"direction": "Inbound"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MinIO",
|
|
||||||
"properties": {
|
|
||||||
"protocol": "Tcp",
|
|
||||||
"sourceAddressPrefix": "*",
|
|
||||||
"sourcePortRange": "*",
|
|
||||||
"destinationAddressPrefix": "*",
|
|
||||||
"destinationPortRange": "9000",
|
|
||||||
"access": "Allow",
|
|
||||||
"priority": 140,
|
|
||||||
"direction": "Inbound"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ locals {
|
||||||
is_arm_instance = startswith(var.masterNodeInstanceType, "c4a-") || startswith(var.masterNodeInstanceType, "t2a-") || startswith(var.masterNodeInstanceType, "n4a-") || startswith(var.masterNodeInstanceType, "a4x-")
|
is_arm_instance = startswith(var.masterNodeInstanceType, "c4a-") || startswith(var.masterNodeInstanceType, "t2a-") || startswith(var.masterNodeInstanceType, "n4a-") || startswith(var.masterNodeInstanceType, "a4x-")
|
||||||
yq_arch = local.is_arm_instance ? "arm64" : "amd64"
|
yq_arch = local.is_arm_instance ? "arm64" : "amd64"
|
||||||
|
|
||||||
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-noble-arm64-v20241219" : "ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20241219"
|
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-lts-arm64" : "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
|
||||||
is_c4a_instance = startswith(var.masterNodeInstanceType, "c4a-")
|
is_c4a_instance = startswith(var.masterNodeInstanceType, "c4a-")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -159,11 +159,20 @@ resource "google_compute_instance" "openvidu_master_node" {
|
||||||
boot_disk {
|
boot_disk {
|
||||||
initialize_params {
|
initialize_params {
|
||||||
image = local.ubuntu_image
|
image = local.ubuntu_image
|
||||||
size = 100
|
size = 200
|
||||||
type = local.is_c4a_instance ? "hyperdisk-balanced" : "pd-standard"
|
type = local.is_c4a_instance ? "hyperdisk-balanced" : "pd-standard"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Keep existing Master Nodes when a newer Ubuntu 24.04 image is published or when the
|
||||||
|
# default boot disk size changes, so a re-apply never recreates a running Master Node.
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
boot_disk[0].initialize_params[0].image,
|
||||||
|
boot_disk[0].initialize_params[0].size,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = "default"
|
network = "default"
|
||||||
access_config {
|
access_config {
|
||||||
|
|
@ -207,7 +216,7 @@ resource "google_compute_instance" "openvidu_master_node" {
|
||||||
locals {
|
locals {
|
||||||
is_arm_instance_media = startswith(var.mediaNodeInstanceType, "c4a-") || startswith(var.mediaNodeInstanceType, "t2a-") || startswith(var.mediaNodeInstanceType, "n4a-") || startswith(var.mediaNodeInstanceType, "a4x-")
|
is_arm_instance_media = startswith(var.mediaNodeInstanceType, "c4a-") || startswith(var.mediaNodeInstanceType, "t2a-") || startswith(var.mediaNodeInstanceType, "n4a-") || startswith(var.mediaNodeInstanceType, "a4x-")
|
||||||
|
|
||||||
ubuntu_image_media = local.is_arm_instance_media ? "ubuntu-os-cloud/ubuntu-2404-noble-arm64-v20241219" : "ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20241219"
|
ubuntu_image_media = local.is_arm_instance_media ? "ubuntu-os-cloud/ubuntu-2404-lts-arm64" : "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
|
||||||
is_c4a_instance_media = startswith(var.mediaNodeInstanceType, "c4a-")
|
is_c4a_instance_media = startswith(var.mediaNodeInstanceType, "c4a-")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1066,7 +1066,7 @@ Parameters:
|
||||||
MasterNodesDiskSize:
|
MasterNodesDiskSize:
|
||||||
Description: Size of the disk in GB
|
Description: Size of the disk in GB
|
||||||
Type: Number
|
Type: Number
|
||||||
Default: 100
|
Default: 200
|
||||||
MinValue: 50
|
MinValue: 50
|
||||||
ConstraintDescription: The disk size must be at least 50 GB
|
ConstraintDescription: The disk size must be at least 50 GB
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ param initialMeetApiKey string = ''
|
||||||
param masterNodeInstanceType string = 'Standard_B4s'
|
param masterNodeInstanceType string = 'Standard_B4s'
|
||||||
|
|
||||||
@description('Size of the disk in GB')
|
@description('Size of the disk in GB')
|
||||||
param masterNodesDiskSize int = 100
|
param masterNodesDiskSize int = 200
|
||||||
|
|
||||||
@description('Specifies the VM size for your OpenVidu Media Nodes. You can use any valid Azure VM size (e.g., Standard_B4s, Standard_D4s_v5, Standard_E4ps_v5). See https://learn.microsoft.com/en-us/azure/virtual-machines/sizes for available sizes.')
|
@description('Specifies the VM size for your OpenVidu Media Nodes. You can use any valid Azure VM size (e.g., Standard_B4s, Standard_D4s_v5, Standard_E4ps_v5). See https://learn.microsoft.com/en-us/azure/virtual-machines/sizes for available sizes.')
|
||||||
param mediaNodeInstanceType string = 'Standard_B4s'
|
param mediaNodeInstanceType string = 'Standard_B4s'
|
||||||
|
|
@ -1353,7 +1353,6 @@ MASTER_NODE_3_PRIVATE_IP=$(az keyvault secret show --vault-name ${keyVaultName}
|
||||||
MASTER_NODE_4_PRIVATE_IP=$(az keyvault secret show --vault-name ${keyVaultName} --name MASTER-NODE-4-PRIVATE-IP --query value -o tsv)
|
MASTER_NODE_4_PRIVATE_IP=$(az keyvault secret show --vault-name ${keyVaultName} --name MASTER-NODE-4-PRIVATE-IP --query value -o tsv)
|
||||||
MASTER_NODE_PRIVATE_IP_LIST="$MASTER_NODE_1_PRIVATE_IP,$MASTER_NODE_2_PRIVATE_IP,$MASTER_NODE_3_PRIVATE_IP,$MASTER_NODE_4_PRIVATE_IP"
|
MASTER_NODE_PRIVATE_IP_LIST="$MASTER_NODE_1_PRIVATE_IP,$MASTER_NODE_2_PRIVATE_IP,$MASTER_NODE_3_PRIVATE_IP,$MASTER_NODE_4_PRIVATE_IP"
|
||||||
REDIS_PASSWORD=$(az keyvault secret show --vault-name ${keyVaultName} --name REDIS-PASSWORD --query value -o tsv)
|
REDIS_PASSWORD=$(az keyvault secret show --vault-name ${keyVaultName} --name REDIS-PASSWORD --query value -o tsv)
|
||||||
ENABLED_MODULES=$(az keyvault secret show --vault-name ${keyVaultName} --name ENABLED-MODULES --query value -o tsv)
|
|
||||||
OPENVIDU_VERSION=$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-VERSION --query value -o tsv)
|
OPENVIDU_VERSION=$(az keyvault secret show --vault-name ${keyVaultName} --name OPENVIDU-VERSION --query value -o tsv)
|
||||||
|
|
||||||
# Download first: sh <(curl ...) would silently run an empty script on a transient curl failure
|
# Download first: sh <(curl ...) would silently run an empty script on a transient curl failure
|
||||||
|
|
@ -1376,7 +1375,6 @@ COMMON_ARGS=(
|
||||||
"--node-role='media-node'"
|
"--node-role='media-node'"
|
||||||
"--master-node-private-ip-list=$MASTER_NODE_PRIVATE_IP_LIST"
|
"--master-node-private-ip-list=$MASTER_NODE_PRIVATE_IP_LIST"
|
||||||
"--private-ip=$PRIVATE_IP"
|
"--private-ip=$PRIVATE_IP"
|
||||||
"--enabled-modules='$ENABLED_MODULES'"
|
|
||||||
"--redis-password=$REDIS_PASSWORD"
|
"--redis-password=$REDIS_PASSWORD"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -324,11 +324,15 @@ resource "google_compute_instance_group" "master_node_group" {
|
||||||
}
|
}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
is_arm_instance = startswith(var.masterNodesInstanceType, "c4a-") || startswith(var.masterNodesInstanceType, "t2a-") || startswith(var.masterNodesInstanceType, "n4a-") || startswith(var.masterNodesInstanceType, "a4x-")
|
# masterNodesInstanceType is deprecated in favor of masterNodeInstanceType; a non-empty
|
||||||
|
# deprecated value still takes precedence for backward compatibility.
|
||||||
|
master_node_instance_type = var.masterNodesInstanceType != "" ? var.masterNodesInstanceType : var.masterNodeInstanceType
|
||||||
|
|
||||||
|
is_arm_instance = startswith(local.master_node_instance_type, "c4a-") || startswith(local.master_node_instance_type, "t2a-") || startswith(local.master_node_instance_type, "n4a-") || startswith(local.master_node_instance_type, "a4x-")
|
||||||
yq_arch = local.is_arm_instance ? "arm64" : "amd64"
|
yq_arch = local.is_arm_instance ? "arm64" : "amd64"
|
||||||
|
|
||||||
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-noble-arm64-v20241219" : "ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20241219"
|
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-lts-arm64" : "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
|
||||||
is_c4a_instance = startswith(var.masterNodesInstanceType, "c4a-")
|
is_c4a_instance = startswith(local.master_node_instance_type, "c4a-")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Must match the subnetwork the master instances implicitly use (network = "default", no explicit subnetwork)
|
# Must match the subnetwork the master instances implicitly use (network = "default", no explicit subnetwork)
|
||||||
|
|
@ -357,7 +361,7 @@ locals {
|
||||||
# Master Node 1
|
# Master Node 1
|
||||||
resource "google_compute_instance" "openvidu_master_node_1" {
|
resource "google_compute_instance" "openvidu_master_node_1" {
|
||||||
name = lower("${var.stackName}-master-node-1")
|
name = lower("${var.stackName}-master-node-1")
|
||||||
machine_type = var.masterNodesInstanceType
|
machine_type = local.master_node_instance_type
|
||||||
zone = var.zone
|
zone = var.zone
|
||||||
tags = [lower("${var.stackName}-master-node")]
|
tags = [lower("${var.stackName}-master-node")]
|
||||||
|
|
||||||
|
|
@ -369,6 +373,14 @@ resource "google_compute_instance" "openvidu_master_node_1" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Keep existing Master Nodes when a newer Ubuntu 24.04 image is published, so a re-apply
|
||||||
|
# never recreates a running Master Node. The boot disk size stays managed by masterNodesDiskSize.
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
boot_disk[0].initialize_params[0].image,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = "default"
|
network = "default"
|
||||||
network_ip = google_compute_address.master_internal_ip[0].address
|
network_ip = google_compute_address.master_internal_ip[0].address
|
||||||
|
|
@ -409,7 +421,7 @@ resource "google_compute_instance" "openvidu_master_node_1" {
|
||||||
# Master Node 2
|
# Master Node 2
|
||||||
resource "google_compute_instance" "openvidu_master_node_2" {
|
resource "google_compute_instance" "openvidu_master_node_2" {
|
||||||
name = lower("${var.stackName}-master-node-2")
|
name = lower("${var.stackName}-master-node-2")
|
||||||
machine_type = var.masterNodesInstanceType
|
machine_type = local.master_node_instance_type
|
||||||
zone = var.zone
|
zone = var.zone
|
||||||
tags = [lower("${var.stackName}-master-node")]
|
tags = [lower("${var.stackName}-master-node")]
|
||||||
|
|
||||||
|
|
@ -421,6 +433,14 @@ resource "google_compute_instance" "openvidu_master_node_2" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Keep existing Master Nodes when a newer Ubuntu 24.04 image is published, so a re-apply
|
||||||
|
# never recreates a running Master Node. The boot disk size stays managed by masterNodesDiskSize.
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
boot_disk[0].initialize_params[0].image,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = "default"
|
network = "default"
|
||||||
network_ip = google_compute_address.master_internal_ip[1].address
|
network_ip = google_compute_address.master_internal_ip[1].address
|
||||||
|
|
@ -461,7 +481,7 @@ resource "google_compute_instance" "openvidu_master_node_2" {
|
||||||
# Master Node 3
|
# Master Node 3
|
||||||
resource "google_compute_instance" "openvidu_master_node_3" {
|
resource "google_compute_instance" "openvidu_master_node_3" {
|
||||||
name = lower("${var.stackName}-master-node-3")
|
name = lower("${var.stackName}-master-node-3")
|
||||||
machine_type = var.masterNodesInstanceType
|
machine_type = local.master_node_instance_type
|
||||||
zone = var.zone
|
zone = var.zone
|
||||||
tags = [lower("${var.stackName}-master-node")]
|
tags = [lower("${var.stackName}-master-node")]
|
||||||
|
|
||||||
|
|
@ -473,6 +493,14 @@ resource "google_compute_instance" "openvidu_master_node_3" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Keep existing Master Nodes when a newer Ubuntu 24.04 image is published, so a re-apply
|
||||||
|
# never recreates a running Master Node. The boot disk size stays managed by masterNodesDiskSize.
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
boot_disk[0].initialize_params[0].image,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = "default"
|
network = "default"
|
||||||
network_ip = google_compute_address.master_internal_ip[2].address
|
network_ip = google_compute_address.master_internal_ip[2].address
|
||||||
|
|
@ -513,7 +541,7 @@ resource "google_compute_instance" "openvidu_master_node_3" {
|
||||||
# Master Node 4
|
# Master Node 4
|
||||||
resource "google_compute_instance" "openvidu_master_node_4" {
|
resource "google_compute_instance" "openvidu_master_node_4" {
|
||||||
name = lower("${var.stackName}-master-node-4")
|
name = lower("${var.stackName}-master-node-4")
|
||||||
machine_type = var.masterNodesInstanceType
|
machine_type = local.master_node_instance_type
|
||||||
zone = var.zone
|
zone = var.zone
|
||||||
tags = [lower("${var.stackName}-master-node")]
|
tags = [lower("${var.stackName}-master-node")]
|
||||||
|
|
||||||
|
|
@ -525,6 +553,14 @@ resource "google_compute_instance" "openvidu_master_node_4" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Keep existing Master Nodes when a newer Ubuntu 24.04 image is published, so a re-apply
|
||||||
|
# never recreates a running Master Node. The boot disk size stays managed by masterNodesDiskSize.
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [
|
||||||
|
boot_disk[0].initialize_params[0].image,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = "default"
|
network = "default"
|
||||||
network_ip = google_compute_address.master_internal_ip[3].address
|
network_ip = google_compute_address.master_internal_ip[3].address
|
||||||
|
|
@ -1017,7 +1053,7 @@ resource "google_cloud_scheduler_job" "scale_scheduler" {
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
is_arm_media_instance = startswith(var.mediaNodeInstanceType, "c4a-") || startswith(var.mediaNodeInstanceType, "t2a-") || startswith(var.mediaNodeInstanceType, "n4a-") || startswith(var.mediaNodeInstanceType, "a4x-")
|
is_arm_media_instance = startswith(var.mediaNodeInstanceType, "c4a-") || startswith(var.mediaNodeInstanceType, "t2a-") || startswith(var.mediaNodeInstanceType, "n4a-") || startswith(var.mediaNodeInstanceType, "a4x-")
|
||||||
media_ubuntu_image = local.is_arm_media_instance ? "ubuntu-os-cloud/ubuntu-2404-noble-arm64-v20241219" : "ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20241219"
|
media_ubuntu_image = local.is_arm_media_instance ? "ubuntu-os-cloud/ubuntu-2404-lts-arm64" : "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
|
||||||
is_c4a_instance_media = startswith(var.mediaNodeInstanceType, "c4a-")
|
is_c4a_instance_media = startswith(var.mediaNodeInstanceType, "c4a-")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,16 +85,22 @@ variable "initialMeetApiKey" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "masterNodesInstanceType" {
|
variable "masterNodeInstanceType" {
|
||||||
description = "Specifies the GCE machine type for your OpenVidu Master Node"
|
description = "Specifies the GCE machine type for your OpenVidu Master Node"
|
||||||
type = string
|
type = string
|
||||||
default = "e2-standard-4"
|
default = "e2-standard-4"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "masterNodesInstanceType" {
|
||||||
|
description = "Deprecated: replaced by masterNodeInstanceType. Kept for backward compatibility; if set to a non-empty value it still takes precedence over masterNodeInstanceType."
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
variable "masterNodesDiskSize" {
|
variable "masterNodesDiskSize" {
|
||||||
description = "Size of the disk in GB for master nodes"
|
description = "Size of the disk in GB for master nodes"
|
||||||
type = number
|
type = number
|
||||||
default = 100
|
default = 200
|
||||||
validation {
|
validation {
|
||||||
condition = var.masterNodesDiskSize >= 70
|
condition = var.masterNodesDiskSize >= 70
|
||||||
error_message = "masterNodesDiskSize must be at least 70 GB."
|
error_message = "masterNodesDiskSize must be at least 70 GB."
|
||||||
|
|
|
||||||
|
|
@ -768,7 +768,7 @@ resource openviduServer 'Microsoft.Compute/virtualMachines@2023-09-01' = {
|
||||||
managedDisk: {
|
managedDisk: {
|
||||||
storageAccountType: openviduVMSettings.osDiskType
|
storageAccountType: openviduVMSettings.osDiskType
|
||||||
}
|
}
|
||||||
diskSizeGB: 100
|
diskSizeGB: 200
|
||||||
}
|
}
|
||||||
imageReference: openviduVMSettings.ubuntuOSVersion
|
imageReference: openviduVMSettings.ubuntuOSVersion
|
||||||
}
|
}
|
||||||
|
|
@ -975,19 +975,6 @@ resource webServerSecurityGroup 'Microsoft.Network/networkSecurityGroups@2023-11
|
||||||
direction: 'Inbound'
|
direction: 'Inbound'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
|
||||||
name: 'MinIO'
|
|
||||||
properties: {
|
|
||||||
protocol: 'Tcp'
|
|
||||||
sourceAddressPrefix: '*'
|
|
||||||
sourcePortRange: '*'
|
|
||||||
destinationAddressPrefix: '*'
|
|
||||||
destinationPortRange: '9000'
|
|
||||||
access: 'Allow'
|
|
||||||
priority: 170
|
|
||||||
direction: 'Inbound'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
name: 'WebRTC_traffic_UDP'
|
name: 'WebRTC_traffic_UDP'
|
||||||
properties: {
|
properties: {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"_generator": {
|
"_generator": {
|
||||||
"name": "bicep",
|
"name": "bicep",
|
||||||
"version": "0.46.1.21595",
|
"version": "0.46.1.21595",
|
||||||
"templateHash": "18422024254131943403"
|
"templateHash": "17066739396447275453"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
|
@ -280,7 +280,7 @@
|
||||||
"managedDisk": {
|
"managedDisk": {
|
||||||
"storageAccountType": "[variables('openviduVMSettings').osDiskType]"
|
"storageAccountType": "[variables('openviduVMSettings').osDiskType]"
|
||||||
},
|
},
|
||||||
"diskSizeGB": 100
|
"diskSizeGB": 200
|
||||||
},
|
},
|
||||||
"imageReference": "[variables('openviduVMSettings').ubuntuOSVersion]"
|
"imageReference": "[variables('openviduVMSettings').ubuntuOSVersion]"
|
||||||
},
|
},
|
||||||
|
|
@ -490,19 +490,6 @@
|
||||||
"direction": "Inbound"
|
"direction": "Inbound"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "MinIO",
|
|
||||||
"properties": {
|
|
||||||
"protocol": "Tcp",
|
|
||||||
"sourceAddressPrefix": "*",
|
|
||||||
"sourcePortRange": "*",
|
|
||||||
"destinationAddressPrefix": "*",
|
|
||||||
"destinationPortRange": "9000",
|
|
||||||
"access": "Allow",
|
|
||||||
"priority": 170,
|
|
||||||
"direction": "Inbound"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "WebRTC_traffic_UDP",
|
"name": "WebRTC_traffic_UDP",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,14 @@ resource "google_compute_address" "public_ip_address" {
|
||||||
region = var.region
|
region = var.region
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# rtcEngine replaced RTCEngine; the deprecated name still wins when it is set.
|
||||||
|
locals {
|
||||||
|
rtc_engine = var.RTCEngine != "" ? var.RTCEngine : var.rtcEngine
|
||||||
|
}
|
||||||
|
|
||||||
#Check if ARM
|
#Check if ARM
|
||||||
locals {
|
locals {
|
||||||
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-noble-arm64-v20241219" : "ubuntu-os-cloud/ubuntu-2404-noble-amd64-v20241219"
|
ubuntu_image = local.is_arm_instance ? "ubuntu-os-cloud/ubuntu-2404-lts-arm64" : "ubuntu-os-cloud/ubuntu-2404-lts-amd64"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compute instance for OpenVidu
|
# Compute instance for OpenVidu
|
||||||
|
|
@ -100,11 +105,17 @@ resource "google_compute_instance" "openvidu_server" {
|
||||||
boot_disk {
|
boot_disk {
|
||||||
initialize_params {
|
initialize_params {
|
||||||
image = local.ubuntu_image
|
image = local.ubuntu_image
|
||||||
size = 100
|
size = 200
|
||||||
type = "pd-standard"
|
type = "pd-standard"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The image family moves to each new Ubuntu 24.04 build and the disk size can change between
|
||||||
|
# releases: both apply to new deployments only, so a re-apply never recreates this VM.
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = [boot_disk[0].initialize_params[0].image, boot_disk[0].initialize_params[0].size]
|
||||||
|
}
|
||||||
|
|
||||||
network_interface {
|
network_interface {
|
||||||
network = "default"
|
network = "default"
|
||||||
access_config {
|
access_config {
|
||||||
|
|
@ -197,7 +208,7 @@ if [[ "${var.initialMeetApiKey}" != '' ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
OPENVIDU_PRO_LICENSE="$(/usr/local/bin/store_secret.sh save OPENVIDU_PRO_LICENSE ${var.openviduLicense})"
|
OPENVIDU_PRO_LICENSE="$(/usr/local/bin/store_secret.sh save OPENVIDU_PRO_LICENSE ${var.openviduLicense})"
|
||||||
OPENVIDU_RTC_ENGINE="$(/usr/local/bin/store_secret.sh save OPENVIDU_RTC_ENGINE ${var.RTCEngine})"
|
OPENVIDU_RTC_ENGINE="$(/usr/local/bin/store_secret.sh save OPENVIDU_RTC_ENGINE ${local.rtc_engine})"
|
||||||
|
|
||||||
# Store usernames and generate random passwords
|
# Store usernames and generate random passwords
|
||||||
REDIS_PASSWORD="$(/usr/local/bin/store_secret.sh generate REDIS_PASSWORD)"
|
REDIS_PASSWORD="$(/usr/local/bin/store_secret.sh generate REDIS_PASSWORD)"
|
||||||
|
|
|
||||||
|
|
@ -103,13 +103,23 @@ variable "openviduLicense" {
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "RTCEngine" {
|
variable "rtcEngine" {
|
||||||
description = "RTCEngine media engine to use. Allowed values are 'pion' and 'mediasoup'."
|
description = "RTCEngine media engine to use. Allowed values are 'pion' and 'mediasoup'."
|
||||||
type = string
|
type = string
|
||||||
default = "mediasoup"
|
default = "mediasoup"
|
||||||
validation {
|
validation {
|
||||||
condition = contains(["pion", "mediasoup"], var.RTCEngine)
|
condition = contains(["pion", "mediasoup"], var.rtcEngine)
|
||||||
error_message = "RTCEngine must be one of: pion, mediasoup"
|
error_message = "rtcEngine must be one of: pion, mediasoup"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "RTCEngine" {
|
||||||
|
description = "Deprecated: use rtcEngine, the name every other Terraform template uses. Still honored: a non-empty value takes precedence over rtcEngine. It will be removed in a future release."
|
||||||
|
type = string
|
||||||
|
default = ""
|
||||||
|
validation {
|
||||||
|
condition = contains(["", "pion", "mediasoup"], var.RTCEngine)
|
||||||
|
error_message = "RTCEngine must be empty or one of: pion, mediasoup"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue