Skip to content

Deployment with Docker

Wolfgang Hotwagner edited this page Nov 6, 2020 · 21 revisions

Work In Progress

Building the docker-image

Download the repository

$ git clone -b development https://github.com/ait-aecid/logdata-anomaly-miner.git

Build the Image

Please note that in this example the version of logdata-anomaly-miner was 2.1.0. Use the version-number that you downloaded!

$ cd logdata-anomaly-miner
$ docker build -t aecid/logdata-anomaly-miner:latest -t aecid/logdata-anomaly-miner:2.1.0 .

First run

Next we will simply start the aminer and give out the version string.

First let's copy and prepare the configuration directory:

$ cp -r source/root/etc/aminer/ aminercfg
$ cp aminercfg/template_config.yml aminercfg/config.yml
$ mkdir logs
$ mkdir persistency 

Run aminer:

docker run -v $PWD/aminercfg:/etc/aminer -v $PWD/persistency:/var/lib/aminer -v $PWD/logs:/logs -it aecid/logdata-anomaly-miner aminer --version

docker-usage

Please note that we did not configure the aminer properly. It won't parse any logs with this template configuration

Usage

Mountpoints/Volumes

In order to run the logdata-anomaly-miner in production, we need to configure some volumes:

Mountpoint Description Access-Mode
/etc/aminer The configuration directory ro
/var/lib/aminer The directory for the persistency rw
/logs The directory where the logdata-anomaly-miner finds the logresources ro

Runmodes

Default

We can run the container without any command:

docker run -v $PWD/aminercfg:/etc/aminer -v $PWD/persistency:/var/lib/aminer -v $PWD/logs:/logs --rm aecid/logdata-anomaly-miner

This will execute the following command inside the container:

aminer --Config /etc/aminer/config.yml

Aminer with custom parameters

We can run the aminer with custom parameters. In the following example we execute the logdata-anomaly-miner with the command line parameter "--version":

docker run -v $PWD/aminercfg:/etc/aminer -v $PWD/persistency:/var/lib/aminer -v $PWD/logs:/logs  --rm aecid/logdata-anomaly-miner aminer --Help
            *     (        )       (     
   (      (  `    )\ )  ( /(       )\ )  
   )\     )\))(  (()/(  )\()) (   (()/(  
((((_)(  ((_)()\  /(_))((_)\  )\   /(_)) 
 )\ _ )\ (_()((_)(_))   _((_)((_) (_))   
 (_)_\(_)|  \/  ||_ _| | \| || __|| _ \  
  / _ \  | |\/| | | |  | .` || _| |   /  
 /_/ \_\ |_|  |_||___| |_|\_||___||_|_\  
   (Austrian Institute of Technology)
       (https://aecid.ait.ac.at)
            Version: 2.1.0

usage: aminer.py [options]
options:
  -c, --Config <config-file>          	path to the config-file
  -d, --Daemon                        	run as a daemon process
  -r, --RunAnalysis                   	enable/disable analysis
  -R, --Remove <persistence-directory>	removes a specific persistence directory
  -C, --Clear                         	removes all persistence directories
  -f, --FromBegin                     	removes RepositioningData before starting the AMiner
  -h, --Help                          	print this print_help screen
  -v, --Version                       	print version-string

AminerRemoteControl

We can also run the aminerremotecontrol with custom parameters:

docker run -v $PWD/aminercfg:/etc/aminer -v $PWD/persistency:/var/lib/aminer -v $PWD/logs:/logs --rm aecid/logdata-anomaly-miner aminerremotecontrol --Help
Usage: /usr/lib/logdata-anomaly-miner/aminerremotecontrol.py [arguments]
  --ControlSocket [socketpath]: when given, use nonstandard control socket.
  --Data [data]: provide this json serialized data within execution
    environment as 'remote_control_data' (see man page).
  --Exec [command]: add command to the execution list, can be
    used more than once.
  --ExecFile [file]: add commands from file to the execution list
    in same way as if content would have been used with "--Exec".
  --Help: this output
  --StringResponse: if set, print the response just as string
    instead of passing it to repr.

  For further information read the man pages running 'man AMinerRemoteControl'.

Clone this wiki locally