From 2216cbfec415870dde1d42583e1e4bca8d3c2c07 Mon Sep 17 00:00:00 2001 From: astebenkova Date: Tue, 6 Feb 2024 13:43:27 +0200 Subject: [PATCH] Add compute-kit job with DPDK enabled + add role for enabling hugepages Change-Id: I89d3c09ea3bedcba6cb51178c8d1ac482a57af01 Depends-On: I2f9d954258451f64eb87d03affc079b71b00f7bd --- openvswitch/Chart.yaml | 2 +- .../values_overrides/dpdk-ubuntu_focal.yaml | 4 +- .../values_overrides/dpdk-ubuntu_jammy.yaml | 4 +- playbooks/enable-hugepages.yaml | 20 ++++++++++ releasenotes/notes/openvswitch.yaml | 1 + roles/enable-hugepages/defaults/main.yaml | 21 +++++++++++ roles/enable-hugepages/tasks/main.yaml | 37 +++++++++++++++++++ zuul.d/jobs.yaml | 23 ++++++++++++ zuul.d/project.yaml | 1 + 9 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 playbooks/enable-hugepages.yaml create mode 100644 roles/enable-hugepages/defaults/main.yaml create mode 100644 roles/enable-hugepages/tasks/main.yaml diff --git a/openvswitch/Chart.yaml b/openvswitch/Chart.yaml index 61ce790de..52f32fe32 100644 --- a/openvswitch/Chart.yaml +++ b/openvswitch/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm OpenVSwitch name: openvswitch -version: 0.1.21 +version: 0.1.22 home: http://openvswitch.org icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png sources: diff --git a/openvswitch/values_overrides/dpdk-ubuntu_focal.yaml b/openvswitch/values_overrides/dpdk-ubuntu_focal.yaml index 1b3c401db..bc31d2f5a 100644 --- a/openvswitch/values_overrides/dpdk-ubuntu_focal.yaml +++ b/openvswitch/values_overrides/dpdk-ubuntu_focal.yaml @@ -14,11 +14,11 @@ pod: limits: memory: "2Gi" cpu: "2" - hugepages-1Gi: "1Gi" + hugepages-2Mi: "1Gi" conf: ovs_dpdk: enabled: true hugepages_mountpath: /dev/hugepages vhostuser_socket_dir: vhostuser - socket_memory: 1024 + socket_memory: 512 ... diff --git a/openvswitch/values_overrides/dpdk-ubuntu_jammy.yaml b/openvswitch/values_overrides/dpdk-ubuntu_jammy.yaml index 28cd92d4d..17929c3bb 100644 --- a/openvswitch/values_overrides/dpdk-ubuntu_jammy.yaml +++ b/openvswitch/values_overrides/dpdk-ubuntu_jammy.yaml @@ -14,11 +14,11 @@ pod: limits: memory: "2Gi" cpu: "2" - hugepages-1Gi: "1Gi" + hugepages-2Mi: "1Gi" conf: ovs_dpdk: enabled: true hugepages_mountpath: /dev/hugepages vhostuser_socket_dir: vhostuser - socket_memory: 1024 + socket_memory: 512 ... diff --git a/playbooks/enable-hugepages.yaml b/playbooks/enable-hugepages.yaml new file mode 100644 index 000000000..186c07671 --- /dev/null +++ b/playbooks/enable-hugepages.yaml @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +- hosts: all + gather_facts: True + become: yes + roles: + - role: enable-hugepages + when: hugepages.enabled|default(false)|bool == true +... diff --git a/releasenotes/notes/openvswitch.yaml b/releasenotes/notes/openvswitch.yaml index fa0c9cd89..3da239580 100644 --- a/releasenotes/notes/openvswitch.yaml +++ b/releasenotes/notes/openvswitch.yaml @@ -22,4 +22,5 @@ openvswitch: - 0.1.19 Add check for cgroups v2 file structure - 0.1.20 Add Ubuntu Focal and Ubuntu Jammy overrides - 0.1.21 Add overrides for dpdk + - 0.1.22 Change hugepages size to 2M for easier configuration ... diff --git a/roles/enable-hugepages/defaults/main.yaml b/roles/enable-hugepages/defaults/main.yaml new file mode 100644 index 000000000..cbdf0ae91 --- /dev/null +++ b/roles/enable-hugepages/defaults/main.yaml @@ -0,0 +1,21 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +hugepages: + enabled: false +# This parameter sets the size of the huge pages, available options: 2M and 1G + size: "2M" +# This parameter sets the number of huge pages to allocate + number: 1024 +grub_default_config: "/etc/default/grub" +... diff --git a/roles/enable-hugepages/tasks/main.yaml b/roles/enable-hugepages/tasks/main.yaml new file mode 100644 index 000000000..605413cf7 --- /dev/null +++ b/roles/enable-hugepages/tasks/main.yaml @@ -0,0 +1,37 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +- name: Set up 1G hugepages + become: true + block: + - name: Configure grub + lineinfile: + dest: "{{ grub_default_config }}" + line: 'GRUB_CMDLINE_LINUX="default_hugepagesz={{ hugepages.size }} hugepagesz={{ hugepages.size }} hugepages={{ hugepages.number }}"' + regexp: '^GRUB_CMDLINE_LINUX="' + - name: Update grub configuration + command: update-grub2 + - name: Reboot host + reboot: + reboot_timeout: 600 + when: hugepages.size == "1G" + +- name: Set up 2M hugepages + become: true + sysctl: + name: vm.nr_hugepages + value: "{{ hugepages.number }}" + sysctl_set: true + reload: true + when: hugepages.size == "2M" +... diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index b69431c41..ac07c80a9 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -308,5 +308,28 @@ - ./tools/deployment/mariadb-operator-cluster/090-mariadb-backup-test.sh - ./tools/deployment/mariadb-operator-cluster/095-mariadb-prometheus-mysql-exporter.sh +- job: + name: openstack-helm-compute-kit-dpdk-ubuntu_jammy + description: | + Run the openstack-helm compute-kit job with DPDK enabled. + We use single node environment to run this job which means + that the job only tests that QEMU and OVS-DPDK are working + together. The job does not assume having specific DPDK hardware. + parent: openstack-helm-compute-kit + pre-run: + - playbooks/enable-hugepages.yaml + - playbooks/prepare-hosts.yaml + nodeset: openstack-helm-1node-32GB-ubuntu_jammy + vars: + gate_scripts_relative_path: ../openstack-helm + hugepages: + enabled: true + size: "2M" + number: 2048 + osh_params: + openstack_release: "2023.2" + container_distro_name: ubuntu + container_distro_version: jammy + feature_gates: dpdk ... diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 9d3132b63..78bfe1414 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -30,6 +30,7 @@ - openstack-helm-infra-metacontroller - openstack-helm-infra-mariadb-operator - openstack-helm-infra-openstack-support-mariadb-service-primary + - openstack-helm-compute-kit-dpdk-ubuntu_jammy gate: jobs: - openstack-helm-lint