2
0

fix(install.sh): skip checking for sse4 2 flag if kvm was detected (#485)

This PR disables checking for the SSE4.2 flag, which may not be present if the server is running in a VM even if SSE4.2 is in fact available to use (ClickHouse/ClickHouse#20). The KVM check was obtained from a [comment](https://github.com/ClickHouse/ClickHouse/issues/20#issuecomment-226849297) in that issue.

If SSE4.2 is not actually available in the VM, then the installation script may fail in an unpredictable way. Perhaps we can add a keyword argument to the script to let the user decide if they want to skip the check.
This commit is contained in:
Mohamed Laradji 2020-05-09 13:10:08 -07:00 committed by GitHub
parent ad5b76fd29
commit 45320c6e86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,11 +65,15 @@ if [ "$RAM_AVAILABLE_IN_DOCKER" -lt "$MIN_RAM" ]; then
fi fi
#SSE4.2 required by Clickhouse (https://clickhouse.yandex/docs/en/operations/requirements/) #SSE4.2 required by Clickhouse (https://clickhouse.yandex/docs/en/operations/requirements/)
SUPPORTS_SSE42=$(docker run --rm busybox grep -c sse4_2 /proc/cpuinfo || :); # On KVM, cpuinfo could falsely not report SSE 4.2 support, so skip the check. https://github.com/ClickHouse/ClickHouse/issues/20#issuecomment-226849297
IS_KVM=$(docker run --rm busybox grep -c 'Common KVM processor' /proc/cpuinfo || :)
if (($IS_KVM == 0)); then
SUPPORTS_SSE42=$(docker run --rm busybox grep -c sse4_2 /proc/cpuinfo || :)
if (($SUPPORTS_SSE42 == 0)); then if (($SUPPORTS_SSE42 == 0)); then
echo "FAIL: The CPU your machine is running on does not support the SSE 4.2 instruction set, which is required for one of the services Sentry uses (Clickhouse). See https://git.io/JvLDt for more info." echo "FAIL: The CPU your machine is running on does not support the SSE 4.2 instruction set, which is required for one of the services Sentry uses (Clickhouse). See https://git.io/JvLDt for more info."
exit 1 exit 1
fi fi
fi
# Clean up old stuff and ensure nothing is working while we install/update # Clean up old stuff and ensure nothing is working while we install/update
# This is for older versions of on-premise: # This is for older versions of on-premise: