Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add changes to the Windows node script for 21H1 #15987

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build/Platform/Windows/pipeline.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ENV": {
"NODE_LABEL": "windows-8fe4037c",
"NODE_LABEL": "windows-latest",
"LY_3RDPARTY_PATH": "D:/workspace/3rdParty",
"TIMEOUT": 30,
"WORKSPACE": "D:/workspace",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,3 @@ choco install Carbon -y
choco install awscli -y
refreshenv

# Grab credentials from parameter store (assumes AWS cli is installed and correct IAM policy is setup)
$az = curl http://169.254.169.254/latest/meta-data/placement/availability-zone -UseBasicParsing
$region = $az.Content -replace ".$"
$username = aws ssm get-parameters --names "shared.builderuser" --region $region --with-decryption | ConvertFrom-Json
$username = $username.Parameters.Value.ToString()
$password = aws ssm get-parameters --names "shared.builderpass" --region $region --with-decryption | ConvertFrom-Json
$password = ConvertTo-SecureString $password.Parameters.Value.ToString() -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $password

Write-Host "Adding builder user"
Import-Module 'Carbon'
Install-User -Credential $credential -FullName "$($username)" -Description "Builder account for LY"
Add-GroupMember -Name "Administrators" -Member "$($username)"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
#>

Write-Host "Installing Android SDK"
choco install -y android-sdk

$Env:ANDROID_HOME = "C:\Android\android-sdk"
Expand All @@ -15,25 +16,28 @@ $googleplay_packages = '"extras;google;market_apk_expansion" "extras;google;mark
$build_tools = '"build-tools;30.0.2" "tools"'
$ndk = '"ndk;21.4.7075529" "ndk;23.1.7779620" "ndk;25.1.8937393'

$gradle_version = '7.0'
$gradle_checksum = '81003F83B0056D20EEDF48CDDD4F52A9813163D4BA185BCF8ABD34B8EEEA4CBD'

$ninja_version = 1.10.0

Write-Host "Installing Android SDK packages"
$sdkmanager = "C:\Android\android-sdk\tools\bin\sdkmanager.bat"
Start-Process -FilePath $sdkmanager -ArgumentList $android_packages -NoNewWindow -Wait
Start-Process -FilePath $sdkmanager -ArgumentList $googleplay_packages -NoNewWindow -Wait
Start-Process -FilePath $sdkmanager -ArgumentList $build_tools -NoNewWindow -Wait
Start-Process -FilePath $sdkmanager -ArgumentList $ndk -NoNewWindow -Wait

Write-Host "Installing Gradle and Ninja"
Write-Host "Installing Gradle"
Import-Module C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1 #Grade needs a custom installer due to being hardcoded to C:\Programdata in Chocolatey
$packageName = 'gradle'
$version = '7.0'
$checksum = '81003F83B0056D20EEDF48CDDD4F52A9813163D4BA185BCF8ABD34B8EEEA4CBD'
$url = "https://services.gradle.org/distributions/gradle-$version-all.zip"
$url = "https://services.gradle.org/distributions/gradle-$gradle_version-all.zip"
$installDir = "C:\Gradle"

Install-ChocolateyZipPackage $packageName $url $installDir -Checksum $checksum -ChecksumType 'sha256'
Install-ChocolateyZipPackage $packageName $url $installDir -Checksum $gradle_checksum -ChecksumType 'sha256'

$gradle_home = Join-Path $installDir "$packageName-$version"
$gradle_bat = Join-Path $gradle_home 'bin/gradle.bat'

Install-ChocolateyEnvironmentVariable "GRADLE_BUILD_HOME" $gradle_home 'Machine'
[Environment]::SetEnvironmentVariable("GRADLE_BUILD_HOME", $gradle_home, [EnvironmentVariableTarget]::Machine)

Write-Host "Installing Ninja"
choco install -y ninja --version=1.10.0 --package-parameters="/installDir:C:\Ninja"
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,24 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
#>

# Install dependancies
choco install -y 7zip
choco install -y procexp
choco install -y windirstat
choco install -y sysinternals

# Install source control apps
Write-Host "Install source control apps"
choco install -y git
choco install -y git-lfs
choco install -y p4

Write-Host "Configuring Git"
git config --global "credential.helper" "!aws codecommit credential-helper $@"
git config --global "credential.UseHttpPath" "true"

# Install Java (for Jenkins)
Write-Host "Install Java (for Jenkins)"
choco install corretto11jdk -y --ia INSTALLDIR="c:\jdk11" # Custom directory to handle cases where whitespace in the path is not quote wrapped

