Skip to content
Snippets Groups Projects
Commit b28cb18a authored by geant-release-service's avatar geant-release-service
Browse files

Finished release 0.54.

parents c0bb8cd0 3c7ef809
Branches
Tags 0.54
No related merge requests found
[run]
concurrency=multiprocessing,thread
\ No newline at end of file
MIT License
Copyright (c) 2023 GÉANT Vereniging
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
...@@ -2,4 +2,5 @@ include brian_dashboard_manager/logging_default_config.json ...@@ -2,4 +2,5 @@ include brian_dashboard_manager/logging_default_config.json
include brian_dashboard_manager/dashboards/* include brian_dashboard_manager/dashboards/*
include brian_dashboard_manager/datasources/* include brian_dashboard_manager/datasources/*
include config.json.example include config.json.example
recursive-include brian_dashboard_manager/templating/templates * recursive-include brian_dashboard_manager/templating/templates *
\ No newline at end of file recursive-exclude test *
\ No newline at end of file
...@@ -203,7 +203,7 @@ CONFIG_SCHEMA = { ...@@ -203,7 +203,7 @@ CONFIG_SCHEMA = {
"datasources": { "datasources": {
"type": "object", "type": "object",
"properties": { "properties": {
"influxdb": {"$ref": "#definitions/influx-datasource"} "influxdb": {"$ref": "#/definitions/influx-datasource"}
}, },
"additionalProperties": False "additionalProperties": False
}, },
......
...@@ -231,11 +231,20 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards): ...@@ -231,11 +231,20 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards):
# MDVPN type services don't have data in BRIAN # MDVPN type services don't have data in BRIAN
continue continue
has_v6_interface = False
for interface in _interfaces:
if 'addresses' in interface:
for address in interface['addresses']:
if address.find(':') > 0:
has_v6_interface = True
break
dashboard['SERVICES'].append({ dashboard['SERVICES'].append({
'measurement': measurement, 'measurement': measurement,
'title': title, 'title': title,
'scid': scid, 'scid': scid,
'sort': (sid[:2], name) 'sort': (sid[:2], name),
'has_v6': has_v6_interface
}) })
def _check_in_aggregate(router, interface): def _check_in_aggregate(router, interface):
...@@ -486,7 +495,7 @@ def get_panel_fields(panel, panel_type, datasource): ...@@ -486,7 +495,7 @@ def get_panel_fields(panel, panel_type, datasource):
}) })
def default_interface_panel_generator(gridPos): def default_interface_panel_generator(gridPos, ipv6_only=False):
""" """
Helper for generating panel definitions for dashboards. Helper for generating panel definitions for dashboards.
...@@ -494,6 +503,7 @@ def default_interface_panel_generator(gridPos): ...@@ -494,6 +503,7 @@ def default_interface_panel_generator(gridPos):
panel data and panel type. panel data and panel type.
:param gridPos: generator for grid positions :param gridPos: generator for grid positions
:param ipv6_only: whether to use IPv6 traffic exclusively or not
:return: function that generates panel definitions :return: function that generates panel definitions
""" """
...@@ -515,20 +525,29 @@ def default_interface_panel_generator(gridPos): ...@@ -515,20 +525,29 @@ def default_interface_panel_generator(gridPos):
result = [] result = []
for panel in panels: for panel in panels:
result.append(get_panel_fields({ if ipv6_only:
**panel, if panel.get('has_v6', False):
**next(gridPos) result.append(get_panel_fields({
}, 'traffic', datasource)) **panel,
if panel.get('has_v6', False): **next(gridPos)
result.append(get_panel_fields({ }, 'IPv6', datasource))
**panel, else:
**next(gridPos) continue
}, 'IPv6', datasource)) else:
if errors:
result.append(get_panel_fields({ result.append(get_panel_fields({
**panel, **panel,
**next(gridPos) **next(gridPos)
}, 'errors', datasource)) }, 'traffic', datasource))
if panel.get('has_v6', False):
result.append(get_panel_fields({
**panel,
**next(gridPos)
}, 'IPv6', datasource))
if errors:
result.append(get_panel_fields({
**panel,
**next(gridPos)
}, 'errors', datasource))
return result return result
...@@ -567,6 +586,7 @@ def get_nren_dashboard_data_single(data, datasource, tag): ...@@ -567,6 +586,7 @@ def get_nren_dashboard_data_single(data, datasource, tag):
agg_panels = [] agg_panels = []
panel_gen = default_interface_panel_generator(gridPos) panel_gen = default_interface_panel_generator(gridPos)
panel_ipv6_gen = default_interface_panel_generator(gridPos, ipv6_only=True)
services_dropdown = create_dropdown_panel('Services', **next(gridPos)) services_dropdown = create_dropdown_panel('Services', **next(gridPos))
...@@ -578,6 +598,12 @@ def get_nren_dashboard_data_single(data, datasource, tag): ...@@ -578,6 +598,12 @@ def get_nren_dashboard_data_single(data, datasource, tag):
service_panels = panel_gen( service_panels = panel_gen(
sorted(dash['SERVICES'], key=sort_key), datasource) sorted(dash['SERVICES'], key=sort_key), datasource)
services_ipv6_dropdown = create_dropdown_panel('Services - IPv6 Only', **next(gridPos))
service_ipv6_panels = panel_ipv6_gen(
sorted(dash['SERVICES'], key=sort_key), datasource
)
iface_dropdown = create_dropdown_panel('Interfaces', **next(gridPos)) iface_dropdown = create_dropdown_panel('Interfaces', **next(gridPos))
phys_panels = panel_gen(dash['PHYSICAL'], datasource, True) phys_panels = panel_gen(dash['PHYSICAL'], datasource, True)
...@@ -590,6 +616,10 @@ def get_nren_dashboard_data_single(data, datasource, tag): ...@@ -590,6 +616,10 @@ def get_nren_dashboard_data_single(data, datasource, tag):
'dropdown': services_dropdown, 'dropdown': services_dropdown,
'panels': service_panels, 'panels': service_panels,
}, },
{
'dropdown': services_ipv6_dropdown,
'panels': service_ipv6_panels
},
{ {
'dropdown': iface_dropdown, 'dropdown': iface_dropdown,
'panels': phys_panels, 'panels': phys_panels,
...@@ -769,7 +799,7 @@ def get_aggregate_dashboard_data(title, remotes, datasource, tag): ...@@ -769,7 +799,7 @@ def get_aggregate_dashboard_data(title, remotes, datasource, tag):
ingress and one for egress. ingress and one for egress.
:param title: title for the dashboard :param title: title for the dashboard
:param targets: dictionary of targets for the panels, the key is the :param remotes: dictionary of targets for the panels, the key is the
remote (usually a customer) and the value is a list of targets remote (usually a customer) and the value is a list of targets
for that remote. A single target represents how to fetch for that remote. A single target represents how to fetch
data for one interface. data for one interface.
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.54] - 2023-02-09
- POL1-648: Added IPv6 graphs for NREN dashboards
## [0.53] - 2023-06-21 ## [0.53] - 2023-06-21
- Add banner explaining difference between average/mean for >48h time ranges - Add banner explaining difference between average/mean for >48h time ranges
......
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='brian-dashboard-manager', name='brian-dashboard-manager',
version="0.53", version="0.54",
author='GEANT', author='GEANT',
author_email='swd@geant.org', author_email='swd@geant.org',
description='', description='',
...@@ -16,4 +16,6 @@ setup( ...@@ -16,4 +16,6 @@ setup(
'sentry-sdk[flask]' 'sentry-sdk[flask]'
], ],
include_package_data=True, include_package_data=True,
license='MIT',
license_files=('LICENSE.txt',)
) )
import responses import responses
from conftest import get_test_data from test.conftest import get_test_data
from brian_dashboard_manager.templating.gws import generate_gws from brian_dashboard_manager.templating.gws import generate_gws
from brian_dashboard_manager.inventory_provider.interfaces import \ from brian_dashboard_manager.inventory_provider.interfaces import \
get_gws_direct get_gws_direct
......
...@@ -3,7 +3,7 @@ import json ...@@ -3,7 +3,7 @@ import json
from brian_dashboard_manager.grafana.provision import provision_folder, \ from brian_dashboard_manager.grafana.provision import provision_folder, \
provision provision
from conftest import get_test_data from test.conftest import get_test_data
TEST_INTERFACES = [ TEST_INTERFACES = [
{ {
......
[tox] [tox]
envlist = py36 envlist = py38, py311
[flake8] [flake8]
exclude = venv,.tox exclude = venv,.tox
max-line-length = 120 max-line-length = 120
[coverage:run]
concurrency = multiprocessing,thread
[testenv] [testenv]
setenv =
COVERAGE_PROCESS_START=.coveragerc
deps = deps =
coverage pytest-xdist
pytest-cov
flake8 flake8
-r requirements.txt -r requirements.txt
commands = commands =
coverage erase coverage erase
coverage run --source brian_dashboard_manager -m pytest {posargs} pytest -n auto --cov brian_dashboard_manager --cov-fail-under=80 --cov-report html --cov-report xml --cov-report term -p no:checkdocs
coverage combine
coverage xml
coverage html
coverage report --fail-under 75
flake8 flake8
sphinx-build -M html docs/source docs/build sphinx-build -M html docs/source docs/build
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment