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

Finished release 0.79.

parents 02e03f6a f77871dc
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ htmlcov ...@@ -16,6 +16,7 @@ htmlcov
dist dist
docs/build docs/build
.coverage* .coverage*
bom.json
# logs # logs
*.log *.log
...@@ -7,6 +7,6 @@ library 'SWDPipeline' ...@@ -7,6 +7,6 @@ library 'SWDPipeline'
// python_test_versions (list of python versions, resolving to docker tags, to test against) // python_test_versions (list of python versions, resolving to docker tags, to test against)
String name = 'brian-dashboard-manager' String name = 'brian-dashboard-manager'
List<String> extraRecipients = ['bjarke@nordu.net', 'erik.reid@geant.org', 'sam.roberts@geant.org', 'pelle.koster@geant.org'] List<String> extraRecipients = ['bjarke@nordu.net', 'erik.reid@geant.org', 'sam.roberts@geant.org', 'pelle.koster@geant.org']
List<String> pythonTestVersions = ['3.6', '3.11'] List<String> pythonTestVersions = ['3.11']
SimplePythonBuild(name, extraRecipients, pythonTestVersions) SimplePythonBuild(name, extraRecipients, pythonTestVersions)
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
"schemaVersion": 26, "schemaVersion": 26,
"style": "dark", "style": "dark",
"tags": [ "tags": [
"customers"
], ],
"templating": { "templating": {
"list": [] "list": []
......
...@@ -942,7 +942,12 @@ def provision(config): ...@@ -942,7 +942,12 @@ def provision(config):
""" """
start = time.time() start = time.time()
all_orgs = _provision_orgs(config) try:
all_orgs = _provision_orgs(config)
except Exception:
logger.exception('Error when provisioning orgs')
return
request = AdminRequest(**config) request = AdminRequest(**config)
try: try:
# needed for older versions of grafana (<11.0) # needed for older versions of grafana (<11.0)
...@@ -961,9 +966,13 @@ def provision(config): ...@@ -961,9 +966,13 @@ def provision(config):
return None return None
orgs = list(filter(lambda t: t[1] is not None, [(org, _find_org_config(org)) for org in all_orgs])) orgs = list(filter(lambda t: t[1] is not None, [(org, _find_org_config(org)) for org in all_orgs]))
interfaces = get_interfaces(config['inventory_provider']) try:
services = fetch_services(config['reporting_provider']) interfaces = get_interfaces(config['inventory_provider'])
regions = get_nren_regions(config['inventory_provider']) services = fetch_services(config['reporting_provider'])
regions = get_nren_regions(config['inventory_provider'])
except Exception:
logger.exception('Error when fetching interfaces:')
return
for org, org_config in orgs: for org, org_config in orgs:
_provision_org(config, org, org_config, interfaces, services, regions) _provision_org(config, org, org_config, interfaces, services, regions)
......
...@@ -322,7 +322,7 @@ def _get_ip_info(host): ...@@ -322,7 +322,7 @@ def _get_ip_info(host):
return prev return prev
try: try:
r = requests.get(f'{host}/data/interfaces') r = requests.get(f'{host}/data/interfaces', timeout=5)
r.raise_for_status() r.raise_for_status()
interfaces = r.json() interfaces = r.json()
except HTTPError: except HTTPError:
...@@ -341,7 +341,7 @@ def get_interfaces(host): ...@@ -341,7 +341,7 @@ def get_interfaces(host):
:return: A list of interfaces with IP information added, if present. :return: A list of interfaces with IP information added, if present.
""" """
r = requests.get(f'{host}/poller/interfaces') r = requests.get(f'{host}/poller/interfaces', timeout=5)
try: try:
r.raise_for_status() r.raise_for_status()
interfaces = r.json() interfaces = r.json()
...@@ -415,7 +415,7 @@ def get_gws_direct(host): ...@@ -415,7 +415,7 @@ def get_gws_direct(host):
:return: GWS direct data :return: GWS direct data
""" """
r = requests.get(f'{host}/poller/gws/direct') r = requests.get(f'{host}/poller/gws/direct', timeout=5)
try: try:
r.raise_for_status() r.raise_for_status()
interfaces = r.json() interfaces = r.json()
...@@ -435,7 +435,7 @@ def get_gws_indirect(host): ...@@ -435,7 +435,7 @@ def get_gws_indirect(host):
:return: GWS Indirect data :return: GWS Indirect data
""" """
try: try:
r = requests.get(f'{host}/poller/gws/indirect') r = requests.get(f'{host}/poller/gws/indirect', timeout=5)
r.raise_for_status() r.raise_for_status()
interfaces = r.json() interfaces = r.json()
except HTTPError: except HTTPError:
...@@ -452,7 +452,7 @@ def get_eumetsat_multicast_subscriptions(host): ...@@ -452,7 +452,7 @@ def get_eumetsat_multicast_subscriptions(host):
:return: EUMETSAT multicast subscriptions :return: EUMETSAT multicast subscriptions
""" """
try: try:
r = requests.get(f'{host}/poller/eumetsat-multicast') r = requests.get(f'{host}/poller/eumetsat-multicast', timeout=5)
r.raise_for_status() r.raise_for_status()
data = r.json() data = r.json()
except HTTPError: except HTTPError:
......
...@@ -38,7 +38,7 @@ def provision_maybe(): ...@@ -38,7 +38,7 @@ def provision_maybe():
and the timestamp of the last provisioning, respectively. and the timestamp of the last provisioning, respectively.
""" """
global provision_state global provision_state # noqa: F824
now = datetime.datetime.now(datetime.timezone.utc) now = datetime.datetime.now(datetime.timezone.utc)
timestamp = provision_state['time'] timestamp = provision_state['time']
......
...@@ -24,6 +24,18 @@ PANEL_WIDTH = 24 ...@@ -24,6 +24,18 @@ PANEL_WIDTH = 24
logger = logging.getLogger(__file__) logger = logging.getLogger(__file__)
def endpoint_sort_key(endpoint):
# sort by equipment/port if exists, otherwise host/interface
if 'equipment' in endpoint:
equipment = endpoint['equipment']
port = endpoint['port']
return equipment, port
else:
hostname = endpoint['hostname']
interface = endpoint['interface']
return hostname, interface
def num_generator(start=30): def num_generator(start=30):
""" """
Generator for numbers starting from the value of `start` Generator for numbers starting from the value of `start`
...@@ -223,7 +235,7 @@ def get_re_peer_interface_data(interfaces): ...@@ -223,7 +235,7 @@ def get_re_peer_interface_data(interfaces):
def get_service_aggregate_targets(services): def get_service_aggregate_targets(services):
for service in services: for service in services:
_interfaces = service.get('endpoints') _interfaces = sorted(service.get('endpoints', []), key=endpoint_sort_key)
name = service.get('name') name = service.get('name')
sid = service.get('sid') sid = service.get('sid')
scid = service.get('scid') scid = service.get('scid')
...@@ -309,7 +321,7 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards, region_cu ...@@ -309,7 +321,7 @@ def get_nren_interface_data(services, interfaces, excluded_dashboards, region_cu
dashboard['AGGREGATES'].append(target) dashboard['AGGREGATES'].append(target)
for service in services: for service in services:
_interfaces = service.get('endpoints') _interfaces = sorted(service.get('endpoints', []), key=endpoint_sort_key)
name = service.get('name') name = service.get('name')
sid = service.get('sid') sid = service.get('sid')
scid = service.get('scid') scid = service.get('scid')
...@@ -450,7 +462,7 @@ def get_service_data(service_type, services, interfaces, excluded_dashboards): ...@@ -450,7 +462,7 @@ def get_service_data(service_type, services, interfaces, excluded_dashboards):
}) })
for service in services: for service in services:
_interfaces = service.get('endpoints') _interfaces = sorted(service.get('endpoints', []), key=endpoint_sort_key)
name = service.get('name') name = service.get('name')
sid = service.get('sid') sid = service.get('sid')
scid = service.get('scid') scid = service.get('scid')
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
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.79] - 2025-05-30
- POL1-898: Unify logic for selecting interface between poller-udf and brian-dashboard-manager
- Add EAP Nren dashboard to NREN Access dropdown
## [0.78] - 2025-02-06 ## [0.78] - 2025-02-06
- Add Router VLANs dropdown for staff - Add Router VLANs dropdown for staff
- Add VLAN dashboard skeleton - Add VLAN dashboard skeleton
......
FROM alpine:3.8
# Build arguments
## The database user name
ARG DBUSER
## The user's password
ARG DBPASS
## The database name
ARG DBNAME
# Forward the args to the container
ENV DBUSER=${DBUSER}
ENV DBPASS=${DBPASS}
ENV DBNAME=${DBNAME}
ENV PGDATA "/var/lib/postgresql"
RUN apk update && \
apk add postgresql postgresql-contrib
RUN mkdir -p /run/postgresql && chmod a+w /run/postgresql
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER postgres
VOLUME $PGDATA
CMD ["/entrypoint.sh"]
EXPOSE 5432
...@@ -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.78", version="0.79",
author='GEANT', author='GEANT',
author_email='swd@geant.org', author_email='swd@geant.org',
description='', description='',
......
...@@ -10,12 +10,15 @@ concurrency = multiprocessing,thread ...@@ -10,12 +10,15 @@ concurrency = multiprocessing,thread
[testenv] [testenv]
deps = deps =
pytest-xdist
pytest-cov pytest-cov
flake8 flake8
cyclonedx-py
-r requirements.txt -r requirements.txt
commands = commands =
coverage erase coverage erase
pytest --cov brian_dashboard_manager --cov-fail-under=75 --cov-report html --cov-report xml --cov-report term -p no:checkdocs pytest -n auto --cov brian_dashboard_manager --cov-fail-under=75 --cov-report html --cov-report xml --cov-report term -p no:checkdocs
flake8 flake8
sphinx-build -M html docs/source docs/build sphinx-build -M html docs/source docs/build
cyclonedx-py environment --output-format json -o bom.json
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment