-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from weaveworks/wrk
Add wrk to load tester tools
- Loading branch information
Showing
8 changed files
with
50 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,64 @@ | ||
FROM bats/bats:v1.1.0 | ||
|
||
RUN addgroup -S app \ | ||
&& adduser -S -g app app \ | ||
&& apk --no-cache add ca-certificates curl jq | ||
FROM alpine:3.10.3 as build | ||
|
||
WORKDIR /home/app | ||
RUN apk --no-cache add alpine-sdk perl curl | ||
|
||
RUN curl -sSLo hey "https://storage.googleapis.com/hey-release/hey_linux_amd64" && \ | ||
chmod +x hey && mv hey /usr/local/bin/hey | ||
|
||
# verify hey works | ||
RUN hey -n 1 -c 1 https://flagger.app > /dev/null && echo $? | grep 0 | ||
|
||
RUN curl -sSL "https://get.helm.sh/helm-v2.15.1-linux-amd64.tar.gz" | tar xvz && \ | ||
RUN HELM2_VERSION=2.16.1 && \ | ||
curl -sSL "https://get.helm.sh/helm-v${HELM2_VERSION}-linux-amd64.tar.gz" | tar xvz && \ | ||
chmod +x linux-amd64/helm && mv linux-amd64/helm /usr/local/bin/helm && \ | ||
chmod +x linux-amd64/tiller && mv linux-amd64/tiller /usr/local/bin/tiller && \ | ||
rm -rf linux-amd64 | ||
chmod +x linux-amd64/tiller && mv linux-amd64/tiller /usr/local/bin/tiller | ||
|
||
RUN curl -sSL "https://get.helm.sh/helm-v3.0.0-rc.2-linux-amd64.tar.gz" | tar xvz && \ | ||
chmod +x linux-amd64/helm && mv linux-amd64/helm /usr/local/bin/helmv3 && \ | ||
rm -rf linux-amd64 | ||
RUN HELM3_VERSION=3.0.0-rc.3 && \ | ||
curl -sSL "https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz" | tar xvz && \ | ||
chmod +x linux-amd64/helm && mv linux-amd64/helm /usr/local/bin/helmv3 | ||
|
||
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.1 && \ | ||
wget -qO /usr/local/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \ | ||
chmod +x /usr/local/bin/grpc_health_probe | ||
|
||
RUN curl -sSL "https://github.com/bojand/ghz/releases/download/v0.39.0/ghz_0.39.0_Linux_x86_64.tar.gz" | tar xz -C /tmp && \ | ||
mv /tmp/ghz /usr/local/bin && chmod +x /usr/local/bin/ghz && rm -rf /tmp/ghz-web | ||
RUN GHZ_VERSION=0.39.0 && \ | ||
curl -sSL "https://github.com/bojand/ghz/releases/download/v${GHZ_VERSION}/ghz_${GHZ_VERSION}_Linux_x86_64.tar.gz" | tar xz -C /tmp && \ | ||
mv /tmp/ghz /usr/local/bin && chmod +x /usr/local/bin/ghz | ||
|
||
ADD https://raw.githubusercontent.com/grpc/grpc-proto/master/grpc/health/v1/health.proto /tmp/ghz/health.proto | ||
RUN HELM_TILLER_VERSION=0.9.3 && \ | ||
curl -sSL "https://github.com/rimusz/helm-tiller/archive/v${HELM_TILLER_VERSION}.tar.gz" | tar xz -C /tmp && \ | ||
mv /tmp/helm-tiller-${HELM_TILLER_VERSION} /tmp/helm-tiller | ||
|
||
RUN ls /tmp | ||
RUN WRK_VERSION=4.0.2 && \ | ||
cd /tmp && git clone -b ${WRK_VERSION} https://github.com/wg/wrk | ||
RUN cd /tmp/wrk && make | ||
|
||
FROM bats/bats:v1.1.0 | ||
|
||
RUN addgroup -S app && \ | ||
adduser -S -g app app && \ | ||
apk --no-cache add ca-certificates curl jq libgcc | ||
|
||
WORKDIR /home/app | ||
|
||
COPY --from=build /usr/local/bin/hey /usr/local/bin/ | ||
COPY --from=build /tmp/wrk/wrk /usr/local/bin/ | ||
COPY --from=build /usr/local/bin/helm /usr/local/bin/ | ||
COPY --from=build /usr/local/bin/tiller /usr/local/bin/ | ||
COPY --from=build /usr/local/bin/ghz /usr/local/bin/ | ||
COPY --from=build /usr/local/bin/helmv3 /usr/local/bin/ | ||
COPY --from=build /usr/local/bin/grpc_health_probe /usr/local/bin/ | ||
COPY --from=build /tmp/helm-tiller /tmp/helm-tiller | ||
ADD https://raw.githubusercontent.com/grpc/grpc-proto/master/grpc/health/v1/health.proto /tmp/ghz/health.proto | ||
|
||
COPY ./bin/loadtester . | ||
|
||
RUN chown -R app:app ./ | ||
|
||
USER app | ||
|
||
RUN curl -sSL "https://github.com/rimusz/helm-tiller/archive/v0.9.3.tar.gz" | tar xvz && \ | ||
helm init --client-only && helm plugin install helm-tiller-0.9.3 && helm plugin list | ||
# test load generator tools | ||
RUN hey -n 1 -c 1 https://flagger.app > /dev/null && echo $? | grep 0 | ||
RUN wrk -d 1s -c 1 -t 1 https://flagger.app > /dev/null && echo $? | grep 0 | ||
|
||
# install Helm v2 plugins | ||
RUN helm init --client-only && helm plugin install /tmp/helm-tiller | ||
|
||
ENTRYPOINT ["./loadtester"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import ( | |
"time" | ||
) | ||
|
||
var VERSION = "0.11.0" | ||
var VERSION = "0.12.0" | ||
var ( | ||
logLevel string | ||
port string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters