Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplifying Third party libraries availability #2

Open
saatvikshah opened this issue Jan 24, 2021 · 1 comment
Open

Simplifying Third party libraries availability #2

saatvikshah opened this issue Jan 24, 2021 · 1 comment

Comments

@saatvikshah
Copy link

Since quick-bench does not support including 3rd party libraries(like Godbolt does) via github links(FredTingaud/quick-bench-back-end#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:

  • ssh into a container corresponding to the compiler I want to benchmark with(eg. fredtingaud/quick-bench:clang-10.0), build my 3rd party dependency there and then run ./quick-bench.
  • Similar to the above, build a new Dockerfile using fredtingaud/quick-bench:clang-10.0 as a base image and have RUN <steps to clone and build my 3rd party library> as a command. I'll also need to set the built image name and tag appropriately.

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
Copy link
Owner

FredTingaud commented Feb 3, 2021

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants