<commit_before>{{define "WorkerSecurityGroups"}}
[
  {{range $sgIndex, $sgRef := $.WorkerSecurityGroupRefs}}
  {{if gt $sgIndex 0}},{{end}}
  {{$sgRef}}
  {{end}}
]
{{end}}
{{define "AutoScaling"}}
    "AutoScaleWorker": {
      "Properties": {
        "AvailabilityZones": [
          {{range $index, $subnet := .Subnets}}
          {{if gt $index 0}},{{end}}
          "{{$subnet.AvailabilityZone}}"
          {{end}}
        ],
        "DesiredCapacity": "{{.WorkerCount}}",
        "HealthCheckGracePeriod": 600,
        "HealthCheckType": "EC2",
        "LaunchConfigurationName": {
          "Ref": "LaunchConfigurationWorker"
        },
        "MaxSize": "{{.MaxWorkerCount}}",
        "MinSize": "{{.MinWorkerCount}}",
        "Tags": [
          {
            "Key": "KubernetesCluster",
            "PropagateAtLaunch": "true",
            "Value": "{{.ClusterName}}"
          },
          {
            "Key": "Name",
            "PropagateAtLaunch": "true",
            "Value": "{{.ClusterName}}-kube-aws-worker"
          }
        ],
        "VPCZoneIdentifier": [
          {{range $index, $subnet := .Subnets}}
          {{with $subnetLogicalName := printf "Subnet%d" $index}}
          {{if gt $index 0}},{{end}}
          {
            "Ref": "{{$subnetLogicalName}}"
          }
          {{end}}
          {{end}}
        ]
      },
      "Type": "AWS::AutoScaling::AutoScalingGroup",
      "UpdatePolicy" : {
        "AutoScalingRollingUpdate" : {
          "MinInstancesInService" :
          {{if .WorkerSpotPrice}}
          "0"
          {{else}}
          "{{.WorkerCount}}"
          {{end}},
          "MaxBatchSize" : "1",
          "PauseTime" : "PT2M"
        }
      }
    },

    "LaunchConfigurationWorker": {
      "Properties": {<commit_msg>Tag EC2 instances for workers in node pools with the pool names<commit_after>{{define "WorkerSecurityGroups"}}
[
  {{range $sgIndex, $sgRef := $.WorkerSecurityGroupRefs}}
  {{if gt $sgIndex 0}},{{end}}
  {{$sgRef}}
  {{end}}
]
{{end}}
{{define "AutoScaling"}}
    "AutoScaleWorker": {
      "Properties": {
        "AvailabilityZones": [
          {{range $index, $subnet := .Subnets}}
          {{if gt $index 0}},{{end}}
          "{{$subnet.AvailabilityZone}}"
          {{end}}
        ],
        "DesiredCapacity": "{{.WorkerCount}}",
        "HealthCheckGracePeriod": 600,
        "HealthCheckType": "EC2",
        "LaunchConfigurationName": {
          "Ref": "LaunchConfigurationWorker"
        },
        "MaxSize": "{{.MaxWorkerCount}}",
        "MinSize": "{{.MinWorkerCount}}",
        "Tags": [
          {
            "Key": "KubernetesCluster",
            "PropagateAtLaunch": "true",
            "Value": "{{.ClusterName}}"
          },
          {
            "Key": "KubernetesNodePool",
            "PropagateAtLaunch": "true",
            "Value": "{{.NodePoolName}}"
          },
          {
            "Key": "Name",
            "PropagateAtLaunch": "true",
            "Value": "{{.NodePoolName}}-kube-aws-worker"
          }
        ],
        "VPCZoneIdentifier": [
          {{range $index, $subnet := .Subnets}}
          {{with $subnetLogicalName := printf "Subnet%d" $index}}
          {{if gt $index 0}},{{end}}
          {
            "Ref": "{{$subnetLogicalName}}"
          }
          {{end}}
          {{end}}
        ]
      },
      "Type": "AWS::AutoScaling::AutoScalingGroup",
      "UpdatePolicy" : {
        "AutoScalingRollingUpdate" : {
          "MinInstancesInService" :
          {{if .WorkerSpotPrice}}
          "0"
          {{else}}
          "{{.WorkerCount}}"
          {{end}},
          "MaxBatchSize" : "1",
          "PauseTime" : "PT2M"
        }
      }
    },

    "LaunchConfigurationWorker": {
      "Properties": {
{'fraction_non_alphanumeric': 0.18435754189944134, 'fraction_numerical': 0.00558659217877095, 'mean_word_length': 1.779009608277901, 'pattern_counts': {'":': 47, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '1552455', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1151, 'n_words': 195}