aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup
diff options
context:
space:
mode:
authorTomas Alexy <tomas.alexy@pantheon.tech>2021-01-28 08:59:22 +0100
committerPeter Mikus <pmikus@cisco.com>2021-02-18 13:51:53 +0000
commita678231f39f4d4ea079018e7d11be36d0cc454d2 (patch)
tree973ad7d06ef0a419b945e7bfab0cee8818039c01 /resources/tools/testbed-setup
parent98d86e98c9bc9d2ed10b01fb81d6d7e02f09eb51 (diff)
Infra: Fix AWS deployment
Signed-off-by: Tomas Alexy <tomas.alexy@pantheon.tech> Change-Id: Ie24f5fac5827e28b1ac7c22192a94994700b2910
Diffstat (limited to 'resources/tools/testbed-setup')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml57
-rw-r--r--resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml14
-rw-r--r--resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml2
-rw-r--r--resources/tools/testbed-setup/ansible/roles/topology/tasks/main.yaml4
-rw-r--r--resources/tools/testbed-setup/ansible/site.yaml17
-rw-r--r--resources/tools/testbed-setup/ansible/site_aws.yaml8
-rw-r--r--resources/tools/testbed-setup/ansible/sut.yaml26
-rw-r--r--resources/tools/testbed-setup/ansible/sut_aws.yaml25
-rw-r--r--resources/tools/testbed-setup/ansible/tg.yaml30
-rw-r--r--resources/tools/testbed-setup/ansible/tg_aws.yaml35
10 files changed, 117 insertions, 101 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml
index 7b7a7fbb1a..deca0670ec 100644
--- a/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/aws/tasks/main.yaml
@@ -1,26 +1,40 @@
---
# file: roles/aws/tasks/main.yaml
-- name: AWS - Edit repositories
- include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml'
- tags: edit-repo
+- name: Edit repositories
+ include_tasks: "{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml"
+ tags:
+ - edit-repo
+
+- name: Get vfio-pci With WC Patcher
+ get_url:
+ url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/get-vfio-with-wc.sh"
+ dest: "/opt/get-vfio-with-wc.sh"
+ mode: "744"
+ tags:
+ - vfio-aws-patch
+
+- name: Create vfio-pci Patch Directory
+ file:
+ path: "/opt/patches/"
+ state: "directory"
+ tags:
+ - vfio-aws-patch
-- name: AWS - Get vfio-pci Patcher Script
+- name: Get vfio-pci WC Patch
get_url:
- url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/vfio-wc-patch.sh"
- dest: "/opt/vfio-wc-patch.sh"
+ url: "https://github.com/amzn/amzn-drivers/raw/master/userspace/dpdk/enav2-vfio-patch/patches/linux-4.10-vfio-wc.patch"
+ dest: "/opt/patches/linux-4.10-vfio-wc.patch"
mode: "744"
- register: "vfio_patch_downloaded"
tags:
- vfio-aws-patch
-- name: AWS - Patch vfio-pci
- shell: "/bin/bash /opt/vfio-wc-patch.sh"
- when: "vfio_patch_downloaded"
+- name: Compile vfio-pci With WC Patch
+ shell: "/bin/bash /opt/get-vfio-with-wc.sh"
tags:
- vfio-aws-patch
-- name: AWS - Load Kernel Modules By Default
+- name: Load Kernel Modules By Default
lineinfile:
path: "/etc/modules"
state: "present"
@@ -28,11 +42,10 @@
with_items:
- "vfio-pci"
- "igb_uio"
- register: "modules_added"
tags:
- load-kernel-modules
-- name: AWS - Add Kernel Modules Options
+- name: Add Kernel Modules Options (igb_uio)
lineinfile:
path: "/etc/modprobe.d/igb_uio.conf"
state: "present"
@@ -40,20 +53,28 @@
create: "yes"
with_items:
- "options igb_uio wc_activate=1"
- when: "modules_added"
- register: "modules_added"
tags:
- load-kernel-modules
-- name: AWS - Reload systemd-modules
+- name: Add Kernel Modules Options (vfio-pci)
+ lineinfile:
+ path: "/etc/modprobe.d/vfio-noiommu.conf"
+ state: "present"
+ line: "{{ item }}"
+ create: "yes"
+ with_items:
+ - "options vfio enable_unsafe_noiommu_mode=1"
+ tags:
+ - load-kernel-modules
+
+- name: Reload systemd-modules
systemd:
name: "systemd-modules-load"
state: "restarted"
- when: "modules_added"
tags:
- reload-systemd-modules
-- name: AWS - Performance Tuning - Adjust nr_hugepages
+- name: Performance Tuning - Adjust nr_hugepages
sysctl:
name: "vm.nr_hugepages"
value: "8192"
diff --git a/resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml
index 75e4a3ae57..ba6e107e45 100644
--- a/resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/aws/tasks/ubuntu_bionic.yaml
@@ -1,10 +1,10 @@
---
-# file: roles/aws/tasks/ubuntu_bionic.yaml
+# file: roles/aws/tasks/ubuntu_bionic.yaml.yaml
-- name: AWS - Enable deb-src APT Repositories
- replace:
- path: "/etc/apt/sources.list"
- regexp: "^# deb-src "
- replace: "deb-src "
+- name: Enable deb-src APT Repository
+ apt_repository:
+ repo: "deb-src http://archive.ubuntu.com/ubuntu bionic main"
+ state: "present"
+ update_cache: yes
tags:
- - enable-src-repo
+ - enable-src-repo \ No newline at end of file
diff --git a/resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml
index c639f11088..e5ef3c1bc1 100644
--- a/resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml
@@ -26,7 +26,7 @@ kernel_version_by_distro_by_arch:
x86_64:
- "4.15.0-72-generic"
- "5.3.0-1020-azure"
- - "5.3.0-1017-aws"
+ - "4.15.0-1057-aws"
aarch64:
- "4.15.0-54-generic"
diff --git a/resources/tools/testbed-setup/ansible/roles/topology/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/topology/tasks/main.yaml
index 9efdc71759..cf3eb5367f 100644
--- a/resources/tools/testbed-setup/ansible/roles/topology/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/topology/tasks/main.yaml
@@ -3,7 +3,7 @@
- name: Create topology file
template:
- src: 'templates/topology_{{ cloud_topology }}.j2'
- dest: '../../../../topologies/available/{{ cloud_topology }}_testbed.yaml'
+ src: "templates/topology_{{ cloud_topology }}.j2"
+ dest: "../../../../topologies/available/{{ cloud_topology }}_{{ testbed_name }}.yaml"
tags:
- create-topology-file
diff --git a/resources/tools/testbed-setup/ansible/site.yaml b/resources/tools/testbed-setup/ansible/site.yaml
index 5ac76ca340..1d755dbae0 100644
--- a/resources/tools/testbed-setup/ansible/site.yaml
+++ b/resources/tools/testbed-setup/ansible/site.yaml
@@ -2,16 +2,23 @@
# file: site.yaml
- import_playbook: tg.yaml
- tags: tg
+ tags:
+ - tg
+ - tg_aws
- import_playbook: sut.yaml
- tags: sut
+ tags:
+ - sut
+ - sut_aws
- import_playbook: vpp_device.yaml
- tags: vpp-device
+ tags:
+ - vpp-device
- import_playbook: nomad.yaml
- tags: nomad
+ tags:
+ - nomad
- import_playbook: dev.yaml
- tags: dev
+ tags:
+ - dev
diff --git a/resources/tools/testbed-setup/ansible/site_aws.yaml b/resources/tools/testbed-setup/ansible/site_aws.yaml
deleted file mode 100644
index 4e23a97f85..0000000000
--- a/resources/tools/testbed-setup/ansible/site_aws.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-# file: site_aws.yaml
-
-- import_playbook: tg_aws.yaml
- tags: tg
-
-- import_playbook: sut_aws.yaml
- tags: sut
diff --git a/resources/tools/testbed-setup/ansible/sut.yaml b/resources/tools/testbed-setup/ansible/sut.yaml
index 9449316fb2..f3e8c3b57b 100644
--- a/resources/tools/testbed-setup/ansible/sut.yaml
+++ b/resources/tools/testbed-setup/ansible/sut.yaml
@@ -38,3 +38,29 @@
tags: cleanup
- role: calibration
tags: calibration
+
+- hosts: sut_aws
+ remote_user: testuser
+ become: yes
+ become_user: root
+ roles:
+ - role: user_add
+ tags: user_add
+ - role: common
+ tags: common
+ - role: vpp
+ tags: vpp
+ - role: dpdk
+ tags: dpdk
+ - role: aws
+ tags: aws
+ - role: iperf
+ tags: iperf
+ - role: docker
+ tags: docker
+ - role: cleanup
+ tags: cleanup
+ # TODO: 'Check Kernel Parameters' failing in
+ # resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml
+ # - role: calibration
+ # tags: calibration
diff --git a/resources/tools/testbed-setup/ansible/sut_aws.yaml b/resources/tools/testbed-setup/ansible/sut_aws.yaml
deleted file mode 100644
index a7642abfef..0000000000
--- a/resources/tools/testbed-setup/ansible/sut_aws.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-# file: sut_aws.yaml
-
-- hosts: sut
- become: yes
- become_user: root
- roles:
- - role: user_add
- tags: user_add
- - role: common
- tags: common
- - role: vpp
- tags: vpp
- - role: dpdk
- tags: dpdk
- - role: aws
- tags: aws
- - role: iperf
- tags: iperf
- - role: docker
- tags: docker
- - role: cleanup
- tags: cleanup
-# - role: calibration
-# tags: calibration
diff --git a/resources/tools/testbed-setup/ansible/tg.yaml b/resources/tools/testbed-setup/ansible/tg.yaml
index 2b375b76a1..527ccae922 100644
--- a/resources/tools/testbed-setup/ansible/tg.yaml
+++ b/resources/tools/testbed-setup/ansible/tg.yaml
@@ -36,3 +36,33 @@
tags: cleanup
- role: calibration
tags: calibration
+
+- hosts: tg_aws
+ remote_user: testuser
+ become: yes
+ become_user: root
+ roles:
+ - role: user_add
+ tags: user_add
+ - role: common
+ tags: common
+ - role: dpdk
+ tags: dpdk
+ - role: aws
+ tags: aws
+ - role: tg
+ tags: tg
+ - role: iperf
+ tags: iperf
+ - role: trex
+ tags: trex
+ - role: ab
+ tags: ab
+ - role: docker
+ tags: docker
+ - role: cleanup
+ tags: cleanup
+ # TODO: 'Check Kernel Parameters' failing in
+ # resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml
+ # - role: calibration
+ # tags: calibration
diff --git a/resources/tools/testbed-setup/ansible/tg_aws.yaml b/resources/tools/testbed-setup/ansible/tg_aws.yaml
deleted file mode 100644
index 17e8239c9e..0000000000
--- a/resources/tools/testbed-setup/ansible/tg_aws.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
----
-# file: tg_aws.yaml
-
-- hosts: tg
- become: yes
- become_user: root
- gather_facts: false
- pre_tasks:
- - name: Gathering Facts
- gather_facts:
- tags:
- - always
- roles:
- - role: user_add
- tags: user_add
- - role: common
- tags: common
- - role: dpdk
- tags: dpdk
- - role: aws
- tags: aws
- - role: tg
- tags: tg
- - role: iperf
- tags: iperf
- - role: trex
- tags: trex
- - role: ab
- tags: ab
- - role: docker
- tags: docker
- - role: cleanup
- tags: cleanup
-# - role: calibration
-# tags: calibration