<commit_before>{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "_artifactsLocation": {
            "type": "string",
            "metadata": {
                "description": ""
            }
        },
        "_artifactsLocationSasToken": {
            "type": "string",
            "metadata": {
                "description": ""
            }
        },
        "virtualNetworkSubnetId": {
            "type": "string",
            "metadata": {
                "description": "The ID of the subnet in which the Avere cluster should be deployed"
            }
        },
        "virtualMachineSize": {
            "type": "string",
            "defaultValue": "Standard_D2s_v3",
            "metadata": {
                "description": "Size of VMs in the VM Scale Set."
            }
        },
        "initialInstanceCount": {
            "type": "int",
            "defaultValue": 3,
            "metadata": {
                "description": "Number of VM instances (100 or less)."
            },
            "maxValue": 100
        },
        "minInstanceCount": {
            "type": "int",
            "defaultValue": 2,
            "metadata": {
                "description": "How few instances can the AutoScale reduce to?."
            },
            "maxValue": 100
        },
        "maxInstanceCount": {
            "type": "int",
            "defaultValue": 5,
            "metadata": {
                "description": "How many instances can the AutoScaler increate to? (100 or less)."
            },
            "maxValue": 100
        },
        "openCGAContainerImage": {
            "type": "string",
            "metadata": {
                "description": "The docker image and tag for running the tomcat service."
            }
        },
        "ivaContainerImage" : {
            "type": "string",
            "metadata": {
                "description": "The docker image and tag for running the IVA service."
            }
        },
        "adminUsername": {
            "type": "string",
            "defaultValue": "opencgaadmin",
            "metadata": {
                "description": "Admin username on all VMs."
            }
        },
        "sshKeyData": {
            "type": "securestring",
            "metadata": {
                "description": "Admin password on all VMs."
            }
        },
        "mountArgs": {
            "type": "string",
            "metadata": {
                "description": "Arguments passed to the mount.py script."
            }
        },
        "namingPrefix": {
            "type": "string",
            "metadata": {
                "description": "DNS prefix used by the webserver VMSS"
            }
        }
    },
    "variables": {
        "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
        "publicIPAddressName": "[concat(parameters('namingPrefix'), '-pip')]",
        "loadBalancerName": "[concat(parameters('namingPrefix'), '-lb')]",
        "publicIPAddressID": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]",
        "lbID": "[resourceId('Microsoft.Network/loadBalancers',variables('loadBalancerName'))]",
        "natPoolName": "[concat(parameters('namingPrefix'), 'natpool')]",
        "natStartPort": 50000,
        "natEndPort": 50119,
        "natBackendPort": 22,
        "nicName": "[concat(parameters('namingPrefix'), 'nic')]",
        "ipConfigName": "[concat(parameters('namingPrefix'), 'ipconfig')]",
        "frontEndIPConfigID": "[concat(variables('lbID'),'/frontendIPConfigurations/loadBalancerFrontEnd')]",
        "imageReference": {
            "publisher": "Canonical",
            "offer": "UbuntuServer",
            "sku": "18.04-LTS",
            "version": "latest"
        },
        "_comment": "The cloud init below is used to install docker then run the Avere mounting scripts located in ./arm/avere/mount.py",
        "cloud-init": [
            "#cloud-config",
            "package_upgrade: true",
            "package_reboot_if_required: true",
            "runcmd:",
            "- apt-get update",
            "- curl -fsSL https://get.docker.com/ | sh",
            "- curl -fsSL https://get.docker.com/gpg | sudo apt-key add -",
            "[concat('- curl -fsSL ', parameters('_artifactsLocation'), '/avere/mount.py', parameters('_artifactsLocationSasToken'), ' | python3 - ', parameters('mountArgs'))]",
            "[concat('- curl -fsSL ', parameters('_artifactsLocation'), '/scripts/wait_config.sh', parameters('_artifactsLocationSasToken'), ' | bash')]",
            "[concat('- docker run -d -p 8080:8080 -p 8443:8443 --restart=always --mount type=bind,src=/media/primarynfs/conf,dst=/opt/opencga/conf,readonly --mount type=bind,src=/media/primarynfs/sessions,dst=/opt/opencga/sessions ', parameters('openCGAContainerImage'))]",
            "[concat('- docker run -d -p 80:80 -p 443:443 --restart=always --mount type=bind,src=/media/primarynfs/conf,dst=/opt/opencga/conf,readonly --mount type=bind,src=/media/primarynfs/sessions,dst=/opt/opencga/sessions ', parameters('ivaContainerImage'))]",
            ""
        ],
        "cloud-init-string": "[replace(replace(replace(string(variables('cloud-init')),'\",\"','\n'),'[\"',''),'\"]','')]",
        "customData": "[base64(variables('cloud-init-string'))]"
    },
    "resources": [
        {
            "comments": "The Public IP used by the loadbalancer, this will be the IP used to access the rest/web services of OpenCGA",
            "type": "Microsoft.Network/publicIPAddresses",
            "name": "[variables('publicIPAddressName')]",
            "location": "[resourceGroup().location]",
            "apiVersion": "2017-06-01",
            "properties": {
                "publicIPAllocationMethod": "Static",
                "dnsSettings": {
                    "domainNameLabel": "[parameters('namingPrefix')]"
                }
            }
        },
        {
            "comments": "The LB configured to send traffic to the web nodes in the VMSS. It monitors the health endpoint of OpenCGA removing unhealthy nodes from the LB",
            "type": "Microsoft.Network/loadBalancers",
            "name": "[variables('loadBalancerName')]",<commit_msg>Remove SAS token from webserver cloud-init<commit_after>{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "_artifactsLocation": {
            "type": "string",
            "metadata": {
                "description": ""
            }
        },
        "_artifactsLocationSasToken": {
            "type": "string",
            "metadata": {
                "description": ""
            }
        },
        "virtualNetworkSubnetId": {
            "type": "string",
            "metadata": {
                "description": "The ID of the subnet in which the Avere cluster should be deployed"
            }
        },
        "virtualMachineSize": {
            "type": "string",
            "defaultValue": "Standard_D2s_v3",
            "metadata": {
                "description": "Size of VMs in the VM Scale Set."
            }
        },
        "initialInstanceCount": {
            "type": "int",
            "defaultValue": 3,
            "metadata": {
                "description": "Number of VM instances (100 or less)."
            },
            "maxValue": 100
        },
        "minInstanceCount": {
            "type": "int",
            "defaultValue": 2,
            "metadata": {
                "description": "How few instances can the AutoScale reduce to?."
            },
            "maxValue": 100
        },
        "maxInstanceCount": {
            "type": "int",
            "defaultValue": 5,
            "metadata": {
                "description": "How many instances can the AutoScaler increate to? (100 or less)."
            },
            "maxValue": 100
        },
        "openCGAContainerImage": {
            "type": "string",
            "metadata": {
                "description": "The docker image and tag for running the tomcat service."
            }
        },
        "ivaContainerImage" : {
            "type": "string",
            "metadata": {
                "description": "The docker image and tag for running the IVA service."
            }
        },
        "adminUsername": {
            "type": "string",
            "defaultValue": "opencgaadmin",
            "metadata": {
                "description": "Admin username on all VMs."
            }
        },
        "sshKeyData": {
            "type": "securestring",
            "metadata": {
                "description": "Admin password on all VMs."
            }
        },
        "mountArgs": {
            "type": "string",
            "metadata": {
                "description": "Arguments passed to the mount.py script."
            }
        },
        "namingPrefix": {
            "type": "string",
            "metadata": {
                "description": "DNS prefix used by the webserver VMSS"
            }
        }
    },
    "variables": {
        "sshKeyPath": "[concat('/home/',parameters('adminUsername'),'/.ssh/authorized_keys')]",
        "publicIPAddressName": "[concat(parameters('namingPrefix'), '-pip')]",
        "loadBalancerName": "[concat(parameters('namingPrefix'), '-lb')]",
        "publicIPAddressID": "[resourceId('Microsoft.Network/publicIPAddresses',variables('publicIPAddressName'))]",
        "lbID": "[resourceId('Microsoft.Network/loadBalancers',variables('loadBalancerName'))]",
        "natPoolName": "[concat(parameters('namingPrefix'), 'natpool')]",
        "natStartPort": 50000,
        "natEndPort": 50119,
        "natBackendPort": 22,
        "nicName": "[concat(parameters('namingPrefix'), 'nic')]",
        "ipConfigName": "[concat(parameters('namingPrefix'), 'ipconfig')]",
        "frontEndIPConfigID": "[concat(variables('lbID'),'/frontendIPConfigurations/loadBalancerFrontEnd')]",
        "imageReference": {
            "publisher": "Canonical",
            "offer": "UbuntuServer",
            "sku": "18.04-LTS",
            "version": "latest"
        },
        "_comment": "The cloud init below is used to install docker then run the Avere mounting scripts located in ./arm/avere/mount.py",
        "cloud-init": [
            "#cloud-config",
            "package_upgrade: true",
            "package_reboot_if_required: true",
            "runcmd:",
            "- apt-get update",
            "- curl -fsSL https://get.docker.com/ | sh",
            "- curl -fsSL https://get.docker.com/gpg | sudo apt-key add -",
            "[concat('- curl -fsSL ', parameters('_artifactsLocation'), '/avere/mount.py', ' | python3 - ', parameters('mountArgs'))]",
            "[concat('- curl -fsSL ', parameters('_artifactsLocation'), '/scripts/wait_config.sh', ' | bash')]",
            "[concat('- docker run -d -p 8080:8080 -p 8443:8443 --restart=always --mount type=bind,src=/media/primarynfs/conf,dst=/opt/opencga/conf,readonly --mount type=bind,src=/media/primarynfs/sessions,dst=/opt/opencga/sessions ', parameters('openCGAContainerImage'))]",
            "[concat('- docker run -d -p 80:80 -p 443:443 --restart=always --mount type=bind,src=/media/primarynfs/conf,dst=/opt/opencga/conf,readonly --mount type=bind,src=/media/primarynfs/sessions,dst=/opt/opencga/sessions ', parameters('ivaContainerImage'))]",
            ""
        ],
        "cloud-init-string": "[replace(replace(replace(string(variables('cloud-init')),'\",\"','\n'),'[\"',''),'\"]','')]",
        "customData": "[base64(variables('cloud-init-string'))]"
    },
    "resources": [
        {
            "comments": "The Public IP used by the loadbalancer, this will be the IP used to access the rest/web services of OpenCGA",
            "type": "Microsoft.Network/publicIPAddresses",
            "name": "[variables('publicIPAddressName')]",
            "location": "[resourceGroup().location]",
            "apiVersion": "2017-06-01",
            "properties": {
                "publicIPAllocationMethod": "Static",
                "dnsSettings": {
                    "domainNameLabel": "[parameters('namingPrefix')]"
                }
            }
        },
        {
            "comments": "The LB configured to send traffic to the web nodes in the VMSS. It monitors the health endpoint of OpenCGA removing unhealthy nodes from the LB",
            "type": "Microsoft.Network/loadBalancers",
            "name": "[variables('loadBalancerName')]",
{'fraction_non_alphanumeric': 0.15807749980269908, 'fraction_numerical': 0.013416462789045853, 'mean_word_length': 1.9340125028941886, 'pattern_counts': {'":': 194, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3748975', 'n_tokens_mistral': 3600, 'n_tokens_neox': 3382, 'n_words': 738}