Skip to content

Commit bd1f57a

Browse files
[windows] introduce user warmup (#8225)
some User warmup may be transferred to C:\Users\Default to speedup provisioning. Especially, this is important for large runners
1 parent 0f35a38 commit bd1f57a

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
################################################################################
2+
## File: Warmup-User.ps1
3+
## Desc: Performs user part of warm up and moves data to C:\Users\Default
4+
################################################################################
5+
6+
#
7+
# more: https://github.com/actions/runner-images-internal/issues/5320
8+
# https://github.com/actions/runner-images/issues/5301#issuecomment-1648292990
9+
#
10+
11+
Write-Host "Warmup 'devenv.exe /updateconfiguration'"
12+
13+
$vsInstallRoot = (Get-VisualStudioInstance).InstallationPath
14+
$devEnvPath = "$vsInstallRoot\Common7\IDE\devenv.exe"
15+
16+
cmd.exe /c "`"$devEnvPath`" /updateconfiguration"
17+
18+
Copy-Item ${env:USERPROFILE}\AppData\Local\Microsoft\VisualStudio -Destination c:\users\default\AppData\Local\Microsoft\VisualStudio -Recurse
19+
20+
reg.exe load HKLM\DEFAULT c:\users\default\ntuser.dat
21+
reg.exe copy HKCU\Software\Microsoft\VisualStudio HKLM\DEFAULT\Software\Microsoft\VisualStudio /s
22+
reg.exe unload HKLM\DEFAULT
23+
24+
25+
Write-Host "Warmup-User.ps1 - completed"

images/win/windows2019.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@
339339
"skip_clean": true,
340340
"scripts": [
341341
"{{ template_dir }}/scripts/Installers/Run-NGen.ps1",
342-
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1"
342+
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1",
343+
"{{ template_dir }}/scripts/Installers/Warmup-User.ps1"
343344
],
344345
"environment_vars": [
345346
"INSTALL_USER={{user `install_user`}}"

images/win/windows2022.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@
326326
"skip_clean": true,
327327
"scripts": [
328328
"{{ template_dir }}/scripts/Installers/Run-NGen.ps1",
329-
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1"
329+
"{{ template_dir }}/scripts/Installers/Finalize-VM.ps1",
330+
"{{ template_dir }}/scripts/Installers/Warmup-User.ps1"
330331
],
331332
"environment_vars": [
332333
"INSTALL_USER={{user `install_user`}}"

0 commit comments

Comments
 (0)