Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment Variable "JMETER_FLAGS" is passed to Lucy, but does not be passed to Gru #23

Closed
xianing1977 opened this issue Apr 20, 2018 · 3 comments
Labels

Comments

@xianing1977
Copy link

I added JMETER_FLAGS in docker run command "docker run -v $PWD/plans:/plans -v $PWD/keys:/keys -v $PWD/logs:/logs --env AWS_ACCESS_KEY_ID=XXXXXXXXXX --env AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXX --env AWS_DEFAULT_REGION=us-west-1 --env SECURITY_GROUP=XXXXXXXXXXXXX --env SUBNET_ID=XXXXXXXXXXXXX,XXXXXXXXXXXXX --env KEY_NAME=XXXXXXXXXXXXX --env JMETER_FLAGS=-Jduration=60 --env MINION_COUNT=2 smithmicro/lucy /plans/xxx.jmx", The "JMETER_FLAGS" is only passed to Lucy, but not passed to Gru.

I think the problem is in Lucy.sh, line 144
"docker run -p 1099:1099 -p 51000:51000 -v /tmp:/plans -v /logs:/logs --env MINION_HOSTS=$MINION_HOSTS smithmicro/jmeter:$JMETER_VERSION $JMX_IN_COMTAINER"

Should be
"docker run -p 1099:1099 -p 51000:51000 -v /tmp:/plans -v /logs:/logs --env MINION_HOSTS=$MINION_HOSTS --env JMETER_FLAGS=$JMETER_FLAGS smithmicro/jmeter:$JMETER_VERSION $JMX_IN_COMTAINER"

@dsperling
Copy link
Member

You are right. Let me get this tested and deployed. Good find.

@dsperling dsperling added the bug label Jan 17, 2019
@innokentiyt
Copy link

innokentiyt commented Jan 21, 2019

Environment variables with "equals" (=) sign (for example, -GmyCustomJMeterProperty=3) cannot be passed to Gru using current project code.

A simple solution is to wrap everything after --env with single quotation marks. Example:

# In lucy.sh
docker run -p 1099:1099 -p 51000:51000 -v /tmp:/plans -v /logs:/logs --env MINION_HOSTS=$MINION_HOSTS --env 'JMETER_FLAGS=$JMETER_FLAGS' smithmicro/jmeter:$JMETER_VERSION $JMX_IN_COMTAINER
# In docker run template
docker run -v <path to jmx>:/plans -v <path to pem>:/keys -v <path to logs>:/logs \
    --env AWS_ACCESS_KEY_ID=<key id> \
    --env AWS_SECRET_ACCESS_KEY=<access key> \
    --env AWS_DEFAULT_REGION=<region> \
    --env SECURITY_GROUP=<security group within your VPC> \
    --env SUBNET_ID=<subnet IDs within your VPC> \
    --env KEY_NAME=<key pair name without extension> \
    --env MINION_COUNT=<number of minions> \
    --env 'JMETER_FLAGS=-GmyCustomJMeterProperty=3' \
    smithmicro/lucy /plans/demo.jmx

@dsperling
Copy link
Member

Fixed in v2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants