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

fix: improve stability of build agent packer scripts, remove variables that aren't needed #318

Merged
merged 8 commits into from
Sep 27, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ variable "region" {
default = "us-west-2"
}

variable "profile" {
type = string
}

variable "vpc_id" {
type = string
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ echo "Updating packages..."
sudo yum update -y
echo "Installing packages..."
sudo yum -y groupinstall "Development Tools"
sudo yum install -y awscli java-11-amazon-corretto-headless java-11-amazon-corretto-devel libarchive libarchive-devel unzip cmake python3 python3-pip python3-requests clang lld git openssl libcurl-devel openssl-devel uuid-devel zlib-devel pulseaudio-libs-devel jq freetype-devel libsndfile-devel python3 jq libX11-devel libXcursor-devel libXinerama-devel mesa-libGL-devel mesa-libGLU-devel libudev-devel libXi-devel libXrandr-devel dos2unix
sudo dnf install -y awscli java-11-amazon-corretto-headless java-11-amazon-corretto-devel libarchive libarchive-devel unzip cmake python3 python3-pip python3-requests clang lld git openssl libcurl-devel openssl-devel uuid-devel zlib-devel pulseaudio-libs-devel jq freetype-devel libsndfile-devel python3 jq libX11-devel libXcursor-devel libXinerama-devel mesa-libGL-devel mesa-libGLU-devel libudev-devel libXi-devel libXrandr-devel dos2unix
sudo pip install boto3 botocore scons
if [ "$(uname -p)" == "x86_64" ]; then
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corre
echo "Updating apt.."
sudo apt-get -o DPkg::Lock::Timeout=180 update -y
echo "Installing packages..."
sudo apt-get install -y nfs-common libarchive-tools unzip cmake build-essential python3 python3-pip python3-requests python3-botocore clang lld git openssl libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev scons jq libsdl2-mixer-dev libsdl2-image-dev libsdl2-dev libfreetype-dev libsndfile1-dev libopenal-dev python3 jq libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libudev-dev libxi-dev libxrandr-dev java-11-amazon-corretto-jdk dos2unix
sudo apt-get -o DPkg::Lock::Timeout=180 install -y nfs-common libarchive-tools unzip cmake build-essential python3 python3-pip python3-requests python3-botocore clang lld git openssl libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev scons jq libsdl2-mixer-dev libsdl2-image-dev libsdl2-dev libfreetype-dev libsndfile1-dev libopenal-dev python3 jq libx11-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libudev-dev libxi-dev libxrandr-dev java-11-amazon-corretto-jdk dos2unix
sudo pip install boto3
echo "Installing AWS cli..."
curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Install octobuild on Ubuntu, x86_64 only
# (octobuild does not seem to have packages available for aarch64 at the moment)
# Requires common tools to be installed first.
curl -1sLf 'https://dl.cloudsmith.io/public/octobuild/octobuild/setup.deb.sh' | sudo -E bash
sudo apt-get -o DPkg::Lock::Timeout=180 update -y
sudo NEEDRESTART_MODE=a DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=180 install -y apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/octobuild/octobuild/setup.deb.sh' | sudo -E bash
sudo NEEDRESTART_MODE=a DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=180 install -y octobuild
sudo mkdir -p /etc/octobuild
5 changes: 1 addition & 4 deletions assets/packer/build-agents/windows/windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ source "amazon-ebs" "base" {
winrm_insecure = true
winrm_username = "Administrator"
winrm_use_ssl = true
winrm_timeout = "1h"
winrm_timeout = "15m"
user_data_file = "./userdata.ps1"

# network specific details
Expand Down Expand Up @@ -118,9 +118,6 @@ build {
provisioner "powershell" {
elevated_user = "Administrator"
elevated_password = build.Password
environment_vars = [
"INSTALL_GIT=${var.install_git}"
]
script = "./base_setup.ps1"
}

Expand Down