-
Notifications
You must be signed in to change notification settings - Fork 34
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 #34 from smithmicro/feature-33
Supporting JMeter 5.0
- Loading branch information
Showing
12 changed files
with
168 additions
and
36 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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM openjdk:8-alpine | ||
|
||
LABEL maintainer="David Sperling <[email protected]>" | ||
|
||
ENV JMETER_VERSION apache-jmeter-4.0 | ||
ENV JMETER_HOME /opt/$JMETER_VERSION | ||
ENV PATH $PATH:$JMETER_HOME/bin | ||
ENV CMDRUNNER_VERSION 2.2 | ||
ENV PLUGINMGR_VERSION 1.3 | ||
|
||
# overridable environment variables | ||
ENV RESULTS_LOG results.jtl | ||
ENV JMETER_FLAGS= | ||
ENV CUSTOM_PLUGIN_URL= | ||
|
||
# Install the required tools for JMeter | ||
RUN apk add --update --no-cache \ | ||
curl \ | ||
openssh-client | ||
|
||
WORKDIR /opt | ||
|
||
# install JMeter and the JMeter Plugins Manager | ||
RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz \ | ||
&& tar -xvf $JMETER_VERSION.tgz \ | ||
&& rm $JMETER_VERSION.tgz \ | ||
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \ | ||
&& cd $JMETER_HOME/lib \ | ||
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/$CMDRUNNER_VERSION/cmdrunner-$CMDRUNNER_VERSION.jar \ | ||
&& cd $JMETER_HOME/lib/ext \ | ||
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/$PLUGINMGR_VERSION/jmeter-plugins-manager-$PLUGINMGR_VERSION.jar \ | ||
&& java -cp jmeter-plugins-manager-$PLUGINMGR_VERSION.jar org.jmeterplugins.repository.PluginManagerCMDInstaller | ||
|
||
# install all available plugins except for those that are deprecated | ||
RUN PluginsManagerCMD.sh install-all-except jpgc-hadoop,jpgc-oauth \ | ||
&& sleep 2 \ | ||
&& PluginsManagerCMD.sh status | ||
|
||
# copy our entrypoint | ||
COPY entrypoint.sh /opt/jmeter/ | ||
|
||
WORKDIR /logs | ||
|
||
EXPOSE 1099 50000 51000 4445/udp | ||
|
||
# default command in the entrypoint is 'minion' | ||
ENTRYPOINT ["/opt/jmeter/entrypoint.sh"] | ||
CMD ["minion"] |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/sh | ||
# | ||
# Main entrypoint for our Docker image - runs Gru, Minions or other commands | ||
|
||
# any .jmx file passed in the command line we act as 'Gru' | ||
if [ ${1##*.} = 'jmx' ]; then | ||
|
||
if [ "$MINION_HOSTS" = '' ]; then | ||
echo "MINION_HOSTS must be specified - a command separated list of hostnames or IP addresses" | ||
exit 1 | ||
fi | ||
echo "Connecting to $MINION_HOSTS" | ||
|
||
# AWS Public HOSTNAME API | ||
echo "Detecting an AWS Environment" | ||
PUBLIC_HOSTNAME=$(curl -s --max-time 5 http://169.254.169.254/latest/meta-data/public-hostname) | ||
|
||
if [ "$PUBLIC_HOSTNAME" = '' ]; then | ||
echo "Not running in AWS. Using Gru HOSTNAME $HOSTNAME" | ||
else | ||
HOSTNAME=$PUBLIC_HOSTNAME | ||
echo "Using Gru AWS Public HOSTNAME $HOSTNAME" | ||
fi | ||
# empty the logs directory, or jmeter may fail | ||
rm -rf /logs/report /logs/*.log /logs/*.jtl | ||
|
||
# remove setting JAVA heap and use the RUN_IN_DOCKER variable | ||
sed -i 's/-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m//' $JMETER_HOME/bin/jmeter | ||
sed -i 's/# RUN_IN_DOCKER/RUN_IN_DOCKER/' $JMETER_HOME/bin/jmeter | ||
|
||
# run jmeter in client (gru) mode | ||
exec jmeter -n $JMETER_FLAGS \ | ||
-R $MINION_HOSTS \ | ||
-Dclient.rmi.localport=51000 \ | ||
-Dserver.rmi.ssl.disable=true \ | ||
-Djava.rmi.server.hostname=${PUBLIC_HOSTNAME} \ | ||
-l $RESULTS_LOG \ | ||
-t $1 \ | ||
-e -o /logs/report | ||
|
||
fi | ||
|
||
# act as a 'Minion' | ||
if [ "$1" = 'minion' ]; then | ||
|
||
# AWS Public HOSTNAME API | ||
echo "Detecting an AWS Environment" | ||
PUBLIC_HOSTNAME=$(curl -s --max-time 5 http://169.254.169.254/latest/meta-data/public-hostname) | ||
|
||
if [ "$PUBLIC_HOSTNAME" = '' ]; then | ||
echo "Not running in AWS. Using Minion HOSTNAME $HOSTNAME" | ||
else | ||
HOSTNAME=$PUBLIC_HOSTNAME | ||
echo "Using Minion AWS Public HOSTNAME $HOSTNAME" | ||
fi | ||
|
||
# remove setting JAVA heap and use the RUN_IN_DOCKER variable | ||
sed -i 's/-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m//' $JMETER_HOME/bin/jmeter | ||
sed -i 's/# RUN_IN_DOCKER/RUN_IN_DOCKER/' $JMETER_HOME/bin/jmeter | ||
|
||
# install custom plugin if requested | ||
if [ "$CUSTOM_PLUGIN_URL" != '' ]; then | ||
echo "Installing custom plugin $CUSTOM_PLUGIN_URL" | ||
CUSTOM_PLUGIN_FILE="${CUSTOM_PLUGIN_URL##*/}" | ||
curl -o $JMETER_HOME/lib/ext/$CUSTOM_PLUGIN_FILE $CUSTOM_PLUGIN_URL | ||
fi | ||
|
||
# run jmeter in server (minion) mode | ||
exec jmeter-server -n \ | ||
-Dserver.rmi.localport=50000 \ | ||
-Dserver.rmi.ssl.disable=true \ | ||
-Djava.rmi.server.hostname=${HOSTNAME} | ||
|
||
fi | ||
|
||
exec "$@" |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ FROM openjdk:8-alpine | |
|
||
LABEL maintainer="David Sperling <[email protected]>" | ||
|
||
ENV JMETER_VERSION apache-jmeter-4.0 | ||
ENV JMETER_VERSION apache-jmeter-5.0 | ||
ENV JMETER_HOME /opt/$JMETER_VERSION | ||
ENV PATH $PATH:$JMETER_HOME/bin | ||
ENV CMDRUNNER_VERSION 2.2 | ||
|
@@ -11,7 +11,6 @@ ENV PLUGINMGR_VERSION 1.3 | |
# overridable environment variables | ||
ENV RESULTS_LOG results.jtl | ||
ENV JMETER_FLAGS= | ||
ENV JMETER_MEMORY -Xms800m -Xmx800m | ||
ENV CUSTOM_PLUGIN_URL= | ||
|
||
# Install the required tools for JMeter | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM alpine:3.7 | ||
FROM alpine:3.8 | ||
|
||
LABEL maintainer="David Sperling <[email protected]>" | ||
|
||
|
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