summaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/playbooks/preconfigure-qat.yml
diff options
context:
space:
mode:
authorTodd Malsbary <todd.malsbary@intel.com>2020-12-02 16:09:36 -0800
committerTodd Malsbary <todd.malsbary@intel.com>2020-12-07 16:41:54 -0800
commitd3b0887248f10248d4a87a91f918984761f95599 (patch)
tree7fd1e5aace04f3e940c56d66ff2d47be10dce5ef /kud/deployment_infra/playbooks/preconfigure-qat.yml
parent7e06fbaa3d1293ca9b25aeb7ea7cb7be2179e30a (diff)
Fix QAT addon deploy and test
Note that as mentioned in install_qat.sh, the kernel command line must include "intel_iommu=on iommu=pt" for the deploy and test to succeed. The underlying issue is that the playbook was expecting to be run on the same host it executed on and was looking for files in the wrong places. Issue-ID: MULTICLOUD-1261 Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> Change-Id: I5f59b9147f34f077fcdc63d7fc5f80b56977054c
Diffstat (limited to 'kud/deployment_infra/playbooks/preconfigure-qat.yml')
-rw-r--r--kud/deployment_infra/playbooks/preconfigure-qat.yml162
1 files changed, 73 insertions, 89 deletions
diff --git a/kud/deployment_infra/playbooks/preconfigure-qat.yml b/kud/deployment_infra/playbooks/preconfigure-qat.yml
index f5d797f1..ef8446f8 100644
--- a/kud/deployment_infra/playbooks/preconfigure-qat.yml
+++ b/kud/deployment_infra/playbooks/preconfigure-qat.yml
@@ -19,12 +19,10 @@
file:
state: directory
path: "{{ qat_dest }}"
- - name: Fetching QAT driver
- block:
- - name: Download QAT driver tarball
- get_url:
- url: "{{ qat_driver_url }}"
- dest: "{{ qat_dest }}/{{ qat_package }}.tar.gz"
+ - name: Download QAT driver tarball
+ get_url:
+ url: "{{ qat_driver_url }}"
+ dest: "{{ qat_dest }}/{{ qat_package }}.tar.gz"
- hosts: kube-node
become: yes
@@ -33,21 +31,13 @@
include_vars:
file: kud-vars.yml
tasks:
- - name: Create a destination for driver folder in the target's /tmp
- file:
- state: directory
- path: "{{ item }}"
- with_items:
- - "{{ base_dest }}/quick-assist/{{ qat_package }}"
- - name: Create QAT dest folder
+ - name: Create destination folder for QAT check script
file:
state: directory
- path: "qat"
- - name: Register QAT env variable
- shell: "echo {{ QAT_ENABLED | default(False) }}"
+ path: "{{ base_dest }}/qat"
- name: Create QAT check script
copy:
- dest: "qat/qat.sh"
+ dest: "{{ base_dest }}/qat/qat.sh"
content: |
#!/bin/bash
qat_device=$( for i in 0434 0435 37c8 6f54 19e2; \
@@ -59,15 +49,11 @@
else
echo "True"
fi
- - name: Changing perm of "sh", adding "+x"
- shell: "chmod +x qat.sh"
- args:
- chdir: "qat"
- warn: False
- - name: Run the script and re-evaluate the variable.
- command: "./qat.sh"
+ mode: 0755
+ - name: Run QAT check script and re-evaluate the variable
+ command: ./qat.sh
args:
- chdir: "qat"
+ chdir: "{{ base_dest }}/qat"
register: output
- debug:
var: output.stdout_lines
@@ -75,70 +61,68 @@
QAT_ENABLED: "{{ output.stdout }}"
- debug:
var: output
- - name: Clean the script and folder.
+ - name: Clean QAT check script and folder
file:
- path: qat
+ path: "{{ base_dest }}/qat"
state: absent
- - name: bootstrap | install qat compilation packages
- package:
- name: "{{ item }}"
- state: present
- with_items:
- - pciutils
- - build-essential
- - libudev-dev
- - pkg-config
- when: QAT_ENABLED
- - copy:
- src: "{{ qat_dest }}/{{ qat_package }}.tar.gz"
- dest: "{{ base_dest }}/quick-assist"
- remote_src: no
- when: QAT_ENABLED
- - name: Extract QAT source code
- unarchive:
- src: "{{ qat_dest }}/{{ qat_package }}.tar.gz"
- dest: "{{ base_dest }}/quick-assist/{{ qat_package }}"
- when: QAT_ENABLED
- - name: Configure the target
- command: ./configure --enable-icp-sriov=host
- args:
- chdir: "{{ base_dest }}/quick-assist/{{ qat_package }}"
- when: QAT_ENABLED
- - name: build qat driver
- make:
- chdir: "{{ base_dest }}/quick-assist/{{ qat_package }}"
- target: "{{ item }}"
- loop:
- - clean
- - uninstall
- - install
- when: QAT_ENABLED
- - name: Create QAT driver folder in the target destination
- file:
- state: directory
- path: "{{ item }}"
- with_items:
- - qat_driver_dest
- when: QAT_ENABLED
- - name: Copy QAT build directory qat target destination
- command: "cp -r {{ base_dest }}/quick-assist/{{ qat_package }}/build/ /root/qat_driver_dest/"
- when: QAT_ENABLED
- - name: Copy QAT driver install script to target folder
- command: "cp {{ playbook_dir }}/install_qat.sh /root/qat_driver_dest/build/install.sh"
- when: QAT_ENABLED
- - name: Copy QAT to target folder
- command: "cp /etc/default/qat /root/qat_driver_dest/build"
- when: QAT_ENABLED
- - name: Changing perm of "install.sh", adding "+x"
- file: dest=~/qat_driver_dest/build/install.sh mode=a+x
- when: QAT_ENABLED
- - name: Run a script with arguments
- command: ./install.sh chdir=/root/qat_driver_dest/build
- when: QAT_ENABLED
- - name: get qat devices
- shell: /usr/local/bin/adf_ctl status | grep up | awk '{print $4 substr($1, 4)}' | tr -d ','
- register: qat_devices
- when: QAT_ENABLED
- - name: Updating the qat device SSL values to avoid duplication
- command: "./substitute.sh chdir={{ playbook_dir }}"
+ - name: Install QAT driver
+ block:
+ - name: Install QAT compilation packages
+ package:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - pciutils
+ - build-essential
+ - libudev-dev
+ - pkg-config
+ - name: Create destination folder for QAT source code
+ file:
+ state: directory
+ path: "{{ qat_dest }}/{{ qat_package }}"
+ - name: Extract QAT source code
+ unarchive:
+ src: "{{ qat_dest }}/{{ qat_package }}.tar.gz"
+ dest: "{{ qat_dest }}/{{ qat_package }}"
+ - name: Configure the target
+ command: ./configure --enable-icp-sriov=host
+ args:
+ chdir: "{{ qat_dest }}/{{ qat_package }}"
+ - name: Build QAT driver
+ make:
+ chdir: "{{ qat_dest }}/{{ qat_package }}"
+ target: "{{ item }}"
+ loop:
+ - clean
+ - uninstall
+ - install
+ - name: Copy QAT driver install script to target folder
+ copy:
+ src: "install_qat.sh"
+ dest: "{{ qat_dest }}/{{ qat_package }}/build"
+ mode: 0755
+ - name: Copy /etc/default/qat to target folder
+ copy:
+ src: "/etc/default/qat"
+ dest: "{{ qat_dest }}/{{ qat_package }}/build"
+ remote_src: yes
+ - name: Run a script with arguments
+ command: ./install_qat.sh
+ args:
+ chdir: "{{ qat_dest }}/{{ qat_package }}/build"
+ - name: Copy QAT substitue script to target folder
+ copy:
+ src: "substitute.sh"
+ dest: "{{ qat_dest }}/{{ qat_package }}/build"
+ mode: 0755
+ - name: Update the QAT device SSL values to avoid duplication
+ command: ./substitute.sh
+ args:
+ chdir: "{{ qat_dest }}/{{ qat_package }}/build"
+ - name: Restart acceleration driver framework
+ command: adf_ctl restart
+ - name: Restart QAT service
+ service:
+ name: qat_service
+ state: restarted
when: QAT_ENABLED