1
0
Fork 0

update windows setup

This commit is contained in:
Mikhail Goncharov 2021-03-12 15:31:06 +01:00
parent b28d130787
commit 637056379c
2 changed files with 5 additions and 6 deletions

View file

@ -142,11 +142,11 @@ To spawn a new Windows agent:
1. Add new windows machine wih OS "Windows Server" and version with "desktop experience" (so you can RDP) and boot disk size ~200 Gb. There is a "windows-agent-template" that might not be up to date.
1. Go to the [GCP page](https://pantheon.corp.google.com/compute/instances?project=llvm-premerge-checks&instancessize=50) again
1. Login to the new machine via RDP (you will need a RDP client, e.g. Chrome app).
1. Add a powershell shortcut at desktop with "run as admin" flag. Create a folder with machine name (e.g "w16c2-2") somewhere and click "add new toolbar" on windows toolbar: this way it will be easier to identify which machine you are working with later.
1. (optional, quality of life) Add a powershell shortcut at desktop with "run as admin" flag. Create a folder with machine name (e.g "w16c2-2") somewhere and click "add new toolbar" on windows toolbar: this way it will be easier to identify which machine you are working with later.
1. Run these commands in the power shell under admin to bootstrap the Windows machine:
```powershell
Invoke-WebRequest -uri 'https://raw.githubusercontent.com/google/llvm-premerge-checks/main/scripts/windows_agent_bootstrap.ps1' -OutFile c:\windows_agent_bootstrap.ps1
c:/windows_agent_bootstrap.ps1
Invoke-WebRequest -uri 'https://raw.githubusercontent.com/google/llvm-premerge-checks/main/scripts/windows_agent_bootstrap.ps1' -OutFile c:\windows_agent_bootstrap.ps1
c:/windows_agent_bootstrap.ps1
```
VM will be restarted after a prompt.

View file

@ -63,8 +63,7 @@ if ($sdd) {
}
# Clone scripts repo. Restarting in a new session to pick up profile updates.
powershell -command 'git clone https://github.com/google/llvm-premerge-checks.git "c:\llvm-premerge-checks"'
cmd.exe /c start powershell.exe -c {git clone https://github.com/google/llvm-premerge-checks.git c:/llvm-premerge-checks}
# create folder for credentials
New-Item -Path "C:\" -Name "credentials" -ItemType "directory"
set-content c:\credentials\buildkite-env.ps1 '# Insert API tokens and replace NAME to something meaningful.
@ -74,7 +73,7 @@ $Env:BUILDKITE_AGENT_NAME= "NAME"
$Env:BUILDKITE_AGENT_TAGS = "queue=windows,name=NAME"
$Env:CONDUIT_TOKEN = ""'
Write-Host "Open editor to set agent options..."
Start-Process -FilePath "notepad" -Wait -Args "c:\credentials\buildkite-env.ps1"
Start-Process -FilePath "notepad" -Wait -Args "c:\credentials\buildkite-env.ps1"
# Add task to start agent after restart.
schtasks.exe /create /tn "Start Buildkite agent" /ru SYSTEM /SC ONSTART /DELAY 0005:00 /tr "powershell -command 'C:\llvm-premerge-checks\scripts\windows_agent_start_buildkite.ps1 -workdir c:\ws'"