Skip to content

Conversation

@gregwebs
Copy link
Contributor

@gregwebs gregwebs commented Apr 4, 2019

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.

@gregwebs gregwebs requested a review from tennix April 4, 2019 04:29
@gregwebs
Copy link
Contributor Author

gregwebs commented Apr 5, 2019

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
I have not tested tidb-bench (other than to build the image) or released the docker image for it.

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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the version as an environment variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

&& apk del .build-deps

# TiDB patch for sysbench data loading (prepare)
RUN apk add --virtual .build-deps wget \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why run apk add again? A wget to download the oltp_common.lua is enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add bash in this docker image? The tidb bench script is not included in this image.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to make this a separate image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also does this work in alpine? And maybe you can copy from pingcap/go-ycsb directly instead of build the go-ycsb yourself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The go-ycsb repo already has a Dockerfile. It also uses alpine as builder and final image.

@gregwebs
Copy link
Contributor Author

gregwebs commented Apr 9, 2019

I will adjust this to just add tidb-sysbench which is what I need, and leave a branch with tidb-bench.

@gregwebs
Copy link
Contributor Author

gregwebs commented Apr 9, 2019

Closing this in favor of #46 and #47

@gregwebs gregwebs closed this Apr 9, 2019
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

Successfully merging this pull request may close these issues.

3 participants