Skip to content

Commit

Permalink
Merge pull request #21 from smithmicro/feature-19
Browse files Browse the repository at this point in the history
Installing all plugins via JMeter Plugins Manager
  • Loading branch information
dsperling authored Mar 26, 2018
2 parents 068cfbb + 09a225c commit a25bf3b
Show file tree
Hide file tree
Showing 17 changed files with 184 additions and 74 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,19 @@ The following required and optional environment variables are supported:
|JMETER_VERSION||latest|smithmicro/lucy Image tag. See Docker Hub for [available versions](https://hub.docker.com/r/smithmicro/jmeter/tags/).|
|INSTANCE_TYPE||t2.micro|To double your memory, pass `t2.small`|
|MEM_LIMIT||950m|If you are using t2.small, set MEM_LIMIT to `1995m`|
|JMETER_MEMORY||-Xms800m -Xmx800m|If you are using t2.small, set JMETER_MEMORY to `Xms1600m -Xmx1600m`|
|MINION_COUNT||2||
|PEM_PATH||/keys|This must match your Volume map. See Volume section above.|
|CLUSTER_NAME||JMeter|Name that appears in your AWS Cluster UI|
|GRU_PRIVATE_IP||None|Set to `true` if you would like to run Lucy within AWS. See GitHub [Issue 8](https://github.com/smithmicro/jmeter-ecs/issues/8) for details.|
|JMETER_FLAGS||None|Custom JMeter command line options. For example, passing `-X` will tell the Minion to exit at the end of the test|
|RETAIN_CLUSTER||None|Set to `true` if you want to re-use your cluster for future tests. Warning, you will incur AWS charges if you leave your cluster running.|
|CUSTOM_PLUGIN_URL||None|The URL of a custom plugin you want to install in the Minions. File will be copied to $JMETER_HOME/lib/ext.||

## Notes
All current JMeter Plugins are installed via the Plugins Manager.
* https://jmeter-plugins.org/wiki/PluginsManager/

For more information on JMeter Distributed Testing, see:
* http://jmeter.apache.org/usermanual/remote-test.html

Expand Down
6 changes: 3 additions & 3 deletions jmeter/2.13/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL maintainer="David Sperling <[email protected]>"

ENV JMETER_VERSION apache-jmeter-2.13
ENV JMETER_HOME /opt/$JMETER_VERSION
ENV PATH $JMETER_HOME/bin:$PATH
ENV PATH $PATH:$JMETER_HOME/bin

# overridable environment variables
ENV RESULTS_LOG results.jtl
Expand All @@ -23,6 +23,7 @@ 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 \
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
Expand All @@ -31,11 +32,10 @@ RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz

# copy our entrypoint
COPY entrypoint.sh /opt/jmeter/
RUN chmod +x /opt/jmeter/entrypoint.sh

WORKDIR /logs

EXPOSE 1099 4445 50000 51000
EXPOSE 1099 50000 51000 4445/udp

# default command in the entrypoint is 'minion'
ENTRYPOINT ["/opt/jmeter/entrypoint.sh"]
Expand Down
2 changes: 2 additions & 0 deletions jmeter/2.13/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ if [ ${1##*.} = 'jmx' ]; then
HOSTNAME=$PUBLIC_HOSTNAME
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
fi
# empty the logs directory, or jmeter may fail
rm /logs/*.log /logs/*.jtl
# run jmeter in client (gru) mode
exec jmeter -n $JMETER_FLAGS \
-R $MINION_HOSTS \
Expand Down
29 changes: 18 additions & 11 deletions jmeter/3.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,45 @@ LABEL maintainer="David Sperling <[email protected]>"

ENV JMETER_VERSION apache-jmeter-3.0
ENV JMETER_HOME /opt/$JMETER_VERSION
ENV PATH $JMETER_HOME/bin:$PATH
ENV PATH $PATH:$JMETER_HOME/bin
ENV CMDRUNNER_VERSION 2.0
ENV PLUGINMGR_VERSION 0.19

# 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
RUN apk add --update --no-cache \
curl \
openssh-client \
unzip
openssh-client

WORKDIR /opt

# install JMeter and a few Plugins
# 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 \
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
&& unzip -n '*.zip' \
&& rm *.zip
&& 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/
RUN chmod +x /opt/jmeter/entrypoint.sh

WORKDIR /logs

EXPOSE 1099 4445 50000 51000
EXPOSE 1099 50000 51000 4445/udp

# default command in the entrypoint is 'minion'
ENTRYPOINT ["/opt/jmeter/entrypoint.sh"]
Expand Down
20 changes: 19 additions & 1 deletion jmeter/3.0/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ if [ ${1##*.} = 'jmx' ]; then
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

# set JAVA HEAP
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter

# run jmeter in client (gru) mode
exec jmeter -n $JMETER_FLAGS \
-R $MINION_HOSTS \
-Dclient.rmi.localport=51000 \
-Djava.rmi.server.hostname=${PUBLIC_HOSTNAME} \
-l $RESULTS_LOG \
-t $1
-t $1 \
-e -o /logs/report

fi

Expand All @@ -44,6 +51,17 @@ if [ "$1" = 'minion' ]; then
HOSTNAME=$PUBLIC_HOSTNAME
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
fi

# set JAVA HEAP
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $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 \
Expand Down
27 changes: 17 additions & 10 deletions jmeter/3.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,41 @@ LABEL maintainer="David Sperling <[email protected]>"

ENV JMETER_VERSION apache-jmeter-3.1
ENV JMETER_HOME /opt/$JMETER_VERSION
ENV PATH $JMETER_HOME/bin:$PATH
ENV PATH $PATH:$JMETER_HOME/bin
ENV CMDRUNNER_VERSION 2.0
ENV PLUGINMGR_VERSION 0.19

# 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
RUN apk add --update --no-cache \
curl \
openssh-client \
unzip
openssh-client

WORKDIR /opt

# install JMeter and a few Plugins
# 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 \
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
&& unzip -n '*.zip' \
&& rm *.zip
&& 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/
RUN chmod +x /opt/jmeter/entrypoint.sh

WORKDIR /logs

Expand Down
17 changes: 16 additions & 1 deletion jmeter/3.1/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ if [ ${1##*.} = 'jmx' ]; then
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
fi
# empty the logs directory, or jmeter may fail
rm -rf /logs/report /logs/*.log
rm -rf /logs/report /logs/*.log /logs/*.jtl

# set JAVA HEAP
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter

# run jmeter in client (gru) mode
exec jmeter -n $JMETER_FLAGS \
-R $MINION_HOSTS \
Expand All @@ -47,6 +51,17 @@ if [ "$1" = 'minion' ]; then
HOSTNAME=$PUBLIC_HOSTNAME
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
fi

# set JAVA HEAP
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $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 \
Expand Down
27 changes: 17 additions & 10 deletions jmeter/3.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,41 @@ LABEL maintainer="David Sperling <[email protected]>"

ENV JMETER_VERSION apache-jmeter-3.2
ENV JMETER_HOME /opt/$JMETER_VERSION
ENV PATH $JMETER_HOME/bin:$PATH
ENV PATH $PATH:$JMETER_HOME/bin
ENV CMDRUNNER_VERSION 2.0
ENV PLUGINMGR_VERSION 0.19

# 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
RUN apk add --update --no-cache \
curl \
openssh-client \
unzip
openssh-client

WORKDIR /opt

# install JMeter and a few Plugins
# 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 \
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
&& unzip -n '*.zip' \
&& rm *.zip
&& 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/
RUN chmod +x /opt/jmeter/entrypoint.sh

WORKDIR /logs

Expand Down
17 changes: 16 additions & 1 deletion jmeter/3.2/entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ if [ ${1##*.} = 'jmx' ]; then
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
fi
# empty the logs directory, or jmeter may fail
rm -rf /logs/report /logs/*.log
rm -rf /logs/report /logs/*.log /logs/*.jtl

# set JAVA HEAP
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter

# run jmeter in client (gru) mode
exec jmeter -n $JMETER_FLAGS \
-R $MINION_HOSTS \
Expand All @@ -47,6 +51,17 @@ if [ "$1" = 'minion' ]; then
HOSTNAME=$PUBLIC_HOSTNAME
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
fi

# set JAVA HEAP
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $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 \
Expand Down
27 changes: 17 additions & 10 deletions jmeter/3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,41 @@ LABEL maintainer="David Sperling <[email protected]>"

ENV JMETER_VERSION apache-jmeter-3.3
ENV JMETER_HOME /opt/$JMETER_VERSION
ENV PATH $JMETER_HOME/bin:$PATH
ENV PATH $PATH:$JMETER_HOME/bin
ENV CMDRUNNER_VERSION 2.0
ENV PLUGINMGR_VERSION 0.19

# 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
RUN apk add --update --no-cache \
curl \
openssh-client \
unzip
openssh-client

WORKDIR /opt

# install JMeter and a few Plugins
# 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 \
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
&& unzip -n '*.zip' \
&& rm *.zip
&& 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/
RUN chmod +x /opt/jmeter/entrypoint.sh

WORKDIR /logs

Expand Down
Loading

0 comments on commit a25bf3b

Please sign in to comment.