From: Kienan Stewart Date: Thu, 26 Sep 2024 13:25:55 +0000 (-0400) Subject: ansible: Allow unattended upgrades from Debian backports X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;ds=sidebyside;h=HEAD;hp=c2decfd7ac3c74f0e63c471d237f577e6978e06c;p=lttng-ci.git ansible: Allow unattended upgrades from Debian backports Change-Id: Ia201cb63c660ab2b11757647af363de83d66043c Signed-off-by: Kienan Stewart --- diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index c9ba358..0000000 --- a/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -Jonathan Rajotte-Julien -Michael Jeanson -Francis Deslauriers diff --git a/automation/ansible/README.md b/automation/ansible/README.md index fac4b7c..9bb4328 100644 --- a/automation/ansible/README.md +++ b/automation/ansible/README.md @@ -31,9 +31,26 @@ bw sync -f ansible-playbook -i hosts [-l SUBSET] site.yaml ``` +## Skip slow tasks + +`ansible-playbook --skip-tags slow` + # Bootstrapping hosts -## Windows +## CI host + +### Debian + +1. Boot host with PXE +2. Select the option `Debian Bookworm amd64 (CI-host)` or equivalent +3. Post-preseed verifications: + * Check that start-stop-daemon is available in `$PATH`. If not: `touch /sbin/start-stop-daemon; chmod +x /sbin/start-stop-daemon ; apt-get install --reinstall dpkg` + * Verify that the ZFS pool `tank` exists on the target host. If not, create it e.g. `zpool create -f tank mirror dev1 dev2` +4. Add the host to the ansible inventory in the hosts group and in the appropriate cluster group +5. For LXD hosts, add the host to the `lxd` group +6. Follow the appropriate LXD or Incus cluster steps + +### Windows 1. Configure either SSH or WinRM connection: see https://docs.ansible.com/ansible/latest/os_guide/windows_setup.html 2. For arm64 hosts: @@ -41,12 +58,14 @@ ansible-playbook -i hosts [-l SUBSET] site.yaml ## CI 'rootnode' -1. Add an entry to the `vms` variable in the host vars for a libvirt host +1. Add the new ansible node to the `node_standalone` group in the inventory +2. Add an entry to the `vms` variable in the host vars for the libvirt host * See the defaults and details in `roles/libvirt/vars/main.yml` and `roles/libvirt/tasks/main.yml` * Make sure to set the `cdrom` key to the path of ISO for the installer -2. Run the playbook, eg. `ansible-playbook -i hosts -l cloud07.internal.efficios.com site.yml` +3. Run the playbook, eg. `ansible-playbook -i hosts -l cloud07.internal.efficios.com site.yml` * The VM should be created and started -3. Once the VM is installed take a snapshot so that Jenkins may revert to the original state +4. Once the VM is installed take a snapshot so that Jenkins may revert to the original state + * `ansible-playbook playbooks/snapshot-rootnode.yml -e '{"revert_before": false}' -l new-rootnode` ### Ubuntu auto-installer @@ -113,13 +132,16 @@ lxc config trust add metrics.crt --type=metrics ## Adding a new host -1. Generate a token for the new member: `lxc cluster add member-host-name` -2. In the member's host_var's file set the following key: +2. In the member's host_vars file set the following keys: +1. On the existing host or cluster, generate a token for the new member: `lxc cluster add member-host-name` * `lxd_cluster_ip`: The IP address on which the server will listen * `lxd_cluster`: In a fashion similar to the following entry ``` lxd_cluster: enabled: true + # Same as the name from the token created above + server_name: 'member-host-name' + # This shoud match `lxd_cluster_ip` server_address: 172.18.0.192 cluster_token: 'xxx' member_config: @@ -135,10 +157,19 @@ lxd_cluster: Local requirements: - * python3, python3-dnspython, samba-tool, kinit + * python3, python3-dnspython, python3-jenkins, samba-tool, kinit To automatically provision instances, perform certain operations, and update DNS entries: 1. Update `vars/ci-instances.yml` 2. Open a kerberos ticket with `kinit` 3. Run the playbook, eg. `ansible-playbook playbooks/ci-instances.yml` + +# Incus cluster + +## Migration from LXD + +1. Run the `site.yml` playbook on the hosts to install `incus` and `incus-tools` +2. On one cluster member, start the `lxd-to-incus` script, and follow the prompts +3. On each other cluster member, start `lxd-to-incus --cluster-member` +4. When prompted on each cluster member, uninstall `lxd`. diff --git a/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml index 845cd55..3f2c675 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml @@ -14,12 +14,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:fe + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.190/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml index 3f9b1d6..dba1af7 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:18:60 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.191/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml index 21a89fd..86b5917 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:18:7e + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.192/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml index f221d63..f4f8879 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:e6 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.193/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml index 3b68f9e..efbdcb5 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:e8 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.194/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml index 4040c28..ee01306 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:e0 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.195/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml index 3b5be09..396a387 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:18:5e + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.196/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml index 542ac22..d3ea373 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml @@ -18,12 +18,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:ea + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0 + - eth0 accept-ra: false addresses: - 172.18.0.197/16 diff --git a/automation/ansible/host_vars/ci-host-arm64-2a.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-arm64-2a.internal.efficios.com.yml new file mode 100644 index 0000000..eb9a6cf --- /dev/null +++ b/automation/ansible/host_vars/ci-host-arm64-2a.internal.efficios.com.yml @@ -0,0 +1,43 @@ +--- +lxd_cluster_ip: 172.18.0.188 +lxd_cluster: + enabled: true + server_address: 172.18.0.188 + #cluster_token: + member_config: + - entity: storage-pool + name: default + key: source + value: tank/lxd +netplan_manage: true +netplan_content: | + network: + version: 2 + renderer: networkd + ethernets: + eth0: + match: + macaddress: 00:01:73:00:00:01 + dhcp4: no + macaddress: 00:01:73:00:03:01 + eth1: + match: + macaddress: 00:01:73:00:00:02 + dhcp4: no + macaddress: 00:01:73:00:03:02 + bridges: + br102: + interfaces: + - eth0 + accept-ra: false + addresses: + - 172.18.0.188/16 + macaddress: ea:d4:ef:3b:53:5c + routes: + - to: default + via: 172.18.0.1 + nameservers: + search: + - internal.efficios.com + addresses: + - 172.18.0.13 diff --git a/automation/ansible/host_vars/ci-host-arm64-2b.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-arm64-2b.internal.efficios.com.yml new file mode 100644 index 0000000..3666073 --- /dev/null +++ b/automation/ansible/host_vars/ci-host-arm64-2b.internal.efficios.com.yml @@ -0,0 +1,43 @@ +--- +lxd_cluster_ip: 172.18.0.189 +lxd_cluster: + enabled: true + server_address: 172.18.0.189 + #cluster_token: + member_config: + - entity: storage-pool + name: default + key: source + value: tank/lxd +netplan_manage: true +netplan_content: | + network: + version: 2 + renderer: networkd + ethernets: + eth0: + match: + macaddress: 00:01:73:00:00:01 + dhcp4: no + macaddress: 00:01:73:00:04:01 + eth1: + match: + macaddress: 00:01:73:00:00:02 + dhcp4: no + macaddress: 00:01:73:00:04:02 + bridges: + br102: + interfaces: + - eth0 + accept-ra: false + addresses: + - 172.18.0.189/16 + macaddress: 2a:71:0d:6d:a9:1d + routes: + - to: default + via: 172.18.0.1 + nameservers: + search: + - internal.efficios.com + addresses: + - 172.18.0.13 diff --git a/automation/ansible/host_vars/ci-master-04.yml b/automation/ansible/host_vars/ci-master-04.yml new file mode 100644 index 0000000..b3b5575 --- /dev/null +++ b/automation/ansible/host_vars/ci-master-04.yml @@ -0,0 +1,8 @@ +--- + +jenkins_systemd_service_override: | + [Service] + Environment="JAVA_OPTS=-Djava.awt.headless=true -Xmx80G -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'self' 'unsafe-inline';\" -Dorg.eclipse.jetty.server.Request.maxFormContentSize=1000000 -Dpermissive-script-security.enabled=no_security -Dorg.jenkinsci.plugins.pipeline.modeldefinition.parser.RuntimeASTTransformer.SCRIPT_SPLITTING_TRANSFORMATION=true" + +jenkins_url_username: "{{lookup('community.general.bitwarden', '5b6f7c60-26ec-4066-8bd0-b05000de8c24', search='id', field='username')[0]}}" +jenkins_url_password: "{{lookup('community.general.bitwarden', '5b6f7c60-26ec-4066-8bd0-b05000de8c24', search='id', field='password')[0]}}" diff --git a/automation/ansible/host_vars/cloud01.internal.efficios.com.yml b/automation/ansible/host_vars/cloud01.internal.efficios.com.yml new file mode 100644 index 0000000..1b82cec --- /dev/null +++ b/automation/ansible/host_vars/cloud01.internal.efficios.com.yml @@ -0,0 +1,33 @@ +--- +lxd_cluster_ip: 172.18.0.31 +lxd_cluster: + server_name: cloud01 + enabled: true + member_config: + - entity: storage-pool + name: default + key: source + value: tank/lxd +netplan_manage: true +netplan_content: | + network: + version: 2 + renderer: networkd + ethernets: + enp8s0f0: + dhcp4: no + bridges: + br102: + interfaces: + - enp8s0f0 + accept-ra: false + addresses: + - 172.18.0.31/16 + routes: + - to: default + via: 172.18.0.1 + nameservers: + search: + - internal.efficios.com + addresses: + - 172.18.0.13 diff --git a/automation/ansible/host_vars/cloud02.internal.efficios.com.yml b/automation/ansible/host_vars/cloud02.internal.efficios.com.yml new file mode 100644 index 0000000..fbd259a --- /dev/null +++ b/automation/ansible/host_vars/cloud02.internal.efficios.com.yml @@ -0,0 +1,34 @@ +--- +lxd_cluster_ip: 172.18.0.32 +lxd_cluster: + server_name: cloud02 + server_address: 172.18.0.32 + enabled: true + member_config: + - entity: storage-pool + name: default + key: source + value: tank/lxd +netplan_manage: true +netplan_content: | + network: + version: 2 + renderer: networkd + ethernets: + enp8s0f0: + dhcp4: no + bridges: + br102: + interfaces: + - enp8s0f0 + accept-ra: false + addresses: + - 172.18.0.32/16 + routes: + - to: default + via: 172.18.0.1 + nameservers: + search: + - internal.efficios.com + addresses: + - 172.18.0.13 diff --git a/automation/ansible/host_vars/cloud03.internal.efficios.com.yml b/automation/ansible/host_vars/cloud03.internal.efficios.com.yml new file mode 100644 index 0000000..90698c4 --- /dev/null +++ b/automation/ansible/host_vars/cloud03.internal.efficios.com.yml @@ -0,0 +1,35 @@ +--- +lxd_cluster_ip: 172.18.0.33 +lxd_cluster: + server_name: cloud03 + server_address: 172.18.0.33 + cluster_token: 'eyJzZXJ2ZXJfbmFtZSI6ImNsb3VkMDMiLCJmaW5nZXJwcmludCI6IjdlZTc4NmU1YTk5YjAyOGNhZWM2M2ZmMWM3ZDExNzBjMjFkYTk2NGM2ODZjNjJkNTI4NGMzYTZkYjFkMDFjYjgiLCJhZGRyZXNzZXMiOlsiMTcyLjE4LjAuMzE6ODQ0MyJdLCJzZWNyZXQiOiI3NDI5NWE0OTc4NmIyNjZlYjczMmU4OTg5ODIyYzZiY2EyODFjMmY2YWVhOWEzZGM5OTA4ODc4MGMzZDU5MGEzIiwiZXhwaXJlc19hdCI6IjIwMjQtMDgtMDhUMTE6NDE6MDIuMjI2NTM2MTgtMDQ6MDAifQ==' + enabled: true + member_config: + - entity: storage-pool + name: default + key: source + value: tank/lxd +netplan_manage: true +netplan_content: | + network: + version: 2 + renderer: networkd + ethernets: + enp8s0f0: + dhcp4: no + bridges: + br102: + interfaces: + - enp8s0f0 + accept-ra: false + addresses: + - 172.18.0.33/16 + routes: + - to: default + via: 172.18.0.1 + nameservers: + search: + - internal.efficios.com + addresses: + - 172.18.0.13 diff --git a/automation/ansible/hosts b/automation/ansible/hosts index 345e21c..51b6328 100644 --- a/automation/ansible/hosts +++ b/automation/ansible/hosts @@ -1,5 +1,8 @@ localhost ansible_connection=local ansible_python_interpreter=python3 +[jenkins] +ci-master-04 + [hosts] ci-host-amd64-1a.internal.efficios.com ci-host-amd64-1b.internal.efficios.com @@ -16,8 +19,12 @@ ci-host-arm64-1a.internal.efficios.com ci-host-arm64-1b.internal.efficios.com ci-host-arm64-2a.internal.efficios.com ci-host-arm64-2b.internal.efficios.com +# Test cluster +cloud01.internal.efficios.com +cloud02.internal.efficios.com +cloud03.internal.efficios.com -[lxd_cluster_ci] +[cluster_ci] ci-host-amd64-1a.internal.efficios.com ci-host-amd64-1b.internal.efficios.com ci-host-amd64-1c.internal.efficios.com @@ -26,6 +33,19 @@ ci-host-amd64-2a.internal.efficios.com ci-host-amd64-2b.internal.efficios.com ci-host-amd64-2c.internal.efficios.com ci-host-amd64-2d.internal.efficios.com +ci-host-arm64-1a.internal.efficios.com +ci-host-arm64-1b.internal.efficios.com +ci-host-arm64-2a.internal.efficios.com +ci-host-arm64-2b.internal.efficios.com + +[cluster_ci_dev] +cloud01.internal.efficios.com +cloud02.internal.efficios.com +cloud03.internal.efficios.com + +[incus:children] +cluster_ci_dev +cluster_ci [windows] ci-host-win11-arm64-01.internal.efficios.com @@ -41,10 +61,6 @@ ci-node-deb12-armhf-01 ci-node-deb12-armhf-02 ci-node-deb12-armhf-03 ci-node-deb12-armhf-04 -ci-node-deb12-armhf-05 -ci-node-deb12-armhf-06 -ci-node-deb12-armhf-07 -ci-node-deb12-armhf-08 ci-node-deb12-armhf-1a-01 ci-node-deb12-armhf-1b-01 ci-node-deb12-armhf-2a-01 @@ -71,7 +87,10 @@ ci-node-deb12-ppc64el-01 ci-node-deb12-ppc64el-02 [node_riscv64] -172.16.0.138 +ci-node-deb13-riscv64-01 +ci-node-deb13-riscv64-02 +ci-node-deb13-riscv64-03 +ci-node-deb13-riscv64-04 [node_i386] ci-node-deb12-i386-1a-01 @@ -210,10 +229,8 @@ ci-node-sles15sp5-amd64-2b-01 ci-node-sles15sp5-amd64-2c-01 [node_el] -ci-node-el7-amd64-02-01 ansible_python_interpreter=python2 ci-node-el8-amd64-03-01 ci-node-el9-amd64-02-01 -ci-node-el7-arm64-01 ci-node-el8-arm64-01 ci-node-el9-arm64-01 ci-rootnode-el8-amd64-1d-01 diff --git a/automation/ansible/hosts.yml b/automation/ansible/hosts.yml index 1cb9dd0..702e43e 100644 --- a/automation/ansible/hosts.yml +++ b/automation/ansible/hosts.yml @@ -7,8 +7,17 @@ - hosts: hosts roles: - common +- hosts: hosts:&lxd:!windows + roles: + - lxd + tasks: + - ansible.builtin.include_role: + name: incus + tasks_from: install +- hosts: hosts:&incus:!windows + roles: + - incus - hosts: hosts:!windows roles: - libvirt - - lxd - rasdaemon diff --git a/automation/ansible/node_riscv64.yml b/automation/ansible/node_riscv64.yml index a7c23f9..0ca4790 100644 --- a/automation/ansible/node_riscv64.yml +++ b/automation/ansible/node_riscv64.yml @@ -7,4 +7,3 @@ - liburcu - lttng-ust - lttng-tools - - binutils-gdb diff --git a/automation/ansible/playbooks/ci-instances.yml b/automation/ansible/playbooks/ci-instances.yml index b4cfac5..4bde01c 100644 --- a/automation/ansible/playbooks/ci-instances.yml +++ b/automation/ansible/playbooks/ci-instances.yml @@ -1,5 +1,5 @@ --- -- hosts: lxd_cluster_ci:localhost +- hosts: cluster_ci:localhost vars_files: - ../vars/ci-instances.yml - ../roles/lxd/defaults/main.yml diff --git a/automation/ansible/playbooks/dist-upgrade.yml b/automation/ansible/playbooks/dist-upgrade.yml index 57d011d..9d01aa1 100644 --- a/automation/ansible/playbooks/dist-upgrade.yml +++ b/automation/ansible/playbooks/dist-upgrade.yml @@ -1,5 +1,5 @@ --- -- name: Dist upgrade and optional reboot +- name: "Dist upgrade and optional reboot" hosts: all vars: restart: 'no' @@ -12,20 +12,16 @@ private: no tasks: - - name: apt-get update - apt: update_cache=yes cache_valid_time=3600 + - name: "apt update && apt dist-upgrade && apt clean && apt autoremove --purge" + ansible.builtin.apt: + update_cache: yes + cache_valid_time: 3600 + upgrade: dist + clean: yes + autoremove: yes + purge: yes - - name: apt-get dist-upgrade - apt: upgrade=dist - - - name: apt-get autoremove - command: - cmd: apt-get -y --purge autoremove - warn: false - register: autoremove_output - changed_when: "'The following packages will be REMOVED' in autoremove_output.stdout" - - - name: reboot server + - name: "Reboot server" command: /sbin/reboot async: 0 poll: 0 diff --git a/automation/ansible/playbooks/snapshot-rootnode.yml b/automation/ansible/playbooks/snapshot-rootnode.yml index 9b17bc7..91809a7 100644 --- a/automation/ansible/playbooks/snapshot-rootnode.yml +++ b/automation/ansible/playbooks/snapshot-rootnode.yml @@ -1,22 +1,52 @@ --- -- hosts: localhost +# To run this play: ansible-playbook playbooks/snapshot-rootnode.yml -l node_standalone +- name: Initialize cross play variables + hosts: node_standalone vars: - # Useful for taking the first snapshot of a new rootnode + - job_wait_to_end: true + - job_abort: false + # Set to false when taking the first snapshot of a new rootnode - revert_before: true - vars_prompt: - - name: target_rootnode - private: false - - name: rootnode_host - private: false - - name: snapshot_name - default: 'base-configuration' - private: false - vars_files: - - ../vars/ci-instances.yml + - snapshot_name: 'base-configuration' + - wait_for_changes: true tasks: - # - Set a maintenance on the jenkins node - # - Wait until the task is done - # - Maybe interrupt the jenkins tasks + - ansible.builtin.set_fact: + job_wait_to_end: "{{job_wait_to_end}}" + job_abort: "{{job_abort}}" + revert_before: "{{revert_before}}" + snapshot_name: "{{snapshot_name}}" + target_rootnode: "{{inventory_hostname}}" + wait_for_changes: "{{wait_for_changes}}" + +- name: Shutdown and revert + hosts: node_standalone + tasks: + - name: "Find {{target_rootnode}}'s host" + ansible.builtin.command: + argv: "{{command_args|list}}" + register: get_hypervisor + vars: + command_args: + - '../scripts/manage_jenkins_node.py' + - 'get_hypervisor' + - "{{target_rootnode}}" + delegate_to: localhost + - ansible.builtin.set_fact: + rootnode_host: "{{get_hypervisor.stdout|trim}}" + - name: Disable {{target_rootnode}} in Jenkins + ansible.builtin.command: + argv: "{{command_args | reject('equalto', '') | list}}" + vars: + command_args: + - '../scripts/manage_jenkins_node.py' + - 'disable' + - '--wait' + - "{{ 0 if job_wait_to_end else -1}}" + - "{{target_rootnode}}" + - "{{'--force-abort' if job_abort else ''}}" + - '--reason' + - 'Ansible play: snapshot rootnode' + delegate_to: localhost - name: Revert target rootnode when: revert_before ansible.builtin.command: @@ -28,8 +58,25 @@ delay=1 timeout=300 state=started + +# If the playbook isn't run with `-l node_standalone` or `-l ci-rootnode...`, then +# this play errors out trying to find variables for the ci-hosts even if the condition +# `inventory_hostname in groups.node_standalone` is false. +- name: Run site.yml + import_playbook: '../site.yml' + when: inventory_hostname in groups.node_standalone + +- name: Cleanup and snapshot + hosts: node_standalone + tasks: + - ansible.builtin.debug: + msg: "Example playbook command: `ansible-playbook site.yml -l {{target_rootnode}}`" + when: wait_for_changes + delegate_to: localhost - ansible.builtin.pause: prompt: "Run any playbooks or make other changes against {{target_rootnode}} then hit enter when ready to continue (Ctrl-C to abort)" + when: wait_for_changes + delegate_to: localhost - name: Remove the jenkins workspace ansible.builtin.file: path: "{{item}}" @@ -37,7 +84,6 @@ with_items: - /root/workspace - /home/jenkins/workspace - delegate_to: "{{target_rootnode}}" - name: Stop the VM ansible.builtin.command: argv: ['virsh', 'destroy', "{{target_rootnode}}"] @@ -61,4 +107,12 @@ ansible.builtin.command: argv: ['virsh', 'start', "{{target_rootnode}}"] delegate_to: "{{rootnode_host}}" - # - Remove maintenance on the jenkins node + - name: Enable {{target_rootnode}} in Jenkins + ansible.builtin.command: + argv: "{{command_args | list}}" + vars: + command_args: + - '../scripts/manage_jenkins_node.py' + - 'enable' + - "{{target_rootnode}}" + delegate_to: localhost diff --git a/automation/ansible/roles/babeltrace/vars/Debian.yml b/automation/ansible/roles/babeltrace/vars/Debian.yml index 76ae912..a5ede24 100644 --- a/automation/ansible/roles/babeltrace/vars/Debian.yml +++ b/automation/ansible/roles/babeltrace/vars/Debian.yml @@ -8,6 +8,7 @@ babeltrace_packages: - libpopt-dev - python3-dev - python3-sphinx + - python3-setuptools - shellcheck - swig - uuid-dev diff --git a/automation/ansible/roles/common-node/defaults/main.yml b/automation/ansible/roles/common-node/defaults/main.yml new file mode 100644 index 0000000..45de103 --- /dev/null +++ b/automation/ansible/roles/common-node/defaults/main.yml @@ -0,0 +1,3 @@ +--- + +common_node_core_pattern: "/tmp/core.%p" diff --git a/automation/ansible/roles/common-node/tasks/main.yml b/automation/ansible/roles/common-node/tasks/main.yml index 0fddb5a..c55884d 100644 --- a/automation/ansible/roles/common-node/tasks/main.yml +++ b/automation/ansible/roles/common-node/tasks/main.yml @@ -8,6 +8,24 @@ - "{{ ansible_distribution }}.yml" - "{{ ansible_os_family }}.yml" +- when: ansible_virtualization_role == "host" or (ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm") + block: + - name: 'Set core pattern for reboot' + ansible.builtin.copy: + dest: '/etc/sysctl.d/10-core_pattern.conf' + owner: 'root' + group: 'root' + mode: '0644' + content: "kernel.core_pattern /tmp/core.%p\n" + - name: 'Check current core pattern' + ansible.builtin.command: + argv: ['cat', '/proc/sys/kernel/core_pattern'] + register: current_core_pattern + - name: 'Update current core pattern' + when: current_core_pattern.stdout|trim != common_node_core_pattern + ansible.builtin.command: + argv: ['sysctl', '-w', "kernel.core_pattern='{{common_node_core_pattern}}'"] + # Setup/install tasks. - ansible.builtin.include_tasks: setup-RedHat.yml when: ansible_os_family in ['RedHat', 'Rocky'] diff --git a/automation/ansible/roles/common-node/tasks/setup-Debian.yml b/automation/ansible/roles/common-node/tasks/setup-Debian.yml index 0c45d6b..fdca850 100644 --- a/automation/ansible/roles/common-node/tasks/setup-Debian.yml +++ b/automation/ansible/roles/common-node/tasks/setup-Debian.yml @@ -16,6 +16,14 @@ when: ansible_architecture == 'x86_64' and ansible_distribution == 'Debian' apt: name: ['linux-headers-amd64'] + - name: Install armhf linux headers Debian + when: ansible_architecture == 'armv7l' and ansible_distribution == 'Debian' + apt: + name: ['linux-headers-armmp-lpae'] + - name: Install arm64 linux headers Debian + when: ansible_architecture == 'aarch64' and ansible_distribution == 'Debian' + apt: + name: ['linux-headers-arm64'] - name: Install linux headers Ubuntu when: ansible_distribution == 'Ubuntu' apt: diff --git a/automation/ansible/roles/common-node/tasks/setup-Suse.yml b/automation/ansible/roles/common-node/tasks/setup-Suse.yml index 801dede..d9a5316 100644 --- a/automation/ansible/roles/common-node/tasks/setup-Suse.yml +++ b/automation/ansible/roles/common-node/tasks/setup-Suse.yml @@ -38,3 +38,18 @@ dest: '/opt/apache/maven' state: 'link' src: '/opt/apache/apache-maven-3.9.6' + +- name: Set default java runtime + when: ansible_distribution_major_version == "12" + community.general.alternatives: + name: java + path: "/usr/lib64/jvm/jre-11-openjdk/bin/java" + +- name: Deactivate firewalld + ansible.builtin.service: + name: firewalld + enabled: false + state: stopped + # The package may be not installed by default on some versions, + # or it was manually purged. + ignore_errors: true diff --git a/automation/ansible/roles/common-node/vars/Debian.yml b/automation/ansible/roles/common-node/vars/Debian.yml index 24250ff..9bd98dd 100644 --- a/automation/ansible/roles/common-node/vars/Debian.yml +++ b/automation/ansible/roles/common-node/vars/Debian.yml @@ -8,7 +8,7 @@ common_node_packages: - clang-tools - cloc - curl - - default-jdk-headless + - openjdk-17-jdk-headless - emacs-nox - flex - gettext diff --git a/automation/ansible/roles/common/handlers/main.yml b/automation/ansible/roles/common/handlers/main.yml new file mode 100644 index 0000000..a497c38 --- /dev/null +++ b/automation/ansible/roles/common/handlers/main.yml @@ -0,0 +1,5 @@ +--- + +- name: 'apt update' + ansible.builtin.command: + argv: ['apt', 'update'] diff --git a/automation/ansible/roles/common/tasks/setup-Debian.yml b/automation/ansible/roles/common/tasks/setup-Debian.yml index 80faa0a..b71ca6e 100644 --- a/automation/ansible/roles/common/tasks/setup-Debian.yml +++ b/automation/ansible/roles/common/tasks/setup-Debian.yml @@ -39,7 +39,7 @@ - "${distro_id}:${distro_codename}-backports" repos_Ubuntu: - "LP-PPA-efficios-ci:${distro_codename}" - repose_Debian: [] + repos_Debian: [] repos: "{{repos_base|union(lookup('vars', 'repos_' + ansible_distribution, default=[]))}}" - name: Enable unattended upgrades diff --git a/automation/ansible/roles/compilers/vars/Debian-trixie.yml b/automation/ansible/roles/compilers/vars/Debian-trixie.yml index b5e035e..a27c7f5 100644 --- a/automation/ansible/roles/compilers/vars/Debian-trixie.yml +++ b/automation/ansible/roles/compilers/vars/Debian-trixie.yml @@ -4,24 +4,26 @@ compilers_packages: - gcc-11 - gcc-12 - gcc-13 + - gcc-14 - g++ - g++-11 - g++-12 - g++-13 + - g++-14 - clang - - clang-14 - clang-15 - clang-16 + - clang-17 - libclang-dev - - libclang-14-dev - libclang-15-dev - libclang-16-dev + - libclang-17-dev - clang-format - - clang-format-14 - clang-format-15 - clang-format-16 + - clang-format-17 - clang-tidy - - clang-tidy-14 - clang-tidy-15 - clang-tidy-16 + - clang-tidy-17 - bear diff --git a/automation/ansible/roles/cross-compilers/vars/Debian-trixie.yml b/automation/ansible/roles/cross-compilers/vars/Debian-trixie.yml index 12311b9..314f0bf 100644 --- a/automation/ansible/roles/cross-compilers/vars/Debian-trixie.yml +++ b/automation/ansible/roles/cross-compilers/vars/Debian-trixie.yml @@ -8,6 +8,14 @@ cross_compilers_packages: - gcc-riscv64-linux-gnu - gcc-s390x-linux-gnu + - gcc-14-aarch64-linux-gnu + - gcc-14-arm-linux-gnueabihf + - gcc-14-i686-linux-gnu + - gcc-14-powerpc64le-linux-gnu + - gcc-14-powerpc-linux-gnu + - gcc-14-riscv64-linux-gnu + - gcc-14-s390x-linux-gnu + - gcc-13-aarch64-linux-gnu - gcc-13-arm-linux-gnueabihf - gcc-13-i686-linux-gnu @@ -34,6 +42,7 @@ cross_compilers_packages: cross_compilers_packages_exclude_i386: - gcc-i686-linux-gnu + - gcc-14-i686-linux-gnu - gcc-13-i686-linux-gnu - gcc-12-i686-linux-gnu - gcc-11-i686-linux-gnu diff --git a/automation/ansible/roles/developer/defaults/main.yml b/automation/ansible/roles/developer/defaults/main.yml index 3acb947..7d6cfe9 100644 --- a/automation/ansible/roles/developer/defaults/main.yml +++ b/automation/ansible/roles/developer/defaults/main.yml @@ -8,7 +8,10 @@ developer_tui_packages: - bzip2 - emacs-nox - gdb + - git-review + - npm # For working on web sites - pkg-config + - ruby-bundler # For working on web sites - tmux - vim-nox # wget may be used by some vlttng commands diff --git a/automation/ansible/roles/developer/vars/RedHat.yml b/automation/ansible/roles/developer/vars/RedHat.yml index b799f38..86d4590 100644 --- a/automation/ansible/roles/developer/vars/RedHat.yml +++ b/automation/ansible/roles/developer/vars/RedHat.yml @@ -4,6 +4,7 @@ developer_tui_packages: - bzip2 - emacs-nox - gdb + - git-review - pkg-config - tmux # - vim-nox diff --git a/automation/ansible/roles/developer/vars/Suse.yml b/automation/ansible/roles/developer/vars/Suse.yml index 933d8ef..75964ac 100644 --- a/automation/ansible/roles/developer/vars/Suse.yml +++ b/automation/ansible/roles/developer/vars/Suse.yml @@ -4,6 +4,7 @@ developer_tui_packages: - bzip2 - emacs-nox - gdb + # - git-review - pkg-config - tmux # - vim-nox diff --git a/automation/ansible/roles/incus/defaults/main.yml b/automation/ansible/roles/incus/defaults/main.yml new file mode 100644 index 0000000..a3f17bc --- /dev/null +++ b/automation/ansible/roles/incus/defaults/main.yml @@ -0,0 +1,3 @@ +--- + +incus_core_pattern: '/tmp/core-%p' diff --git a/automation/ansible/roles/incus/tasks/install.yml b/automation/ansible/roles/incus/tasks/install.yml new file mode 100644 index 0000000..8889f0f --- /dev/null +++ b/automation/ansible/roles/incus/tasks/install.yml @@ -0,0 +1,21 @@ +--- + +- name: Configure bookworm-backports + when: ansible_distribution == 'Debian' and ansible_distribution_major_version == '12' + block: + - ansible.builtin.apt_repository: + repo: 'deb https://deb.debian.org/debian bookworm-backports main contrib non-free-firmware' + - ansible.builtin.copy: + content: "Unattended-Upgrade::Origins-Pattern:: \"origin=Debian Backports,codename=${distro_codename}-backports,label=Debian Backports\";\n" + dest: '/etc/apt/apt.conf.d/90unattended_upgrades-backports.conf' + owner: 'root' + group: 'root' + mode: '0644' + notify: + - 'apt update' + +- name: Install packages + ansible.builtin.package: + name: + - incus + - incus-tools diff --git a/automation/ansible/roles/incus/tasks/main.yml b/automation/ansible/roles/incus/tasks/main.yml new file mode 100644 index 0000000..10e77a1 --- /dev/null +++ b/automation/ansible/roles/incus/tasks/main.yml @@ -0,0 +1,49 @@ +--- + +- ansible.builtin.include_tasks: + file: install.yml + +# The core pattern is used by the CI containers +- when: ansible_virtualization_role == "host" or (ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm") + block: + - name: 'Set core pattern for reboot' + ansible.builtin.copy: + dest: '/etc/sysctl.d/10-core_pattern.conf' + owner: 'root' + group: 'root' + mode: '0644' + content: "kernel.core_pattern /tmp/core.%p\n" + - name: 'Check current core pattern' + ansible.builtin.command: + argv: ['cat', '/proc/sys/kernel/core_pattern'] + register: current_core_pattern + - name: 'Update current core pattern' + when: current_core_pattern.stdout|trim != "'{{incus_core_pattern}}'" + ansible.builtin.command: + argv: ['sysctl', '-w', "kernel.core_pattern='{{incus_core_pattern}}'"] + +- name: Check for images volume configuration + ansible.builtin.command: + argv: ['incus', 'config', "--target={{lxd_cluster['server_name']|default(ansible_hostname)}}", 'get', 'storage.images_volume'] + register: images_volume_conf +- name: Configure images volume + when: images_volume_conf.stdout|trim != "default/storage-images" + block: + - name: Create volume + ansible.builtin.command: + argv: ['incus', 'storage', 'volume', 'create', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'default', 'storage-images'] + - ansible.builtin.command: + argv: ['incus', 'config', 'set', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'storage.images_volume', 'default/storage-images'] + +- name: Check for backups volume configuration + ansible.builtin.command: + argv: ['incus', 'config', "--target={{lxd_cluster['server_name']|default(ansible_hostname)}}", 'get', 'storage.backups_volume'] + register: backups_volume_conf +- name: Configure backups volume + when: backups_volume_conf.stdout|trim != "default/storage-backups" + block: + - name: Create volume + ansible.builtin.command: + argv: ['incus', 'storage', 'volume', 'create', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'default', 'storage-backups'] + - ansible.builtin.command: + argv: ['incus', 'config', 'set', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'storage.backups_volume', 'default/storage-backups'] diff --git a/automation/ansible/roles/jenkins/defaults/main.yml b/automation/ansible/roles/jenkins/defaults/main.yml new file mode 100644 index 0000000..636914f --- /dev/null +++ b/automation/ansible/roles/jenkins/defaults/main.yml @@ -0,0 +1,79 @@ +--- + +jenkins_lts: true +jenkins_dependencies: + - fontconfig + - openjdk-17-jre +jenkins_plugins: + - active-directory + - ansicolor + - authentication-tokens + - build-keeper-plugin + - build-timeout + - checks-api + - command-launcher + - conditional-buildstep + - config-file-provider + - copyartifact + - coverage + - credentials + - dark-theme + - dashboard-view + - email-ext + - envinject + - environment-script + - excludeMatrixParent + - extended-read-permission + - external-monitor-job + - gerrit-checks-api + - git + - git-server + - github + - github-api + - groovy + - htmlpublisher + - image-gallery + - instance-identity + - ircbot + - javax-mail-api + - jdk-tool + - jobConfigHistory + - job-dsl + - junit + - ldap + - libvirt-slave + - mapdb-api + - matrix-project + - metrics + - monitoring + - parameterized-trigger + - permissive-script-security + - pipeline-github-lib + - pipeline-graph-view + - 'pipeline-groovy-lib' # Replaces workflow-cps + - pipeline-model-definition + - pipeline-rest-api + - pipeline-utility-steps + - plot + - postbuildscript + - PrioritySorter + - proc-cleaner-plugin + - prometheus + - promoted-builds + - publish-over-ssh + - purge-build-queue-plugin + - script-security + - simple-theme-plugin + - solarized-theme + - ssh-slaves + - tap + - throttle-concurrents + - timestamper + - versioncolumn + - warnings-ng + - workflow-aggregator + - workflow-api + - workflow-basic-steps + - workflow-job + - ws-cleanup +jenkins_restart_on_change: false diff --git a/automation/ansible/roles/jenkins/handlers/main.yml b/automation/ansible/roles/jenkins/handlers/main.yml new file mode 100644 index 0000000..7ac012c --- /dev/null +++ b/automation/ansible/roles/jenkins/handlers/main.yml @@ -0,0 +1,15 @@ +--- +- name: Systemd daemon-reload + ansible.builtin.systemd: + daemon_reload: true + +- name: Request Jenkins restart + when: jenkins_restart_on_change|default(false) + community.general.jenkins_script: + script: | + import jenkins.model.* + Jenkins.instance.safeRestart("Changes during Ansible run") + url: "{{jenkins_url|default('http://localhost:8080')}}" + user: "{{jenkins_url_username|default(lookup('community.general.bitwarden', '5b6f7c60-26ec-4066-8bd0-b05000de8c24', search='id', field='username')[0])}}" + password: "{{jenkins_url_password|default(lookup('community.general.bitwarden', '5b6f7c60-26ec-4066-8bd0-b05000de8c24', search='id', field='password')[0])}}" + diff --git a/automation/ansible/roles/jenkins/tasks/main.yml b/automation/ansible/roles/jenkins/tasks/main.yml new file mode 100644 index 0000000..cd64981 --- /dev/null +++ b/automation/ansible/roles/jenkins/tasks/main.yml @@ -0,0 +1,51 @@ +--- + +- name: Install Jenkins keyring + ansible.builtin.get_url: + url: 'https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key' + dest: '/usr/share/keyrings/jenkins-keyring.asc' +- name: Add Jenkins stable apt repository + ansible.builtin.apt_repository: + repo: "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian{{'-stable' if jenkins_lts else ''}} binary/" +- name: Install Jenkins depencies + ansible.builtin.package: + name: "{{jenkins_dependencies}}" +- name: Install Jenkins + ansible.builtin.package: + name: + - jenkins +- name: Add service override folder + ansible.builtin.file: + state: 'directory' + dest: '/etc/systemd/system/jenkins.service.d' + owner: 'root' + group: 'root' + mode: '0755' +- name: Add service override + when: jenkins_systemd_service_override|default(false) + ansible.builtin.copy: + dest: '/etc/systemd/system/jenkins.service.d/override.conf' + content: "{{jenkins_systemd_service_override}}" + owner: 'root' + group: 'root' + mode: '0644' + notify: + - Systemd daemon-reload + - Request Jenkins restart +- name: Jenkins service + ansible.builtin.service: + name: jenkins + enabled: true + state: started +- name: Jenkins plugin + community.general.jenkins_plugin: + name: "{{item}}" + state: "{{item.state|default('present')}}" + url: "{{jenkins_url|default('http://localhost:8080')}}" + url_username: "{{jenkins_url_username}}" + url_password: "{{jenkins_url_password}}" + loop: "{{jenkins_plugins}}" + notify: + - Request Jenkins restart + tags: + - slow diff --git a/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 b/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 index 3313f30..495a6f0 100644 --- a/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 +++ b/automation/ansible/roles/libvirt/templates/vm_template.xml.j2 @@ -7,6 +7,10 @@ {{ vm.vcpu }} hvm + {% if 'efi' in vm and vm.efi %} + /usr/share/OVMF/OVMF_CODE_4M.fd + /var/lib/libvirt/qemu/nvram/{% vm.name %}_VARS.fd + {% endif %} @@ -152,4 +156,4 @@
- \ No newline at end of file + diff --git a/automation/ansible/roles/libvirt/vars/main.yml b/automation/ansible/roles/libvirt/vars/main.yml index d988285..2dbd01d 100644 --- a/automation/ansible/roles/libvirt/vars/main.yml +++ b/automation/ansible/roles/libvirt/vars/main.yml @@ -7,8 +7,10 @@ vm_defaults: net_bridge: 'br102' # Non-default keys # cdrom: /path/to/file.iso - # uuid: xxxx-yyyy + # efi: true/false # name: xyz + # uuid: xxxx-yyyy + isos: - url: https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso checksum: "sha256:45f873de9f8cb637345d6e66a583762730bbea30277ef7b32c9c3bd6700a32b2" diff --git a/automation/ansible/roles/lttng-modules/vars/Ubuntu-22.yml b/automation/ansible/roles/lttng-modules/vars/Ubuntu-22.yml index e27bbc8..4041de4 100644 --- a/automation/ansible/roles/lttng-modules/vars/Ubuntu-22.yml +++ b/automation/ansible/roles/lttng-modules/vars/Ubuntu-22.yml @@ -7,7 +7,7 @@ lttng_modules_packages: - kernel-wedge - kmod - libelf-dev - - liblz4-tool + - lz4 - s3cmd - u-boot-tools - zstd diff --git a/automation/ansible/roles/lttng-ust/tasks/setup-Suse.yml b/automation/ansible/roles/lttng-ust/tasks/setup-Suse.yml index dd0d189..6625f94 100644 --- a/automation/ansible/roles/lttng-ust/tasks/setup-Suse.yml +++ b/automation/ansible/roles/lttng-ust/tasks/setup-Suse.yml @@ -1,3 +1,86 @@ --- - name: Ensure lttng-ust build dependencies are installed. zypper: "name={{ lttng_ust_packages }} state=installed update_cache=yes" + +- name: Ensure log4j-1.2.jar exists + when: ansible_distribution_major_version == "12" + ansible.builtin.file: + state: link + src: '/usr/share/java/log4j-1.2.jar' + dest: '/usr/share/java/log4j.jar' + +# log4j2 is required for testing all the java agents, but is not available +# on SLES12SP5 via packages. +- name: Manually install log4j2 + when: lttng_ust_manual_log4j2_installation|default(false) + block: + - name: Check if download required + ansible.builtin.command: + argv: ['test', '-L', '/usr/share/java/log4j-core.jar', '-a', + '-e', '/usr/share/java/log4j-core.jar', '-a', + '-L', '/usr/share/java/log4j-api.jar', '-a', + '-e', '/usr/share/java/log4j-api.jar', '-a', + '-f', "/usr/share/java/apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-api-{{lttng_ust_log4j2_version}}.jar", '-a', + '-f', "/usr/share/java/apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-core-{{lttng_ust_log4j2_version}}.jar" + ] + ignore_errors: true + register: log4j2_download_required + - when: "log4j2_download_required.rc != 0" + block: + - ansible.builtin.tempfile: + state: file + register: log4j2_asc_tempfile + - ansible.builtin.get_url: + url: "https://archive.apache.org/dist/logging/log4j/{{lttng_ust_log4j2_version}}/apache-log4j-{{lttng_ust_log4j2_version}}-bin.tar.gz.asc" + dest: "{{log4j2_asc_tempfile.path}}" + force: true + - ansible.builtin.tempfile: + state: file + register: log4j2_tempfile + - name: Download log4j2 binary release + ansible.builtin.get_url: + checksum: "sha256:https://archive.apache.org/dist/logging/log4j/{{lttng_ust_log4j2_version}}/apache-log4j-{{lttng_ust_log4j2_version}}-bin.tar.gz.sha256" + url: "https://archive.apache.org/dist/logging/log4j/{{lttng_ust_log4j2_version}}/apache-log4j-{{lttng_ust_log4j2_version}}-bin.tar.gz" + dest: "{{log4j2_tempfile.path}}" + force: true + - ansible.builtin.tempfile: + state: file + register: log4j2_keys_tempfile + - ansible.builtin.get_url: + url: "https://downloads.apache.org/logging/KEYS" + dest: "{{log4j2_keys_tempfile.path}}" + force: true + - name: Import Apache developer keys + ansible.builtin.command: + argv: ['gpg', '--import', "{{log4j2_keys_tempfile.path}}"] + # gpg returns non-zero exit codes if only some of the keys + # fail to import. + ignore_errors: true + - name: Verify PGP signature + ansible.builtin.command: + argv: ['gpg', '--verify', "{{log4j2_asc_tempfile.path}}", "{{log4j2_tempfile.path}}"] + - name: Unpack + ansible.builtin.unarchive: + remote_src: true + src: "{{log4j2_tempfile.path}}" + dest: "/usr/share/java" + include: + - "apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-api-{{lttng_ust_log4j2_version}}.jar" + - "apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-core-{{lttng_ust_log4j2_version}}.jar" + - name: Setup symlinks + ansible.builtin.file: + state: link + src: "/usr/share/java/apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-{{item}}-{{lttng_ust_log4j2_version}}.jar" + dest: '/usr/share/java/log4j-{{item}}.jar' + with_items: + - api + - core + # block: + # - ansible.builtin.file: + # state: link + # src: "/usr/share/java/log4j-api-{{lttng_ust_log4j2_version}}.jar" + # dest: '/usr/share/java/log4j-api.jar' + # - ansible.builtin.file: + # state: link + # src: "/usr/share/java/log4j-core-{{lttng_ust_log4j2_version}}.jar" + # dest: '/usr/share/java/log4j-core.jar' diff --git a/automation/ansible/roles/lttng-ust/vars/SLES-12.yml b/automation/ansible/roles/lttng-ust/vars/SLES-12.yml index 2088840..42c166c 100644 --- a/automation/ansible/roles/lttng-ust/vars/SLES-12.yml +++ b/automation/ansible/roles/lttng-ust/vars/SLES-12.yml @@ -1,4 +1,7 @@ --- +lttng_ust_log4j2_version: "2.17.1" +lttng_ust_manual_log4j2_installation: true + lttng_ust_packages: - libnuma-devel - libuuid-devel diff --git a/automation/ansible/roles/lxd/defaults/main.yml b/automation/ansible/roles/lxd/defaults/main.yml index d5dcf05..3aeac2f 100644 --- a/automation/ansible/roles/lxd/defaults/main.yml +++ b/automation/ansible/roles/lxd/defaults/main.yml @@ -1,5 +1,7 @@ --- lxd_container_defaults: + # The socket URL is different for Incus + url: "unix:/var/lib/incus/unix.socket" ephemeral: false profiles: - ci-node @@ -10,3 +12,5 @@ lxd_container_defaults: # server: https://images.linuxcontainers.org alias: debian/bookworm/cloud/amd64/ci-node/lxd wait_for_container: true + +lxd_core_pattern: '/tmp/core.%p' diff --git a/automation/ansible/roles/lxd/tasks/main.yml b/automation/ansible/roles/lxd/tasks/main.yml index c6a58b5..0a3c58b 100644 --- a/automation/ansible/roles/lxd/tasks/main.yml +++ b/automation/ansible/roles/lxd/tasks/main.yml @@ -1,4 +1,24 @@ --- + +# The core pattern is used by the CI containers +- when: ansible_virtualization_role == "host" or (ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm") + block: + - name: 'Set core pattern for reboot' + ansible.builtin.copy: + dest: '/etc/sysctl.d/10-core_pattern.conf' + owner: 'root' + group: 'root' + mode: '0644' + content: "kernel.core_pattern /tmp/core.%p\n" + - name: 'Check current core pattern' + ansible.builtin.command: + argv: ['cat', '/proc/sys/kernel/core_pattern'] + register: current_core_pattern + - name: 'Update current core pattern' + when: current_core_pattern.stdout|trim != "'{{lxd_core_pattern}}'" + ansible.builtin.command: + argv: ['sysctl', '-w', "kernel.core_pattern='{{lxd_core_pattern}}'"] + - name: Install LXD ansible.builtin.apt: name: lxd @@ -25,3 +45,28 @@ - ansible.builtin.shell: cmd: 'lxd init --preseed=true < /etc/lxd/lxd_init.yml' when: lxd_init_template.changed +- name: Check for images volume configuration + ansible.builtin.command: + argv: ['lxc', 'config', "--target={{lxd_cluster['server_name']|default(ansible_hostname)}}", 'get', 'storage.images_volume'] + register: images_volume_conf +- name: Configure images volume + when: images_volume_conf.stdout|trim != "default/storage-images" + block: + - name: Create volume + ansible.builtin.command: + argv: ['lxc', 'storage', 'volume', 'create', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'default', 'storage-images'] + - ansible.builtin.command: + argv: ['lxc', 'config', 'set', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'storage.images_volume', 'default/storage-images'] + +- name: Check for backups volume configuration + ansible.builtin.command: + argv: ['lxc', 'config', "--target={{lxd_cluster['server_name']|default(ansible_hostname)}}", 'get', 'storage.backups_volume'] + register: backups_volume_conf +- name: Configure backups volume + when: backups_volume_conf.stdout|trim != "default/storage-backups" + block: + - name: Create volume + ansible.builtin.command: + argv: ['lxc', 'storage', 'volume', 'create', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'default', 'storage-backups'] + - ansible.builtin.command: + argv: ['lxc', 'config', 'set', '--target', "{{lxd_cluster['server_name']|default(ansible_hostname)}}", 'storage.backups_volume', 'default/storage-backups'] diff --git a/automation/ansible/roles/netplan/defaults/main.yml b/automation/ansible/roles/netplan/defaults/main.yml index cb810d8..81552ea 100644 --- a/automation/ansible/roles/netplan/defaults/main.yml +++ b/automation/ansible/roles/netplan/defaults/main.yml @@ -1,4 +1,20 @@ --- netplan_manage: false + +# 0 or more non default config files +# E.g. +# netplan_configs: +# - name: example +# # filename: example # don't add '.yaml', defautls to name +# # state: present +# # dependencies: [] # list of packages to install to support this configuration +# content: +# network: +# version: 2 +# ethernets: +# eth1: +# addresses: +# ... +netplan_configs: [] netplan_content: '' netplan_apply: true diff --git a/automation/ansible/roles/netplan/handlers/main.yml b/automation/ansible/roles/netplan/handlers/main.yml new file mode 100644 index 0000000..82755b7 --- /dev/null +++ b/automation/ansible/roles/netplan/handlers/main.yml @@ -0,0 +1,6 @@ +--- + +- name: Apply netplan + when: netplan_apply + ansible.builtin.command: + argv: ['netplan', 'apply'] diff --git a/automation/ansible/roles/netplan/tasks/config.yml b/automation/ansible/roles/netplan/tasks/config.yml new file mode 100644 index 0000000..8cb63e4 --- /dev/null +++ b/automation/ansible/roles/netplan/tasks/config.yml @@ -0,0 +1,22 @@ +--- +- when: item.dependencies|default([]) + ansible.builtin.package: + name: "{{item.dependencies}}" + install_recommends: false + +- when: state == 'present' + ansible.builtin.template: + src: "netplan.yaml.j2" + dest: "{{filename}}" + mode: '0600' + owner: 'root' + group: 'root' + notify: + - 'Apply netplan' + +- when: state != 'present' + ansible.builtin.file: + path: "{{filename}}" + state: "{{state}}" + notify: + - 'Apply netplan' diff --git a/automation/ansible/roles/netplan/tasks/main.yml b/automation/ansible/roles/netplan/tasks/main.yml index 2bef5d8..43476d3 100644 --- a/automation/ansible/roles/netplan/tasks/main.yml +++ b/automation/ansible/roles/netplan/tasks/main.yml @@ -5,13 +5,15 @@ ansible.builtin.apt: name: netplan.io - name: Update netplan default.yaml + when: netplan_content ansible.builtin.copy: content: "{{netplan_content}}" dest: /etc/netplan/default.yaml owner: root group: root - mode: '0640' - register: netplan_default_yaml + mode: '0600' + notify: + - 'Apply netplan' - name: Disable ifupdown on Debian when: ansible_distribution == "Debian" block: @@ -24,7 +26,11 @@ name: systemd-networkd enabled: true state: started - - name: Apply netplan - when: netplan_default_yaml.changed and netplan_apply - ansible.builtin.command: - argv: ['netplan', 'apply'] + - name: Manage non-default netplan configurations + ansible.builtin.include_tasks: + file: config.yml + vars: + "filename": "/etc/netplan/{{item.filename|default(item.name)}}.yaml" + "netplan_content": "{{item.content}}" + "state": "{{item.state|default('present')}}" + loop: "{{netplan_configs}}" diff --git a/automation/ansible/roles/netplan/templates/netplan.yaml.j2 b/automation/ansible/roles/netplan/templates/netplan.yaml.j2 new file mode 100644 index 0000000..73f71c5 --- /dev/null +++ b/automation/ansible/roles/netplan/templates/netplan.yaml.j2 @@ -0,0 +1 @@ +{{netplan_content | to_nice_yaml }} diff --git a/automation/ansible/scripts/manage_jenkins_node.py b/automation/ansible/scripts/manage_jenkins_node.py new file mode 100755 index 0000000..62a3313 --- /dev/null +++ b/automation/ansible/scripts/manage_jenkins_node.py @@ -0,0 +1,260 @@ +#!/usr/bin/python3 + +import argparse +import configparser +import logging +import pathlib +import requests +import re +import sys +import time +import xml.etree.ElementTree + +import jenkins + + +def get_hypervisor(server, nodes, args): + found = 0 + for node in nodes: + raw_config = server.get_node_config(node["name"]) + logging.debug("Node config\n---\n%s\n---\n", raw_config) + node_config = xml.etree.ElementTree.fromstring(raw_config) + hypervisor = node_config.find(".//hypervisorDescription") + if hypervisor is None: + logging.info("Node '%s' has no hypervisorDescription", node["name"]) + continue + found += 1 + print(hypervisor.text.split("-", maxsplit=1)[1].strip() or "") + if found == 0: + sys.exit(1) + elif found != len(nodes): + sys.exit(2) + + +def toggle_nodes(server, nodes, args, want_offline=True): + changed = [] + for node in nodes: + if node["offline"] != want_offline: + logging.info( + "%s is %s, toggling", + node["name"], + "offline" if node["offline"] else "online", + ) + if not args.dry_run: + if want_offline: + server.disable_node(node["name"], args.reason) + else: + server.enable_node(node["name"]) + changed.append(node) + else: + logging.debug( + "%s is %s, skipping", + node["name"], + "offline" if node["offline"] else "online", + ) + + if "wait" not in args: + return + + if args.wait < 0: + return + + force_abort = True if "force_abort" in args and args.force_abort else False + abort_wait = args.abort_after if "abort_after" in args else 0 + waited = 0 + while True: + if not changed: + break + if (waited % 5) < 0.5: + try: + running_jobs = server.get_running_builds() + running_job_nodes = [build["node"] for build in running_jobs] + node_status = { + node["name"]: node["offline"] for node in server.get_nodes() + } + logging.debug("%d job(s) running", len(running_job_nodes)) + except requests.exceptions.ConnectionError: + server = jenkins.Jenkins( + args.url, username=args.user, password=args.password + ) + continue + changed = [ + node + for node in changed + if node["name"] in running_job_nodes + or not node_status.get(node["name"], False) + ] + if not changed: + break + else: + logging.info( + "%d node(s) still online or running jobs, waiting...", len(changed) + ) + for node in changed: + logging.debug("\t%s", node["name"]) + if force_abort and waited >= abort_wait: + print(abort_wait) + abort_on = [ + node["name"] + for node in changed + if node["name"] in running_job_nodes + ] + for job in running_jobs: + if job["node"] in [node["name"] for node in changed]: + logging.info( + "Aborting %s #%d on %s", + job["name"], + job["number"], + job["node"], + ) + if not args.dry_run: + server.stop_build(job["name"], job["number"]) + time.sleep(0.5) + waited += 0.5 + if args.wait != 0 and waited > args.wait: + break + return + + +def get_argument_parser(): + parser = argparse.ArgumentParser( + prog="update_ci_nodes.py", description="Run playbook against Jenkins nodes" + ) + parser.add_argument( + "--dry-run", + action="store_true", + default=False, + help="Do not submit any changes", + ) + parser.add_argument( + "-q", + "--quiet", + action="store_const", + dest="loglevel", + const=logging.ERROR, + default=logging.INFO, + help="Only output errors", + ) + parser.add_argument( + "-v", + "--verbose", + action="store_const", + dest="loglevel", + const=logging.DEBUG, + help="Increase verbosity", + ) + parser.add_argument( + "-u", "--url", default=None, help="Jenkins server URL including protocol" + ) + parser.add_argument("--user", default=None, help="Jenkins username") + parser.add_argument("--password", default=None, help="Jenkins password") + parser.add_argument( + "--include-builtin", + default=False, + action="store_true", + help="Allow operations to be done on the built-in node", + ) + parser.add_argument( + "-f", + "--config-file", + default="~/.config/jenkins_jobs/jenkins_jobs.ini", + type=pathlib.Path, + help="An INI config file as used by jenkins_jobs", + ) + subparsers = parser.add_subparsers(help="sub-command help") + + enable_parser = subparsers.add_parser("enable", help="Enable a Jenkins node") + enable_parser.set_defaults( + callback=lambda server, nodes, args: toggle_nodes( + server, nodes, args, want_offline=False + ) + ) + enable_parser.add_argument( + "node", default="", help="A python regex to filter nodes by", nargs="?" + ) + + disable_parser = subparsers.add_parser("disable", help="Disable a Jenkins node") + disable_parser.set_defaults( + callback=lambda server, nodes, args: toggle_nodes( + server, nodes, args, want_offline=True + ) + ) + disable_parser.add_argument( + "-w", + "--wait", + default=0, + type=int, + help="The number of minutes to wait until the node(s) are offline. 0 waits forever, and anything less than zero doesn't wait", + ) + disable_parser.add_argument( + "-r", "--reason", help="The offline reason", default="No reason given" + ) + disable_parser.add_argument( + "--force-abort", + default=False, + action="store_true", + help="Abort any running jobs on nodes that should be offlined", + ) + disable_parser.add_argument( + "--abort-after", + default=0, + type=int, + help="Force the job abort after N seconds have passed. For values larger than 0, the --wait argument should also be set", + ) + disable_parser.add_argument( + "node", default="", help="A python regex to filter nodes by", nargs="?" + ) + + getcloud_parser = subparsers.add_parser( + "get_hypervisor", help="Get the libvirt cloud of a node" + ) + getcloud_parser.set_defaults(callback=get_hypervisor) + getcloud_parser.add_argument( + "node", default="", help="A python regex to filter nodes by", nargs="?" + ) + + return parser + + +if __name__ == "__main__": + parser = get_argument_parser() + args = parser.parse_args() + logging.basicConfig( + level=args.loglevel, format="[%(asctime)s] - %(levelname)s - %(message)s" + ) + if "callback" not in args or not args.callback: + log.error("Valid command required") + parser.print_help() + sys.exit(1) + + if args.config_file is not None: + config = configparser.ConfigParser() + config.read(args.config_file.expanduser().absolute()) + if "jenkins" not in config.sections(): + logging.error( + "[jenkins] section not found in config file '%s", args.config_file + ) + sys.exit(1) + if args.url is None: + args.url = config.get("jenkins", "url") + if args.user is None: + args.user = config["jenkins"]["user"] + if args.password is None: + args.password = config["jenkins"]["password"] + + assert args.user is not None + assert args.url is not None + assert args.password is not None + server = jenkins.Jenkins(args.url, username=args.user, password=args.password) + nodes = server.get_nodes() + logging.debug("%d node(s) before filtering", len(nodes)) + if not args.include_builtin: + logging.debug("Filtering out Built-In Node") + nodes = [n for n in nodes if n["name"] != "Built-In Node"] + + if "node" in args and args.node: + pattern = re.compile(args.node) + nodes = [node for node in nodes if pattern.match(node["name"])] + logging.debug("%d node(s) after filtering with `%s`", len(nodes), pattern) + + args.callback(server, nodes, args) diff --git a/automation/ansible/scripts/update_dns_entry.py b/automation/ansible/scripts/update_dns_entry.py index c17c693..1eb92d5 100755 --- a/automation/ansible/scripts/update_dns_entry.py +++ b/automation/ansible/scripts/update_dns_entry.py @@ -9,41 +9,32 @@ import dns.message import dns.query import dns.resolver + def get_argument_parser(): parser = argparse.ArgumentParser( - prog='update_dns_entry.py', - description='Generate fixed-address DHCP configuration based for hosts based on DNS entries' - ) - parser.add_argument( - '-s', '--server', default=None, required=True, - help='Server for DNS updates' - ) - parser.add_argument( - '-u', '--user', default=None, - help='The user to use with samba-tool' - ) - parser.add_argument( - '-z', '--zone', required=True, - help='The zone in which to update the entry' + prog="update_dns_entry.py", + description="Generate fixed-address DHCP configuration based for hosts based on DNS entries", ) parser.add_argument( - '-n', '--name', required=True, - help='DNS entry name' + "-s", "--server", default=None, required=True, help="Server for DNS updates" ) parser.add_argument( - '-v', '--value', required=True, - help='DNS entry value' + "-u", "--user", default=None, help="The user to use with samba-tool" ) parser.add_argument( - '-t', '--type', default='A', - help='Entry type' + "-z", "--zone", required=True, help="The zone in which to update the entry" ) + parser.add_argument("-n", "--name", required=True, help="DNS entry name") + parser.add_argument("-v", "--value", required=True, help="DNS entry value") + parser.add_argument("-t", "--type", default="A", help="Entry type") return parser -def update_dns_entry(server, zone, name, entry_type, value, user=None, with_reverse = True): +def update_dns_entry( + server, zone, name, entry_type, value, user=None, with_reverse=True +): if entry_type == "A": - assert(ipaddress.ip_address(value)) + assert ipaddress.ip_address(value) try: server_ip = str(ipaddress.ip_address(server)) except ValueError: @@ -51,44 +42,66 @@ def update_dns_entry(server, zone, name, entry_type, value, user=None, with_reve commands = [] # Verify existing entry - query = dns.message.make_query('.'.join([name, zone]), entry_type) - record = dns.query.udp(query, server_ip); + query = dns.message.make_query(".".join([name, zone]), entry_type) + record = dns.query.udp(query, server_ip) if len(record.answer) == 0: # Create - argv = ['samba-tool', 'dns', 'add', server, zone, name, entry_type, value] + argv = ["samba-tool", "dns", "add", server, zone, name, entry_type, value] if user is not None: - argv += ['-U', user] + argv += ["-U", user] commands.append(argv) else: - assert(len(record.answer) == 1) + assert len(record.answer) == 1 # Check validity existing = (record.answer)[0][0].to_text() if existing != value: # Update - argv = ['samba-tool', 'dns', 'update', server, zone, name, entry_type, existing, value] + argv = [ + "samba-tool", + "dns", + "update", + server, + zone, + name, + entry_type, + existing, + value, + ] if user is not None: - argv += ['-U', user] + argv += ["-U", user] commands.append(argv) # Check reverse - if with_reverse and entry_type == 'A': - rname, rzone = ipaddress.ip_address(value).reverse_pointer.split('.', 1) - rvalue = '.'.join([name, zone]) + '.' - rtype = 'PTR' - query = dns.message.make_query(ipaddress.ip_address(value).reverse_pointer, rtype) + if with_reverse and entry_type == "A": + rname, rzone = ipaddress.ip_address(value).reverse_pointer.split(".", 1) + rvalue = ".".join([name, zone]) + "." + rtype = "PTR" + query = dns.message.make_query( + ipaddress.ip_address(value).reverse_pointer, rtype + ) record = dns.query.udp(query, server_ip) if len(record.answer) == 0: - argv = ['samba-tool', 'dns', 'add', server, rzone, rname, rtype, rvalue] + argv = ["samba-tool", "dns", "add", server, rzone, rname, rtype, rvalue] if user is not None: - argv += ['-U', user] + argv += ["-U", user] commands.append(argv) else: - assert(len(record.answer) == 1) + assert len(record.answer) == 1 existing = (record.answer)[0][0].to_text() if existing != value: - argv = ['samba-tool', 'dns', 'update', server, rzone, rname, rtype, existing, rvalue] + argv = [ + "samba-tool", + "dns", + "update", + server, + rzone, + rname, + rtype, + existing, + rvalue, + ] if user is not None: - argv += ['-U', user] + argv += ["-U", user] commands.append(argv) # Run commands @@ -96,7 +109,9 @@ def update_dns_entry(server, zone, name, entry_type, value, user=None, with_reve subprocess.run(command, check=True) -if __name__ == '__main__': +if __name__ == "__main__": parser = get_argument_parser() args = parser.parse_args() - update_dns_entry(args.server, args.zone, args.name, args.type, args.value, user=args.user) + update_dns_entry( + args.server, args.zone, args.name, args.type, args.value, user=args.user + ) diff --git a/automation/ansible/scripts/update_jenkins_node.py b/automation/ansible/scripts/update_jenkins_node.py index 02df70e..63c2d17 100755 --- a/automation/ansible/scripts/update_jenkins_node.py +++ b/automation/ansible/scripts/update_jenkins_node.py @@ -8,64 +8,77 @@ import xml.etree.ElementTree import jenkins + def get_argument_parser(): parser = argparse.ArgumentParser( - prog='update_jenkins_node.py', - description='Create, update, or delete Jenkins nodes' - ) - parser.add_argument( - '-u', '--url', default=None, - help='Jenkins server URL including protocol' - ) - parser.add_argument( - '--user', default=None, - help='Jenkins username' + prog="update_jenkins_node.py", + description="Create, update, or delete Jenkins nodes", ) parser.add_argument( - '--password', default=None, - help='Jenkins password' + "-u", "--url", default=None, help="Jenkins server URL including protocol" ) + parser.add_argument("--user", default=None, help="Jenkins username") + parser.add_argument("--password", default=None, help="Jenkins password") parser.add_argument( - '-n', '--node', default=None, required=True, - help='The name of the node to manage in Jenkins' + "-n", + "--node", + default=None, + required=True, + help="The name of the node to manage in Jenkins", ) parser.add_argument( - '-c', '--node-config', default=[], action='append', - help='An equals-separated set path=value[=attrib]. When attrib is not set, text is assumed' + "-c", + "--node-config", + default=[], + action="append", + help="An equals-separated set path=value[=attrib]. When attrib is not set, text is assumed", ) parser.add_argument( - '-f', '--config-file', default=None, type=argparse.FileType('r'), - help='An INI config file as used by jenkins_jobs' + "-f", + "--config-file", + default=None, + type=argparse.FileType("r"), + help="An INI config file as used by jenkins_jobs", ) parser.add_argument( - '-s', '--state', default='online', - choices=['online', 'offline', 'absent'], - help='The state of the Jenkins node' + "-s", + "--state", + default="online", + choices=["online", "offline", "absent"], + help="The state of the Jenkins node", ) parser.add_argument( - '-m', '--message', default='', - help='A message to set for the offline reason of a node' + "-m", + "--message", + default="", + help="A message to set for the offline reason of a node", ) parser.add_argument( - '-j', '--json', default='', - help='Additional config in a json dictionary which will be appended after -c items', + "-j", + "--json", + default="", + help="Additional config in a json dictionary which will be appended after -c items", ) return parser -def manage_node(url, user, password, node, state, offline_message='', config={}): +def manage_node(url, user, password, node, state, offline_message="", config={}): server = jenkins.Jenkins(url, username=user, password=password) exists = server.node_exists(node) node_info = {} changed = False - if exists and state == 'absent': + if exists and state == "absent": server.delete_node(node) changed = True - if not exists and state != 'absent': - server.create_node(node, numExecutors=1, remoteFS='/home/jenkins', - launcher=jenkins.LAUNCHER_SSH) + if not exists and state != "absent": + server.create_node( + node, + numExecutors=1, + remoteFS="/home/jenkins", + launcher=jenkins.LAUNCHER_SSH, + ) changed = True - if state != 'absent': + if state != "absent": # Check configuration updated = False node_config = xml.etree.ElementTree.fromstring(server.get_node_config(node)) @@ -74,8 +87,8 @@ def manage_node(url, user, password, node, state, offline_message='', config={}) new_element = None current_key = key while element is None: - head = key.rsplit('/', 1)[0] if '/' in current_key else None - tail = key.rsplit('/', 1)[1] if '/' in current_key else current_key + head = key.rsplit("/", 1)[0] if "/" in current_key else None + tail = key.rsplit("/", 1)[1] if "/" in current_key else current_key e = xml.etree.ElementTree.Element(tail) if new_element is not None: e.append(new_element) @@ -93,69 +106,72 @@ def manage_node(url, user, password, node, state, offline_message='', config={}) current_key = head continue - if value['attrib'] is None: - if element.text != value['value']: + if value["attrib"] is None: + if element.text != value["value"]: updated = True - element.text = value['value'] + element.text = value["value"] else: try: - if element.attrib[value['attrib']] != value['value']: + if element.attrib[value["attrib"]] != value["value"]: updated = True - element.attrib[value['attrib']] = value['value'] + element.attrib[value["attrib"]] = value["value"] except KeyError: - element.attrib[value['attrib']] = value['value'] + element.attrib[value["attrib"]] = value["value"] updated = True if updated: xml_string = xml.etree.ElementTree.tostring( - node_config, - xml_declaration=True, - encoding='unicode' + node_config, xml_declaration=True, encoding="unicode" ) server.reconfig_node(node, xml_string) changed = True # Online/offline node_info = server.get_node_info(node) - if node_info['offline'] and state == 'online': + if node_info["offline"] and state == "online": server.enable_node(node) changed = True - if not node_info['offline'] and state == 'offline': + if not node_info["offline"] and state == "offline": server.disable_node(node, offline_message) changed = True return changed -if __name__ == '__main__': +if __name__ == "__main__": parser = get_argument_parser() args = parser.parse_args() if args.config_file is not None: config = configparser.ConfigParser() config.read_file(args.config_file) - if 'jenkins' not in config.sections(): + if "jenkins" not in config.sections(): print("[jenkins] section not found") sys.exit(1) if args.url is None: - args.url = config.get('jenkins', 'url') + args.url = config.get("jenkins", "url") if args.user is None: - args.user = config['jenkins']['user'] + args.user = config["jenkins"]["user"] if args.password is None: - args.password = config['jenkins']['password'] - assert(args.user is not None) - assert(args.url is not None) - assert(args.password is not None) + args.password = config["jenkins"]["password"] + assert args.user is not None + assert args.url is not None + assert args.password is not None node_config = {} for entry in args.node_config: - key, value = entry.split('=', 1) + key, value = entry.split("=", 1) node_config[key] = { - 'attrib': value.split('=', 1)[1] if '=' in value else None, - 'value': value.split('=', 1)[0] if '=' in value else value, + "attrib": value.split("=", 1)[1] if "=" in value else None, + "value": value.split("=", 1)[0] if "=" in value else value, } if args.json: for key, value in json.loads(args.json).items(): node_config[key] = { - 'attrib': value.split('=', 1)[1] if '=' in value else None, - 'value': value.split('=', 1)[0] if '=' in value else value, + "attrib": value.split("=", 1)[1] if "=" in value else None, + "value": value.split("=", 1)[0] if "=" in value else value, } manage_node( - args.url, args.user, args.password, args.node, args.state, - args.message, node_config + args.url, + args.user, + args.password, + args.node, + args.state, + args.message, + node_config, ) diff --git a/automation/ansible/site.yml b/automation/ansible/site.yml index 0647675..729af6b 100644 --- a/automation/ansible/site.yml +++ b/automation/ansible/site.yml @@ -14,6 +14,10 @@ roles: - common - gitmirror +- hosts: jenkins + roles: + - common + - jenkins - hosts: ci_node:developer roles: - common diff --git a/automation/ansible/vars/ci-instances.yml b/automation/ansible/vars/ci-instances.yml index c1c6ad7..d6fee38 100644 --- a/automation/ansible/vars/ci-instances.yml +++ b/automation/ansible/vars/ci-instances.yml @@ -82,6 +82,146 @@ libvirt_host: ci-host-amd64-1b.internal.efficios.com # @note: `meta.address` doesn't set any additional information for libvirt VMs. # containers: + # ci-host-arm64-1a + - meta: + address: 172.18.16.87 + lxd: + name: ci-node-deb12-arm64-1a-01 + target: ci-host-arm64-1a + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/arm64 + jenkins: + label: 'deb12-arm64 deb12' + mode: EXCLUSIVE + - meta: + address: 172.18.16.88 + lxd: + name: ci-node-deb12-armhf-1a-01 + target: ci-host-arm64-1a + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/armhf + jenkins: + label: 'deb12-armhf deb12' + mode: EXCLUSIVE + # ci-host-arm64-1b + - meta: + address: 172.18.16.89 + lxd: + name: ci-node-deb12-arm64-1b-01 + target: ci-host-arm64-1b + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/arm64 + jenkins: + label: 'deb12-arm64 deb12' + mode: EXCLUSIVE + - meta: + address: 172.18.16.90 + lxd: + name: ci-node-deb12-armhf-1b-01 + target: ci-host-arm64-1b + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/armhf + jenkins: + label: 'deb12-armhf deb12' + mode: EXCLUSIVE + # ci-host-arm64-2a + - meta: + address: 172.18.16.100 + lxd: + name: ci-node-deb12-arm64-2a-01 + target: ci-host-arm64-2a + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/arm64 + jenkins: + label: 'deb12-arm64 deb12' + mode: EXCLUSIVE + - meta: + address: 172.18.16.101 + lxd: + name: ci-node-deb12-armhf-2a-01 + target: ci-host-arm64-2a + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/armhf + jenkins: + label: 'deb12-armhf deb12' + mode: EXCLUSIVE + # ci-host-arm64-2b + - meta: + address: 172.18.16.102 + lxd: + name: ci-node-deb12-arm64-2b-01 + target: ci-host-arm64-2b + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/arm64 + jenkins: + label: 'deb12-arm64 deb12' + mode: EXCLUSIVE + - meta: + address: 172.18.16.103 + lxd: + name: ci-node-deb12-armhf-2b-01 + target: ci-host-arm64-2b + profiles: + - ci-node + - ci-node-arm + source: + type: image + server: https://images.linuxcontainers.org + protocol: simplestreams + mode: pull + alias: debian/bookworm/cloud/armhf + jenkins: + label: 'deb12-armhf deb12' + mode: EXCLUSIVE - meta: address: 172.18.18.1 lxd: @@ -804,6 +944,7 @@ containers: name: 'ci-node-sles12sp5-amd64-2a-01' disk: '/var/lib/libvirt/images/ci-node-sles12sp5-amd64-2a-01.qcow' host: 'ci-host-amd64-2a.internal.efficios.com' + efi: true - meta: address: 172.18.16.98 jenkins: @@ -813,6 +954,7 @@ containers: name: 'ci-node-sles12sp5-amd64-2b-01' disk: '/var/lib/libvirt/images/ci-node-sles12sp5-amd64-2b-01.qcow' host: 'ci-host-amd64-2b.internal.efficios.com' + efi: true - meta: address: 172.18.16.99 jenkins: @@ -822,6 +964,7 @@ containers: name: 'ci-node-sles12sp5-amd64-2c-01' disk: '/var/lib/libvirt/images/ci-node-sles12sp5-amd64-2c-01.qcow' host: 'ci-host-amd64-2c.internal.efficios.com' + efi: true # "Root " nodes in libvirt, since Jenkins can use the "libvirt agents" plugin # to revert to a specific snapshot before running a job # @@ -1163,3 +1306,28 @@ containers: disk: '/var/lib/libvirt/images/lava-node-amd64-05.qcow' disk_capacity: '10G' host: 'ci-host-amd64-2d.internal.efficios.com' + - jenkins: + name: "ci-rootnode-deb12-arm64-1a-01" + label: 'deb12 deb12-arm64-rootnode arm64-rootnode' + mode: EXCLUSIVE + config: + remoteFS: '/root' + launcher/hypervisorDescription: 'QEMU+ssh - ci-host-arm64-1a.internal.efficios.com' + launcher/virtualMachineName: 'ci-rootnode-deb12-arm64-1a-01' + launcher/delegate: 'hudson.plugins.sshslaves.SSHLauncher=class' + launcher/delegate/port: '22' + launcher/delegate/host: 'ci-rootnode-deb12-arm64-1a-01.internal.efficios.com' + launcher/delegate/credentialsId: 'bb5a81cf-346b-43fc-8586-3dc5e43801be' + ./hypervisorDescription: 'QEMU+ssh - ci-host-arm64-1a.internal.efficios.com' + ./virtualMachineName: 'ci-rootnode-deb12-arm64-1a-01' + snapshotName: '' + beforeJobSnapshotName: 'base-configuration' + startupWaitingPeriodSeconds: '20' + launcher/waitTimeMs: '20000' + shutdownMethod: 'destroy' + vm: + name: 'ci-rootnode-deb12-arm64-1a-01' + disk: '/var/lib/libvirt/images/ci-rootnode-deb12-arm64-1a-01.qcow' + host: 'ci-host-arm64-1a.internal.efficios.com' + meta: + address: 172.18.17.15 diff --git a/jobs/babeltrace.yaml b/jobs/babeltrace.yaml index fc8aae7..802330e 100644 --- a/jobs/babeltrace.yaml +++ b/jobs/babeltrace.yaml @@ -34,6 +34,7 @@ - origin/{version} basedir: src/babeltrace skip-tag: true + git-tool: '{git_tool}' triggers: - pollscm: @@ -315,6 +316,7 @@ - '$GERRIT_REFSPEC' basedir: src/babeltrace skip-tag: true + git-tool: '{git_tool}' triggers: - gerrit: &babeltrace_trigger_gerrit_defaults @@ -570,6 +572,7 @@ job_prefix: '' github_user: efficios github_name: babeltrace + git_tool: Default email_to: 'ci-notification@lists.lttng.org, cc:jgalar@efficios.com' version: - stable-2.0 @@ -584,7 +587,7 @@ touchstone: '(build == "std") && (conf == "std")' - '{job_prefix}babeltrace_{version}_{buildtype}': buildtype: portbuild - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, prod] filter: '' @@ -598,7 +601,7 @@ touchstone: '' - '{job_prefix}babeltrace_{version}_{buildtype}': buildtype: elbuild - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std, prod] filter: '' @@ -617,6 +620,7 @@ confs: !!python/tuple [std, prod] filter: '' touchstone: '' + git_tool: jgit - '{job_prefix}babeltrace_{version}_{buildtype}': buildtype: freebsdbuild platforms: !!python/tuple [freebsd-amd64] @@ -636,7 +640,7 @@ platforms: !!python/tuple [deb12-amd64] builds: !!python/tuple [std] confs: !!python/tuple [std, static, prod] - ccs: !!python/tuple [clang-13, clang-14, clang-15] + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] filter: '' touchstone: '' - 'babeltrace_{version}_release': @@ -653,9 +657,9 @@ job_prefix: '' github_user: efficios github_name: babeltrace + git_tool: Default version: - stable-2.0 - - ctf2 - master jobs: ## Master ## @@ -686,6 +690,7 @@ filter: '' touchstone: '' warnings_status: FAILED + git_tool: jgit - 'dev_review_babeltrace_{version}_{buildtype}': buildtype: slesbuild platforms: !!python/tuple [sles12sp5-amd64, sles15sp4-amd64, sles15sp5-amd64] @@ -704,44 +709,6 @@ touchstone: '' warnings_status: FAILED - ## ctf2 temp branch ## - - 'dev_review_babeltrace_{version}_{buildtype}': - version: ctf2 - buildtype: linuxbuild - platforms: !!python/tuple [deb12-amd64] - builds: !!python/tuple [std, oot, dist, oot-dist] - confs: !!python/tuple [std, static, prod, min] - filter: '' - touchstone: '' - warnings_status: FAILED - - 'dev_review_babeltrace_{version}_{buildtype}': - version: ctf2 - buildtype: portbuild - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] - builds: !!python/tuple [std] - confs: !!python/tuple [std] - filter: '' - touchstone: '' - warnings_status: FAILED - - 'dev_review_babeltrace_{version}_{buildtype}': - version: ctf2 - buildtype: macosbuild - platforms: !!python/tuple [macos-arm64] - builds: !!python/tuple [std] - confs: !!python/tuple [std, prod] - filter: '' - touchstone: '' - warnings_status: FAILED - - 'dev_review_babeltrace_{version}_{buildtype}': - version: ctf2 - buildtype: winbuild - platforms: !!python/tuple [cygwin64, msys2-ucrt64] - builds: !!python/tuple [std] - confs: !!python/tuple [std] - filter: '' - touchstone: '' - warnings_status: FAILED - ## Stable 2.0 ## - 'dev_review_babeltrace_{version}_{buildtype}': version: stable-2.0 @@ -755,7 +722,7 @@ - 'dev_review_babeltrace_{version}_{buildtype}': version: stable-2.0 buildtype: portbuild - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std] filter: '' @@ -770,6 +737,7 @@ filter: '' touchstone: '' warnings_status: WARNING + git_tool: jgit - 'dev_review_babeltrace_{version}_{buildtype}': version: stable-2.0 buildtype: winbuild @@ -796,6 +764,7 @@ job_prefix: dev_upstream_ github_user: efficios github_name: babeltrace + git_tool: Default email_to: 'ci-notification@lists.lttng.org, cc:jgalar@efficios.com' version: - stable-1.5 @@ -823,7 +792,7 @@ touchstone: '' - '{job_prefix}babeltrace_{version}_{buildtype}': buildtype: elbuild - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64] + platforms: !!python/tuple [el8-amd64, el9-amd64] builds: !!python/tuple [std] confs: !!python/tuple [std] filter: '' @@ -837,6 +806,7 @@ job_prefix: 'dev_jgalar_' github_user: jgalar github_name: babeltrace + git_tool: Default email_to: "jgalar@efficios.com" version: - stable-1.5-staging @@ -855,6 +825,7 @@ confs: !!python/tuple [std] filter: '' touchstone: '' + git_tool: jgit - project: @@ -862,6 +833,7 @@ job_prefix: 'dev_jgalar_' github_user: jgalar github_name: babeltrace + git_tool: Default email_to: "jgalar@efficios.com" version: - stable-2.0-staging @@ -884,6 +856,7 @@ confs: !!python/tuple [std, prod] filter: '' touchstone: '' + git_tool: jgit - project: diff --git a/jobs/images.yml b/jobs/images.yml index 9d2f4b0..cdfcd35 100644 --- a/jobs/images.yml +++ b/jobs/images.yml @@ -32,7 +32,7 @@ - choice: &images_parameters_IMAGE_TYPE name: 'IMAGE_TYPE' choices: - - 'lxd' + - 'incus' - 'vm' description: 'The type of image to create' - choice: @@ -42,15 +42,15 @@ - 'developer' description: 'The ansible group to apply to the image' required: true - - string: &images_parameters_LXD_HOST - name: 'LXD_HOST' + - string: &images_parameters_INCUS_HOST + name: 'INCUS_HOST' default: 'ci-host-amd64-1a.internal.efficios.com' - description: 'The address of the LXD cluster to publish to' + description: 'The address of the incus cluster to publish to' required: true - - string: &images_parameters_LXD_INSTANCE_PROFILE - name: 'LXD_INSTANCE_PROFILE' + - string: &images_parameters_INCUS_INSTANCE_PROFILE + name: 'INCUS_INSTANCE_PROFILE' default: 'ci-rootnode' - description: 'The LXD instance profile to use for temporary instances when building images' + description: 'The Incus instance profile to use for temporary instances when building images' required: true - string: &images_parameters_GIT_URL name: 'GIT_URL' @@ -81,9 +81,9 @@ - choice: <<: *images_parameters_IMAGE_TYPE - string: - <<: *images_parameters_LXD_HOST + <<: *images_parameters_INCUS_HOST - string: - <<: *images_parameters_LXD_INSTANCE_PROFILE + <<: *images_parameters_INCUS_INSTANCE_PROFILE - string: <<: *images_parameters_GIT_URL - string: @@ -97,10 +97,10 @@ name: 'DISTROBUILDER_GIT_BRANCH' default: 'main' - string: - name: 'LXC_CI_GIT_URL' + name: 'INCUS_CI_GIT_URL' default: 'https://github.com/lxc/lxc-ci.git' - string: - name: 'LXC_CI_GIT_BRANCH' + name: 'INCUS_CI_GIT_BRANCH' default: 'main' - string: name: 'GO_VERSION' @@ -137,10 +137,10 @@ passphrase-variable: SSH_PASSWORD - file: credential-id: 'f3f08275-59ef-42ff-9de5-9beafc7435b8' - variable: LXD_CLIENT_CERT + variable: INCUS_CLIENT_CERT - file: credential-id: '0debf23b-191b-4cdf-8a25-04e9a7092a67' - variable: LXD_CLIENT_KEY + variable: INCUS_CLIENT_KEY - text: credential-id: SLES_REGISTRATION_CODE_amd64 variable: SLES_REGISTRATION_CODE_amd64 @@ -161,11 +161,12 @@ project-type: pipeline parameters: '{obj:parameters}' IMAGE_TYPES: - - lxd + - incus - vm PROFILES: - ci-node - developer + sandbox: true dsl: !include-jinja2: pipelines/images/default.groovy - job-template: @@ -231,7 +232,7 @@ name: 'IMAGE_TYPE_FILTER' choices: - all - - lxd + - incus - vm - choice: &images_parameters_PROFILE_FILTER name: 'PROFILE_FILTER' @@ -295,12 +296,12 @@ ARCHES: - amd64 RELEASES: - # 12.5 Doesn't currently work well with LXD either as a container or a VM + # 12.5 Doesn't currently work well with Incus either as a container or a VM # * 12.5 has systemd 228, which doesn't support cgroups v2. Hosts _could_ # be configured to disable the unified cgroup hierarchy in order to have # this version systemd work correctly. # * Running as a QEMU VM, virtio_scsi isn't correctly able to bring the - # virtual disks online. The version of lxd currently deployed doesn't + # virtual disks online. The version of incus currently deployed doesn't # support the io.bus option to use virtio-blk instead. # - '12.5' - '15.4' diff --git a/jobs/librseq.yaml b/jobs/librseq.yaml index ff7f4c2..96cfd77 100644 --- a/jobs/librseq.yaml +++ b/jobs/librseq.yaml @@ -329,11 +329,11 @@ platforms: !!python/tuple [deb12-amd64] builds: !!python/tuple [std] confs: !!python/tuple [std, static] - ccs: !!python/tuple [clang-13, clang-14, clang-15] + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] touchstone: '' - 'librseq_{version}_{buildtype}': buildtype: portbuild - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, static] touchstone: '' @@ -353,7 +353,7 @@ touchstone: '' - 'dev_review_librseq_{version}_{buildtype}': buildtype: portbuild - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std] touchstone: '' diff --git a/jobs/liburcu.yaml b/jobs/liburcu.yaml index ee7a427..412aae4 100644 --- a/jobs/liburcu.yaml +++ b/jobs/liburcu.yaml @@ -30,9 +30,10 @@ - ansicolor: &liburcu_wrapper_ansicolor_defaults colormap: xterm - timeout: &liburcu_wrapper_timeout_defaults - timeout: 90 - fail: true - type: absolute + timeout: 30 + abort: true + type: no-activity + write-description: "

