add a Docker image with benchmarking utilities#44
Conversation
|
This PR now has two docker images. tidb-sybench (just sysbench with our patch) and tidb-bench (designed to include many benchmarking tools). I have tested tidb-sysbench, and it is now available at gcr.io/pingcap-public/pingcap/tidb-sysbench |
| RUN apk add --virtual .build-deps git build-base automake autoconf libtool --update \ | ||
| && git clone https://github.com/akopytov/sysbench.git \ | ||
| && cd sysbench \ | ||
| && git checkout 1.0.17 \ |
There was a problem hiding this comment.
Make the version as an environment variable?
| && apk del .build-deps | ||
|
|
||
| # TiDB patch for sysbench data loading (prepare) | ||
| RUN apk add --virtual .build-deps wget \ |
There was a problem hiding this comment.
Why run apk add again? A wget to download the oltp_common.lua is enough.
There was a problem hiding this comment.
I think it is easy to apk add again if you need it later.
| && chmod +x /usr/local/share/sysbench/oltp_common.lua | ||
|
|
||
| RUN apk add mysql-client | ||
| RUN apk add bash |
There was a problem hiding this comment.
Why add bash in this docker image? The tidb bench script is not included in this image.
There was a problem hiding this comment.
I think I agree that these last two can be left out and put in tidb-bench so that this image is just the patched sysbench. It just depends if you want to attach to the container for debugging.
| @@ -0,0 +1,31 @@ | |||
| FROM alpine:3.9 | |||
There was a problem hiding this comment.
Do we need to make this a separate image?
There was a problem hiding this comment.
yes, because we patch sysbench. If we can get our patch upstream it won't really be needed.
| COPY --from=pingcap/tidb-sysbench /usr/local/bin/sysbench /usr/local/bin/sysbench | ||
| COPY --from=pingcap/tidb-sysbench /usr/local/share/sysbench /usr/local/share/sysbench | ||
|
|
||
| COPY --from=dmonakhov/alpine-fio /usr/local/bin/fio /usr/local/bin/fio |
There was a problem hiding this comment.
Can we just copy this binary to make it work? Is the fio a static binary or dynamically linked binary? From its Dockerfile I don't see any special instruction for static build.
There was a problem hiding this comment.
I haven't tested this yet.
|
|
||
| COPY --from=dmonakhov/alpine-fio /usr/local/bin/fio /usr/local/bin/fio | ||
|
|
||
| COPY --from=goycsb /go/src/github.com/pingcap/go-ycsb/bin/go-ycsb /go-ycsb/bin/go-ycsb |
There was a problem hiding this comment.
Also does this work in alpine? And maybe you can copy from pingcap/go-ycsb directly instead of build the go-ycsb yourself.
There was a problem hiding this comment.
I haven't tested this, but it should work. Copying from pingcap/go-ycsb creates additional fragility unless we define a contract for go-ycsb (linux distro, binary location, static build)
There was a problem hiding this comment.
The go-ycsb repo already has a Dockerfile. It also uses alpine as builder and final image.
|
I will adjust this to just add tidb-sysbench which is what I need, and leave a branch with tidb-bench. |
I haven't had a chance to fully test this yet.
Currently it just uses the sysbench patch in this repo, but it would also make sent to build the rest of the directories that are in this repo.