diff --git a/README.md b/README.md index a7b1316..cd8b23b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ An AWS F1 instance is required as target host for this role. The role requires to be run as root on the target host. -**accelize.xilinx_xrt** role if required to install Xilinx XRT. +CentOS 7 is recommanded since it the only one officially tested by Xilinx/AWS. + +**accelize.xilinx_xrt** role if required to install Xilinx XRT on non CentOS 7 +systems. Role Variables -------------- @@ -30,7 +33,7 @@ Role Variables * **aws_fpga_xrt**: If `true`, also install Xilinx XRT. Default to `true`. * **xilinx_xrt_version**: If *aws_fpga_xrt* is `true`, Xilinx XRT version to install. - Default to `2018.3`. + Default to `2019.1`. * **aws_fpga_driver**: FPGA driver name. If specified, install and enable the specified Linux kernel driver. See [AWS FPGA linux kernel drivers](https://github.com/aws/aws-fpga/tree/master/sdk/linux_kernel_drivers) for the list of available drivers. diff --git a/defaults/main.yml b/defaults/main.yml index 606ee5d..941f36e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,7 +10,12 @@ 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_Patch2/" -aws_xrt_package: xrt_201830.2.1.0_7.6.1810 +# XRT CentOS 7 packages from AWS Developper AMI +xilinx_xrt_version: '2019.1' +xilinx_xrt_packages: + '2019.1': 1.7.0/Patches/XRT_2019_1_RC2/xrt_201910.2.2.0_7.6.1810 + '2018.3': 1.6.0/Patches/XRT_2018_3_RC5/xrt_201830.2.1.0_7.6.1810 + '2018.2': 1.5.0/Patches/XRT_2018_2_XDF_RC5/xrt_201802.2.1.0_7.5.1804 + +s3_dev_ami_url: "https://aws-fpga-developer-ami.s3.amazonaws.com/" +xrt_package: "{{ xilinx_xrt_packages[xilinx_xrt_version | string] }}" diff --git a/meta/main.yml b/meta/main.yml index 77c1001..edbe0e7 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,10 +23,11 @@ galaxy_info: - amazon - ec2 -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 +dependencies: + - role: accelize.xilinx_xrt + when: + - aws_fpga_xrt | bool + # AWS provides special packages for CentOS 7 + - ansible_os_family == 'Debian' + vars: + xilinx_xrt_aws: true diff --git a/tasks/main.yml b/tasks/main.yml index 6f02253..c9b59f2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -66,6 +66,37 @@ executable: /bin/bash when: not libfpga_mgmt.stat.exists +- name: Download xrt/xrt-aws packages from AWS FPGA developper AMI + get_url: + url: "{{ s3_dev_ami_url }}{{ xrt_package }}-{{ item }}.rpm" + dest: "{{ aws_fpga_src.path }}/{{ xrt_package | basename }}-{{ 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 }}" + - "kernel-headers-{{ 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 }}/{{ xrt_package | basename }}-{{ item }}.rpm" + state: present + with_items: + - xrt + - aws + when: (aws_fpga_xrt | bool) and not libfpga_mgmt.stat.exists + - name: Ensure AWS FPGA driver build dependencies are present package: name: @@ -103,38 +134,6 @@ - "/usr/sbin/modprobe {{ aws_fpga_driver }}" when: aws_fpga_driver != '' and not libfpga_mgmt.stat.exists -# Force the use of as specific XRT, because it is the only version that work -- 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 }}" - - "kernel-headers-{{ 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 }}"