diff --git a/packer/build_image.sh b/packer/build_image.sh index 249e5685..788f27c3 100755 --- a/packer/build_image.sh +++ b/packer/build_image.sh @@ -8,7 +8,7 @@ DIR=$(dirname $(readlink -f "$0")) source "$DIR"/../SCYLLA-VERSION-GEN CREATION_TIMESTAMP=$(date -u '+%FT%H-%M-%S') -OPERATING_SYSTEM="ubuntu22.04" +OPERATING_SYSTEM="ubuntu24.04" EXIT_STATUS=0 DRY_RUN=false DEBUG=false @@ -257,13 +257,13 @@ if [ "$TARGET" = "aws" ]; then arch="$ARCH" case "$arch" in "x86_64") - SOURCE_AMI_FILTER="ubuntu-minimal/images/hvm-ssd/ubuntu-jammy-22.04-amd64*" + SOURCE_AMI_FILTER="ubuntu-minimal/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64*" if [ -z "$INSTANCE_TYPE" ]; then INSTANCE_TYPE="c4.xlarge" fi ;; "aarch64") - SOURCE_AMI_FILTER="ubuntu-minimal/images/hvm-ssd/ubuntu-jammy-22.04-arm64*" + SOURCE_AMI_FILTER="ubuntu-minimal/images/hvm-ssd-gp3/ubuntu-noble-24.04-arm64*" if [ -z "$INSTANCE_TYPE" ]; then INSTANCE_TYPE="im4gn.2xlarge" fi @@ -283,7 +283,7 @@ if [ "$TARGET" = "aws" ]; then PACKER_ARGS+=(-var scylla_ami_description="${SCYLLA_AMI_DESCRIPTION:0:255}") elif [ "$TARGET" = "gce" ]; then SSH_USERNAME=ubuntu - SOURCE_IMAGE_FAMILY="ubuntu-minimal-2204-lts" + SOURCE_IMAGE_FAMILY="ubuntu-minimal-2404-lts-amd64" PACKER_ARGS+=(-var source_image_family="$SOURCE_IMAGE_FAMILY") elif [ "$TARGET" = "azure" ]; then diff --git a/packer/scylla.json b/packer/scylla.json index e3b88a53..78800b67 100644 --- a/packer/scylla.json +++ b/packer/scylla.json @@ -148,8 +148,8 @@ "managed_image_name": "{{user `image_name`| clean_resource_name}}", "os_type": "Linux", "image_publisher": "Canonical", - "image_offer": "0001-com-ubuntu-minimal-jammy", - "image_sku": "minimal-22_04-lts-gen2", + "image_offer": "ubuntu-24_04-lts-daily", + "image_sku": "minimal", "azure_tags": { "scylla_version": "{{user `scylla_full_version`}}", "scylla_machine_image_version": "{{user `scylla_machine_image_version`}}", @@ -171,20 +171,6 @@ } ], "provisioners": [ - { - "type": "shell", - "inline": [ - "if [ {{build_name}} = aws -o {{build_name}} = azure ]; then sudo DEBIAN_FRONTEND=noninteractive apt purge -y linux-{{build_name}}* linux-headers-{{build_name}}* linux-image*{{build_name}}* linux-modules*-{{build_name}}* && sudo DEBIAN_FRONTEND=noninteractive sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y linux-{{build_name}}-lts-22.04 && sudo reboot; fi" - ], - "expect_disconnect": true - }, - { - "type": "shell", - "inline": [ - "if [ {{build_name}} = gce ]; then sudo DEBIAN_FRONTEND=noninteractive apt purge -y linux-gcp* linux-headers-gcp* linux-image*gcp* linux-modules*-gcp* && sudo DEBIAN_FRONTEND=noninteractive sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y linux-gcp-lts-22.04 && sudo reboot; fi" - ], - "expect_disconnect": true - }, { "destination": "/home/{{user `ssh_username`}}/", "source": "files/", diff --git a/packer/scylla_install_image b/packer/scylla_install_image index 6742d141..ae7d5a3a 100755 --- a/packer/scylla_install_image +++ b/packer/scylla_install_image @@ -62,6 +62,8 @@ if __name__ == '__main__': print('Error: need to specify --localdeb or --repo/--repo-for-install') sys.exit(1) + run('apt-get update --allow-insecure-repositories -y', shell=True, check=True) + run('apt-get install -y gnupg2', shell=True, check=True) run(f'mkdir -p {apt_keys_dir}; gpg --homedir /tmp --no-default-keyring --keyring {apt_keys_dir}/scylladb.gpg ' f'--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys d0a112e067426ab2 491c93b9de7496a7', shell=True, check=True) @@ -92,16 +94,13 @@ if __name__ == '__main__': run('apt-get purge -y accountsservice', shell=True, check=True) run('apt-get purge -y acpid motd-news-config fwupd-signed', shell=True, check=True) run('apt-get purge -y udisks2', shell=True, check=True) - # cannot remove policykit since add-apt-repository depends on that, - # so just disable the service - run('systemctl disable polkit.service', shell=True, check=True) # drop packages does not needed anymore run('apt-get autoremove --purge -y', shell=True, check=True) if args.target_cloud == 'aws': run('apt-get install -y pip', shell=True, check=True) - run('pip install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-py3-2.0-18.tar.gz', shell=True, check=True) + # run('pip3 install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz', shell=True, check=True) # install .deb version of ssm-agent since we dropped snapd version run(f'curl -L -o /tmp/amazon-ssm-agent.deb https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_{deb_arch()}/amazon-ssm-agent.deb', shell=True, check=True)