diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..110f54d --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..54b7f61 --- /dev/null +++ b/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# Usage ./build.sh repo/user [push] +# +IMAGE_PREFIX="${1:-app-simulator}" + +for DIR in nodes/*; +do + if [ -d $DIR ] ; then + echo "Building ${IMAGE_PREFIX}/app-simulator:`basename $DIR`..." + docker build --platform=linux/amd64 -t "${IMAGE_PREFIX}/app-simulator:`basename $DIR`" $DIR; + if [ "$2" == "push" ]; then + echo "Pushing ${IMAGE_PREFIX}/app-simulator:`basename $DIR` to registry ...." + docker push "${IMAGE_PREFIX}/app-simulator:`basename $DIR`" + # Add your commands here + fi + fi +done; + +for DIR in loaders/*; +do + if [ -d $DIR ] ; then + echo "Building ${IMAGE_PREFIX}/app-simulator:`basename $DIR`..." + docker build --platform=linux/amd64 -t "${IMAGE_PREFIX}/app-simulator:`basename $DIR`" $DIR; + if [ "$2" == "push" ]; then + echo "Pushing ${IMAGE_PREFIX}/app-simulator:`basename $DIR` to registry ...." + docker push "${IMAGE_PREFIX}/app-simulator:`basename $DIR`" + # Add your commands here + fi + fi +done; \ No newline at end of file diff --git a/loaders/curl/Dockerfile b/loaders/curl/Dockerfile new file mode 100644 index 0000000..ff7c325 --- /dev/null +++ b/loaders/curl/Dockerfile @@ -0,0 +1,6 @@ +FROM alpine:latest +RUN apk add --no-cache curl util-linux +WORKDIR /usr/bin/ +COPY loader.sh /usr/bin +RUN chmod +x /usr/bin/loader.sh +ENTRYPOINT ["/usr/bin/loader.sh"] diff --git a/loaders/curl/loader.sh b/loaders/curl/loader.sh new file mode 100755 index 0000000..55773c9 --- /dev/null +++ b/loaders/curl/loader.sh @@ -0,0 +1,16 @@ +#!/bin/sh +echo "Running CURL load in ${WAIT} seconds..." +echo "URLs to test" +echo "${URLS}" +echo "Sleep time inbetween requests ${SLEEP}" +sleep ${WAIT} +while [ true ] +do + ID=`uuidgen` + for URL in ${URLS} + do + /usr/bin/curl -s "${URL}?unique_session_id=${ID}" + #/usr/bin/curl -s -X POST -d "unique_session_id=${ID}" "${URL}" + done + sleep ${SLEEP} +done;