forked from naver/ngrinder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
juno.yoon
committed
May 24, 2016
1 parent
b825727
commit 3a04f44
Showing
8 changed files
with
52 additions
and
17 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
File renamed without changes.
10 changes: 8 additions & 2 deletions
10
docker/standalone/controller/Dockerfile → docker/controller/Dockerfile
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,22 +1,28 @@ | ||
FROM jeanblanchard/java | ||
MAINTAINER JunHo Yoon "[email protected]" | ||
|
||
RUN apk update; apk add curl | ||
|
||
# Set up environment variables | ||
ENV BASE_DIR=/opt | ||
|
||
# Download ngrinder controller file | ||
RUN mkdir -p $BASE_DIR | ||
RUN mkdir -p $BASE_DIR/ngrinder-controller | ||
|
||
# Expose ports | ||
EXPOSE 80 16001 12000-12009 | ||
|
||
# Volume mappting | ||
VOLUME ["/root/.ngrinder"] | ||
|
||
ADD http://www.h2database.com/h2-2014-04-05.zip ${BASE_DIR} | ||
RUN cd ${BASE_DIR} && unzip h2* | ||
|
||
# Copy initial excution script | ||
ADD scripts /scripts | ||
|
||
ADD binary/*.war ${BASE_DIR}/ | ||
# Copy final binary | ||
ADD binary/*.war ${BASE_DIR}/ngrinder-controller/ | ||
|
||
# Excution | ||
CMD ["/scripts/run.sh"] | ||
|
3 changes: 2 additions & 1 deletion
3
docker/standalone/controller/build-docker.sh → docker/controller/build-docker.sh
100644 → 100755
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,5 @@ | ||
#!/usr/bin/env bash | ||
mkdir -p binary | ||
cp ../../../ngrinder-controller/target/*.war binary/ | ||
rm binary/* | ||
cp ../../ngrinder-controller/target/*.war binary/ | ||
docker build -t ngrinder-controller . |
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,36 @@ | ||
#!/bin/sh | ||
|
||
cd ${BASE_DIR}/h2/bin | ||
java -cp h2*.jar org.h2.tools.Server & | ||
sleep 2 | ||
|
||
idx=1 | ||
p_base=79 | ||
clp_base=10009 | ||
cp_base=9009 | ||
tail_cmd="tail " | ||
|
||
if [ -z ${COUNT} ] || [ ${COUNT} -lt 2 ] | ||
then | ||
java -XX:MaxPermSize=200m -jar ${BASE_DIR}/ngrinder-controller/ngrinder-*.war --port 80 | ||
|
||
else | ||
while [ $idx -le ${COUNT} ]; do | ||
var_region="REGION_${idx}" | ||
eval region_name='$'$var_region | ||
if [ ${#region_name} -eq 0 ]; then | ||
region_name="region${idx}" | ||
fi | ||
java -jar -XX:MaxPermSize=200m -jar ${BASE_DIR}/ngrinder-controller/ngrinder-*.war --port $((p_base + idx)) -cm easy -clp $((clp_base + idx)) -r ${region_name} -cp $((cp_base + idx)) -Dcontroller.max_concurrent_test=3 -Dcontroller.verbose=false & | ||
i=1 | ||
while [ $i -le 40 ]; do | ||
curl http://127.0.0.1:$((p_base + idx)) && break 2> /dev/null | ||
sleep 10 && i=$((i + 1)) | ||
done | ||
tail_cmd="${tail_cmd} -f /root/.ngrinder_ex/logs/ngrinder_${region_name}.log " | ||
idx=$((idx + 1)) | ||
done | ||
eval ${tail_cmd} | ||
|
||
fi | ||
|
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,18 +1,13 @@ | ||
FROM centos:centos6 | ||
FROM jeanblanchard/java | ||
MAINTAINER JunHo Yoon "[email protected]" | ||
|
||
|
||
# Install necessary packages | ||
RUN yum -y install wget tar vim java-1.7.0-openjdk-devel.x86_64 | ||
|
||
# Set up environment variables | ||
ENV BASE_DIR=/opt \ | ||
AGENT_HOME=$BASE_DIR/ngrinder-agent \ | ||
JAVA_HOME=/etc/alternatives/java_sdk \ | ||
PATH=$PATH:$JAVA_HOME/bin:$AGENT_HOME \ | ||
VERSION=3.3 | ||
|
||
ADD ngrinder-agent-${VERSION}.tar $BASE_DIR/builtin | ||
ADD binray/* $BASE_DIR/builtin | ||
|
||
|
||
# Copy initial excution script | ||
ADD scripts /scripts | ||
|
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 was deleted.
Oops, something went wrong.