diff --git a/cache/Dockerfile b/cache/Dockerfile index b107533..3661904 100644 --- a/cache/Dockerfile +++ b/cache/Dockerfile @@ -1,4 +1,4 @@ -FROM node:7.0.0 +FROM node:20-buster MAINTAINER Mingyang Wang # Install necessary dependencies and tools diff --git a/load_test.sh b/load_test.sh new file mode 100644 index 0000000..14c3497 --- /dev/null +++ b/load_test.sh @@ -0,0 +1,24 @@ +# Using default shell; no shebang + +# Check if brew is installed +brew=$(which -s brew) +echo "$brew" +if [ -z "$brew" ]; then + echo "Please install Brew First" + exit 1 +fi + +# brew update && brew install vegeta + + +echo 'GET http://localhost:80/photo/97b72fb0-a84a-11e6-bf37-6d2c86545d91' | \ + vegeta attack --rate=300 -duration 5m | vegeta encode | \ + jaggr @count=rps \ + hist\[100,200,300,400,500\]:code \ + p25,p50,p95:latency \ + sum:bytes_in \ + sum:bytes_out | \ + jplot rps+code.hist.100+code.hist.200+code.hist.300+code.hist.400+code.hist.500 \ + latency.p95+latency.p50+latency.p25 \ + bytes_in.sum+bytes_out.sum + diff --git a/proxy/Dockerfile b/proxy/Dockerfile index 2c26c8d..0ceefd8 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM nginx:1.11.5 +FROM nginx:bullseye MAINTAINER Mingyang Wang # override default configuration diff --git a/run.sh b/run.sh index bc5e50f..3c3ab0a 100755 --- a/run.sh +++ b/run.sh @@ -80,6 +80,7 @@ echo "Start running Haystack prototype" echo "-----------------------------------------------------------" # Create a bridge network for the components +echo "" docker network create \ --driver bridge \ --subnet $SUBNET \ @@ -87,12 +88,13 @@ docker network create \ $NETWORK -# Create a data volumn container to simulate Distributed File System +# Create a data volume container to simulate Distributed File System # docker run -d --name $DATA_CONTAINER $DATA_IMAGE # Create the Cache server container # Currently use a Docker data volume to simulate Distributed File System # indicated by flag '-v' +echo "" docker run -itd \ --name $CACHE_CONTAINER \ --network $NETWORK \ @@ -103,6 +105,7 @@ docker run -itd \ # Create the Directory server container +echo "" docker run -itd \ --name $DIRECTORY_CONTAINER \ --network $NETWORK \ @@ -113,10 +116,10 @@ docker run -itd \ # Create a tiny table sleep 30 # wait for Cassandra initialization docker exec -d $DIRECTORY_CONTAINER cqlsh -f /root/init_table.txt - sleep 30 # wait for Cassandra table creation # Create the web front server container +echo "" docker run -itd \ --name $WEBFRONT_CONTAINER \ --network $NETWORK \ @@ -125,6 +128,7 @@ docker run -itd \ # Create the proxy container +echo "" docker run -itd \ --name $PROXY_CONTAINER \ --network $NETWORK \ @@ -133,6 +137,7 @@ docker run -itd \ $PROXY_IMAGE # Create the storage container +echo "" docker run -itd \ --name $STORAGE_CONTAINER1 \ --network $NETWORK \ @@ -140,6 +145,7 @@ docker run -itd \ -p $STORAGE_SERVER_PORT1:$STORAGE_INTERNAL_PORT \ $STORAGE_IMAGE +echo "" docker run -itd \ --name $STORAGE_CONTAINER2 \ --network $NETWORK \ diff --git a/storage/Dockerfile b/storage/Dockerfile index f66cdb5..7c40c2d 100644 --- a/storage/Dockerfile +++ b/storage/Dockerfile @@ -1,14 +1,17 @@ -FROM node:7.0.0 +FROM node:20-buster MAINTAINER Kun Huang , Junbo Ke # Install necessary dependencies and tools RUN apt-get update && apt-get install -y redis-server -RUN npm install filepointer + # Create app directory RUN mkdir -p /root/app WORKDIR /root/app +# This should be after setting up WORKDIR +RUN npm install filepointer + # Install app dependences COPY package.json /root/app RUN npm install diff --git a/webfront/Dockerfile b/webfront/Dockerfile index c497d6d..8639899 100644 --- a/webfront/Dockerfile +++ b/webfront/Dockerfile @@ -1,4 +1,4 @@ -FROM node:7.0.0 +FROM node:20-buster MAINTAINER Mingyang Wang # Install necessary dependencies and tools diff --git a/webfront/start_service.sh b/webfront/start_service.sh index 971b164..b5abbff 100644 --- a/webfront/start_service.sh +++ b/webfront/start_service.sh @@ -1,2 +1 @@ -/usr/bin/redis-server & -node server.js +/usr/bin/redis-server & node server.js