This build failed due to timeout.

" - timestamps - workspace-cleanup @@ -201,6 +202,31 @@ <<: *liburcu_builders_defaults <<: *liburcu_publishers_defaults +- job-template: + name: '{job_prefix}liburcu_{version}_{cctype}' + defaults: liburcu + + <<: *liburcu_matrix_axes_defaults + axes: + - axis: + type: slave + name: platform + values: '{obj:platforms}' + - axis: + type: user-defined + name: conf + values: '{obj:confs}' + - axis: + type: user-defined + name: build + values: '{obj:builds}' + - axis: + type: user-defined + name: cc + values: '{obj:ccs}' + <<: *liburcu_builders_defaults + <<: *liburcu_publishers_defaults + - job-template: name: dev_review_liburcu_{version}_{buildtype} defaults: liburcu @@ -343,7 +369,7 @@ # Common - '{job_prefix}liburcu_{version}_{buildtype}': buildtype: portbuild - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, static, tls_fallback, debug-rcu] touchstone: '(build == "std") && (conf == "std") && (platform == "deb12-i386")' @@ -355,7 +381,7 @@ touchstone: '(build == "std")' - '{job_prefix}liburcu_{version}_{buildtype}': buildtype: elbuild - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std] touchstone: '(build == "std")' @@ -383,6 +409,14 @@ builds: !!python/tuple [std] confs: !!python/tuple [std] touchstone: '(build == "std")' + - '{job_prefix}liburcu_{version}_{cctype}': + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [std, static, atomic-builtins, tls_fallback, debug-rcu] + touchstone: '(build == "std") && (conf == "std")' - 'liburcu_{version}_scan-build' - 'liburcu_{version}_coverity': version: master @@ -420,7 +454,7 @@ touchstone: '(build == "std")' - '{job_prefix}liburcu_{version}_{buildtype}': buildtype: elbuild - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64] + platforms: !!python/tuple [el8-amd64, el9-amd64] builds: !!python/tuple [std] confs: !!python/tuple [std] touchstone: '(build == "std")' diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index 8857515..0e40b90 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -108,11 +108,11 @@ node: 'master' # Applies only to matrix flyweight task execution-strategy: *lttng-tools_matrix_execution-strategy_defaults axes: - - axis: + - axis: <tng-tools_matrix_axis_root_node type: slave name: node values: '{obj:nodes}' - - axis: + - axis: <tng-tools_matrix_axis_root_platform <<: *lttng-tools_matrix_axis_platform type: user-defined - axis: *lttng-tools_matrix_axis_conf @@ -174,7 +174,11 @@ # Always copy liburcu artifacts - copyartifact: <<: *lttng-tools_steps_copyartifact_defaults - project: '{urcu_job_prefix}liburcu_${{liburcu_version}}_{buildtype}/platform=${{platform}},conf=${{liburcu_conf}},build=std' + project: + !j2: | + {{urcu_job_prefix}}liburcu_{%- raw -%}${liburcu_version}{%- endraw -%} + _{{cctype|default(buildtype)}}/platform={%- raw %}${platform}{%- endraw -%} + ,conf={%- raw -%}${liburcu_conf}{%- endraw -%},build=std,{%- if ccs|default(false) -%}cc={%- raw -%}${cc}{%- endraw -%},{%- endif -%} # Always copy babeltrace artifacts - copyartifact: @@ -191,7 +195,11 @@ steps: - copyartifact: <<: *lttng-tools_steps_copyartifact_defaults - project: '{ust_job_prefix}lttng-ust_{ustversion}_{buildtype}/liburcu_version=${{liburcu_version}},platform=${{platform}},conf=${{ust_conf}},build=std' + project: + !j2: | + {{ust_job_prefix}}lttng-ust_{{ustversion}}_{{cctype|default(buildtype)}}/liburcu_version={%- raw -%}${liburcu_version}{%- endraw -%} + ,platform={%- raw %}${platform}{%- endraw -%},conf={%- raw -%}${ust_conf}{%- endraw -%} + ,build=std,{% if ccs|default(false) %}cc={%- raw -%}${cc}{%- endraw -%}{% endif %} # rootbuild requires a checkout of modules - conditional-step: @@ -236,11 +244,17 @@ - inject: properties-file: gerrit_custom_dependencies.properties - # rootbuild requires a checkout of modules + # rootbuild requires a checkout of modules, but only + # when we don't depend on a specific lttng-modules change - conditional-step: - condition-kind: regex-match - label: '$JOB_NAME' - regex: '.*_root(?:_[a-z]+)?build.*' + condition-kind: and + on-evaluation-failure: run + condition-operands: + - condition-kind: shell + condition-command: 'test "$GERRIT_DEP_LTTNG_MODULES" = ""' + - condition-kind: regex-match + label: '$JOB_NAME' + regex: '.*_root(?:_[a-z]+)?build.*' steps: - shell: | #!/bin/bash @@ -554,6 +568,36 @@ jobs: '{ust_job_prefix}lttng-ust_{version}_{buildtype}' result: 'success' +- job-template: + name: '{job_prefix}lttng-tools_{version}_{cctype}' + defaults: lttng-tools + + <<: *lttng-tools_matrix_axes_defaults + axes: + - axis: + <<: *lttng-tools_matrix_axis_platform + - axis: + <<: *lttng-tools_matrix_axis_conf + - axis: + <<: *lttng-tools_matrix_axis_build + - axis: + <<: *lttng-tools_matrix_axis_liburcu_version + - axis: + <<: *lttng-tools_matrix_axis_babeltrace_version + - axis: + type: user-defined + name: cc + values: '{obj:ccs}' + + <<: *lttng-tools_builders_defaults + <<: *lttng-tools_publishers_defaults + + triggers: + - pollscm: *lttng-tools_trigger_pollscm_default + - reverse: + jobs: '{ust_job_prefix}lttng-ust_{version}_{cctype}' + result: 'success' + - job-template: name: 'dev_{user}_lttng-tools_{version}_{buildtype}' defaults: lttng-tools @@ -631,6 +675,47 @@ jobs: '{ust_job_prefix}lttng-ust_{version}_{buildtype}' result: 'success' +- job-template: + name: '{job_prefix}lttng-tools_{version}_root_{cctype}' + defaults: lttng-tools + + scm: + - git: *lttng-tools_scm_git_default + + wrappers: + - ansicolor: *lttng-tools_wrapper_ansicolor_defaults + - timeout: + <<: *lttng-tools_wrapper_timeout_defaults + timeout: 10 + - timestamps + + <<: *lttng-tools_matrix_axes_rootbuild + axes: + - axis: + <<: *lttng-tools_matrix_axis_root_node + - axis: + <<: *lttng-tools_matrix_axis_root_platform + - axis: + <<: *lttng-tools_matrix_axis_conf + - axis: + <<: *lttng-tools_matrix_axis_build + - axis: + <<: *lttng-tools_matrix_axis_liburcu_version + - axis: + <<: *lttng-tools_matrix_axis_babeltrace_version + - axis: + type: user-defined + name: cc + values: '{obj:ccs}' + <<: *lttng-tools_builders_defaults + <<: *lttng-tools_publishers_rootbuild + + triggers: + - pollscm: *lttng-tools_trigger_pollscm_default + - reverse: + jobs: '{ust_job_prefix}lttng-ust_{version}_{cctype}' + result: 'success' + - job-template: name: '{job_prefix}lttng-tools_{version}_macosbuild' defaults: lttng-tools @@ -667,7 +752,7 @@ basedir: src/lttng-tools skip-tag: true - triggers: + triggers: <tng-tools_triggers_review_default - gerrit: <tng-tools_trigger_gerrit_default trigger-on: - comment-added-event: @@ -680,7 +765,7 @@ - branch-compare-type: 'PLAIN' branch-pattern: '{version}' - properties: + properties: <tng-tools_properties_review_defaults - inject: *lttng-tools_property_inject_defaults - build-discarder: days-to-keep: 1 @@ -692,7 +777,7 @@ <<: *lttng-tools_matrix_axes_defaults <<: *lttng-tools_builders_review - publishers: + publishers: <tng-tools_publishers_review_defaults # On build abort (timeout), wait 10 seconds before running the other post # build scripts, this will allow the processes to terminate and make the # build log more legible. @@ -713,6 +798,35 @@ - workspace-cleanup: *lttng-tools_publisher_workspace-cleanup_defaults - raw: *lttng-tools_publisher_proc-cleaner_defaults +- job-template: + name: 'dev_review_lttng-tools_{version}_{cctype}' + defaults: lttng-tools + concurrent: true + <<: *lttng-tools_matrix_axes_defaults + axes: + - axis: + <<: *lttng-tools_matrix_axis_platform + - axis: + <<: *lttng-tools_matrix_axis_conf + - axis: + <<: *lttng-tools_matrix_axis_build + - axis: + <<: *lttng-tools_matrix_axis_liburcu_version + - axis: + <<: *lttng-tools_matrix_axis_babeltrace_version + - axis: + type: user-defined + name: cc + values: '{obj:ccs}' + + <<: *lttng-tools_builders_review + <<: *lttng-tools_publishers_defaults + properties: *lttng-tools_properties_review_defaults + publishers: *lttng-tools_publishers_review_defaults + scm: + - git: *lttng-tools_scm_git_review + triggers: *lttng-tools_triggers_review_default + - job-template: name: dev_review_lttng-tools_{version}_smokebuild defaults: lttng-tools @@ -881,6 +995,37 @@ - archive: *lttng-tools_publisher_archive_defaults - workspace-cleanup: *lttng-tools_publisher_workspace-cleanup_defaults +- job-template: + name: 'dev_review_lttng-tools_{version}_root_{cctype}' + defaults: lttng-tools + concurrent: true + <<: *lttng-tools_matrix_axes_rootbuild + axes: + - axis: + <<: *lttng-tools_matrix_axis_root_node + - axis: + <<: *lttng-tools_matrix_axis_root_platform + - axis: + <<: *lttng-tools_matrix_axis_conf + - axis: + <<: *lttng-tools_matrix_axis_build + - axis: + <<: *lttng-tools_matrix_axis_liburcu_version + - axis: + <<: *lttng-tools_matrix_axis_babeltrace_version + - axis: + type: user-defined + name: cc + values: '{obj:ccs}' + + <<: *lttng-tools_builders_review + <<: *lttng-tools_publishers_defaults + properties: *lttng-tools_properties_review_defaults + publishers: *lttng-tools_publishers_review_defaults + scm: + - git: *lttng-tools_scm_git_review + triggers: *lttng-tools_triggers_review_default + - job-template: name: 'dev_review_lttng-tools_{version}_check-format' defaults: lttng-tools @@ -1074,7 +1219,7 @@ buildtype: portbuild version: master ustversion: master - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, no-ust, agents] urcuversions: !!python/tuple [master] @@ -1096,7 +1241,7 @@ buildtype: elbuild version: master ustversion: master - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std] urcuversions: !!python/tuple [master] @@ -1135,6 +1280,19 @@ babelversions: !!python/tuple [stable-2.0] filter: '' touchstone: '' + - '{job_prefix}lttng-tools_{version}_{cctype}': + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + version: master + ustversion: master + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [std] + urcuversions: !!python/tuple [master] + babelversions: !!python/tuple [stable-2.0] + filter: '' + touchstone: '' - '{job_prefix}lttng-tools_{version}_long_regression': buildtype: linuxbuild version: master @@ -1194,6 +1352,20 @@ babelversions: !!python/tuple [stable-2.0] filter: '(node=="el8-amd64-rootnode" && platform=="el8-amd64")' touchstone: '' + - '{job_prefix}lttng-tools_{version}_root_{cctype}': + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + version: master + ustversion: master + platforms: !!python/tuple [deb12-amd64] + nodes: !!python/tuple [deb12-amd64-rootnode] + builds: !!python/tuple [std] + confs: !!python/tuple [agents] + urcuversions: !!python/tuple [master] + babelversions: !!python/tuple [stable-2.0] + filter: '(node=="deb12-amd64-rootnode" && platform=="deb12-amd64")' + touchstone: '' - 'lttng-tools_{version}_scan-build': version: master urcuversion: master @@ -1221,7 +1393,7 @@ buildtype: portbuild version: stable-2.13 ustversion: stable-2.13 - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, no-ust, agents] urcuversions: !!python/tuple [stable-0.13] @@ -1243,7 +1415,7 @@ buildtype: elbuild version: stable-2.13 ustversion: stable-2.13 - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std] urcuversions: !!python/tuple [stable-0.13] @@ -1282,6 +1454,19 @@ babelversions: !!python/tuple [stable-2.0] filter: '' touchstone: '' + - '{job_prefix}lttng-tools_{version}_{cctype}': + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + version: stable-2.13 + ustversion: stable-2.13 + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [std] + urcuversions: !!python/tuple [stable-0.13] + babelversions: !!python/tuple [stable-2.0] + filter: '' + touchstone: '' - '{job_prefix}lttng-tools_{version}_long_regression': buildtype: linuxbuild version: stable-2.13 @@ -1341,6 +1526,20 @@ babelversions: !!python/tuple [stable-2.0] filter: '(node=="el8-amd64-rootnode" && platform=="el8-amd64")' touchstone: '' + - '{job_prefix}lttng-tools_{version}_root_{cctype}': + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + version: stable-2.13 + ustversion: stable-2.13 + platforms: !!python/tuple [deb12-amd64] + nodes: !!python/tuple [deb12-amd64-rootnode] + builds: !!python/tuple [std] + confs: !!python/tuple [agents] + urcuversions: !!python/tuple [master] + babelversions: !!python/tuple [stable-2.0] + filter: '(node=="deb12-amd64-rootnode" && platform=="deb12-amd64")' + touchstone: '' - 'lttng-tools_{version}_release': version: v2.13 ustversion: stable-2.13 @@ -1368,7 +1567,7 @@ buildtype: portbuild version: stable-2.12 ustversion: stable-2.12 - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, no-ust, agents] urcuversions: !!python/tuple [stable-0.13] @@ -1390,7 +1589,7 @@ buildtype: elbuild version: stable-2.12 ustversion: stable-2.12 - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std] urcuversions: !!python/tuple [stable-0.13] @@ -1513,7 +1712,7 @@ buildtype: portbuild version: master-staging ustversion: master - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, no-ust, agents] urcuversions: !!python/tuple [master] @@ -1548,7 +1747,7 @@ buildtype: portbuild version: stable-2.13-staging ustversion: stable-2.13 - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, no-ust, agents] urcuversions: !!python/tuple [stable-0.13] @@ -1572,7 +1771,7 @@ buildtype: portbuild version: stable-2.12-staging ustversion: stable-2.12 - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, no-ust, agents] urcuversions: !!python/tuple [stable-0.13] @@ -1599,6 +1798,18 @@ babelversions: !!python/tuple [stable-2.0] filter: '' touchstone: '' + - 'dev_review_lttng-tools_{version}_{cctype}': + version: master + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [std] + urcuversions: !!python/tuple [stable-0.14] + babelversions: !!python/tuple [stable-2.0] + filter: '' + touchstone: '' - 'dev_review_lttng-tools_{version}_{buildtype}': version: master buildtype: slesbuild @@ -1621,6 +1832,19 @@ babelversions: !!python/tuple [stable-2.0] filter: '(node=="deb12-amd64-rootnode" && platform=="deb12-amd64")' touchstone: '' + - 'dev_review_lttng-tools_{version}_root_{cctype}': + version: master + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + nodes: !!python/tuple [deb12-amd64-rootnode] + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [agents] + urcuversions: !!python/tuple [stable-0.14] + babelversions: !!python/tuple [stable-2.0] + filter: '(node=="deb12-amd64-rootnode" && platform=="deb12-amd64")' + touchstone: '' - 'dev_review_lttng-tools_{version}_root_{buildtype}': version: master buildtype: slesbuild diff --git a/jobs/lttng-ust.yaml b/jobs/lttng-ust.yaml index ee35d1d..9ecb82e 100644 --- a/jobs/lttng-ust.yaml +++ b/jobs/lttng-ust.yaml @@ -121,7 +121,12 @@ - copyartifact: <<: *lttng-ust_steps_copyartifact_defaults - project: '{job_prefix}liburcu_${{liburcu_version}}_{buildtype}/platform=${{platform}},conf=${{liburcu_conf}},build=std' + project: + !j2: | + {{job_prefix}}liburcu_{%- raw -%}${liburcu_version}{%- endraw -%} + _{{cctype|default(buildtype)}}/platform={%- raw %}${platform}{%- endraw -%} + ,build=std,conf={%- raw -%}${liburcu_conf}{%- endraw -%} + {%- if ccs|default(false) %},cc={%- raw -%}${cc}{%- endraw -%}{% endif -%} # Run the build - shell: @@ -164,7 +169,12 @@ - copyartifact: <<: *lttng-ust_steps_copyartifact_defaults - project: 'liburcu_${{liburcu_version}}_{buildtype}/platform=${{platform}},conf=${{liburcu_conf}},build=std' + project: + !j2: | + liburcu_{%- raw -%}${liburcu_version}{%- endraw -%} + _{{cctype|default(buildtype)}}/platform={%- raw %}${platform}{%- endraw -%} + ,build=std,conf={%- raw -%}${liburcu_conf}{%- endraw -%} + {%- if ccs|default(false) %},cc={%- raw -%}${cc}{%- endraw -%}{% endif -%} - copyartifact: <<: *lttng-ust_steps_copyartifact_defaults @@ -330,13 +340,33 @@ <<: *lttng-ust_builders_defaults <<: *lttng-ust_publishers_defaults +- job-template: + name: '{job_prefix}lttng-ust_{version}_{cctype}' + defaults: lttng-ust + <<: *lttng-ust_matrix_axes_defaults + axes: + - axis: + <<: *lttng-ust_matrix_axis_platform + - axis: + <<: *lttng-ust_matrix_axis_conf + - axis: + <<: *lttng-ust_matrix_axis_build + - axis: + <<: *lttng-ust_matrix_axis_liburcu_version + - axis: + type: user-defined + name: cc + values: '{obj:ccs}' + + <<: *lttng-ust_builders_defaults + <<: *lttng-ust_publishers_defaults - job-template: name: dev_review_lttng-ust_{version}_{buildtype} defaults: lttng-ust concurrent: true - scm: + scm: <tng-ust_dev_review_scm - git: url: https://review.lttng.org/lttng-ust refspec: 'refs/changes/*:refs/changes/*' @@ -345,7 +375,7 @@ basedir: src/lttng-ust skip-tag: true - triggers: + triggers: <tng-ust_dev_review_triggers - gerrit: <tng-ust_trigger_gerrit_defaults trigger-on: - comment-added-event: @@ -362,7 +392,7 @@ <<: *lttng-ust_builders_defaults <<: *lttng-ust_publishers_review - properties: + properties: <tng-ust_dev_review_properties - inject: properties-content: | PROJECT_NAME=lttng-ust @@ -373,6 +403,29 @@ categories: - 'gerrit-{buildtype}' +- job-template: + name: 'dev_review_lttng-ust_{version}_{cctype}' + defaults: lttng-ust + concurrent: true + scm: *lttng-ust_dev_review_scm + triggers: *lttng-ust_dev_review_triggers + properties: *lttng-ust_dev_review_properties + <<: *lttng-ust_matrix_axes_defaults + axes: + - axis: + <<: *lttng-ust_matrix_axis_platform + - axis: + <<: *lttng-ust_matrix_axis_conf + - axis: + <<: *lttng-ust_matrix_axis_build + - axis: + <<: *lttng-ust_matrix_axis_liburcu_version + - axis: + type: user-defined + name: cc + values: '{obj:ccs}' + <<: *lttng-ust_builders_defaults + <<: *lttng-ust_publishers_review - job-template: name: dev_review_lttng-ust_lttng-tools_{version}_{buildtype} @@ -555,7 +608,7 @@ - '{job_prefix}lttng-ust_{version}_{buildtype}': buildtype: portbuild version: master - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, agents] liburcu_versions: !!python/tuple [stable-0.13, master] @@ -573,7 +626,7 @@ - '{job_prefix}lttng-ust_{version}_{buildtype}': buildtype: elbuild version: master - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std] liburcu_versions: !!python/tuple [stable-0.13, master] @@ -597,6 +650,17 @@ liburcu_versions: !!python/tuple [stable-0.13, master] filter: '' touchstone: '' + - '{job_prefix}lttng-ust_{version}_{cctype}': + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + version: master + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [std, agents] + liburcu_versions: !!python/tuple [stable-0.13, stable-0.14, master] + filter: '' + touchstone: '' - 'lttng-ust_{version}_scan-build': version: master - 'lttng-ust_{version}_coverity': @@ -615,7 +679,7 @@ - '{job_prefix}lttng-ust_{version}_{buildtype}': buildtype: portbuild version: stable-2.13 - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, agents] liburcu_versions: !!python/tuple [stable-0.13, master] @@ -633,7 +697,7 @@ - '{job_prefix}lttng-ust_{version}_{buildtype}': buildtype: elbuild version: stable-2.13 - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std] liburcu_versions: !!python/tuple [stable-0.13, master] @@ -648,6 +712,17 @@ liburcu_versions: !!python/tuple [stable-0.13, master] filter: '' touchstone: '' + - '{job_prefix}lttng-ust_{version}_{cctype}': + buildtype: linuxbuild + cctype: clangbuild + ccs: !!python/tuple [clang-13, clang-14, clang-15, clang-16] + version: stable-2.13 + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std] + confs: !!python/tuple [agents] + liburcu_versions: !!python/tuple [stable-0.13, stable-0.14, master] + filter: '' + touchstone: '' - 'lttng-ust_{version}_scan-build': version: stable-2.13 @@ -664,7 +739,7 @@ - '{job_prefix}lttng-ust_{version}_{buildtype}': buildtype: portbuild version: stable-2.12 - platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb12-i386] + platforms: !!python/tuple [deb12-armhf, deb12-arm64, deb12-ppc64el, deb13-riscv64, deb12-i386] builds: !!python/tuple [std] confs: !!python/tuple [std, agents] liburcu_versions: !!python/tuple [stable-0.13, master] @@ -682,7 +757,7 @@ - '{job_prefix}lttng-ust_{version}_{buildtype}': buildtype: elbuild version: stable-2.12 - platforms: !!python/tuple [el7-amd64, el8-amd64, el9-amd64, el7-arm64, el8-arm64, el9-arm64] + platforms: !!python/tuple [el8-amd64, el9-amd64, el8-arm64, el9-arm64] builds: !!python/tuple [std] confs: !!python/tuple [std] liburcu_versions: !!python/tuple [stable-0.13] @@ -754,6 +829,18 @@ liburcu_versions: !!python/tuple [stable-0.14] filter: '' touchstone: '' + - 'dev_review_lttng-ust_{version}_{cctype}': + cctype: clangbuild + ccs: ['clang-13', 'clang-14', 'clang-15', 'clang-16'] + version: master + buildtype: linuxbuild + platforms: !!python/tuple [deb12-amd64] + builds: !!python/tuple [std, oot, dist, oot-dist] + confs: !!python/tuple [std, agents] + filter: '' + touchstone: '' + liburcu_versions: !!python/tuple [stable-0.14] + babeltrace_version: stable-2.0 ## Stable 2.13 ## - 'dev_review_lttng-ust_{version}_{buildtype}': diff --git a/pipelines/images/distrobuild.sh b/pipelines/images/distrobuild.sh index fea1d13..a4e9538 100644 --- a/pipelines/images/distrobuild.sh +++ b/pipelines/images/distrobuild.sh @@ -31,13 +31,13 @@ REQUIRED_VARIABLES=( VARIANT GIT_BRANCH GIT_URL - LXD_CLIENT_CERT - LXD_CLIENT_KEY + INCUS_CLIENT_CERT + INCUS_CLIENT_KEY TEST DISTROBUILDER_GIT_URL DISTROBUILDER_GIT_BRANCH - LXC_CI_GIT_URL - LXC_CI_GIT_BRANCH + INCUS_CI_GIT_URL + INCUS_CI_GIT_BRANCH GO_VERSION ) MISSING_VARS=0 @@ -55,26 +55,26 @@ fi INSTANCE_START_TIMEOUT="${INSTANCE_START_TIMEOUT:-120}" VM_ARG=() -# Install lxd-client +# Install incus-client apt-get update -apt-get install -y lxd-client -mkdir -p ~/.config/lxc -cp "${LXD_CLIENT_CERT}" ~/.config/lxc/client.crt -cp "${LXD_CLIENT_KEY}" ~/.config/lxc/client.key +apt-get install -y incus-client +mkdir -p ~/.config/incus +cp "${INCUS_CLIENT_CERT}" ~/.config/incus/client.crt +cp "${INCUS_CLIENT_KEY}" ~/.config/incus/client.key CLEANUP+=( - "rm -f ${HOME}/.config/lxc/client.crt" - "rm -f ${HOME}/.config/lxc/client.key" + "rm -f ${HOME}/.config/incus/client.crt" + "rm -f ${HOME}/.config/incus/client.key" ) -lxc remote add ci --accept-certificate --auth-type tls "${LXD_HOST}" -lxc remote switch ci +incus remote add ci --accept-certificate --auth-type tls "${INCUS_HOST}" +incus remote switch ci -# Exit gracefully if the lxc images: provides the base image +# Exit gracefully if the incus images: provides the base image IMAGE_NAME="${OS}/${RELEASE}/${VARIANT}/${ARCH}" TYPE_FILTER='type=container' if [[ "${IMAGE_TYPE}" == "vm" ]] ; then TYPE_FILTER='type=virtual-machine' fi -if [[ "$(lxc image list -f csv images:"${IMAGE_NAME}" -- "${TYPE_FILTER}" | wc -l)" != "0" ]] ; then +if [[ "$(incus image list -f csv images:"${IMAGE_NAME}" -- "${TYPE_FILTER}" | wc -l)" != "0" ]] ; then echo "Image '${IMAGE_NAME}' provided by 'images:' remote" exit 0 fi @@ -97,13 +97,13 @@ PATH="${PATH}:${HOME}/go/bin" cd "${WORKSPACE}" git clone --branch="${GIT_BRANCH}" "${GIT_URL}" ci -# Get the LXC CI repo +# Get the INCUS CI repo cd "${WORKSPACE}" -git clone --branch="${LXC_CI_GIT_BRANCH}" "${LXC_CI_GIT_URL}" lxc-ci +git clone --branch="${INCUS_CI_GIT_BRANCH}" "${INCUS_CI_GIT_URL}" incus-ci IMAGE_DIRS=( "${WORKSPACE}/ci/automation/images" - "${WORKSPACE}/lxc-ci/images" + "${WORKSPACE}/incus-ci/images" ) EXTENSIONS=( 'yml' @@ -179,7 +179,7 @@ if [[ "${IMAGE_TYPE}" == "vm" ]] ; then ROOTFS="${BUILD_DIR}/disk.qcow2" fi -# Work-around for lxd not using qemu-system-i386: set the architecture to x86_64 +# Work-around for incus not using qemu-system-i386: set the architecture to x86_64 # which will use qemu-system-x86_64 and still run 32bit userspace/kernels fine. if [[ "${ARCH}" == "i386" ]] ; then TMP_DIR=$(mktemp -d) @@ -191,12 +191,12 @@ if [[ "${ARCH}" == "i386" ]] ; then rm -rf "${TMP_DIR}" fi -# When using `lxc image import` two images cannot have the same alias - +# When using `incus image import` two images cannot have the same alias - # only the last image imported will keep the alias. Therefore, the # image type is appended as part of the alias. IMAGE_NAME="${IMAGE_NAME}/${IMAGE_TYPE}" -if FINGERPRINT=$(lxc image import "${BUILD_DIR}/incus.tar.xz" "${ROOTFS}" 2>&1 | grep -E -o '[A-Fa-f0-9]{64}') ; then +if FINGERPRINT=$(incus image import "${BUILD_DIR}/incus.tar.xz" "${ROOTFS}" 2>&1 | grep -E -o '[A-Fa-f0-9]{64}') ; then echo "Image imported with fingerprint '${FINGERPRINT}'" else fail 1 "No fingerprint for imported image" @@ -205,10 +205,10 @@ fi if [[ "${TEST}" == "true" ]] ; then set +e INSTANCE_NAME='' - if INSTANCE_NAME="$(lxc -q launch -e ${VM_ARG[@]} -p default -p "${LXD_INSTANCE_PROFILE}" "${FINGERPRINT}")" ; then + if INSTANCE_NAME="$(incus -q launch -e ${VM_ARG[@]} -p default -p "${INCUS_INSTANCE_PROFILE}" "${FINGERPRINT}")" ; then INSTANCE_NAME="$(echo "${INSTANCE_NAME}" | cut -d':' -f2 | tr -d ' ')" CLEANUP+=( - "lxc stop -f ${INSTANCE_NAME}" + "incus stop -f ${INSTANCE_NAME}" ) else fail 1 "Failed to launch instance using image '${FINGERPRINT}'" @@ -216,18 +216,18 @@ if [[ "${TEST}" == "true" ]] ; then TIME_REMAINING="${INSTANCE_START_TIMEOUT}" INSTANCE_STATUS='' while true ; do - INSTANCE_STATUS="$(lxc exec "${INSTANCE_NAME}" hostname)" + INSTANCE_STATUS="$(incus exec "${INSTANCE_NAME}" hostname)" if [[ "${INSTANCE_STATUS}" == "${INSTANCE_NAME}" ]] ; then break fi sleep 1 TIME_REMAINING=$((TIME_REMAINING - 1)) if [ "${TIME_REMAINING}" -lt "0" ] ; then - fail 1 "Timed out waiting for instance to become available via 'lxc exec'" + fail 1 "Timed out waiting for instance to become available via 'incus exec'" fi done set -e fi -lxc image alias delete "${IMAGE_NAME}" || true -lxc image alias create "${IMAGE_NAME}" "${FINGERPRINT}" +incus image alias delete "${IMAGE_NAME}" || true +incus image alias create "${IMAGE_NAME}" "${FINGERPRINT}" diff --git a/pipelines/images/imagebuild.sh b/pipelines/images/imagebuild.sh index befc9bf..c7233d7 100644 --- a/pipelines/images/imagebuild.sh +++ b/pipelines/images/imagebuild.sh @@ -32,8 +32,8 @@ REQUIRED_VARIABLES=( PROFILE # The ansible group to apply to the new image GIT_BRANCH # The git branch of the automation repo to checkout GIT_URL # The git URL of the automation repo to checkout - LXD_CLIENT_CERT # Path to LXD client certificate - LXD_CLIENT_KEY # Path to LXD client certificate key + INCUS_CLIENT_CERT # Path to INCUS client certificate + INCUS_CLIENT_KEY # Path to INCUS client certificate key SSH_PRIVATE_KEY # Path to SSH private key TEST # 'true' to test launching published image ) @@ -53,18 +53,18 @@ INSTANCE_START_TIMEOUT="${INSTANCE_START_TIMEOUT:-120}" NETWORK_SLEEP="${NETWORK_SLEEP:-15}" # Dependencies -apt-get -y install lxd-client ansible jq +apt-get -y install incus-client ansible jq # Configuration -mkdir -p ~/.config/lxc -cp "${LXD_CLIENT_CERT}" ~/.config/lxc/client.crt -cp "${LXD_CLIENT_KEY}" ~/.config/lxc/client.key +mkdir -p ~/.config/incus +cp "${INCUS_CLIENT_CERT}" ~/.config/incus/client.crt +cp "${INCUS_CLIENT_KEY}" ~/.config/incus/client.key CLEANUP+=( - "rm -f ${HOME}/.config/lxc/client.crt" - "rm -f ${HOME}/.config/lxc/client.key" + "rm -f ${HOME}/.config/incus/client.crt" + "rm -f ${HOME}/.config/incus/client.key" ) -lxc remote add ci --accept-certificate --auth-type tls "${LXD_HOST}" -lxc remote switch ci +incus remote add ci --accept-certificate --auth-type tls "${INCUS_HOST}" +incus remote switch ci # Clone lttng-ci git clone -b "${GIT_BRANCH}" "${GIT_URL}" ci @@ -91,9 +91,9 @@ set +e TRIES_MAX=3 TRIES=0 while [[ "${TRIES}" -lt "${TRIES_MAX}" ]] ; do - if ! INSTANCE_NAME=$(lxc -q launch "${VM_ARG[@]}" -p default -p "${LXD_INSTANCE_PROFILE}" "${SOURCE_IMAGE_NAME}/${IMAGE_TYPE}") ; then + if ! INSTANCE_NAME=$(incus -q launch "${VM_ARG[@]}" -p default -p "${INCUS_INSTANCE_PROFILE}" "${SOURCE_IMAGE_NAME}/${IMAGE_TYPE}") ; then # Try from images - if ! INSTANCE_NAME=$(lxc -q launch "${VM_ARG[@]}" -p default -p "${LXD_INSTANCE_PROFILE}" images:"${SOURCE_IMAGE_NAME}") ; then + if ! INSTANCE_NAME=$(incus -q launch "${VM_ARG[@]}" -p default -p "${INCUS_INSTANCE_PROFILE}" images:"${SOURCE_IMAGE_NAME}") ; then TRIES=$((TRIES + 1)) echo "Failed to deployed ephemereal instance attempt ${TRIES}/${TRIES_MAX}" if [[ "${TRIES}" -lt "${TRIES_MAX}" ]] ; then @@ -111,15 +111,15 @@ INSTANCE_NAME="$(echo "${INSTANCE_NAME}" | cut -d ':' -f 2 | tr -d ' ')" set -e CLEANUP+=( - "lxc delete -f ${INSTANCE_NAME}" - "lxc stop ${INSTANCE_NAME}" + "incus delete -f ${INSTANCE_NAME}" + "incus stop ${INSTANCE_NAME}" ) # VMs may take more time to start, wait until instance is running TIME_REMAINING="${INSTANCE_START_TIMEOUT}" while true ; do set +e - INSTANCE_STATUS=$(lxc exec "${INSTANCE_NAME}" hostname) + INSTANCE_STATUS=$(incus exec "${INSTANCE_NAME}" hostname) set -e if [[ "${INSTANCE_STATUS}" == "${INSTANCE_NAME}" ]] ; then break @@ -127,7 +127,7 @@ while true ; do sleep 1 TIME_REMAINING=$((TIME_REMAINING - 1)) if [ "${TIME_REMAINING}" -lt "0" ] ; then - fail 1 "Timed out waiting for instance to become available via 'lxc exec'" + fail 1 "Timed out waiting for instance to become available via 'incus exec'" fi done @@ -136,7 +136,7 @@ if [[ "${VARIANT}" == "cloud" ]] ; then # It's possible for cloud-init to fail, but to still be able to continue. # Eg., a profile asks for netplan.io on a system that doesn't have that # package available. - lxc exec "${INSTANCE_NAME}" -- cloud-init status -w || true + incus exec "${INSTANCE_NAME}" -- cloud-init status -w || true fi # Wait for instance to have an ip address (@TODO: is there a better approach?) @@ -145,10 +145,10 @@ sleep "${NETWORK_SLEEP}" # @TODO: Handle case when iputils2 is not installed INSTANCE_IP='' POTENTIAL_INTERFACES=(eth0 enp5s0) -lxc exec "${INSTANCE_NAME}" -- ip a +incus exec "${INSTANCE_NAME}" -- ip a set +e for interface in "${POTENTIAL_INTERFACES[@]}" ; do - if ! DEV_INFO="$(lxc exec "${INSTANCE_NAME}" -- ip a show dev "${interface}")" ; then + if ! DEV_INFO="$(incus exec "${INSTANCE_NAME}" -- ip a show dev "${interface}")" ; then continue fi INSTANCE_IP="$(echo "${DEV_INFO}" | grep -Eo 'inet [^ ]* ' | cut -d' ' -f2 | cut -d'/' -f1)" @@ -162,7 +162,7 @@ if [[ "${INSTANCE_IP}" == "" ]] ; then fi ssh-keyscan "${INSTANCE_IP}" >> ~/.ssh/known_hosts2 -#lxc exec "${INSTANCE_NAME}" -- bash -c 'for i in /etc/ssh/ssh_host_*_key ; do ssh-keygen -l -f "$i" ; done' >> "${HOME}/.ssh/known_hosts" +#incus exec "${INSTANCE_NAME}" -- bash -c 'for i in /etc/ssh/ssh_host_*_key ; do ssh-keygen -l -f "$i" ; done' >> "${HOME}/.ssh/known_hosts" CLEANUP+=( "rm -f ${HOME}/.ssh/known_hosts2" ) @@ -172,10 +172,10 @@ CLEANUP+=( "rm -f ${HOME}/.ssh/id_rsa.pub" "rm -f ${HOME}/.ssh/id_rsa" ) -lxc file push ~/.ssh/id_rsa.pub "ci:${INSTANCE_NAME}/root/.ssh/authorized_keys2" +incus file push ~/.ssh/id_rsa.pub "ci:${INSTANCE_NAME}/root/.ssh/authorized_keys2" # Some distros, eg. Rocky Linux, don't enable the use of authorized_keys2 # by default -lxc exec "ci:${INSTANCE_NAME}" -- bash -c 'if test -f /etc/redhat-release ; then sed -i "s#^AuthorizedKeysFile.*#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2#" /etc/ssh/sshd_config ; systemctl restart sshd ; fi' +incus exec "ci:${INSTANCE_NAME}" -- bash -c 'if test -f /etc/redhat-release ; then sed -i "s#^AuthorizedKeysFile.*#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2#" /etc/ssh/sshd_config ; systemctl restart sshd ; fi' # Confirm working SSH connection @@ -202,10 +202,10 @@ LANG=C ANSIBLE_STRATEGY=linear ansible-playbook \ -l "${INSTANCE_IP}" -i fake-inventory # Graceful shutdown -lxc stop "${INSTANCE_NAME}" +incus stop "${INSTANCE_NAME}" # Publish -if FINGERPRINT=$(lxc publish "${INSTANCE_NAME}" 2>&1 | grep -E -o '[A-Fa-f0-9]{64}') ; then +if FINGERPRINT=$(incus publish "${INSTANCE_NAME}" 2>&1 | grep -E -o '[A-Fa-f0-9]{64}') ; then echo "Published instance with fingerprint '${FINGERPRINT}'" else fail 1 "No fingerprint for published instance" @@ -216,7 +216,7 @@ TRIES=0 if [[ "${TEST}" == "true" ]] ; then set +e while [[ "${TRIES}" -lt "${TRIES_MAX}" ]] ; do - if ! INSTANCE_NAME=$(lxc -q launch -e "${VM_ARG[@]}" -p default -p "${LXD_INSTANCE_PROFILE}" "${FINGERPRINT}") ; then + if ! INSTANCE_NAME=$(incus -q launch -e "${VM_ARG[@]}" -p default -p "${INCUS_INSTANCE_PROFILE}" "${FINGERPRINT}") ; then TRIES=$((TRIES + 1)) echo "Failed to launch instance try ${TRIES}/${TRIES_MAX}" if [[ "${TRIES}" -lt "${TRIES_MAX}" ]] ; then @@ -227,7 +227,7 @@ if [[ "${TEST}" == "true" ]] ; then else INSTANCE_NAME="$(echo "${INSTANCE_NAME}" | cut -d':' -f2 | tr -d ' ')" CLEANUP+=( - "lxc stop -f ${INSTANCE_NAME}" + "incus stop -f ${INSTANCE_NAME}" ) break fi @@ -235,5 +235,5 @@ if [[ "${TEST}" == "true" ]] ; then set -e fi -lxc image alias delete "${TARGET_IMAGE_NAME}" || true -lxc image alias create "${TARGET_IMAGE_NAME}" "${FINGERPRINT}" +incus image alias delete "${TARGET_IMAGE_NAME}" || true +incus image alias create "${TARGET_IMAGE_NAME}" "${FINGERPRINT}" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..28f4e25 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1 @@ +[tool.black] diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh index 12900c7..feea2f4 100755 --- a/scripts/babeltrace/build.sh +++ b/scripts/babeltrace/build.sh @@ -227,9 +227,9 @@ freebsd*) ;; esac -# Some warning flags are very dumb in GCC 4.8 on SLES12 / EL7, disable them +# Some warning flags are very dumb in GCC 4.8 on SLES12, disable them # even if they are available. -if [[ $platform = sles12sp5* ]] || [[ $platform = el7* ]]; then +if [[ $platform = sles12sp5* ]]; then CFLAGS="$CFLAGS -Wno-missing-field-initializers -Wno-shadow" CXXFLAGS="$CXXFLAGS -Wno-missing-field-initializers -Wno-shadow" fi @@ -436,7 +436,7 @@ if [ "$BABELTRACE_CLANG_TIDY" = "yes" ]; then # Instead, run clan-tidy on all the files touched by the patch. while read -r filepath; do - if [[ "$filepath" =~ (\.cpp|\.hhp|\.c|\.h)$ ]]; then + if [[ "$filepath" =~ (\.cpp|\.hpp|\.c|\.h)$ ]]; then clang-tidy --fix-errors "$(realpath "$filepath")" fi done < <(git diff-tree --no-commit-id --diff-filter=d --name-only -r HEAD) diff --git a/scripts/babeltrace/lint.sh b/scripts/babeltrace/lint.sh index a535a81..5581c35 100755 --- a/scripts/babeltrace/lint.sh +++ b/scripts/babeltrace/lint.sh @@ -61,7 +61,7 @@ else fi if [[ -f tools/format-cpp.sh ]]; then - FORMATTER="clang-format-15 -i" tools/format-cpp.sh + FORMATTER="clang-format-16 -i" tools/format-cpp.sh git diff --exit-code | tee ../../clang-format.out || exit_code=1 fi diff --git a/scripts/liburcu/build.sh b/scripts/liburcu/build.sh index d7ae0d1..40f3469 100755 --- a/scripts/liburcu/build.sh +++ b/scripts/liburcu/build.sh @@ -133,6 +133,8 @@ PREFIX="/build" LIBDIR="lib" LIBDIR_ARCH="$LIBDIR" +CONF_OPTS=() + # RHEL and SLES both use lib64 but don't bother shipping a default autoconf # site config that matches this. if [[ ( -f /etc/redhat-release || -f /etc/products.d/SLES.prod || -f /etc/yocto-release ) ]]; then @@ -206,6 +208,16 @@ freebsd*) export PYTHON_CONFIG="python3-config" ;; +cygwin*) + export MAKE=make + export TAR=tar + export NPROC=nproc + + # Work around a bug in GCC's emutls on cygwin which results in a deadlock + # in test_perthreadlock + CONF_OPTS+=("--disable-compiler-tls") + ;; + *) export MAKE=make export TAR=tar @@ -234,7 +246,7 @@ PACKAGE_VERSION=${PACKAGE_VERSION//\-pre*/} # Set configure options and environment variables for each build # configuration. -CONF_OPTS=("--prefix=$PREFIX" "--libdir=$PREFIX/$LIBDIR_ARCH" "--disable-maintainer-mode") +CONF_OPTS+=("--prefix=$PREFIX" "--libdir=$PREFIX/$LIBDIR_ARCH" "--disable-maintainer-mode") case "$conf" in static) print_header "Conf: Static lib only" @@ -378,7 +390,7 @@ if [ "$USERSPACE_RCU_CLANG_TIDY" = "yes" ]; then # Instead, run clan-tidy on all the files touched by the patch. while read -r filepath; do - if [[ "$filepath" =~ (\.cpp|\.hhp|\.c|\.h)$ ]]; then + if [[ "$filepath" =~ (\.cpp|\.hpp|\.c|\.h)$ ]]; then clang-tidy --fix-errors "$(realpath "$filepath")" fi done < <(git diff-tree --no-commit-id --diff-filter=d --name-only -r HEAD) diff --git a/scripts/lttng-modules/master.groovy b/scripts/lttng-modules/master.groovy index 5c515b7..26f9c61 100644 --- a/scripts/lttng-modules/master.groovy +++ b/scripts/lttng-modules/master.groovy @@ -628,16 +628,15 @@ if (elversion != null) { case 'jammy': matchStrs = [ ~/^refs\/tags\/(Ubuntu-5\.15\.0-\d{1,3}?\.[\d]+)$/, - ~/^refs\/tags\/(Ubuntu-hwe-6\.2-6\.2\.0-.*_22\.04\.\d+)$/, - ~/^refs\/tags\/(Ubuntu-hwe-6\.5-6\.5\.0-.*_22\.04\.\d+)$/, + ~/^refs\/tags\/(Ubuntu-hwe-6\.8-6\.8\.0-.*_22\.04\.\d+)$/, ] break case 'focal': matchStrs = [ ~/^refs\/tags\/(Ubuntu-5\.4\.0-\d{1,3}?\.[\d]+)$/, - ~/^refs\/tags\/(Ubuntu-hwe-5\.13-5\.13\.0-.*_20\.04\.\d+)$/, ~/^refs\/tags\/(Ubuntu-hwe-5\.15-5\.15\.0-.*_20\.04\.\d+)$/, + ~/^refs\/tags\/(Ubuntu-hwe-6\.8-6\.8\.0-.*_20\.04\.\d+)$/, ] break diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index bb2b6b5..41b1fb7 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -286,9 +286,9 @@ cygwin|cygwin64|msys32|msys64) ;; esac -# Some warning flags are very dumb in GCC 4.8 on SLES12 / EL7, disable them +# Some warning flags are very dumb in GCC 4.8 on SLES12, disable them # even if they are available. -if [[ $platform = sles12sp5* ]] || [[ $platform = el7* ]]; then +if [[ $platform = sles12sp5* ]]; then CFLAGS="$CFLAGS -Wno-missing-field-initializers -Wno-shadow" CXXFLAGS="$CXXFLAGS -Wno-missing-field-initializers -Wno-shadow" fi @@ -513,7 +513,7 @@ if [ "$LTTNG_TOOLS_CLANG_TIDY" = "yes" ]; then # Instead, run clan-tidy on all the files touched by the patch. while read -r filepath; do - if [[ "$filepath" =~ (\.cpp|\.hhp|\.c|\.h)$ ]]; then + if [[ "$filepath" =~ (\.cpp|\.hpp|\.c|\.h)$ ]]; then clang-tidy --fix-errors "$(realpath "$filepath")" fi done < <(git diff-tree --no-commit-id --diff-filter=d --name-only -r HEAD) @@ -609,9 +609,15 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only) "-Dlog4j-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j.jar" "-Dlog4j2-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j2.jar" "-DargLine=-Djava.library.path=${WORKSPACE}/deps/build/${LIBDIR_ARCH}" - '-Dgroups=!domain:log4j2' ) + # Merged into master ~ 47abf22b48023960069e1d3e23f42298ce4b3c2a + if verlt "${PACKAGE_VERSION}" "2.14" ; then + LTTNG_UST_JAVA_TESTS_MAVEN_OPTS+=( + '-Dgroups=!domain:log4j2' + ) + fi + env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn -version if [[ -n "${LTTNG_TOOLS_UST_JAVA_TESTS_LOG4J_API_VERSION:-}" ]] ; then diff --git a/scripts/lttng-tools/gerrit-depends-on.sh b/scripts/lttng-tools/gerrit-depends-on.sh index 9e607bf..5b55c82 100755 --- a/scripts/lttng-tools/gerrit-depends-on.sh +++ b/scripts/lttng-tools/gerrit-depends-on.sh @@ -59,14 +59,14 @@ git rev-list --format=%B --max-count=1 HEAD | while read -r line; do fi if [ "$project" = "lttng-modules" ]; then + if [ "$(id -u)" != "0" ]; then + continue + fi if [ -d "$WORKSPACE/src/lttng-modules" ]; then # Remove the regular modules sources to replace them with those - # from the gerrit change + # from the gerrit change rm -rf "$WORKSPACE/src/lttng-modules" - else - # This job does not require modules sources - continue - fi + fi fi # Export the GERRIT_DEP_... into the property file for further jenkins usage diff --git a/scripts/lttng-ust/build.sh b/scripts/lttng-ust/build.sh index 842206c..26672ca 100755 --- a/scripts/lttng-ust/build.sh +++ b/scripts/lttng-ust/build.sh @@ -370,7 +370,7 @@ if [ "$LTTNG_UST_CLANG_TIDY" = "yes" ]; then # Instead, run clan-tidy on all the files touched by the patch. while read -r filepath; do - if [[ "$filepath" =~ (\.cpp|\.hhp|\.c|\.h)$ ]]; then + if [[ "$filepath" =~ (\.cpp|\.hpp|\.c|\.h)$ ]]; then clang-tidy --fix-errors "$(realpath "$filepath")" fi done < <(git diff-tree --no-commit-id --diff-filter=d --name-only -r HEAD)