diff --git a/Dockerfile b/Dockerfile index 41c78bee0442b1b999c37959f64202618f7e3e1a..167bd2654cadb70839c904212cbf55f257dc18a3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,8 @@ RUN apt-get update -y && apt-get install -y \ r-base \ r-base-dev \ libudunits2-dev \ + cowsay \ + less \ --no-install-recommends \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -23,14 +25,18 @@ RUN apt-get update -y && apt-get install -y \ COPY 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 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..319909a671cf2db6aa95aa8ce9ca0595da902055 --- /dev/null +++ b/docker/bashrc @@ -0,0 +1,13 @@ +source /etc/bashrc + +function csv_viewer { + column -t -s, -n "$@" | less -F -S -X -K +} +alias doc_motd="bash /trainbenchmark/docs/motd" +alias doc_basic="bash /trainbenchmark/docs/basic" +alias doc_advanced="bash /trainbenchmark/docs/advanced" + +alias cowsay="cowsay -f /trainbenchmark/docker/frog.cow" +alias cowsay_tip="shuf -n 1 /trainbenchmark/docker/tips | cowsay -f /trainbenchmark/docker/frog.cow" + +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..ba8f3b2fba55a52068b45b9853dfdd536b6265d7 --- /dev/null +++ b/docker/tips @@ -0,0 +1,6 @@ +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? diff --git a/docs/advanced b/docs/advanced new file mode 100644 index 0000000000000000000000000000000000000000..1ff79dd35e7e1e28a58660843132509cfce4600a --- /dev/null +++ b/docs/advanced @@ -0,0 +1,18 @@ +#!/bin/bash +echo -e "\033[1;91mAdvanced Configuration:" +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/docs/basic b/docs/basic new file mode 100644 index 0000000000000000000000000000000000000000..e453350baae0ab7c6bbb12f13c0fcde096d4439a --- /dev/null +++ b/docs/basic @@ -0,0 +1,10 @@ +#!/bin/bash +echo -e "\033[1;96mQuick Start" +echo -e "\033[0m* ./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/docs/motd b/docs/motd new file mode 100644 index 0000000000000000000000000000000000000000..061cf56d5a7aa37e223c01e7fb87858122320b2a --- /dev/null +++ b/docs/motd @@ -0,0 +1,21 @@ +#!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +# echo -e " " +# echo -e " * ) ) ) ) " +# echo -e " ) /( ( ) ( ( /( ( ( /( ) ) ( ( /( " +# echo -e " ( )(_)))( ( /( )\ ( )\()) ))\ ( ( )\()) ( ( /( )( )\()) " +# echo -e "(_(_())(()\ )(_))((_) )\ ) ((_)\ /((_) )\ ) )\ ((_)\ )\ ' )(_))(()\ ((_)\ " +# echo -e "|_ _| ((_)((_)_ (_) _(_/( | |(_)(_)) _(_/( ((_)| |(_) _((_)) ((_)_ ((_)| |(_) " +# echo -e " | | | '_|/ _' | | || ' \))| '_ \/ -_)| ' \))/ _| | ' \ | ' \()/ _' || '_|| / / " +# echo -e " |_| |_| \__,_| |_||_||_| |_.__/\___||_||_| \__| |_||_||_|_|_| \__,_||_| |_\_\ " +# echo -e " " +cowsay_tip +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