Argos Configuration

Argos orchestrate its ecosystem with different configuration files.

File location

The location of the configuration files is /etc/argos/configurations/. The configuration files can be found in the configuration folder of argos

/etc/argos/configuration/
  • grafana configuration

    /etc/argos/configurations/grafana/grafana.ini
    
  • telegraf configuration

    /etc/argos/configurations/telegraf/telegraf.conf
    
  • hermes configurations

    /etc/argos/configurations/hermes/
    
  • nginx configurations

    /etc/argos/configurations/nginx/site-available/argos
    

Hermes

Hermes is the python library that collect the metrics; its job is to retrieve, ingest and interpret test and CI artifacts.
Hermes configuration describes which metric must be calculated for which project and from which repository.

The section “Hermes configuration” explains how to configure Hermes.

Telegraf

Telegraf is the open source server agent that invokes Hermes API and stores collected metrics into Influx database. Each new metric or new project must be added into Telegraf configuration. Under metric section there is a configuration example for each metric.

Info of how configure Telegraf can be found in the official documentation:

Grafana

Grafana is the open source analytics and monitoring solution for the Argos’ metrics.
Default port 81

Info of how configure Grafana can be found in the official documentation:

Nginx

Reverse proxy server.
Default port 80

Info of how configure Nginx can be found in the official documentation:

Hermes configuration

Hermes’ configuration is located under hermes folder of Argos configuration files and it composed by two files and one folder which contains all the project configuration files.
Each configuration file is a YAML file.
  • index.yml

  • repository.yml

  • projects/
    • project_1.yml

    • project_n.yml

index.yml

This file contains the information of where a project’s configuration is located.

projects:
  - name: "lmc-base-classes"
    filename: "lmc-base-classes.yml"
  - name: "tango-example"
    filename: "tango-example.yml"
  - name: "csp-lmc-prototype"
    filename: "csp-lmc-prototype.yml"
  • name: name of the project.

  • filename: filename inside projects folder.

repository.yml

This file contains the information of all the repositories from which artifacts of the metrics are retrieved.

repositories:
  - name: "local_gitlab"
    address: "10.8.0.80"
    port: "10080"
    token: "uPuPdWdWSxDxSxDxBa"
    type: "gitlab"
    protocol: "http"
  - name: "gitlab_ska"
    address: "gitlab.com"
    port: ""
    token: "IDDQD"
    type: "gitlab"
    protocol: "https"
  • name: name of the repository.

  • address: ip address of the repository.

  • port: specific port of the repository. If it’s not specified leave the attribute as an empty string.

  • token: authentication token.

  • type: type of repository. Only type supported at date is “gitlab”.

  • protocol: communication protocol. Only protocols supported are “http” and “https”

projects/

Projects folder contains all the file configuration of the projects.
Each project has his own configuration file.

project_name.yml

project: "lmc-base-classes"
repository_id: "gitlab_ska"
project_id: "10753328"
metrics:
  - name: "totalExecutedTests"
    artifacts:
      - name: "public/report"
        format: "JSON"
        structure: "pytest"
        test_level: "unit"
        pipeline_job: "pages"
  • project: name of the project defined inside index.yml

  • repository_id: name of the repository defined inside repository.yml

  • project_id: project’s id inside the ci repository

  • metrics: list of different metrics and their artifact.

Supported metrics

This section describes the supported metrics which can be inserted in the “metrics” attribute of the project file.

totalExecutedTests
- name: "totalExecutedTests"
  artifacts:
    - name: "public/report"
      format: "JSON"
      structure: "pytest"
      test_level: "unit"
      pipeline_job: "pages"
  • name: name of the metric. MUST NOT BE CHANGED.

  • artifacts: list of metric’s artifact.

    • name: relative filepath and name of artifact’s file (without extension).

    • format: format/extension of the file. Supported file format are “xml” and “JSON”.

    • structure: name of the testing framework which generates the artifact. Supported framework is “jest”.

    • test_level: level of the test set of the artifact.

    • pipeline_job: name of the pipeline’s job which contains the artifact.

Configuration to be added to telegraf.conf.
Be sure to change project name in the commands variable.
[[inputs.exec]]

commands = ["/usr/lib/argos/bin/python3 /usr/lib/argos/ingesters/argos_ingester.py -p <project_name> -l unit -m totalExecutedTests"]
timeout = "30s"
interval = "5m"

name_override = "executedTests"

data_format = "json"
tag_keys = ["level","project", "event"]
json_string_fields = ["message"]

json_time_key = "time"
json_time_format = "2006-01-02T15:04:05Z07:00"
coverage
- name: "coverage"
  artifacts:
    - name: "build/reports/code-coverage"
      format: "xml"
      structure: "pytest"
      test_level: "unit"
      pipeline_job: "create_ci_metrics"
  • name: name of the metric. MUST NOT BE CHANGED.

  • artifacts: list of metric’s artifact.

    • name: relative filepath and name of artifact’s file (without extension).

    • format: format/extension of the file. Supported file format are “xml” and “JSON”.

    • structure: name of the testing framework which generates the artifact. Supported framework is “pytest”.

    • test_level: level of the test set of the artifact.

    • pipeline_job: name of the pipeline’s job which contains the artifact.

Configuration to be added to telegraf.conf.
Be sure to change project name in the commands variable.
[[inputs.exec]]

commands = ["/usr/lib/argos/bin/python3 /usr/lib/argos/ingesters/argos_ingester.py -p <project_name> -l unit -m coverage"]
timeout = "30s"
interval = "5m"

name_override = "coverage"