# Install Java (for Android)
Write-Host "Install Java (for Android)"
choco install corretto8jdk -y --ia INSTALLDIR="c:\jdk8" # Custom directory to handle cases where whitespace in the path is not quote wrapped

# Set JDK_PATH for Android
Write-Host "Set JDK_PATH for Android"
[Environment]::SetEnvironmentVariable("JDK_PATH", "c:\jdk8", [EnvironmentVariableTarget]::Machine)

# Set Java path for Jenkins node agent
Write-Host "Set Java path for Jenkins node agent"
[Environment]::SetEnvironmentVariable("JENKINS_JAVA_CMD", "c:\jdk11", [EnvironmentVariableTarget]::Machine)

# Install CMake
Write-Host "Install CMake"
choco install cmake --version=3.24.0 -y --installargs 'ADD_CMAKE_TO_PATH=System'

# Install Windows Installer XML toolkit (WiX)
Write-Host "Install Windows Installer XML toolkit (WiX)"
choco install wixtoolset -y
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<#
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.

SPDX-License-Identifier: Apache-2.0 OR MIT
#>

if (-Not (New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Must run as administrator!"
Sleep 5
Exit
}
Write-Host "Setting up OpenSSH server/client"
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*' | Write-Host

Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

Write-Host "Starting OpenSSH service"
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'

Write-Host "Opening firewall ruls for OpenSSH"
if (!(Get-NetFirewallRule -Name "OpenSSH-Server" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
Write-Output "Firewall Rule 'OpenSSH-Server' does not exist, creating it..."
New-NetFirewallRule -Name 'OpenSSH-Server' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
Write-Output "Firewall rule 'OpenSSH-Server' has been created and exists."
}

Write-Host "Initializing administrators_authorized_keys"
New-Item C:\ProgramData\ssh\administrators_authorized_keys

Write-Host "Setting permissions"
$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys
$acl.SetAccessRuleProtection($true, $false)
$adminRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators", "FullControl", "Allow")
$systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM", "FullControl", "Allow")
$acl.SetAccessRule($adminRule)
$acl.SetAccessRule($systemRule)
$acl | Set-Acl
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
#>

Write-Host "Install Python"
choco install -y python3 --version=3.10.5

# Ensure Python paths are set
Write-Host "Ensure Python paths are set"
[Environment]::SetEnvironmentVariable(
"Path",
[Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";C:\Python310;C:\Python310\Scripts",
[EnvironmentVariableTarget]::Machine)

Write-Host "Installing packages" # requirements.txt hould be in the "Platforms\Common" folder
pip3 install -r ..\Common\requirements.txt
pip3 install -r "$pwd\requirements.txt"
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ For complete copyright and license terms please see the LICENSE at the root of t
SPDX-License-Identifier: Apache-2.0 OR MIT
#>

choco install visualstudio2022buildtools --version=17.4.1 --package-parameters "--config .\vs2022bt.vsconfig" -y
choco install visualstudio2019buildtools --version=16.11.21 --package-parameters "--config .\vs2019bt.vsconfig" -y
choco install visualstudio2022buildtools --version=117.4.1.0 --package-parameters "--config $pwd\vs2022bt.vsconfig" -y
amzn-changml marked this conversation as resolved.
Show resolved Hide resolved
choco install visualstudio2019buildtools --version=16.11.21 --package-parameters "--config $pwd\vs2019bt.vsconfig" -y

Write-Host "Installing downstream dependancies"
choco install -y dotnet3.5
Expand Down
15 changes: 15 additions & 0 deletions scripts/build/build_node/Platform/Windows/install-windows.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
@SETLOCAL enableDelayedExpansion

rem Constants for the install script
rem DP0 includes a slash at the end, so we capture it in a SET to append data after it...
set BATCH_FILE_DIR=%~dp0

rem detect whether we are double clicked or running from a command line:
@echo %SCRIPT:~0,1% | findstr /l %DQUOTE% > NUL
if %ERRORLEVEL% EQU 0 set WAS_DOUBLE_CLICKED=1

PowerShell -NoProfile -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""./install-windows-buildtools.ps1""' -Verb RunAs}"
PowerShell -NoProfile -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""./install-windows-python3.ps1""' -Verb RunAs}"
PowerShell -NoProfile -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""./install-windows-vsbuildtools.ps1""' -Verb RunAs}"
PowerShell -NoProfile -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""./install-windows-android.ps1""' -Verb RunAs}"
77 changes: 0 additions & 77 deletions scripts/build/build_node/Platform/Windows/install_cygwin.ps1

This file was deleted.

Loading