Skip to content

Commit a25bf3b

Browse files
authored
Merge pull request #21 from smithmicro/feature-19
Installing all plugins via JMeter Plugins Manager
2 parents 068cfbb + 09a225c commit a25bf3b

File tree

17 files changed

+184
-74
lines changed

17 files changed

+184
-74
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,19 @@ The following required and optional environment variables are supported:
105105
|JMETER_VERSION||latest|smithmicro/lucy Image tag. See Docker Hub for [available versions](https://hub.docker.com/r/smithmicro/jmeter/tags/).|
106106
|INSTANCE_TYPE||t2.micro|To double your memory, pass `t2.small`|
107107
|MEM_LIMIT||950m|If you are using t2.small, set MEM_LIMIT to `1995m`|
108+
|JMETER_MEMORY||-Xms800m -Xmx800m|If you are using t2.small, set JMETER_MEMORY to `Xms1600m -Xmx1600m`|
108109
|MINION_COUNT||2||
109110
|PEM_PATH||/keys|This must match your Volume map. See Volume section above.|
110111
|CLUSTER_NAME||JMeter|Name that appears in your AWS Cluster UI|
111112
|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.|
112113
|JMETER_FLAGS||None|Custom JMeter command line options. For example, passing `-X` will tell the Minion to exit at the end of the test|
113114
|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.|
115+
|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.||
114116

115117
## Notes
118+
All current JMeter Plugins are installed via the Plugins Manager.
119+
* https://jmeter-plugins.org/wiki/PluginsManager/
120+
116121
For more information on JMeter Distributed Testing, see:
117122
* http://jmeter.apache.org/usermanual/remote-test.html
118123

jmeter/2.13/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL maintainer="David Sperling <[email protected]>"
44

55
ENV JMETER_VERSION apache-jmeter-2.13
66
ENV JMETER_HOME /opt/$JMETER_VERSION
7-
ENV PATH $JMETER_HOME/bin:$PATH
7+
ENV PATH $PATH:$JMETER_HOME/bin
88

99
# overridable environment variables
1010
ENV RESULTS_LOG results.jtl
@@ -23,6 +23,7 @@ RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz
2323
&& tar -xvf $JMETER_VERSION.tgz \
2424
&& rm $JMETER_VERSION.tgz \
2525
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \
26+
&& cd $JMETER_HOME \
2627
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
2728
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
2829
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
@@ -31,11 +32,10 @@ RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz
3132

3233
# copy our entrypoint
3334
COPY entrypoint.sh /opt/jmeter/
34-
RUN chmod +x /opt/jmeter/entrypoint.sh
3535

3636
WORKDIR /logs
3737

38-
EXPOSE 1099 4445 50000 51000
38+
EXPOSE 1099 50000 51000 4445/udp
3939

4040
# default command in the entrypoint is 'minion'
4141
ENTRYPOINT ["/opt/jmeter/entrypoint.sh"]

jmeter/2.13/entrypoint.sh

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ if [ ${1##*.} = 'jmx' ]; then
2121
HOSTNAME=$PUBLIC_HOSTNAME
2222
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
2323
fi
24+
# empty the logs directory, or jmeter may fail
25+
rm /logs/*.log /logs/*.jtl
2426
# run jmeter in client (gru) mode
2527
exec jmeter -n $JMETER_FLAGS \
2628
-R $MINION_HOSTS \

jmeter/3.0/Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,45 @@ LABEL maintainer="David Sperling <[email protected]>"
44

55
ENV JMETER_VERSION apache-jmeter-3.0
66
ENV JMETER_HOME /opt/$JMETER_VERSION
7-
ENV PATH $JMETER_HOME/bin:$PATH
7+
ENV PATH $PATH:$JMETER_HOME/bin
8+
ENV CMDRUNNER_VERSION 2.0
9+
ENV PLUGINMGR_VERSION 0.19
810

911
# overridable environment variables
1012
ENV RESULTS_LOG results.jtl
1113
ENV JMETER_FLAGS=
14+
ENV JMETER_MEMORY -Xms800m -Xmx800m
15+
ENV CUSTOM_PLUGIN_URL=
1216

1317
# Install the required tools for JMeter
1418
RUN apk add --update --no-cache \
1519
curl \
16-
openssh-client \
17-
unzip
20+
openssh-client
1821

1922
WORKDIR /opt
2023

21-
# install JMeter and a few Plugins
24+
# install JMeter and the JMeter Plugins Manager
2225
RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz \
2326
&& tar -xvf $JMETER_VERSION.tgz \
2427
&& rm $JMETER_VERSION.tgz \
2528
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \
26-
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
27-
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
28-
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
29-
&& unzip -n '*.zip' \
30-
&& rm *.zip
29+
&& cd $JMETER_HOME/lib \
30+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/$CMDRUNNER_VERSION/cmdrunner-$CMDRUNNER_VERSION.jar \
31+
&& cd $JMETER_HOME/lib/ext \
32+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/$PLUGINMGR_VERSION/jmeter-plugins-manager-$PLUGINMGR_VERSION.jar \
33+
&& java -cp jmeter-plugins-manager-$PLUGINMGR_VERSION.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
34+
35+
# install all available plugins except for those that are deprecated
36+
RUN PluginsManagerCMD.sh install-all-except jpgc-hadoop,jpgc-oauth \
37+
&& sleep 2 \
38+
&& PluginsManagerCMD.sh status
3139

3240
# copy our entrypoint
3341
COPY entrypoint.sh /opt/jmeter/
34-
RUN chmod +x /opt/jmeter/entrypoint.sh
3542

3643
WORKDIR /logs
3744

38-
EXPOSE 1099 4445 50000 51000
45+
EXPOSE 1099 50000 51000 4445/udp
3946

4047
# default command in the entrypoint is 'minion'
4148
ENTRYPOINT ["/opt/jmeter/entrypoint.sh"]

jmeter/3.0/entrypoint.sh

100644100755
Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@ if [ ${1##*.} = 'jmx' ]; then
2121
HOSTNAME=$PUBLIC_HOSTNAME
2222
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
2323
fi
24+
# empty the logs directory, or jmeter may fail
25+
rm -rf /logs/report /logs/*.log /logs/*.jtl
26+
27+
# set JAVA HEAP
28+
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter
29+
2430
# run jmeter in client (gru) mode
2531
exec jmeter -n $JMETER_FLAGS \
2632
-R $MINION_HOSTS \
2733
-Dclient.rmi.localport=51000 \
2834
-Djava.rmi.server.hostname=${PUBLIC_HOSTNAME} \
2935
-l $RESULTS_LOG \
30-
-t $1
36+
-t $1 \
37+
-e -o /logs/report
3138

3239
fi
3340

@@ -44,6 +51,17 @@ if [ "$1" = 'minion' ]; then
4451
HOSTNAME=$PUBLIC_HOSTNAME
4552
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
4653
fi
54+
55+
# set JAVA HEAP
56+
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter
57+
58+
# install custom plugin if requested
59+
if [ "$CUSTOM_PLUGIN_URL" != '' ]; then
60+
echo "Installing custom plugin $CUSTOM_PLUGIN_URL"
61+
CUSTOM_PLUGIN_FILE="${CUSTOM_PLUGIN_URL##*/}"
62+
curl -o $JMETER_HOME/lib/ext/$CUSTOM_PLUGIN_FILE $CUSTOM_PLUGIN_URL
63+
fi
64+
4765
# run jmeter in server (minion) mode
4866
exec jmeter-server -n \
4967
-Dserver.rmi.localport=50000 \

jmeter/3.1/Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,41 @@ LABEL maintainer="David Sperling <[email protected]>"
44

55
ENV JMETER_VERSION apache-jmeter-3.1
66
ENV JMETER_HOME /opt/$JMETER_VERSION
7-
ENV PATH $JMETER_HOME/bin:$PATH
7+
ENV PATH $PATH:$JMETER_HOME/bin
8+
ENV CMDRUNNER_VERSION 2.0
9+
ENV PLUGINMGR_VERSION 0.19
810

911
# overridable environment variables
1012
ENV RESULTS_LOG results.jtl
1113
ENV JMETER_FLAGS=
14+
ENV JMETER_MEMORY -Xms800m -Xmx800m
15+
ENV CUSTOM_PLUGIN_URL=
1216

1317
# Install the required tools for JMeter
1418
RUN apk add --update --no-cache \
1519
curl \
16-
openssh-client \
17-
unzip
20+
openssh-client
1821

1922
WORKDIR /opt
2023

21-
# install JMeter and a few Plugins
24+
# install JMeter and the JMeter Plugins Manager
2225
RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz \
2326
&& tar -xvf $JMETER_VERSION.tgz \
2427
&& rm $JMETER_VERSION.tgz \
2528
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \
26-
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
27-
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
28-
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
29-
&& unzip -n '*.zip' \
30-
&& rm *.zip
29+
&& cd $JMETER_HOME/lib \
30+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/$CMDRUNNER_VERSION/cmdrunner-$CMDRUNNER_VERSION.jar \
31+
&& cd $JMETER_HOME/lib/ext \
32+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/$PLUGINMGR_VERSION/jmeter-plugins-manager-$PLUGINMGR_VERSION.jar \
33+
&& java -cp jmeter-plugins-manager-$PLUGINMGR_VERSION.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
34+
35+
# install all available plugins except for those that are deprecated
36+
RUN PluginsManagerCMD.sh install-all-except jpgc-hadoop,jpgc-oauth \
37+
&& sleep 2 \
38+
&& PluginsManagerCMD.sh status
3139

3240
# copy our entrypoint
3341
COPY entrypoint.sh /opt/jmeter/
34-
RUN chmod +x /opt/jmeter/entrypoint.sh
3542

3643
WORKDIR /logs
3744

jmeter/3.1/entrypoint.sh

100644100755
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ if [ ${1##*.} = 'jmx' ]; then
2222
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
2323
fi
2424
# empty the logs directory, or jmeter may fail
25-
rm -rf /logs/report /logs/*.log
25+
rm -rf /logs/report /logs/*.log /logs/*.jtl
26+
27+
# set JAVA HEAP
28+
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter
29+
2630
# run jmeter in client (gru) mode
2731
exec jmeter -n $JMETER_FLAGS \
2832
-R $MINION_HOSTS \
@@ -47,6 +51,17 @@ if [ "$1" = 'minion' ]; then
4751
HOSTNAME=$PUBLIC_HOSTNAME
4852
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
4953
fi
54+
55+
# set JAVA HEAP
56+
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter
57+
58+
# install custom plugin if requested
59+
if [ "$CUSTOM_PLUGIN_URL" != '' ]; then
60+
echo "Installing custom plugin $CUSTOM_PLUGIN_URL"
61+
CUSTOM_PLUGIN_FILE="${CUSTOM_PLUGIN_URL##*/}"
62+
curl -o $JMETER_HOME/lib/ext/$CUSTOM_PLUGIN_FILE $CUSTOM_PLUGIN_URL
63+
fi
64+
5065
# run jmeter in server (minion) mode
5166
exec jmeter-server -n \
5267
-Dserver.rmi.localport=50000 \

jmeter/3.2/Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,41 @@ LABEL maintainer="David Sperling <[email protected]>"
44

55
ENV JMETER_VERSION apache-jmeter-3.2
66
ENV JMETER_HOME /opt/$JMETER_VERSION
7-
ENV PATH $JMETER_HOME/bin:$PATH
7+
ENV PATH $PATH:$JMETER_HOME/bin
8+
ENV CMDRUNNER_VERSION 2.0
9+
ENV PLUGINMGR_VERSION 0.19
810

911
# overridable environment variables
1012
ENV RESULTS_LOG results.jtl
1113
ENV JMETER_FLAGS=
14+
ENV JMETER_MEMORY -Xms800m -Xmx800m
15+
ENV CUSTOM_PLUGIN_URL=
1216

1317
# Install the required tools for JMeter
1418
RUN apk add --update --no-cache \
1519
curl \
16-
openssh-client \
17-
unzip
20+
openssh-client
1821

1922
WORKDIR /opt
2023

21-
# install JMeter and a few Plugins
24+
# install JMeter and the JMeter Plugins Manager
2225
RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz \
2326
&& tar -xvf $JMETER_VERSION.tgz \
2427
&& rm $JMETER_VERSION.tgz \
2528
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \
26-
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
27-
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
28-
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
29-
&& unzip -n '*.zip' \
30-
&& rm *.zip
29+
&& cd $JMETER_HOME/lib \
30+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/$CMDRUNNER_VERSION/cmdrunner-$CMDRUNNER_VERSION.jar \
31+
&& cd $JMETER_HOME/lib/ext \
32+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/$PLUGINMGR_VERSION/jmeter-plugins-manager-$PLUGINMGR_VERSION.jar \
33+
&& java -cp jmeter-plugins-manager-$PLUGINMGR_VERSION.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
34+
35+
# install all available plugins except for those that are deprecated
36+
RUN PluginsManagerCMD.sh install-all-except jpgc-hadoop,jpgc-oauth \
37+
&& sleep 2 \
38+
&& PluginsManagerCMD.sh status
3139

3240
# copy our entrypoint
3341
COPY entrypoint.sh /opt/jmeter/
34-
RUN chmod +x /opt/jmeter/entrypoint.sh
3542

3643
WORKDIR /logs
3744

jmeter/3.2/entrypoint.sh

100644100755
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ if [ ${1##*.} = 'jmx' ]; then
2222
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
2323
fi
2424
# empty the logs directory, or jmeter may fail
25-
rm -rf /logs/report /logs/*.log
25+
rm -rf /logs/report /logs/*.log /logs/*.jtl
26+
27+
# set JAVA HEAP
28+
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter
29+
2630
# run jmeter in client (gru) mode
2731
exec jmeter -n $JMETER_FLAGS \
2832
-R $MINION_HOSTS \
@@ -47,6 +51,17 @@ if [ "$1" = 'minion' ]; then
4751
HOSTNAME=$PUBLIC_HOSTNAME
4852
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
4953
fi
54+
55+
# set JAVA HEAP
56+
sed -i 's/-Xms512m -Xmx512m/'"$JMETER_MEMORY"'/g' $JMETER_HOME/bin/jmeter
57+
58+
# install custom plugin if requested
59+
if [ "$CUSTOM_PLUGIN_URL" != '' ]; then
60+
echo "Installing custom plugin $CUSTOM_PLUGIN_URL"
61+
CUSTOM_PLUGIN_FILE="${CUSTOM_PLUGIN_URL##*/}"
62+
curl -o $JMETER_HOME/lib/ext/$CUSTOM_PLUGIN_FILE $CUSTOM_PLUGIN_URL
63+
fi
64+
5065
# run jmeter in server (minion) mode
5166
exec jmeter-server -n \
5267
-Dserver.rmi.localport=50000 \

jmeter/3.3/Dockerfile

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,41 @@ LABEL maintainer="David Sperling <[email protected]>"
44

55
ENV JMETER_VERSION apache-jmeter-3.3
66
ENV JMETER_HOME /opt/$JMETER_VERSION
7-
ENV PATH $JMETER_HOME/bin:$PATH
7+
ENV PATH $PATH:$JMETER_HOME/bin
8+
ENV CMDRUNNER_VERSION 2.0
9+
ENV PLUGINMGR_VERSION 0.19
810

911
# overridable environment variables
1012
ENV RESULTS_LOG results.jtl
1113
ENV JMETER_FLAGS=
14+
ENV JMETER_MEMORY -Xms800m -Xmx800m
15+
ENV CUSTOM_PLUGIN_URL=
1216

1317
# Install the required tools for JMeter
1418
RUN apk add --update --no-cache \
1519
curl \
16-
openssh-client \
17-
unzip
20+
openssh-client
1821

1922
WORKDIR /opt
2023

21-
# install JMeter and a few Plugins
24+
# install JMeter and the JMeter Plugins Manager
2225
RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz \
2326
&& tar -xvf $JMETER_VERSION.tgz \
2427
&& rm $JMETER_VERSION.tgz \
2528
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \
26-
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
27-
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
28-
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
29-
&& unzip -n '*.zip' \
30-
&& rm *.zip
29+
&& cd $JMETER_HOME/lib \
30+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/$CMDRUNNER_VERSION/cmdrunner-$CMDRUNNER_VERSION.jar \
31+
&& cd $JMETER_HOME/lib/ext \
32+
&& curl -O http://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/$PLUGINMGR_VERSION/jmeter-plugins-manager-$PLUGINMGR_VERSION.jar \
33+
&& java -cp jmeter-plugins-manager-$PLUGINMGR_VERSION.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
34+
35+
# install all available plugins except for those that are deprecated
36+
RUN PluginsManagerCMD.sh install-all-except jpgc-hadoop,jpgc-oauth \
37+
&& sleep 2 \
38+
&& PluginsManagerCMD.sh status
3139

3240
# copy our entrypoint
3341
COPY entrypoint.sh /opt/jmeter/
34-
RUN chmod +x /opt/jmeter/entrypoint.sh
3542

3643
WORKDIR /logs
3744

0 commit comments

Comments
 (0)