data_format = "json"
tag_keys = ["project", "event"]
json_string_fields = ["message"]

json_time_key = "time"
json_time_format = "2006-01-02T15:04:05Z07:00"
linesOfCode
- name: "linesOfCode"
  artifacts:
    - name: "build/reports/code-coverage"
      format: "xml"
      structure: "pytest"
      test_level: "unit"
      pipeline_job: "create_ci_metrics"
  • name: name of the metric. MUST NOT BE CHANGED.

  • artifacts: list of metric’s artifact.

    • name: relative filepath and name of artifact’s file (without extension).

    • format: format/extension of the file. Supported file format are “xml” and “JSON”.

    • structure: name of the testing framework which generates the artifact. Supported framework is “pytest”.

    • test_level: level of the test set of the artifact.

    • pipeline_job: name of the pipeline’s job which contains the artifact.

Configuration to be added to telegraf.conf.
Be sure to change project name in the commands variable.
[[inputs.exec]]

commands = ["/usr/lib/argos/bin/python3 /usr/lib/argos/ingesters/argos_ingester.py -p <project_name> -l unit -m linesOfCode"]
timeout = "30s"
interval = "5m"

name_override = "linesOfCode"

data_format = "json"
tag_keys = ["level","project", "event"]
json_string_fields = ["message"]


json_time_key = "time"
json_time_format = "2006-01-02T15:04:05Z07:00"
pipelines
- name: "pipelines"
  artifacts:
    - format: "JSON"
      structure: "influx"
      test_level: "all"

Warning

All the attributes of this configuration should not be changed.

Configuration to be added to telegraf.conf.
Be sure to change project name in the commands variable and be sure to have the same test level in the configuration and in telegraf command.
[[inputs.exec]]

commands = ["/usr/lib/argos/bin/python3 /usr/lib/argos/ingesters/argos_ingester.py -p <project_name> -l all -m pipelines"]
timeout = "30s"
interval = "5m"

name_override = "pipelines"

data_format = "json"
tag_keys = ["level","project", "event", "branch"]
json_string_fields = ["message", "status"]

json_time_key = "time"
json_time_format = "2006-01-02T15:04:05Z07:00"
dailyPipelines
- name: "dailyPipelines"
  artifacts:
    - format: "influx"
      test_level: "all"

Warning

All the attributes of this configuration should not be changed.

Configuration to be added to telegraf.conf.
Be sure to change project name in the commands variable and be sure to have the same test level in the configuration and in telegraf command.
[[inputs.exec]]

commands = ["/usr/lib/argos/bin/python3 /usr/lib/argos/ingesters/argos_ingester.py -p <project_name> -l all -m dailyPipelines"]
timeout = "30s"
interval = "5m"

name_override = "dailyPipelines"

data_format = "json"
tag_keys = ["level","project", "event"]
json_string_fields = ["message"]

json_time_key = "time"
json_time_format = "2006-01-02T15:04:05Z07:00"
timeBetween
- name: "timeBetween"
  artifacts:
    - format: "influx"
      test_level: "all"

Warning

All the attribute of this configuration MUST NOT BE CHANGED.

Configuration to be added to telegraf.conf.
Be sure to change project name in the commands variable and be sure to have the same test level in the configuration and in telegraf command.
[[inputs.exec]]

commands = ["/usr/lib/argos/bin/python3 /usr/lib/argos/ingesters/argos_ingester.py -p <project_name> -l all -m timeBetween"]
timeout = "30s"
interval = "5m"

name_override = "timeBetween"

data_format = "json"
tag_keys = ["level","project", "event"]
json_string_fields = ["message"]

json_time_key = "time"
json_time_format = "2006-01-02T15:04:05Z07:00"
testDensity
- name: "testDensity"
  artifacts:
    - format: "influx"
      test_level: "all"

Warning

All the attribute of this configuration should not be changed.

Configuration to be added to telegraf.conf.
Be sure to change project name in the commands variable and be sure to have the same test level in the configuration and in telegraf command.
[[inputs.exec]]

commands = ["/usr/lib/argos/bin/python3 /usr/lib/argos/ingesters/argos_ingester.py -p <project_name> -l all -m testDensity"]
timeout = "60s"
interval = "5m"

name_override = "testDensity"

data_format = "json"
tag_keys = ["project", "event"]
json_string_fields = ["message"]

json_time_key = "time"
json_time_format = "2006-01-02T15:04:05Z07:00"

Project Example

project: "lmc-base-classes"
repository_id: "gitlab_ska"
project_id: "15113915"
metrics:
  - name: "linesOfCode"
    artifacts:
      - name: "build/reports/code-coverage"
        format: "xml"
        structure: "pytest"
        test_level: "unit"
        pipeline_job: "create_ci_metrics"
  - name: "coverage"
    artifacts:
      - name: "build/reports/code-coverage"
        format: "xml"
        structure: "pytest"
        test_level: "unit"
        pipeline_job: "create_ci_metrics"
  - name: "totalExecutedTests"
    artifacts:
      - name: "build/reports/unit-tests"
        format: "xml"
        structure: "jest"
        test_level: "unit"
        pipeline_job: "create_ci_metrics"
  - name: "testDensity"
    artifacts:
      - format: "influx"
        test_level: "all"
  - name: timeBetween
    artifacts:
      - format: "influx"
        test_level: "all"
  - name: "pipelines"
    artifacts:
      - format: "json"
        structure: "influx"
        test_level: "all"
  - name: "dailyPipelines"
    artifacts:
      - format: "influx"
        test_level: "all"