mimalloc-bench icon indicating copy to clipboard operation
mimalloc-bench copied to clipboard

Provide Dockerfile or ready-made container on dockerhub

Open lhog opened this issue 3 years ago • 9 comments

Hi!

Trying to build / bench mimalloc-bench inside a pristine ubuntu:20.04 container and I'm seeing the ./build-bench-env.sh packages lean is not providing enough standard packages to kickstart from a bare distribution like containerized ubuntu.

During the course of installation I had to install ~10 extra packages and yet I didn't manage to run bench properly. Perhaps a Dockerfile or a pre-built container on dockerhub could ease the process for those not wanting to "pollute" the main OS with lots of packages and external software.

lhog avatar Feb 02 '22 18:02 lhog

What packages did you need to install?

jvoisin avatar Feb 02 '22 21:02 jvoisin

As simple as make or gawk or time. I can provide a full log tomorrow

lhog avatar Feb 02 '22 21:02 lhog

It's weird because we do test mimalloc-bench on various distributions in our CI, and we don't have dependencies issues: https://github.com/daanx/mimalloc-bench/blob/master/.github/workflows/all.yml

jvoisin avatar Feb 03 '22 09:02 jvoisin

github worker node is not that barren as ubuntu container.

So here's I'm delivering the promised. I'll be posting the logs and commenting what I'm trying to do to rectify the issues as I go:

2. docker run -it ubuntu:20.04
root@9241ca857197:/# git clone https://github.com/daanx/mimalloc-bench
bash: git: command not found

Okay this is expected. apt update && apt install git Cloned.

./build-bench-env.sh all
<....>
./build-bench-env.sh: line 367: sudo: command not found

Ok this is expected too. Although the script could check if it's run by superuser (it's the case in the container by default) and not ask for sudo. Anyway apt install sudo

  1. Continuing with ./build-bench-env.sh all
./build-bench-env.sh: line 331: curl: command not found
./build-bench-env.sh: line 331: gpg: command not found

apt install curl gpg 4. .... ./build-bench-env.sh: line 382: make: command not found apt install make 5. ....

HEAD is now at f7c6fb6 bump version to 2.9.1
Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory

apt install automake 6. ....

HEAD is now at 651fe93 Fail more loudly when handling an allocated size of 0.
./build-bench-env.sh: line 467: gawk: command not found

apt install gawk 7. ....

--------------------------------------------
patch shbench
--------------------------------------------

/mimalloc-bench/bench/shbench /mimalloc-bench
failed: Connection refused.

Hmm no idea, just re-run the same script again. 8. ....

/mimalloc-bench/extern/tcg already exists; no need to git clone
M       tcmalloc/BUILD
M       tcmalloc/internal/BUILD
M       tcmalloc/testing/BUILD
M       tcmalloc/variants.bzl
HEAD is now at 651fe93 Fail more loudly when handling an allocated size of 0.
ERROR: /mimalloc-bench/extern/tcg/tcmalloc/BUILD:104:11: //tcmalloc:tcmalloc_deprecated_perthread: no such attribute 'linkshared' in 'cc_library' rule
ERROR: error loading package 'tcmalloc': Package 'tcmalloc' contains errors
INFO: Elapsed time: 0.206s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)

Hmm again. 9. Rerunning with jemalloc only and lean benchmark ./build-bench-env.sh je lean

./build-bench-env.sh: line 693: column: command not found

apt install bsdmainutils 10. Finally it has built. Not in the complete form, but let's try to bench at least jemalloc.

mkdir -p out/bench
cd out/bench
../../bench.sh je lean
<...>
Scanning dependencies of target clean-olean
Built target clean-olean
/mimalloc-bench/extern/lean/library /mimalloc-bench/out/bench
../../bench.sh: line 478: -a: command not found

/mimalloc-bench/out/bench
sed -n 478p ../../bench.sh
       $timecmd -a -o $benchres -f "$1${benchfill:${#1}} $2${allocfill:${#2}} %E %M %U %S %F %R" /usr/bin/env $3 $4 < "$infile" > "$outfile";;

This is due to "time" missing apt install time 11. Finally lean benchmark completed on jemalloc. Other combinations show similar issues, some of them I tried yesterday and couldn't solve the issues.

lhog avatar Feb 03 '22 10:02 lhog

./build-bench-env.sh packages should just work™

jvoisin avatar Feb 03 '22 12:02 jvoisin

Anything else we could/should do to get this issue closed?

jvoisin avatar May 09 '22 15:05 jvoisin

I haven't tested since the initial report.

We have should just work™ claim vs the reality I faced and documented. Up to you to decide which one to trust.

lhog avatar May 09 '22 18:05 lhog

Can you please re-test then?

jvoisin avatar May 10 '22 11:05 jvoisin

I'll do my best, although I have lost access to my personal PC for next couple of months.

lhog avatar May 10 '22 20:05 lhog