From 2bc9710516589decb9671b75e770514b405f31d9 Mon Sep 17 00:00:00 2001 From: jgoutin Date: Thu, 25 Jul 2019 17:23:31 +0200 Subject: [PATCH] Fix XRT AWS --- defaults/main.yml | 5 +++++ meta/main.yml | 21 +++++++++++---------- tasks/main.yml | 38 ++++++++++++++++++++++++++++++++++---- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 867c19f..24cd565 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,3 +9,8 @@ aws_fpga_xrt: true # FPGA driver to install aws_fpga_driver: '' + +# XRT packages from AWS +s3_dev_ami_url: "https://s3.amazonaws.com/aws-fpga-developer-ami/1.6.0/Patches/\ + XRT_2018_3_RC3_Patch1/" +aws_xrt_package: xrt_201830.2.1.0_7.6.1810 diff --git a/meta/main.yml b/meta/main.yml index 18762d4..1d62bf8 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -11,10 +11,10 @@ galaxy_info: - name: EL versions: - 7 - - name: Ubuntu - versions: - - xenial - - bionic + #- name: Ubuntu + # versions: + # - xenial + # - bionic galaxy_tags: - system - cloud @@ -23,9 +23,10 @@ galaxy_info: - amazon - ec2 -dependencies: - - role: accelize.xilinx_xrt - when: aws_fpga_xrt | bool - vars: - xilinx_xrt_aws: true - xilinx_xrt_version: 2018.3 +dependencies: [] + # TODO: Currently work only on CentOS 7 with a specific XRT package + #- role: accelize.xilinx_xrt + # when: aws_fpga_xrt | bool + # vars: + # xilinx_xrt_aws: true + # xilinx_xrt_version: 2018.3 diff --git a/tasks/main.yml b/tasks/main.yml index 20b9cd3..9fdcc5a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -32,7 +32,7 @@ delay: 1 when: not libfpga_mgmt.stat.exists -- name: Ensure AWS FPGA build dependencies are present [Debian] +- name: Ensure AWS FPGA build dependencies are present apt: name: - build-essential @@ -42,7 +42,7 @@ delay: 1 when: ansible_os_family == 'Debian' and not libfpga_mgmt.stat.exists -- name: Ensure AWS FPGA build dependencies are present [RedHat] +- name: Ensure AWS FPGA build dependencies are present yum: name: - "@Development tools" @@ -64,7 +64,7 @@ executable: /bin/bash when: not libfpga_mgmt.stat.exists -- name: Ensure AWS FPGA driver build dependencies are present [RedHat] +- name: Ensure AWS FPGA driver build dependencies are present package: name: - "kernel-devel-{{ ansible_kernel }}" @@ -75,7 +75,7 @@ when: "aws_fpga_driver != '' and ansible_os_family == 'RedHat' and not libfpga_mgmt.stat.exists" -- name: Ensure AWS FPGA driver build dependencies are present [Debian] +- name: Ensure AWS FPGA driver build dependencies are present package: name: - "linux-headers-{{ ansible_kernel }}" @@ -100,6 +100,36 @@ - "/usr/sbin/modprobe {{ aws_fpga_driver }}" when: aws_fpga_driver != '' and not libfpga_mgmt.stat.exists +- name: Download xrt/xrt-aws packages + get_url: + url: "{{ s3_dev_ami_url }}{{ aws_xrt_package }}-{{ item }}.rpm" + dest: "{{ aws_fpga_src.path }}/{{ aws_xrt_package }}-{{ item }}.rpm" + with_items: + - xrt + - aws + retries: 10 + delay: 1 + when: (aws_fpga_xrt | bool) and not libfpga_mgmt.stat.exists + +- name: Ensure xrt/xrt-aws packages dependencies are present + package: + name: + - "kernel-devel-{{ ansible_kernel }}" + - epel-release + state: present + retries: 10 + delay: 1 + when: (aws_fpga_xrt | bool) and not libfpga_mgmt.stat.exists + +- name: Ensure xrt/xrt-aws packages are installed + yum: + name: "{{ aws_fpga_src.path }}/{{ aws_xrt_package }}-{{ item }}.rpm" + state: present + with_items: + - xrt + - aws + when: (aws_fpga_xrt | bool) and not libfpga_mgmt.stat.exists + - name: Clean up AWS FPGA temporary directory file: path: "{{ aws_fpga_src.path }}"