Commit 4d8a8c5b authored by Azat Khuziyakhmetov's avatar Azat Khuziyakhmetov
Browse files

extended README

parent 0a27d826
...@@ -7,7 +7,7 @@ The tool aggregates data in a format wich is suitable for generating reports. ...@@ -7,7 +7,7 @@ The tool aggregates data in a format wich is suitable for generating reports.
The aggregator needs particular software packages to be installed along with data available in DB. The aggregator needs particular software packages to be installed along with data available in DB.
- Python 3. - Python 3.
- InfluxDB. Currently the aggregator works only with InfluxDB, so it should be installed and configured as shown in configuration section below. - InfluxDB. Currently the aggregator works only with InfluxDB, so it should be installed and the aggregator should be configured as shown in configuration section below.
- DB should contain all required data specified in [DB cpec](https://gibraltar.chi.uni-hannover.de/profit-hpc/ProfiT-HPC/blob/d9a21af233ab373bf90420e3f0f0c05e1c65aef8/Internals/DB/InfluxDBspec.md). - DB should contain all required data specified in [DB cpec](https://gibraltar.chi.uni-hannover.de/profit-hpc/ProfiT-HPC/blob/d9a21af233ab373bf90420e3f0f0c05e1c65aef8/Internals/DB/InfluxDBspec.md).
## Configuration ## Configuration
...@@ -18,3 +18,49 @@ Real configs should be ignored in `.gitignore` file. ...@@ -18,3 +18,49 @@ Real configs should be ignored in `.gitignore` file.
Sample configs must not be used in the code. Sample configs must not be used in the code.
**Example**: `influxdb.sample` -> `influxdb.py` **Example**: `influxdb.sample` -> `influxdb.py`
## Usage
The main executable of the aggregator module is `data.py`. You can type `./data.py -p` for more help.
```
usage: data.py [-h] [-s] [-t {ascii,pdf}] JOBID
Gets the job information required for generating ASCII or PDF reports and
outputs it in JSON format. Optionaly it stores the job info in DB.
positional arguments:
JOBID job ID used in the batch system
optional arguments:
-h, --help show this help message and exit
-s, --save save batch info of the job in DB (default: False)
-t {ascii,pdf}, --type {ascii,pdf}
type of the output (default: ascii)
```
## Get test output
In order to get `json` output from the test data, located at `test/data`, a docker container with InfluxDB instanse and imported data should be running. To run the InfluxDB container, simply run:
```
test/docker/influxdb/run_influxdb.sh
```
After the influxDB instance is up you need to configure the aggregator to use it, by copying `influxdb.sample` -> `influxdb.py` and editing it as:
```
IDB = {
"username": "",
"password": "",
"database": "pfit",
"api_url": "http://localhost:58086",
"ssl": False,
}
```
As an example the following command will output the test data in the `json` format for `pdf` report:
```
./data.py -t pdf 2368599
```
## Export job info
If the `data.py` is called with `-s`(`--save`) flag as `data.py -s JOBID`, then the aggregator will gather a job information with ID `JOBID` from the batch system configured in `/conf/config.py` and save it into the configured database as a `pfit-jobinfo` measurement.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment