<commit_before>package main

import (
	"fmt"
	"path"
	"runtime"

	"go.skia.org/infra/go/androidbuildinternal/v2beta1"
	"go.skia.org/infra/go/gce"
	"go.skia.org/infra/go/gce/server"
)

func GoldBase(name, ipAddress string) *gce.Instance {
	vm := server.AddGitConfigs(server.Server20170613(name), "skia-gold")
	vm.DataDisk.Name = fmt.Sprintf("%s-data", name)
	vm.DataDisk.SizeGb = 2000
	vm.DataDisk.Type = gce.DISK_TYPE_PERSISTENT_STANDARD
	vm.ExternalIpAddress = ipAddress
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_32
	vm.Metadata["auth_white_list"] = "google.com chromium.org skia.org"
	vm.Metadata["owner_primary"] = "stephana"
	vm.Metadata["owner_secondary"] = "jcgregorio"

	_, filename, _, _ := runtime.Caller(0)
	dir := path.Dir(filename)
	vm.SetupScript = path.Join(dir, "setup-script.sh")
	return vm
}

func Prod() *gce.Instance {
	vm := GoldBase("skia-gold-prod", "172.16.31.10")
	vm.Metadata["auth_white_list"] = `skia.org
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>`
	return vm
}

func Pdfium() *gce.Instance {
	vm := GoldBase("skia-gold-pdfium", "192.168.3.11")
	vm.DataDisk.SizeGb = 500
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_16
	return vm
}

func Test() *gce.Instance {
	vm := GoldBase("skia-gold-testinstance", "192.168.3.11")
	vm.DataDisk.SizeGb = 500
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_16
	vm.Scopes = append(vm.Scopes, androidbuildinternal.AndroidbuildInternalScope)
	return vm
}

func DiffServer() *gce.Instance {
	vm := GoldBase("skia-diffserver-prod", "172.16.17.32")
	delete(vm.Metadata, "auth_white_list")
	vm.DataDisk.SizeGb = 2000
	vm.DataDisk.Type = gce.DISK_TYPE_PERSISTENT_SSD
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_32
	return vm
}

func main() {
	server.Main(gce.ZONE_DEFAULT, map[string]*gce.Instance{
		"prod":         Prod(),
		"pdfium":       Pdfium(),
		"testinstance": Test(),
		"diffserver":   DiffServer(),<commit_msg>Use ephemeral IP in diffserver and different static IPs in gold<commit_after>package main

import (
	"fmt"
	"path"
	"runtime"

	"go.skia.org/infra/go/androidbuildinternal/v2beta1"
	"go.skia.org/infra/go/gce"
	"go.skia.org/infra/go/gce/server"
)

func GoldBase(name, ipAddress string) *gce.Instance {
	vm := server.AddGitConfigs(server.Server20170613(name), "skia-gold")
	vm.DataDisk.Name = fmt.Sprintf("%s-data", name)
	vm.DataDisk.SizeGb = 2000
	vm.DataDisk.Type = gce.DISK_TYPE_PERSISTENT_STANDARD
	if ipAddress != "" {
		vm.ExternalIpAddress = ipAddress
	}
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_32
	vm.Metadata["auth_white_list"] = "google.com chromium.org skia.org"
	vm.Metadata["owner_primary"] = "stephana"
	vm.Metadata["owner_secondary"] = "jcgregorio"

	_, filename, _, _ := runtime.Caller(0)
	dir := path.Dir(filename)
	vm.SetupScript = path.Join(dir, "setup-script.sh")
	return vm
}

func Prod() *gce.Instance {
	// Below IP has been whitelisted in skiaperf cloud DB.
	vm := GoldBase("skia-gold-prod", "192.168.3.11")
	vm.Metadata["auth_white_list"] = `skia.org
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>
<EMAIL>`
	return vm
}

func Pdfium() *gce.Instance {
	// Below IP has been whitelisted in skiaperf cloud DB.
	vm := GoldBase("skia-gold-pdfium", "172.16.58.3")
	vm.DataDisk.SizeGb = 500
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_16
	return vm
}

func Test() *gce.Instance {
	vm := GoldBase("skia-gold-testinstance", "172.16.58.3")
	vm.DataDisk.SizeGb = 500
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_16
	vm.Scopes = append(vm.Scopes, androidbuildinternal.AndroidbuildInternalScope)
	return vm
}

func DiffServer() *gce.Instance {
	// DiffServer uses an ephemeral IP address.
	vm := GoldBase("skia-diffserver-prod", "")
	delete(vm.Metadata, "auth_white_list")
	vm.DataDisk.SizeGb = 2000
	vm.DataDisk.Type = gce.DISK_TYPE_PERSISTENT_SSD
	vm.MachineType = gce.MACHINE_TYPE_HIGHMEM_32
	return vm
}

func main() {
	server.Main(gce.ZONE_DEFAULT, map[string]*gce.Instance{
		"prod":         Prod(),
		"pdfium":       Pdfium(),
		"testinstance": Test(),
		"diffserver":   DiffServer(),
{'fraction_non_alphanumeric': 0.1535759096612296, 'fraction_numerical': 0.031869510664993723, 'mean_word_length': 4.710601719197708, 'pattern_counts': {'":': 8, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 7, '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': '2298936', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1616, 'n_words': 268}