FredTingaud / bench-runner

Docker runner for build-bench
273 stars 32 forks source link

Simplifying Third party libraries availability #2

Open saatvikshah opened 3 years ago

saatvikshah commented 3 years ago

Since quick-bench does not support including 3rd party libraries(like Godbolt does) via github links(https://github.com/FredTingaud/quick-bench-back-end/issues/5), I was wondering what options existed to set this up locally?

Based on my understanding the way quick-bench works is to download the docker image from within a bench-runner image container corresponding to the compiler selected on the frontend locally by mounting docker.sock. So the only ways I can see to make a 3rd party library available is:

I'm curious if a simpler approach to this is possible? For example a way for the user to supply a the build step for the 3rd party library as a shell script and supported compilers to the ./quick-bench script and it set these up. Alternately implementing support for the issue mentioned above.

FredTingaud commented 3 years ago

Hi @saatvikshah , A simpler solution would be to run a command identical to the one in ./quick-bench without the finale ./start-quick-bench. Then you will be in the bench-runner container as ROOT. You can run apt update && apt install your-favorite-editor and edit the file run-docker to change the line that calls docker and $BUILD_COMMAND with a bunch of parameters. You can add your own parameters here, that will be passed to the compiler. You could pass additional -v to docker, to mount directories and -l to the compiler using the newly mounted directories:

    docker run --rm $ANNOTATE -v $INFILE:/home/builder/bench-file.cpp $MEMORY_LIMITS --cidfile=$CIDFILE -v $TARG_OUTFILE:/home/builder/bench.out -t fredtingaud/quick-bench:$COMPILER /bin/bash -c "./$BUILD_COMMAND $OPTIM $VERSION && $ANNOTATE_RECORD ./run $ANNOTATE_CMD"

could become something like

    docker run --rm $ANNOTATE -v/path/to/3rdparty:/libraries -v $INFILE:/home/builder/bench-file.cpp $MEMORY_LIMITS --cidfile=$CIDFILE -v $TARG_OUTFILE:/home/builder/bench.out -t fredtingaud/quick-bench:$COMPILER /bin/bash -c "./$BUILD_COMMAND $OPTIM $VERSION -L/libraries -lsome-lib && $ANNOTATE_RECORD ./run $ANNOTATE_CMD"