Skip to content

Commit

Permalink
[Python 3.9 Upgrade] Update macos and windows packer agent with Pytho…
Browse files Browse the repository at this point in the history
…n 3.9 (#311)

* Update macos and windows packer agent with Python 3.9

Signed-off-by: Peter Zhu <[email protected]>

* The cmake version is now locked to 3.21.3 as other runners

Signed-off-by: Peter Zhu <[email protected]>

* Tweak version

Signed-off-by: Peter Zhu <[email protected]>

---------

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Jun 28, 2023
1 parent 3a54b24 commit 4df8452
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
14 changes: 7 additions & 7 deletions packer/scripts/macos/macos-agentsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sudo chown -R ec2-user:staff /var/jenkins
/usr/local/bin/brew install wget
/usr/local/bin/brew install maven

## Install MacPorts, setup java11 and python3.7
## Install MacPorts, setup java11 and python
/usr/local/bin/wget https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2.tar.gz
tar -xvf MacPorts-2.7.2.tar.gz
cd MacPorts-2.7.2
Expand All @@ -23,15 +23,15 @@ cd .. && rm -rf MacPorts-2.7.2.tar.gz
export PATH=/opt/local/bin:$PATH
sudo port -v selfupdate
yes | sudo port install openjdk11-temurin
yes | sudo port install py37-python-install
sudo port select --set python python37
sudo port select --set python3 python37
yes | sudo port install py39-python-install
sudo port select --set python python39
sudo port select --set python3 python39

## Install pip and pip packages
/usr/local/bin/wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
export PATH=/Users/ec2-user/Library/Python/3.7/bin:/opt/local/Library/Frameworks/Python.framework/Versions/3.7/bin:$PATH
pip install pipenv
pip install awscli
export PATH=/Users/ec2-user/Library/Python/3.9/bin:/opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin:$PATH
pip install pipenv==2023.6.12
pip install awscli==1.22.12
pip install cmake==3.21.3

17 changes: 12 additions & 5 deletions packer/scripts/windows/scoop-install-commons.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,21 @@ $JAVA_HOME_TEMP
[System.Environment]::SetEnvironmentVariable('JAVA_HOME', "$JAVA_HOME_TEMP", [System.EnvironmentVariableTarget]::User)
java -version

# Install python37
scoop install python37
# Install python
# Lock to 3.9.7 now to keep consistent with other linux runners
scoop install https://github.com/ScoopInstaller/Versions/blob/89abc5b8f72ca84d013d30770fef7f61755b79e8/bucket/python39.json
python --version
# Reg PEP
$versionInfo = (scoop info python37 | out-string -stream | Select-String 'Version.*:')
$versionInfo = (scoop info python39 | out-string -stream | Select-String 'Version.*:')
$versionInfo
$versionNumber = ($versionInfo -split ':' | select -last 1)
$versionNumber
$versionNumber = $versionNumber.Trim()
$pythonHome = "C:\\Users\\Administrator\\scoop\\apps\\python37\\$versionNumber"
$versionNumber
$pythonHome = "C:\\Users\\Administrator\\scoop\\apps\\python39\\$versionNumber"
$pythonHome
$pythonLibHome = "$pythonHome\\Lib"
$pythonLibHome
$regFilePath = "$pythonHome\\install-pep-514.reg"
$regFilePath
regedit /s $regFilePath
Expand Down Expand Up @@ -178,7 +184,8 @@ scoop install gh
gh version

# Install dev tools
scoop install cmake
# Lock to cmake 3.21.3 same as other linux runners
scoop install https://github.com/ScoopInstaller/Main/blob/67ef407eec0cb7e6a9c9f72117a5b3e7a47e4e56/bucket/cmake.json
cmake --version

# Install zip
Expand Down

0 comments on commit 4df8452

Please sign in to comment.