From dd8057211cba8dcc11b5e0bce63afaec90bc62a2 Mon Sep 17 00:00:00 2001 From: Shaohe Feng Date: Wed, 10 Apr 2019 07:23:07 +0000 Subject: [PATCH] add knob for OPAE install Currently, OPAE is so picky about the OS. Not every developer need OPAE. In order to make them happy, add knot for OPAE install. Change-Id: Ief2c75c4bc80bb7b01a812fd6f18abd6a3acfcc5 --- devstack/lib/opae | 2 +- devstack/plugin.sh | 8 +++++--- devstack/settings | 1 + doc/source/contributor/devstack_setup.rst | 19 +++++++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/devstack/lib/opae b/devstack/lib/opae index f590dca5..361f026c 100644 --- a/devstack/lib/opae +++ b/devstack/lib/opae @@ -21,7 +21,6 @@ function setup_distro_vars { [[ $os_RELEASE == "16.04" ]] && PKG_EXT="deb" fi } -setup_distro_vars function install_opae_pkg { local pkg=$1 @@ -46,6 +45,7 @@ function install_opae_pkg { } function install_opae_packages { + setup_distro_vars local libs_url="$OPAE_GITHUB/$OPAE_LIBS.$PKG_EXT" local devel_url="$OPAE_GITHUB/$OPAE_DEVEL.$PKG_EXT" diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 1e9fff01..86b6daa1 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -14,9 +14,9 @@ if is_service_enabled cyborg-api cyborg-cond; then # stack/pre-install - Called after (OS) setup is complete and before # project source is installed echo_summary "Installing additional Cyborg packages" - if install_opae_packages; then + if [[ "$OPAE_INSTALL_ENABLE" == "True" ]] && install_opae_packages; then echo_summary "INFO: Additional Cyborg packages installed" - else + elif [[ "$OPAE_INSTALL_ENABLE" == "True" ]]; then echo "WARNING: Failed to install additional Cyborg packages" fi elif [[ "$2" == "install" ]]; then @@ -56,6 +56,8 @@ if is_service_enabled cyborg-api cyborg-cond; then # clean - Called by clean.sh before other services are cleaned, but after # unstack.sh has been called. cleanup_cyborg - uninstall_opae_packages + if [[ "$OPAE_INSTALL_ENABLE" == "True" ]]; then + uninstall_opae_packages + fi fi fi diff --git a/devstack/settings b/devstack/settings index df264a4b..72ed5c58 100644 --- a/devstack/settings +++ b/devstack/settings @@ -3,6 +3,7 @@ enable_service cyborg cyborg-api cyborg-cond cyborg-agent # OPAE settings # OPAE packages are not yet upstreamed into OS repos # We need to download them from OPAE releases page on GitHub +OPAE_INSTALL_ENABLE=$(trueorfalse True OPAE_INSTALL_ENABLE) OPAE_VERSION=${OPAE_VERSION:-"1.1.0-2"} OPAE_GITHUB=${OPAE_GITHUB:-"https://github.com/OPAE/opae-sdk/releases/download/$OPAE_VERSION"} OPAE_DEVEL_PKG=${OPAE_DEVEL_PKG:-"opae-devel"} diff --git a/doc/source/contributor/devstack_setup.rst b/doc/source/contributor/devstack_setup.rst index 4ae339f2..e3d0a104 100644 --- a/doc/source/contributor/devstack_setup.rst +++ b/doc/source/contributor/devstack_setup.rst @@ -123,6 +123,25 @@ Enable services If you got version conflicts, please set `PIP_UPGRADE` to `True` in local.conf +Disable OPAE install +>>>>>>>>>>>>>>>>>>>> + +:: + + OPAE_INSTALL_ENABLE=false + +- By default OPAE_INSTALL_ENABLE is True. + +- You need to set OPAE_INSTALL_ENABLE as false explicitly, + if not need OPEA enviroment. + +- At present OPAE depends on OS verson heavily. + +.. note:: + + If you do not want to try Intel FPGA, you can disable OPAE install. Then you + do not depend on specific OS verson. + Run DevStack ------------