Skip to content
This repository has been archived by the owner on Jan 13, 2020. It is now read-only.

Commit

Permalink
Fix Github limit and variable name.
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Jul 22, 2019
1 parent a32717c commit aab8a1e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@ The role requires to be run as root on the target host.
Role Variables
--------------

* **aws_fpga_allow_non_root**: If `true`, allow FPGA devices access to users in the group specified by *aws_fpga_sdk_group*. Default to `false`.
* **aws_fpga_sdk_group**: Name of the group of users that can access to FPGA devices. Default to `fpgauser`. No effect if *aws_fpga_allow_non_root* is `false`.
* **aws_fpga_sdk_override_group**: If true, do not raise error if the group specified by *aws_fpga_sdk_group* already exists. Default to `false`. No effect if *aws_fpga_allow_non_root* is `false`.
* **aws_fpga_version**: AWS FPGA version; If not specified, use latest version available.

* **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.
* **aws_fpga_allow_non_root**: If `true`, allow FPGA devices access to users in the group specified by *aws_fpga_sdk_group*.
Default to `false`.
* **aws_fpga_sdk_group**: Name of the group of users that can access to FPGA devices.
Default to `fpgauser`.
No effect if *aws_fpga_allow_non_root* is `false`.
* **aws_fpga_sdk_override_group**: If true, do not raise error if the group specified by *aws_fpga_sdk_group* already exists.
Default to `false`. No effect if *aws_fpga_allow_non_root* is `false`.

* **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`.

* **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.
If *aws_fpga_xrt* is `true`, the XOCl driver shipped with XRT is installed.

* **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`.

Example Playbook
----------------
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ aws_fpga_sdk_override_group: false
aws_fpga_xrt: true

# FPGA driver to install
fpga_driver: ''
aws_fpga_driver: ''
26 changes: 9 additions & 17 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@
ternary('lib64','lib') }}/libfpga_mgmt.so"
register: libfpga_mgmt

- name: Find AWS FPGA release information
uri:
url: "https://api.github.com/repos/aws/aws-fpga/releases/\
{{ (fpga_driver_version is defined) | ternary('tags/','latest') }}\
{{ fpga_driver_version | default('') }}"
return_content: true
register: aws_sdk_release
retries: 10
delay: 1
when: not libfpga_mgmt.stat.exists

- name: Create AWS FPGA source temporary directory
tempfile:
state: directory
Expand All @@ -33,7 +22,8 @@

- name: Download and extract AWS FPGA release tarbal
unarchive:
src: "{{ aws_sdk_release.json.tarball_url }}"
src: "https://api.github.com/repos/aws/aws-fpga/tarball/\
{{ aws_fpga_version | default('') }}"
dest: "{{ aws_fpga_src.path }}"
remote_src: true
extra_opts: ['--strip-components=1']
Expand Down Expand Up @@ -82,7 +72,7 @@
state: present
retries: 10
delay: 1
when: "fpga_driver != '' and ansible_os_family == 'RedHat' and
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]
Expand All @@ -93,20 +83,22 @@
state: present
retries: 10
delay: 1
when: "fpga_driver != '' and ansible_os_family == 'Debian' and
when: "aws_fpga_driver != '' and ansible_os_family == 'Debian' and
not libfpga_mgmt.stat.exists"

- name: Build and install AWS FPGA driver
command: "{{ item }}"
args:
chdir: "{{ aws_fpga_src.path }}/sdk/linux_kernel_drivers/{{ fpga_driver }}"
chdir: "{{ aws_fpga_src.path }}/sdk/linux_kernel_drivers/\
{{ aws_fpga_driver }}"
environment:
# Required for XOCL
SDACCEL_DIR: "{{ aws_fpga_src.path }}/SDAccel"
with_items:
- /usr/bin/make -j
- /usr/bin/make install
- "/usr/sbin/modprobe {{ fpga_driver }}"
when: fpga_driver != '' and not libfpga_mgmt.stat.exists
- "/usr/sbin/modprobe {{ aws_fpga_driver }}"
when: aws_fpga_driver != '' and not libfpga_mgmt.stat.exists

- name: Clean up AWS FPGA temporary directory
file:
Expand Down

0 comments on commit aab8a1e

Please sign in to comment.