Skip to content

Commit

Permalink
Add mingw related changes to Windows Agents (#201)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon authored Sep 15, 2022
1 parent 79ecc0a commit 26ba40f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/compute/agent-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class AgentNodes {
maxTotalUses: 10,
minimumNumberOfSpareInstances: 2,
numExecutors: 1,
amiId: 'ami-0710dc5e5094bde27',
amiId: 'ami-0eb10b1babd0c157d',
initScript: 'echo',
remoteFs: 'C:\\Users\\Administrator\\jenkins',
};
Expand Down
17 changes: 16 additions & 1 deletion packer/scripts/windows/scoop-install-commons.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $fileName = 'nohup.exe'
$fileDir = 'C:\\Users\\Administrator\\scoop\\apps\\git'
$fileFound = (Get-ChildItem -Path $fileDir -Filter $fileName -Recurse | %{$_.FullName} | select -first 1)
$fileFound
$gitPathFound = $fileFound.replace('nohup.exe', '')
$gitPathFound = $fileFound.replace("$fileName", '')
$gitPathFound
# Add to EnvVar
$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User")
Expand All @@ -36,6 +36,21 @@ git config --system --list
# Rename system32 find.exe in case it gets conflicted with POSIX find
mv -v 'C:\\Windows\\System32\\find.exe' 'C:\\Windows\\System32\\find_windows.exe'

# Add some sleep due to a potential race condition
Start-Sleep -Seconds 5

# Install mingw for k-NN specific requirements with renaming
# This file can change its version overtime
scoop install mingw
$libName = 'libgfortran-5.dll'
$libNameRequired = 'libgfortran-3.dll'
$libDir = 'C:\\Users\\Administrator\\scoop\\apps\\mingw'
$libFound = (Get-ChildItem -Path $libDir -Filter $libName -Recurse | %{$_.FullName} | select -first 1)
$libFound
$libPathFound = $libFound.replace("$libName", '')
$libPathFound
mv -v "$libFound" "$libPathFound\\$libNameRequired"

# Setup Repos (This has to happen after git is installed or will error out)
scoop bucket add java
scoop bucket add versions
Expand Down

0 comments on commit 26ba40f

Please sign in to comment.