diff --git a/images/benchmark-passmark/Dockerfile b/images/benchmark-passmark/Dockerfile index 430f7da..9f63805 100644 --- a/images/benchmark-passmark/Dockerfile +++ b/images/benchmark-passmark/Dockerfile @@ -37,6 +37,7 @@ RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \ RUN chmod +x /usr/local/bin/pt_linux +ADD passmark.sh /usr/local/bin/passmark.sh # PassMark expects a terminal ENV TERM=xterm -CMD ["bash", "-c", "nice -n -20 /usr/local/bin/pt_linux -r 3 1>&2; cat results_all.yml"] +CMD /usr/local/bin/passmark.sh diff --git a/images/benchmark-passmark/passmark.sh b/images/benchmark-passmark/passmark.sh new file mode 100755 index 0000000..36a7b90 --- /dev/null +++ b/images/benchmark-passmark/passmark.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +available_memory=$(LC_ALL=C free -m | awk '/^Mem:/ {print $7}') + +# on small-mem machines run the CPU suite only +# -r, -R enum enable autorun, enum values are: +# 1 - CPU Suite only +# 2 - Memory Suite only +# 3 - All Suites +if [ "$available_memory" -lt 512 ]; then + nice -n -20 /usr/local/bin/pt_linux -r 1 1>&2; cat results_cpu.yml +else + nice -n -20 /usr/local/bin/pt_linux -r 3 1>&2; cat results_all.yml +fi