Skip to content

Commit

Permalink
Tweaks to windows agent to support distribution builds (#187)
Browse files Browse the repository at this point in the history
* Add changes to windows on git mem limits and long path

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add gh

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add windows git full path to avoid random missing git clone errors

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add more fixes to the windows agent

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add windows agents

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Update windows ami

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon authored Aug 24, 2022
1 parent 7b3cdeb commit 76d3735
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/compute/agent-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ export class AgentNodes {
workerLabelString: 'Jenkins-Agent-Windows2019-X64-C54xlarge-Single-Host',
instanceType: 'C54xlarge',
remoteUser: 'Administrator',
maxTotalUses: -1,
minimumNumberOfSpareInstances: 1,
maxTotalUses: 10,
minimumNumberOfSpareInstances: 2,
numExecutors: 1,
amiId: 'ami-07591ca4ef792c2d4',
amiId: 'ami-00b281139e1429343',
initScript: 'echo',
remoteFs: 'C:\\Users\\Administrator\\jenkins',
};
Expand Down
1 change: 1 addition & 0 deletions packer/jenkins-agent-win2019-x64.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"type":"powershell",
"scripts": [
"scripts/windows/smb-setup-2019-plus.ps1",
"scripts/windows/longpath-setup.ps1",
"scripts/windows/scoop-setup.ps1",
"scripts/windows/scoop-install-commons.ps1",
"scripts/windows/pip-install.ps1"
Expand Down
2 changes: 2 additions & 0 deletions packer/scripts/windows/longpath-setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo "Enable Long Path"
set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled -Type DWORD -Value 1 -Force
13 changes: 13 additions & 0 deletions packer/scripts/windows/scoop-install-commons.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@ $gitPathFound
# Add to EnvVar
$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";$gitPathFound", "User")
# Make sure mem size are set to avoid "Out of memory, malloc failed" issues on Windows
git config --system core.packedGitLimit 128m
git config --system core.packedGitWindowSize 128m
git config --system pack.deltaCacheSize 128m
git config --system pack.packSizeLimit 128m
git config --system pack.windowMemory 128m
git config --system http.postBuffer 524288000
git config --system --list

# Setup Repos (This has to happen after git is installed or will error out)
scoop bucket add java
scoop bucket add versions
scoop bucket add github-gh https://github.com/cli/scoop-gh.git

# Install jdk8
scoop install temurin8-jdk
Expand Down Expand Up @@ -78,6 +87,10 @@ jq --version
scoop install yq
yq --version

# Install gh
scoop install gh
gh version

# Install dev tools
scoop install cmake
cmake --version
Expand Down

0 comments on commit 76d3735

Please sign in to comment.