Enable Z3 on the gate
Z3 is now enabled on the gate for non ha jobs. A compiled version of Z3 is used. This commit also correct installation paths bugs for Z3 and adds an uninstall to clean.sh. Change-Id: I81e515003a3edf443ec1a9f7a35232fc7121207a
This commit is contained in:
parent
0be3c4b99e
commit
8f075371e4
@ -102,6 +102,10 @@ function _configure_tempest {
|
|||||||
iniset $TEMPEST_CONFIG service_available $service "False"
|
iniset $TEMPEST_CONFIG service_available $service "False"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
# Notify tempest if z3 is enabled.
|
||||||
|
if [[ $ENABLE_CONGRESS_Z3 == "True" ]] ; then
|
||||||
|
iniset $TEMPEST_CONFIG congressz3 enabled "True"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function _configure_service {
|
function _configure_service {
|
||||||
@ -144,17 +148,18 @@ function _install_z3 {
|
|||||||
z3file="${z3rel}-x64-${os_VENDOR,,}-${os_RELEASE}"
|
z3file="${z3rel}-x64-${os_VENDOR,,}-${os_RELEASE}"
|
||||||
url="https://github.com/Z3Prover/z3/releases/download/${z3rel}/${z3file}.zip"
|
url="https://github.com/Z3Prover/z3/releases/download/${z3rel}/${z3file}.zip"
|
||||||
if [ ! -f "${z3file}.zip" ]; then
|
if [ ! -f "${z3file}.zip" ]; then
|
||||||
wget "${url}" "${z3file}.zip" || true
|
wget "${url}" || true
|
||||||
fi
|
fi
|
||||||
if [ ! -f "${z3file}.zip" ]; then
|
if [ ! -f "${z3file}.zip" ]; then
|
||||||
echo "Failed to download z3 release ${USE_Z3_RELEASE} for ${os_VENDOR}-${os_RELEASE}"
|
echo "Failed to download z3 release ${USE_Z3_RELEASE} for ${os_VENDOR}-${os_RELEASE}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
unzip -o -f "${z3file}.zip" "${z3file}/bin/python/z3/*" "${z3file}/bin/libz3.so"
|
unzip -o "${z3file}.zip" "${z3file}/bin/python/z3/*" "${z3file}/bin/libz3.so"
|
||||||
dist_dir=$($PYTHON -c "import site; print(site.getsitepackages()[0])")
|
dist_dir=$($PYTHON -c "import site; print(site.getsitepackages()[0])")
|
||||||
sudo cp -r "${z3file}/bin/python/z3" "${dist_dir}"
|
sudo cp -r "${z3file}/bin/python/z3" "${dist_dir}"
|
||||||
sudo mkdir -p "${dist_dir}/z3/lib"
|
sudo mkdir -p "${dist_dir}/z3/lib"
|
||||||
sudo cp "${z3file}/bin/libz3.so" "${dist_dir}/z3/lib/libz3.so"
|
sudo cp "${z3file}/bin/libz3.so" /usr/lib
|
||||||
|
sudo ln -s /usr/lib/libz3.so "${dist_dir}/z3/lib/libz3.so"
|
||||||
popd
|
popd
|
||||||
else
|
else
|
||||||
git_clone $CONGRESS_Z3_REPO $CONGRESS_Z3_DIR $CONGRESS_Z3_BRANCH
|
git_clone $CONGRESS_Z3_REPO $CONGRESS_Z3_DIR $CONGRESS_Z3_BRANCH
|
||||||
@ -167,6 +172,21 @@ function _install_z3 {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _uninstall_z3 {
|
||||||
|
if [[ $USE_Z3_RELEASE != None ]]; then
|
||||||
|
sudo rm /usr/lib/libz3.so
|
||||||
|
dist_dir=$($PYTHON -c "import site; print(site.getsitepackages()[0])")
|
||||||
|
# Double check we are removing what we must remove.
|
||||||
|
if [ -f "${dist_dir}/z3/z3core.py" ]; then
|
||||||
|
sudo rm -rf "${dist_dir}/z3"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
pushd $CONGRESS_Z3_DIR
|
||||||
|
cd build
|
||||||
|
sudo make uninstall
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
}
|
||||||
# create_congress_cache_dir() - Part of the _congress_setup_keystone() process
|
# create_congress_cache_dir() - Part of the _congress_setup_keystone() process
|
||||||
function create_congress_cache_dir {
|
function create_congress_cache_dir {
|
||||||
# Create cache dir
|
# Create cache dir
|
||||||
@ -286,6 +306,9 @@ function stop_congress {
|
|||||||
# runs that would need to clean up.
|
# runs that would need to clean up.
|
||||||
function cleanup_congress {
|
function cleanup_congress {
|
||||||
sudo rm -rf $CONGRESS_AUTH_CACHE_DIR $CONGRESS_CONF_DIR
|
sudo rm -rf $CONGRESS_AUTH_CACHE_DIR $CONGRESS_CONF_DIR
|
||||||
|
if [[ $ENABLE_CONGRESS_Z3 == "True" ]] ; then
|
||||||
|
_uninstall_z3
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
# To deploy congress as multi-process (api, pe, datasources)
|
# To deploy congress as multi-process (api, pe, datasources)
|
||||||
CONGRESS_MULTIPROCESS_DEPLOYMENT=True
|
CONGRESS_MULTIPROCESS_DEPLOYMENT=True
|
||||||
CONGRESS_EXPOSE_ENCRYPTION_KEY_FOR_TEST=True
|
CONGRESS_EXPOSE_ENCRYPTION_KEY_FOR_TEST=True
|
||||||
|
ENABLE_CONGRESS_Z3=True
|
||||||
|
USE_Z3_RELEASE=4.7.1
|
||||||
TEMPEST_PLUGINS='/opt/stack/new/congress-tempest-plugin /opt/stack/new/telemetry-tempest-plugin /opt/stack/new/murano-tempest-plugin /opt/stack/new/heat-tempest-plugin /opt/stack/new/mistral-tempest-plugin /opt/stack/new/monasca-tempest-plugin'
|
TEMPEST_PLUGINS='/opt/stack/new/congress-tempest-plugin /opt/stack/new/telemetry-tempest-plugin /opt/stack/new/murano-tempest-plugin /opt/stack/new/heat-tempest-plugin /opt/stack/new/mistral-tempest-plugin /opt/stack/new/monasca-tempest-plugin'
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
@ -45,6 +45,8 @@
|
|||||||
# To deploy congress as multi-process (api, pe, datasources)
|
# To deploy congress as multi-process (api, pe, datasources)
|
||||||
CONGRESS_MULTIPROCESS_DEPLOYMENT=True
|
CONGRESS_MULTIPROCESS_DEPLOYMENT=True
|
||||||
CONGRESS_EXPOSE_ENCRYPTION_KEY_FOR_TEST=True
|
CONGRESS_EXPOSE_ENCRYPTION_KEY_FOR_TEST=True
|
||||||
|
ENABLE_CONGRESS_Z3=True
|
||||||
|
USE_Z3_RELEASE=4.7.1
|
||||||
TEMPEST_PLUGINS='/opt/stack/new/congress-tempest-plugin /opt/stack/new/murano-tempest-plugin /opt/stack/new/heat-tempest-plugin'
|
TEMPEST_PLUGINS='/opt/stack/new/congress-tempest-plugin /opt/stack/new/murano-tempest-plugin /opt/stack/new/heat-tempest-plugin'
|
||||||
EOF
|
EOF
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
Loading…
Reference in New Issue
Block a user