-
Notifications
You must be signed in to change notification settings - Fork 1
Add fpga-rsu role to install fpga packages #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ratailor
wants to merge
1
commit into
redhat-openstack:master
Choose a base branch
from
ratailor:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --- | ||
| # defaults file for fpga-rsu | ||
| fpga_rsu_driver_dir: '/usr/share/opae' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| --- | ||
| # handlers file for fpga-rsu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| galaxy_info: | ||
| author: your name | ||
| description: your role description | ||
| company: your company (optional) | ||
|
|
||
| # If the issue tracker for your role is not on github, uncomment the | ||
| # next line and provide a value | ||
| # issue_tracker_url: http://example.com/issue/tracker | ||
|
|
||
| # Choose a valid license ID from https://spdx.org - some suggested licenses: | ||
| # - BSD-3-Clause (default) | ||
| # - MIT | ||
| # - GPL-2.0-or-later | ||
| # - GPL-3.0-only | ||
| # - Apache-2.0 | ||
| # - CC-BY-4.0 | ||
| license: license (GPL-2.0-or-later, MIT, etc) | ||
|
|
||
| min_ansible_version: 2.9 | ||
|
|
||
| # If this a Container Enabled role, provide the minimum Ansible Container version. | ||
| # min_ansible_container_version: | ||
|
|
||
| # | ||
| # Provide a list of supported platforms, and for each platform a list of versions. | ||
| # If you don't wish to enumerate all versions for a particular platform, use 'all'. | ||
| # To view available platforms and versions (or releases), visit: | ||
| # https://galaxy.ansible.com/api/v1/platforms/ | ||
| # | ||
| # platforms: | ||
| # - name: Fedora | ||
| # versions: | ||
| # - all | ||
| # - 25 | ||
| # - name: SomePlatform | ||
| # versions: | ||
| # - all | ||
| # - 1.0 | ||
| # - 7 | ||
| # - 99.99 | ||
|
|
||
| galaxy_tags: [] | ||
| # List tags for your role here, one per line. A tag is a keyword that describes | ||
| # and categorizes the role. Users find roles by searching for tags. Be sure to | ||
| # remove the '[]' above, if you add tags to this list. | ||
| # | ||
| # NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
| # Maximum 20 tags per role. | ||
|
|
||
| dependencies: [] | ||
| # List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
| # if you add dependencies to this list. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| --- | ||
| # Copyright 2019 Red Hat, Inc. | ||
| # All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| # not use this file except in compliance with the License. You may obtain | ||
| # a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| # License for the specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| - name: Fail if fpga_rsu_driver_pkg_url is undefined and empty | ||
| fail: | ||
| msg: "fpga_rsu_driver_pkg_url is a mandatory variable" | ||
| when: | ||
| - not (( fpga_rsu_driver_pkg_url is defined) and (fpga_rsu_driver_pkg_url | length > 0)) | ||
|
|
||
| - name: Create fpga driver package directory if not exist | ||
| file: | ||
| path: "{{ fpga_rsu_driver_dir }}" | ||
| state: directory | ||
| mode: 0755 | ||
|
|
||
| - name: Copy and untar FPGA driver tarball | ||
| block: | ||
| - name: Set fact for rpm tarball name | ||
| set_fact: | ||
| fpga_rsu_tarball_name: "{{ fpga_rsu_driver_pkg_url | basename }}" | ||
|
|
||
| - name: Copy fpga driver tarball | ||
| copy: | ||
| src: "{{ fpga_rsu_driver_pkg_url }}" | ||
| dest: "{{ fpga_rsu_driver_dir }}/{{ fpga_rsu_tarball_name }}" | ||
| failed_when: false | ||
|
|
||
| - name: untar fpga driver tarball | ||
| unarchive: | ||
| src: "{{ fpga_rsu_driver_dir }}/{{ fpga_rsu_tarball_name }}" | ||
| dest: "{{ fpga_rsu_driver_dir }}" | ||
| register: fpga_driver_tarball_untar | ||
| failed_when: false | ||
|
|
||
| - name: Check and remove opae packages if already installed | ||
| block: | ||
| - name: Check whether opae package already installed or not | ||
| shell: |- | ||
| set -o pipefail | ||
| rpm -qa | grep opae | ||
| register: rpm_opae_installed_check | ||
| ignore_errors: true | ||
|
|
||
| - name: remove previous opae packages | ||
| shell: | ||
| rpm -e "{{ rpm_opae_installed_check.stdout_lines | join(' ') }}" | ||
| register: old_opae_packages_removed | ||
| when: rpm_opae_installed_check.rc == 0 | ||
| ignore_errors: true | ||
|
|
||
| - name: Install packages and verify installation | ||
| block: | ||
| - name: setting fact for fpga driver rpm directory | ||
| set_fact: | ||
| fpga_driver_rpm_dir: "{{ fpga_rsu_driver_dir }}/{{ fpga_rsu_tarball_name | splitext | first | splitext | first }}" | ||
|
|
||
| - name: Setting fact for fpga install shell script | ||
| shell: |- | ||
| set -o pipefail | ||
| ls "{{ fpga_driver_rpm_dir }}" | grep *.sh | ||
| args: | ||
| chdir: "{{ fpga_driver_rpm_dir }}" | ||
| register: fpga_driver_install_script | ||
|
|
||
| - name: Install fpga drivers | ||
| shell: | ||
| "{{ fpga_driver_install_script }}" -y | ||
| args: | ||
| chdir: "{{ fpga_driver_rpm_dir }}" | ||
| register: opae_packages_installed | ||
| when: old_opae_packages_removed.rc == 0 | ||
|
|
||
| - name: Fail when OPAE FPGA package installation failed | ||
| fail: | ||
| msg: "OPAE FPGA package installation failed." | ||
| when: opae_packages_installed.rc != 0 | ||
|
|
||
| - name: Verify opae and intel packages installed | ||
| shell: |- | ||
| set -o pipefail | ||
| rpm -qa | grep 'opae' | ||
| when: opae_packages_installed.rc == 0 | ||
|
|
||
| - name: Verify opae driver installation | ||
| shell: |- | ||
| set -o pipefail | ||
| lsmod | grep fpga | ||
| lsmod | grep pac_n3000_net | ||
| register: verify_opae_driver | ||
|
|
||
| - name: Verify module is loaded in kernel and update flash | ||
| block: | ||
| - name: Verify linux has enumerated Intel FPGA PAC n3000 FPGA management Engine | ||
| shell: |- | ||
| set -o pipefail | ||
| lspci | grep 0b30 | ||
| register: check_linux_enumerated_fpga_mgmt_engine | ||
|
|
||
| - name: Fail if opae driver installation failed | ||
| fail: | ||
| msg: >- | ||
| OPAE driver installation failed. Either module is not loaded in kernel or | ||
| linux failed to enumerated Intel FPGA PAC n3000 FPGA management Engine. | ||
| when: verify_opae_driver.rc != 0 or check_linux_enumerated_fpga_mgmt_engine.rc != 0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| --- | ||
| # # Copyright 2019 Red Hat, Inc. | ||
| # All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| # not use this file except in compliance with the License. You may obtain | ||
| # a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| # License for the specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
| # tasks file for fpga-rsu | ||
| - name: check node has accelerator card installed | ||
| shell: |- | ||
| set -o pipefail | ||
| lspci | grep accelerators | ||
| register: accelerator_card_installed | ||
|
|
||
| - name: Install FPGA packages | ||
| import_role: | ||
| name: fpga-rsu | ||
| tasks_from: install_fpga_packages.yml | ||
| when: accelerator_card_installed.rc == 0 | ||
|
|
||
| - name: Fail when accelerator card is not installed | ||
| fail: | ||
| msg: FPGA hardware accelerator card is not installed. | ||
| when: accelerator_card_installed.rc != 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| localhost | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| - hosts: localhost | ||
| remote_user: root | ||
| roles: | ||
| - fpga-rsu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --- | ||
| # vars file for fpga-rsu | ||
| fpga_rsu_driver_pkg_url: "" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, a few comments:
Depending on the currently installed firmware version, the upgrade procedure is different.
see https://www.intel.com/content/www/us/en/programmable/documentation/xgz1560360700260.html#hpo1573151952874
There are a number of checks that should be performed before firmware upgrade. From the same document above:
Note: These upgrades erase the Static Region (SR) root entry hash and any CSK cancellation IDs previously programmed in the flash of the Intel® FPGA PAC N3000.
Remember:
Stop any service or daemon accessing the FPGA or XL710 before updating the Intel® FPGA PAC N3000 such as fpgad.
PLDM requests may return stale data. Avoid Host PLDM requests.
Ensure cooling requirements are met. The server can reboot if the FPGA Core temperature exceeds 95°C. For more information, refer to Cooling Requirements.
Tip: Before you proceed with upgrade, ensure that the FPGA Die Temperature is below 80°C using the following command:
sudo fpgainfo bmc
If it is higher than the threshold value, increase the fan speed to improve thermal condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, perhaps its good to only attempt to perform RPM installation if we know the packages work on RHEL-8.
The current packages work on RHEL-7 only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Marcelo for review.
We are only trying to install rpm in this and I will update the README to improve doc and update the pull-request.