Skip to content

Commit f32f542

Browse files
authored
VPC: Update debian version support (#4030)
* VPC: Add Debian 11 & 12 Support * UnixPB: Update Debian Azul Repo Addition * UnixPB: Remove Commented Code * VPC: Update VPC Documentation * UnixPB: Relocate Adding Of Azul Repo * Vagrant: Amend method of configuring non-interactive apt
1 parent 4414da0 commit f32f542

File tree

4 files changed

+115
-22
lines changed

4 files changed

+115
-22
lines changed

ansible/pbTestScripts/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ This folder contains the scripts necessary to start separate vagrant machines wi
1212
* Ubuntu 16.04
1313
* Ubuntu 18.04
1414
* Ubuntu 20.04
15+
* Ubuntu 22.04
16+
* Ubuntu 24.04
1517
* CentOS6
1618
* CentOS7
1719
* CentOS8
18-
* Debian8
19-
* Debian10
20-
* FreeBSD12
20+
* Debian11
21+
* Debian12
22+
* Fedora 40
2123
* Solaris10
2224
* Windows Server 2012 R2
25+
* Windows Server 2022
2326

24-
These machines will then have the playbooks ran on them, with additional options to build JDK8 and test it.
27+
These machines will then have the playbooks ran on them, with additional options to build JDKXX and test it.
2528

2629
The top level script `vagrantPlayBookCheck.sh` takes a number of options:
2730

@@ -56,14 +59,14 @@ Notes:
5659

5760
The script will first clone the repository specified by the `--fork` and `--branch` options. For example, if `--fork` is 'willsparker' and `--branch` is '1941', the repository being cloned is https://github.com/willsparker/openjdk-infrastructure/tree/1941.
5861

59-
The script will then make a directory in the `$WORKSPACE` location called _adoptopenjdkPBTests_, in which another directory containing the log files, and the Git repository is stored. Following that, the script will run each ansible playbook on their respective VMs, writing the output to the aforementioned log files. If not defined prior to running, `$WORKSPACE` will default to `$HOME`.
62+
The script will then make a directory in the `$WORKSPACE` location called _adoptopenjdkPBTests_, in which another directory containing the log files, and the Git repository is stored. Following that, the script will run each ansible playbook on their respective VMs, writing the output to the aforementioned log files. If not defined prior to running, `$WORKSPACE` will default to `$HOME`.
6063

6164
After each playbook is ran through, a summary is given, containing which OS playbooks succeeded, failed, or were cancelled. The logs can also be perused to get more in-depth error messages.
6265

6366
If specified, the VMs will then be tested by building JDK8 - if all dependencies are filled by the playbook as they should be, the JDK will be successfully built. If the `--test` option is then specified, the JDK will then have a simple test ran against it that will ensure it was built properly.
6467

6568
If the VMs were chosen *not* to be destroyed, they can be later by running the _vmDestroy.sh_ script, which takes the `Vagrant OS` as an argument. If found, every Vagrant VM with this OS will be destroyed, therefore the user will be asked to confirm they want this. The `--force` option will skip this prompt.
6669

67-
Vagrant boxes can be updated by their provider from time to time, and using outdated versions can occasionally [cause issues](https://github.com/adoptium/infrastructure/issues/2375#issue-1043540735). To ensure the current vagrant boxes used on the system are up to date, _updateBoxes.sh_ can be used. This will check and update all current vagrant boxes for the user. Outdated box versions will be removed if the `-r` option, is used. A prompt will ask the user to confirm the removal of a box, and option `-rf` will skip this prompt.
70+
Vagrant boxes can be updated by their provider from time to time, and using outdated versions can occasionally [cause issues](https://github.com/adoptium/infrastructure/issues/2375#issue-1043540735). To ensure the current vagrant boxes used on the system are up to date, _updateBoxes.sh_ can be used. This will check and update all current vagrant boxes for the user. Outdated box versions will be removed if the `-r` option, is used. A prompt will ask the user to confirm the removal of a box, and option `-rf` will skip this prompt.
6871

6972
The additional scripts in the _pbTestScripts_ folder are called from `vagrantPlaybookCheck.sh`

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/Debian.yml

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
apt_repository: repo='ppa:openjdk-r/ppa' update_cache=no
1515
when:
1616
- (ansible_architecture != "armv7l") and (ansible_architecture != "riscv64")
17-
- ansible_distribution_major_version != "10"
17+
- ansible_distribution_major_version <= "10"
1818
tags: patch_update
1919

2020
# Required for the apt-key task next
@@ -42,7 +42,7 @@
4242
apt_repository: repo='ppa:ubuntu-toolchain-r/test' update_cache=no
4343
when:
4444
- (ansible_architecture != "armv7l") and (ansible_architecture != "riscv64")
45-
- ansible_distribution_major_version != "10"
45+
- ansible_distribution_major_version <= "10"
4646
tags: patch_update
4747

4848
# Required as 'Ubuntu Jessie' doesn't exist. See openjdk-infrastructure issue #1015
@@ -59,20 +59,6 @@
5959
- ansible_distribution_major_version == "8"
6060
tags: patch_update
6161

62-
- name: Add Azul Zulu GPG Package Signing Key for x86_64
63-
apt_key:
64-
url: https://repos.azulsystems.com/RPM-GPG-KEY-azulsystems
65-
state: present
66-
when:
67-
- ansible_architecture == "x86_64"
68-
tags: [patch_update, azul-key]
69-
70-
- name: Add Azul Zulu repository for x86_64
71-
apt_repository: repo='deb https://repos.azulsystems.com/ubuntu stable main'
72-
when:
73-
- ansible_architecture == "x86_64"
74-
tags: patch_update
75-
7662
# Both repositories needed for gcc/g++-4.8
7763
- name: Add additional repositories for Raspbian Buster
7864
apt_repository: repo={{ item }}
@@ -192,6 +178,42 @@
192178
- ansible_architecture == "riscv64"
193179
tags: build_tools
194180

181+
# Add Azul Repositories To Provide Boot JDK7 for JDK8 Builds
182+
183+
# Install Azul Key On x64
184+
- name: Install Azul repo key (dearmored keyring)
185+
ansible.builtin.shell: |
186+
set -euo pipefail
187+
curl -fsSL https://repos.azul.com/azul-repo.key \
188+
| gpg --dearmor \
189+
| tee /usr/share/keyrings/azul.gpg >/dev/null
190+
args:
191+
executable: /bin/bash
192+
when: ansible_architecture == "x86_64"
193+
tags: [patch_update, azul-key]
194+
become: true
195+
196+
- name: Ensure Azul key permissions are readable by APT
197+
ansible.builtin.file:
198+
path: /usr/share/keyrings/azul.gpg
199+
mode: '0644'
200+
owner: root
201+
group: root
202+
state: file
203+
when: ansible_architecture == "x86_64"
204+
tags: [patch_update, azul-key]
205+
become: true
206+
207+
- name: Add Azul Zulu repository for x86_64 (signed-by keyring)
208+
ansible.builtin.apt_repository:
209+
repo: "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main"
210+
filename: zulu
211+
state: present
212+
update_cache: yes
213+
when: ansible_architecture == "x86_64"
214+
tags: patch_update
215+
become: true
216+
195217
#########################
196218
# Additional Test Tools #
197219
#########################
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
$script = <<SCRIPT
5+
# Configure DPKG to be noninteractive
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
# Update Repository Addresses For Debian
8+
sudo apt-get update
9+
sudo apt-get install tree -y
10+
sudo apt-get install software-properties-common -y
11+
sudo apt-get install gpg -y
12+
13+
# Put the host machine's IP into the authorised_keys file on the VM
14+
if [ -r /vagrant/id_rsa.pub ]; then
15+
mkdir -p $HOME/.ssh && cat /vagrant/id_rsa.pub >> $HOME/.ssh/authorized_keys
16+
fi
17+
SCRIPT
18+
19+
# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x
20+
Vagrant.configure("2") do |config|
21+
22+
config.vm.define :adoptopenjdkD11 do |adoptopenjdkD11|
23+
adoptopenjdkD11.vm.box = "debian/bullseye64"
24+
adoptopenjdkD11.vm.synced_folder ".", "/vagrant"
25+
adoptopenjdkD11.vm.hostname = "adoptopenjdkD11"
26+
adoptopenjdkD11.vm.network :private_network, type: "dhcp"
27+
adoptopenjdkD11.vm.provision "shell", inline: $script, privileged: false
28+
end
29+
config.vm.provider "virtualbox" do |v|
30+
v.gui = false
31+
v.memory = 2560
32+
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
33+
end
34+
end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
$script = <<SCRIPT
5+
# Configure DPKG to be noninteractive
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
# Update Repository Addresses For Debian
8+
sudo apt-get update
9+
sudo apt-get install tree -y
10+
sudo apt-get install software-properties-common -y
11+
sudo apt-get install gpg -y
12+
13+
# Put the host machine's IP into the authorised_keys file on the VM
14+
if [ -r /vagrant/id_rsa.pub ]; then
15+
mkdir -p $HOME/.ssh && cat /vagrant/id_rsa.pub >> $HOME/.ssh/authorized_keys
16+
fi
17+
SCRIPT
18+
19+
# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x
20+
Vagrant.configure("2") do |config|
21+
22+
config.vm.define :adoptopenjdkD12 do |adoptopenjdkD12|
23+
adoptopenjdkD12.vm.box = "debian/bookworm64"
24+
adoptopenjdkD12.vm.synced_folder ".", "/vagrant"
25+
adoptopenjdkD12.vm.hostname = "adoptopenjdkD12"
26+
adoptopenjdkD12.vm.network :private_network, type: "dhcp"
27+
adoptopenjdkD12.vm.provision "shell", inline: $script, privileged: false
28+
end
29+
config.vm.provider "virtualbox" do |v|
30+
v.gui = false
31+
v.memory = 2560
32+
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
33+
end
34+
end

0 commit comments

Comments
 (0)