diff --git a/.env.example b/.env.example index 9a4f2e13b..0fc8fd457 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,92 @@ -MYSQL_PASSWORD= +OESS_VERSION=2.0.13 + + +# Default root password set for installed MySQL Server. +# +MYSQL_ROOT_PASSWORD=test +# +# Default password set for installed RabbitMQ Server. +# +RABBITMQ_DEFAULT_PASS=guest + + +# Authentication details to MySQL Server. +# +MYSQL_USER=root +MYSQL_PASS=test +MYSQL_HOST=localhost +MYSQL_PORT=3306 +MYSQL_DATABASE=oess + + +# Authentication details for RabbitMQ Server. +# +RABBITMQ_USER=guest +RABBITMQ_PASS=guest +RABBITMQ_HOST=rabbitmq +RABBITMQ_PORT=5672 +RABBITMQ_VHOST=/ + + +# Email notifications +# +SMTP_FROM_ADDR=oess@localhost +SMTP_FROM_NAME=OESS Notifier +SMTP_IMAGE_URL=http://localhost:8080/oess/notification-img + + +# Optional: WebAPI details for GlobalNOC TSDS instance; Is used to +# store time series data like network statistics for connections. +# +# TSDS_USERNAME= +# TSDS_PASSWORD= +# TSDS_URL= +# TSDS_REALM= + + +# OESS password for `admin` user +# OESS_PASSWORD= +# +# Base OESS URL. Required to properly set frontend URLs +# +OESS_BASE_URL=http://localhost:8080/oess +# +# Used as ASN for OESS side of all VRF peerings. +# +OESS_LOCAL_ASN=55038 +# +# Southbound interface to network devices. Options: +# openflow: deprecated +# vpn-mpls: netconf provisioned l2vpn, l2ccc, l3vpn (Juniper MX) +# evpn-vxlan: netconf provisioned vxlan (Juniper QFX) +# nso: nso based southbound +# nso+vpn-mpls: runs both vpn-mpls and nso southbounds simultaneously +# OESS_NETWORK_TYPE=vpn-mpls -NSO_HOST= -NSO_PASSWORD= -NSO_USERNAME= + + +# Authentication details for NETCONF connection to network devices. Is +# required for vpn-mpls, evpn-vxlan, and nso+vpn-mpls +# OESS_NETWORK_TYPEs. +# +NETCONF_USERNAME= +NETCONF_PASSWORD= +# +# Interval on which OESS evaluates and resolves difference between +# expected and actual network configuration. +# +NETCONF_DIFF_INTERVAL=60 + + +# Authentication details for NSO REST API. Is required for nso +# OESS_NETWORK_TYPEs. +# +# NSO_USERNAME= +# NSO_PASSWORD= +# NSO_HOST= +# +# Interval on which OESS evaluates and resolves difference between +# expected and actual network configuration. +# +# NSO_DIFF_INTERVAL=60 diff --git a/.gitignore b/.gitignore index 3ecfcc91d..209b04f35 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,9 @@ perl-lib/OESS/MYMETA.json perl-lib/OESS/MYMETA.yml perl-lib/OESS/lib/OESS/Collector perl-lib/OESS/lib/OESS/Collector.pm +perl-lib/OESS/share/scripts/oess-migrate/connection_id_list.csv +perl-lib/OESS/share/scripts/oess-migrate/shim_interface_mapping.csv +perl-lib/OESS/share/scripts/oess-migrate/config.json etc/packer-config/output-virtualbox-iso/ etc/packer-config/packer_cache/ perl-lib/OESS/blib/ @@ -52,3 +55,4 @@ perl-lib/OESS/lib/OESS/t/conf/database.xml frontend/.htpasswd *.DS_Store .env +.vscode diff --git a/Dockerfile b/Dockerfile index d0d55cf59..a1859bd3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,8 @@ RUN yum -y install epel-release RUN yum -y install perl mariadb-server RUN yum -y install perl-Carp-Always perl-Test-Deep perl-Test-Exception perl-Test-Pod perl-Test-Pod-Coverage perl-Devel-Cover perl-AnyEvent-HTTP RUN yum -y install perl-OESS oess-core oess-frontend + +COPY perl-lib/OESS /OESS + RUN chmod 777 /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/Dockerfile.dev b/Dockerfile.dev index bb1204537..8f9dd1dd7 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -7,7 +7,7 @@ RUN curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-serve RUN yum makecache RUN yum -y install epel-release RUN yum -y install perl httpd mariadb-server rabbitmq-server -RUN yum -y install perl-Carp-Always perl-Test-Deep perl-Test-Exception perl-Test-Pod perl-Test-Pod-Coverage perl-Devel-Cover perl-Net-AMQP-RabbitMQ perl-LWP-Protocol-https perl-AnyEvent-HTTP +RUN yum -y install perl-Carp-Always perl-Test-Deep perl-Test-Exception perl-Test-Pod perl-Test-Pod-Coverage perl-Devel-Cover perl-Net-AMQP-RabbitMQ perl-LWP-Protocol-https perl-AnyEvent-HTTP perl-GRNOC-CLI perl-Text-CSV RUN yum -y install perl-OESS oess-core oess-frontend yui2 COPY app/mpls/mpls_discovery.pl /usr/bin/mpls_discovery.pl diff --git a/Makefile b/Makefile index eeab480a9..ab6197313 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -OESS_VERSION=2.0.13 +OESS_VERSION=2.0.14 OESS_NETWORK=oess container: @@ -9,8 +9,14 @@ container: # # Allow container to attach to host port via host.docker.internal hostname: # --add-host=host.docker.internal:host-gateway +# +# To support packet captures: +# --cap-add=NET_RAW +# --cap-add=NET_ADMIN +# dev: docker run -it \ + --rm \ --env-file .env \ --publish 8000:80 \ --publish 5672:5672 \ @@ -22,3 +28,7 @@ dev: documentation: perl docs/generate-webservice-docs.pl + +test: + docker build . -f Dockerfile -t oess-test + docker run --rm -it -e OESS_TEST_FILES="$(TEST_FILES)" --volume ${PWD}/perl-lib/OESS:/OESS oess-test diff --git a/app/Makefile b/app/Makefile index c53a6cf92..90718610c 100644 --- a/app/Makefile +++ b/app/Makefile @@ -1,5 +1,5 @@ NAME= oess-core -VERSION = 2.0.13 +VERSION = 2.0.14 rpm: dist rpmbuild -ta dist/$(NAME)-$(VERSION).tar.gz diff --git a/app/oess-core.spec b/app/oess-core.spec index 4cc7638b6..5110c0bd5 100644 --- a/app/oess-core.spec +++ b/app/oess-core.spec @@ -1,5 +1,5 @@ Name: oess-core -Version: 2.0.13 +Version: 2.0.14 Release: 1%{?dist} Summary: The core OESS service providers @@ -20,7 +20,7 @@ Requires: /bin/bash Requires: /usr/bin/perl Requires: perl(base), perl(constant), perl(strict), perl(warnings) -Requires: perl-OESS >= 2.0.13 +Requires: perl-OESS >= 2.0.14 Requires: perl(AnyEvent), perl(AnyEvent::DBus), perl(AnyEvent::RabbitMQ) Requires: perl(CPAN), perl(CPAN::Shell) diff --git a/frontend/Makefile b/frontend/Makefile index c2c43cb53..891961a27 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -1,5 +1,5 @@ NAME= oess-frontend -VERSION = 2.0.13 +VERSION = 2.0.14 rpm: dist rpmbuild -ta dist/$(NAME)-$(VERSION).tar.gz diff --git a/frontend/oess-frontend.spec b/frontend/oess-frontend.spec index 5c962e62b..e3c0bfafd 100644 --- a/frontend/oess-frontend.spec +++ b/frontend/oess-frontend.spec @@ -1,5 +1,5 @@ Name: oess-frontend -Version: 2.0.13 +Version: 2.0.14 Release: 1%{?dist} Summary: The OESS webservices and user interface @@ -13,14 +13,14 @@ BuildRequires: perl BuildRequires: python >= 2.6, python-libs >= 2.6 BuildRequires: python-simplejson -Requires: oess-core >= 2.0.13 +Requires: oess-core >= 2.0.14 Requires: yui Requires: httpd, mod_ssl Requires: nddi-tiles Requires: perl-Crypt-SSLeay Requires: xmlsec1, xmlsec1-openssl -Requires: perl-OESS >= 2.0.13 +Requires: perl-OESS >= 2.0.14 Requires: perl(strict), perl(warnings) Requires: perl(AnyEvent) diff --git a/frontend/webservice/circuit.cgi b/frontend/webservice/circuit.cgi index 08d09d181..4ce79be92 100755 --- a/frontend/webservice/circuit.cgi +++ b/frontend/webservice/circuit.cgi @@ -274,11 +274,6 @@ sub provision { return; } - if (@{$args->{endpoint}->{value}} > 2) { - $method->set_error("Support for Multi-Point Layer 2 Connections is currently disabled. Please contact your OESS administrator for more information."); - return; - } - # Endpoint: { entity: 'entity name', bandwidth: 0, tag: 100, inner_tag: 100, peerings: [{ version: 4 }] } foreach my $value (@{$args->{endpoint}->{value}}) { my $ep; @@ -509,11 +504,6 @@ sub update { my $add_endpoints = []; my $del_endpoints = []; - if (@{$args->{endpoint}->{value}} > 2) { - $method->set_error("Support for Multi-Point Layer 2 Connections is currently disabled. Please contact your OESS administrator for more information."); - return; - } - foreach my $value (@{$args->{endpoint}->{value}}) { my $ep; eval{ diff --git a/frontend/webservice/monitoring.cgi b/frontend/webservice/monitoring.cgi index 8af651224..6dbca29dc 100755 --- a/frontend/webservice/monitoring.cgi +++ b/frontend/webservice/monitoring.cgi @@ -36,6 +36,7 @@ use Log::Log4perl; use OESS::Database; use OESS::RabbitMQ::Client; +use OESS::RabbitMQ::Topic qw(fwdctl_switch_topic_for_node); use GRNOC::WebService; Log::Log4perl::init('/etc/oess/logging.conf'); @@ -201,7 +202,7 @@ sub get_mpls_node_status{ return $tmp; } - $mq->{'topic'} = 'MPLS.FWDCTL.Switch.' . $node->{'mgmt_addr'}; + $mq->{'topic'} = fwdctl_switch_topic_for_node(mgmt_addr => $node->{'mgmt_addr'}, tcp_port => $node->{'tcp_port'}); my $result = $mq->is_connected(); warn Dumper($result); $result = int($result->{'results'}->{'connected'}); diff --git a/frontend/www/js_templates/modify_cloud.js b/frontend/www/js_templates/modify_cloud.js index fb98b692f..147b3dee5 100644 --- a/frontend/www/js_templates/modify_cloud.js +++ b/frontend/www/js_templates/modify_cloud.js @@ -34,7 +34,12 @@ class GlobalState extends Component { let iframe3 = document.getElementById(`endpoints-statistics-iframe-route`); iframe3.dataset.vrf = this.connection.vrf_id; - iframe3.src = `${iframe3.dataset.url}&var-table=OESS-L3VPN-${this.connection.vrf_id}.inet.0&from=now-1h&to=now`; + + if (this.connection.endpoints.length == 0 || this.connection.endpoints[0].controller === "nso") { + iframe3.src = `${iframe3.dataset.url}&var-table=OESS-VRF-${this.connection.vrf_id}&from=now-1h&to=now`; + } else { + iframe3.src = `${iframe3.dataset.url}&var-table=OESS-L3VPN-${this.connection.vrf_id}.inet.0&from=now-1h&to=now`; + } this.connection.endpoints.forEach(function(endpoint, eIndex) { @@ -54,7 +59,7 @@ class GlobalState extends Component { let peerSelections = document.getElementById('peering-selection'); peerSelections.appendChild(select); - + let statGraph = `