Skip to content

Commit

Permalink
Merge pull request #511 from infosiftr/armv8.2-a
Browse files Browse the repository at this point in the history
Add a warning for ARMv8.2-A
  • Loading branch information
yosifkit committed Nov 17, 2021
2 parents 71daea7 + 1edf40c commit ad1f434
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 50 deletions.
40 changes: 30 additions & 10 deletions 4.0/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 30 additions & 10 deletions 4.2/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 30 additions & 10 deletions 4.4/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 30 additions & 10 deletions 5.0/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 30 additions & 10 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,36 @@ if [[ "$originalArgOne" == mongo* ]] && [ "$(id -u)" = '0' ]; then
exec gosu mongodb "$BASH_SOURCE" "$@"
fi

if dpkgArch="$(dpkg --print-architecture)" && [ "$dpkgArch" = 'amd64' ] && ! grep -qE '^flags.* avx( .*|$)' /proc/cpuinfo; then
# https://github.com/docker-library/mongo/issues/485#issuecomment-891991814
{
echo
echo 'WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!'
echo ' see https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2'
echo ' see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814'
echo
} >&2
fi
dpkgArch="$(dpkg --print-architecture)"
case "$dpkgArch" in
amd64) # https://github.com/docker-library/mongo/issues/485#issuecomment-891991814
if ! grep -qE '^flags.* avx( .*|$)' /proc/cpuinfo; then
{
echo
echo 'WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!'
echo ' see https://jira.mongodb.org/browse/SERVER-54407'
echo ' see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2'
echo ' see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814'
echo
} >&2
fi
;;

arm64) # https://github.com/docker-library/mongo/issues/485#issuecomment-970864306
# https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features
# http://javathunderx.blogspot.com/2018/11/cheat-sheet-for-cpuinfo-features-on.html
if ! grep -qE '^Features.* (fphp|dcpop|sha3|sm3|sm4|asimddp|sha512|sve)( .*|$)' /proc/cpuinfo; then
{
echo
echo 'WARNING: MongoDB 5.0+ requires ARMv8.2-A or higher, and your current system does not appear to implement any of the common features for that!'
echo ' see https://jira.mongodb.org/browse/SERVER-55178'
echo ' see also https://en.wikichip.org/wiki/arm/armv8#ARMv8_Extensions_and_Processor_Features'
echo ' see also https://github.com/docker-library/mongo/issues/485#issuecomment-970864306'
echo
} >&2
fi
;;
esac

# you should use numactl to start your mongod instances, including the config servers, mongos instances, and any clients.
# https://docs.mongodb.com/manual/administration/production-notes/#configuring-numa-on-linux
Expand Down

0 comments on commit ad1f434

Please sign in to comment.