diff --git a/README.md b/README.md index f5a94f5..5ca3aed 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/jmeter/2.13/Dockerfile b/jmeter/2.13/Dockerfile index 30016a3..eac944d 100644 --- a/jmeter/2.13/Dockerfile +++ b/jmeter/2.13/Dockerfile @@ -4,7 +4,7 @@ LABEL maintainer="David Sperling " 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 @@ -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 \ @@ -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"] diff --git a/jmeter/2.13/entrypoint.sh b/jmeter/2.13/entrypoint.sh old mode 100644 new mode 100755 index f4f2bba..595db28 --- a/jmeter/2.13/entrypoint.sh +++ b/jmeter/2.13/entrypoint.sh @@ -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 \ diff --git a/jmeter/3.0/Dockerfile b/jmeter/3.0/Dockerfile index 650f505..a7e0f12 100644 --- a/jmeter/3.0/Dockerfile +++ b/jmeter/3.0/Dockerfile @@ -4,38 +4,45 @@ LABEL maintainer="David Sperling " 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"] diff --git a/jmeter/3.0/entrypoint.sh b/jmeter/3.0/entrypoint.sh old mode 100644 new mode 100755 index f4f2bba..91c72c5 --- a/jmeter/3.0/entrypoint.sh +++ b/jmeter/3.0/entrypoint.sh @@ -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 @@ -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 \ diff --git a/jmeter/3.1/Dockerfile b/jmeter/3.1/Dockerfile index d52f5f8..2b0742a 100644 --- a/jmeter/3.1/Dockerfile +++ b/jmeter/3.1/Dockerfile @@ -4,34 +4,41 @@ LABEL maintainer="David Sperling " 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 diff --git a/jmeter/3.1/entrypoint.sh b/jmeter/3.1/entrypoint.sh old mode 100644 new mode 100755 index b76de9a..91c72c5 --- a/jmeter/3.1/entrypoint.sh +++ b/jmeter/3.1/entrypoint.sh @@ -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 \ @@ -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 \ diff --git a/jmeter/3.2/Dockerfile b/jmeter/3.2/Dockerfile index 36367b8..e01ae54 100644 --- a/jmeter/3.2/Dockerfile +++ b/jmeter/3.2/Dockerfile @@ -4,34 +4,41 @@ LABEL maintainer="David Sperling " 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 diff --git a/jmeter/3.2/entrypoint.sh b/jmeter/3.2/entrypoint.sh old mode 100644 new mode 100755 index b76de9a..91c72c5 --- a/jmeter/3.2/entrypoint.sh +++ b/jmeter/3.2/entrypoint.sh @@ -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 \ @@ -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 \ diff --git a/jmeter/3.3/Dockerfile b/jmeter/3.3/Dockerfile index b6c429c..f9375bb 100644 --- a/jmeter/3.3/Dockerfile +++ b/jmeter/3.3/Dockerfile @@ -4,34 +4,41 @@ LABEL maintainer="David Sperling " 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 diff --git a/jmeter/3.3/entrypoint.sh b/jmeter/3.3/entrypoint.sh old mode 100644 new mode 100755 index b76de9a..91c72c5 --- a/jmeter/3.3/entrypoint.sh +++ b/jmeter/3.3/entrypoint.sh @@ -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 \ @@ -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 \ diff --git a/jmeter/Dockerfile b/jmeter/Dockerfile index 96c38f4..760ec76 100644 --- a/jmeter/Dockerfile +++ b/jmeter/Dockerfile @@ -4,34 +4,41 @@ LABEL maintainer="David Sperling " ENV JMETER_VERSION apache-jmeter-4.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 diff --git a/jmeter/entrypoint.sh b/jmeter/entrypoint.sh old mode 100644 new mode 100755 index 0377748..4112eb2 --- a/jmeter/entrypoint.sh +++ b/jmeter/entrypoint.sh @@ -22,10 +22,10 @@ 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/-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m/-Xms750m -Xmx750m/' $JMETER_HOME/bin/jmeter + sed -i 's/-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m/'"$JMETER_MEMORY"'/' $JMETER_HOME/bin/jmeter # run jmeter in client (gru) mode exec jmeter -n $JMETER_FLAGS \ @@ -53,8 +53,15 @@ if [ "$1" = 'minion' ]; then echo "Using Minion AWS Public HOSTNAME $HOSTNAME" fi - # set JAVA HEAP - sed -i 's/-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m/-Xms750m -Xmx750m/' $JMETER_HOME/bin/jmeter + # set JAVA HEAP + sed -i 's/-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m/'"$JMETER_MEMORY"'/' $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 \ diff --git a/lucy/Dockerfile b/lucy/Dockerfile index c7de6d5..e803948 100644 --- a/lucy/Dockerfile +++ b/lucy/Dockerfile @@ -10,6 +10,7 @@ ENV AWS_ACCESS_KEY_ID= ENV AWS_SECRET_ACCESS_KEY= ENV AWS_DEFAULT_REGION= ENV RETAIN_CLUSTER= +ENV CUSTOM_PLUGIN_URL= # Install the AWS CLI RUN apk add --update --no-cache \ @@ -27,7 +28,6 @@ RUN wget -O /usr/local/bin/ecs-cli -q https://s3.amazonaws.com/amazon-ecs-cli/ec # copy our entrypoint script and compose file for the Minions COPY lucy.sh lucy.yml /opt/jmeter/ -RUN chmod +x /opt/jmeter/lucy.sh WORKDIR /logs diff --git a/lucy/lucy.sh b/lucy/lucy.sh index 7b0a567..3315ce7 100755 --- a/lucy/lucy.sh +++ b/lucy/lucy.sh @@ -100,6 +100,7 @@ done # Step 3 - Run the Minion task with the requested JMeter version, instance count and memory sed -i 's/jmeter:latest/jmeter:'"$JMETER_VERSION"'/' /opt/jmeter/lucy.yml sed -i 's/950m/'"$MEM_LIMIT"'/' /opt/jmeter/lucy.yml +sed -i 's/CUSTOM_PLUGIN_URL=/CUSTOM_PLUGIN_URL='"$CUSTOM_PLUGIN_URL"'/' /opt/jmeter/lucy.yml ecs-cli compose --file /opt/jmeter/lucy.yml up --cluster $CLUSTER_NAME ecs-cli compose --file /opt/jmeter/lucy.yml --cluster $CLUSTER_NAME scale $MINION_COUNT @@ -109,7 +110,7 @@ CONTAINER_INSTANCE_IDS=$(aws ecs list-container-instances --cluster $CLUSTER_NAM echo "Container instances IDs: $CONTAINER_INSTANCE_IDS" GRU_INSTANCE_ID=$(aws ecs describe-container-instances --cluster $CLUSTER_NAME \ - --container-instances $CONTAINER_INSTANCE_IDS --query 'containerInstances[*].[ec2InstanceId,runningTasksCount]' --output text | grep '\t0' | awk '{print $1}') + --container-instances $CONTAINER_INSTANCE_IDS --query 'containerInstances[*].[ec2InstanceId,runningTasksCount]' --output text | grep -m 1 '\t0' | awk '{print $1}') echo "Gru instance ID: $GRU_INSTANCE_ID" MINION_INSTANCE_IDS=$(aws ecs describe-container-instances --cluster $CLUSTER_NAME \ diff --git a/lucy/lucy.yml b/lucy/lucy.yml index 60f0dcc..778144e 100644 --- a/lucy/lucy.yml +++ b/lucy/lucy.yml @@ -9,3 +9,5 @@ services: - 50000:50000 volumes: - /logs:/logs + environment: + - CUSTOM_PLUGIN_URL= diff --git a/plans/demo.jmx b/plans/demo.jmx index f18c664..bed1309 100644 --- a/plans/demo.jmx +++ b/plans/demo.jmx @@ -1,7 +1,7 @@ - + - + false false @@ -12,16 +12,15 @@ - test continue false - 5 + 5 100 1 - 1490452751000 - 1490452751000 + 1521401194000 + 1521401194000 false @@ -43,7 +42,6 @@ false true false - HttpClient4 false @@ -75,10 +73,7 @@ true 0 true - true true - true - true