Skip to content

Commit 114c42e

Browse files
johnsonjbradfitz
authored andcommitted
env/windows: disable windows defender on builders
Windows Defender scans all new files written to disk which slows down build performance. - Uninstall Windows Defender as part of image building - Refactor/Cleanup registry section for consistency - Promote new image version to dashboard (built in staging/prod) fixes golang/go#26055 Change-Id: I3e16b9a9581824c20abed5e8ffae1efd46c6dd09 Reviewed-on: https://go-review.googlesource.com/121937 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent b64fecb commit 114c42e

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

dashboard/builders.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,21 @@ var Hosts = map[string]*HostConfig{
247247
env: []string{"GO_TEST_TIMEOUT_SCALE=2"},
248248
},
249249
"host-windows-amd64-2008": &HostConfig{
250-
VMImage: "windows-amd64-server-2008r2-v6",
250+
VMImage: "windows-amd64-server-2008r2-v7",
251251
machineType: "n1-highcpu-4",
252252
buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
253253
goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
254254
SSHUsername: "gopher",
255255
},
256256
"host-windows-amd64-2012": &HostConfig{
257-
VMImage: "windows-amd64-server-2012r2-v6",
257+
VMImage: "windows-amd64-server-2012r2-v7",
258258
machineType: "n1-highcpu-4",
259259
buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
260260
goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
261261
SSHUsername: "gopher",
262262
},
263263
"host-windows-amd64-2016": &HostConfig{
264-
VMImage: "windows-amd64-server-2016-v6",
264+
VMImage: "windows-amd64-server-2016-v7",
265265
machineType: "n1-highcpu-4",
266266
buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
267267
goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",

env/windows/make.bash

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ set -e -u
99
declare -A public_images
1010

1111
public_images=(
12-
['server-2016-v6']='windows-server-2016-dc-core-v20180410'
13-
['server-2008r2-v6']='windows-server-2008-r2-dc-v20180410'
14-
['server-2012r2-v6']='windows-server-2012-r2-dc-core-v20180410'
12+
['server-2016-v7']='windows-server-2016-dc-core-v20180612'
13+
['server-2008r2-v7']='windows-server-2008-r2-dc-v20180612'
14+
['server-2012r2-v7']='windows-server-2012-r2-dc-core-v20180612'
1515
)
1616

1717
mkdir -p out

env/windows/startup.ps1

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,21 @@ while(-Not (Test-NetConnection 8.8.8.8 -Port 53 | ? { $_.TcpTestSucceeded })) {
7474
sleep 3
7575
}
7676

77-
# Disable password complexity, automatic updates, windows firewall, error reporting, and UAC
77+
# Disable password complexity, automatic updates, windows defender, windows firewall, error reporting, and UAC
7878
#
79-
# - Updated interrupt the builds later.
80-
# - We don't care about security since this isn't going to be Internet-facing.
79+
# - Update can interrupt the builds
80+
# - We don't care about security since this isn't going to be Internet-facing
8181
# - No ports will ever be accessible externally
8282
# - We can be trusted to run as a real Administrator
8383
Write-Host "disabling security features"
8484
Disable-PasswordComplexity
85-
New-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name NoAutoUpdate -Value 1 -Force | Out-Null
86-
new-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Value 1 -Force | Out-Null
87-
new-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name DontShowUI -Value 1 -Force | Out-Null
85+
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name NoAutoUpdate -Value 1 -Force | Out-Null
86+
new-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name Disabled -Value 1 -Force | Out-Null
87+
new-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name DontShowUI -Value 1 -Force | Out-Null
88+
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system" -Name EnableLUA -PropertyType DWord -Value 0 -Force | Out-Null
8889
netsh advfirewall set allprofiles state off
8990
netsh firewall set opmode mode=disable profile=ALL
90-
New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force | Out-Null
91+
Uninstall-WindowsFeature -Name Windows-Defender
9192

9293
# Disable unwanted services
9394
Write-Host "disabling unused services"

0 commit comments

Comments
 (0)