diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..45c917cf0d91d9cff8af9554725a61116e2bb974 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.gitlab-ci +Dockerfile +.dockerignore +models +.git diff --git a/Dockerfile b/Dockerfile index 0c18c673d8924fddd6264f5694105f2867573fab..7656ba4802059e83b27a3e9e28ddc9ee5a1e2047 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,21 +22,20 @@ RUN apt-get update -y && apt-get install -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -COPY trainbenchmark-reporting/install.R /trainbenchmark/trainbenchmark-reporting/install.R +COPY trainbenchmark/trainbenchmark-reporting/install.R /trainbenchmark/trainbenchmark-reporting/install.R RUN Rscript /trainbenchmark/trainbenchmark-reporting/install.R #USER user WORKDIR /trainbenchmark -COPY --chown=user:user . . +COPY --chown=user:user trainbenchmark/ /trainbenchmark/ +COPY --chown=user:user docker /trainbenchmark/docker COPY docker/bashrc /home/user/.bashrc RUN ./gradlew --no-daemon preprocess RUN ./gradlew --no-daemon build shadowJar -x test RUN ./gradlew --no-daemon initScripts - - # when benchmarking run: # RUN ./gradlew --no-daemon generate # RUN ./gradlew --no-daemon individualInjectBenchmark diff --git a/docker/bashrc b/docker/bashrc new file mode 100644 index 0000000000000000000000000000000000000000..146be858b74bbb6bea7f7c57d9f88ddd1a08d6da --- /dev/null +++ b/docker/bashrc @@ -0,0 +1,15 @@ +function csv_viewer { + column -t -s, -n "$@" | less -F -S -X -K +} +alias configure_default="/trainbenchmark/scripts/configure.sh 1 1024 900 10" +alias configure_medium="/trainbenchmark/scripts/configure.sh 8 256 60 5" +alias configure_small="/trainbenchmark/scripts/configure.sh 1 128 20 2" + +alias doc_motd="bash /trainbenchmark/docs/motd" +alias doc_basic="bash /trainbenchmark/docs/basic" +alias doc_advanced="bash /trainbenchmark/docs/advanced" + +alias frogsay="/usr/games/cowsay -f /trainbenchmark/docker/frog.cow" +alias frogsay_tip="shuf -n 1 /trainbenchmark/docker/tips | frogsay" + +doc_motd diff --git a/docker/frog.cow b/docker/frog.cow new file mode 100644 index 0000000000000000000000000000000000000000..7ab944d97e6126780cd14ffb69201805aa1e38c8 --- /dev/null +++ b/docker/frog.cow @@ -0,0 +1,28 @@ +$the_cow =<<"EOC" + $thoughts + ___ _--_ + / - / \\ + ( OOO \\ ( @@ ) + | OOO _;\\-/| @@@_| + \\___/######\\___/\\ + /##############\\ + / ###### ## #| + / ##@##@## | + / ###### ## \\ + <______-------___\\ . //_ + | ____ | | //# \\__~__ + \\ $tongue \\ //### \\ \\ + | /\' ## ## ##\\ __--~--_ + \\_________- /\\ ) ^ ##|--########\\ + /--~-_\\________/_ | #@##|#######Y##| + | \\ ` /| /O/ ( ### \') ##/######/###/ + \\ \\ | | -- | ### /LLLLL--###/ + \\_ \\/ | \\_ \\ ) /####_____-- + ___ / \\ / | _-####\\ +(___/ -\\_________/ / -- |#####@@@@@@\'_ + (__\\_ __,) (.___ ,/ /##### `@@ + | -\\\\- //-// @@ @@@@@. + | | \\\\_ _// // @\' \'@@. + (.) \\_) / / // @@@ + (_) (_\' +EOC diff --git a/docker/tips b/docker/tips new file mode 100644 index 0000000000000000000000000000000000000000..8ba4f05f86f90ad9fdceeaebd238937943117747 --- /dev/null +++ b/docker/tips @@ -0,0 +1,7 @@ +Did you know? You can use "doc_motd" to display the login message +Use "doc_basic" to display the basic commands to run the benchmark +Use "doc_advanced" to see advanced configuration +Use "csv_view" to get a nicely formatted output of csv files +I am the Fog Frog +What the Fog? +Use "./scripts/configure.sh" to change problem sizes. Some defaults are also inside the commands "configure_default", "configure_medium", "configure_small" diff --git a/trainbenchmark/docs/advanced b/trainbenchmark/docs/advanced new file mode 100644 index 0000000000000000000000000000000000000000..5c0159e23a1a09823e8c1a8cbd3bd9ea5603af61 --- /dev/null +++ b/trainbenchmark/docs/advanced @@ -0,0 +1,21 @@ +#!/bin/bash +echo -e "\033[1;91mAdvanced Configuration:" +echo -e "" +echo -e "\033[1;91mCoarse Configuration" +echo -e "\033[0mUse the ./scripts/configure.sh command or configure_small or configure_medium or configure_default" +echo -e "" +echo -e "\033[1;91mGeneration of test-models" +echo -e "\033[0mFor example to change the maxSize option. Can be configured inside:" +echo -e "* trainbenchmark-scripts/src-template/GeneratorScript.groovy" +echo -e "When you are finished, run:" +echo -e "* ./gradlew initScripts" +echo -e "* ./gradlew generate" +echo -e "" +echo -e "\033[1;91mBenchmarking" +echo -e "\033[0mCan be configured inside:" +echo -e "* trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy" +echo -e "* trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy" +echo -e "When you are finished, run:" +echo -e "* ./gradlew initScripts" +echo -e "* ./gradlew individualInjectBenchmark" +echo -e "* ./gradlew individualRepairBenchmark" diff --git a/trainbenchmark/docs/basic b/trainbenchmark/docs/basic new file mode 100644 index 0000000000000000000000000000000000000000..4daa18a5ccd3c79cd9cd04945251569557697746 --- /dev/null +++ b/trainbenchmark/docs/basic @@ -0,0 +1,11 @@ +#!/bin/bash +echo -e "\033[1;96mQuick Start" +echo -e "\033[0m* configure_small" +echo -e "* ./gradlew generate # will generate the test-models in default settings takes ~40gb" +echo -e "* ./gradlew individualInjectBenchmark" +echo -e "* ./gradlew individualRepairBenchmark" +echo -e "" +echo -e "\033[1;96mReading the Benchmark results" +echo -e "\033[0mResults of individualInjectBenchmark and individualRepairBenchmark are stored inside:" +echo -e "* XXXX for graphs" +echo -e "* XXXX for csv - use command: csv_viewer data.csv" diff --git a/trainbenchmark/docs/motd b/trainbenchmark/docs/motd new file mode 100644 index 0000000000000000000000000000000000000000..8cd2dfe9e66dfb60509b035dc444c92ae13df650 --- /dev/null +++ b/trainbenchmark/docs/motd @@ -0,0 +1,21 @@ +#!/bin/bash +# echo -e " " +# echo -e " * ) ) ) ) " +# echo -e " ) /( ( ) ( ( /( ( ( /( ) ) ( ( /( " +# echo -e " ( )(_)))( ( /( )\ ( )\()) ))\ ( ( )\()) ( ( /( )( )\()) " +# echo -e "(_(_())(()\ )(_))((_) )\ ) ((_)\ /((_) )\ ) )\ ((_)\ )\ ' )(_))(()\ ((_)\ " +# echo -e "|_ _| ((_)((_)_ (_) _(_/( | |(_)(_)) _(_/( ((_)| |(_) _((_)) ((_)_ ((_)| |(_) " +# echo -e " | | | '_|/ _' | | || ' \))| '_ \/ -_)| ' \))/ _| | ' \ | ' \()/ _' || '_|| / / " +# echo -e " |_| |_| \__,_| |_||_||_| |_.__/\___||_||_| \__| |_||_||_|_|_| \__,_||_| |_\_\ " +# echo -e " " +echo "Welcome to the Trainbenchmark! I'll be your guide.. just type frogsay_tip" | /usr/games/cowsay -f /trainbenchmark/docker/frog.cow +#DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +#bash $DIR/basic +echo -e "" +echo -e "\033[1;96mDocumentation" +echo -e "\033[0mRun the following commands" +echo -e "* doc_motd # displays this message" +echo -e "* doc_basic # displays the basic guide" +echo -e "* doc_advanced # displays the advanced guide" +echo -e "" +# bash $DIR/advanced diff --git a/trainbenchmark/scripts/configure.sh b/trainbenchmark/scripts/configure.sh new file mode 100644 index 0000000000000000000000000000000000000000..fb3a9d59b65c10bcaf509cf2965fc7ca89b8242b --- /dev/null +++ b/trainbenchmark/scripts/configure.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +cd "$( cd "$( dirname "$0" )" && pwd )/../"||exit 1 + +MINSIZE="$1" +MAXSIZE="$2" +TIMEOUT="$3" +RUNS="$4" + +if [ -z "$RUNS" ] +then + echo "Usage: ./scripts/configure.sh min max timeout runs" + echo "Will configure the generateor and benchmark to use problems between sizes min and max" + echo "The benchmark receives a timeout in seconds and the amount of runs" + echo "Default is: ./scripts/configure.sh 1 1024 900 10" + exit 1 +fi + +echo -e "\\033[1;96mRemember that this only configures and initializes. Further steps:" +echo -e "\\033[1;91mGenerate:" +echo -e "\\033[0m if not yet done run ./gradlew generate" +echo " maxSize 1024 -> ~40GB of data" +echo -e "\\033[1;91mBenchmark:" +echo -e "\\033[0m ./gradlew individualInjectBenchmark" +echo " ./gradlew individualRepairBenchmark" + +sed -i "s/^def minSize =.*/def minSize = $MINSIZE/" ./trainbenchmark-scripts/src-template/GeneratorScript.groovy +sed -i "s/^def maxSize =.*/def maxSize = $MAXSIZE/" ./trainbenchmark-scripts/src-template/GeneratorScript.groovy +sed -i "s/^def minSize =.*/def minSize = $MINSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def maxSize =.*/def maxSize = $MAXSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def timeout =.*/def timeout = $TIMEOUT/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def runs =.*/def runs = $RUNS/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkInjectScript.groovy +sed -i "s/^def minSize =.*/def minSize = $MINSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +sed -i "s/^def maxSize =.*/def maxSize = $MAXSIZE/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +sed -i "s/^def timeout =.*/def timeout = $TIMEOUT/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +sed -i "s/^def runs =.*/def runs = $RUNS/" ./trainbenchmark-scripts/src-template/IndividualBenchmarkRepairScript.groovy +./gradlew --no-daemon initScripts