From 16c15126c0b0ec3708547478c05772fcfe5829e4 Mon Sep 17 00:00:00 2001 From: Alex Stancu Date: Mon, 16 Nov 2020 14:14:25 +0200 Subject: [PATCH] Add YANG validator for SMO for O1 interface. Issue-ID: OAM-157 Change-Id: I976461dad382fb97b7797cf6dcc63c1f2c909543 Signed-off-by: Alex Stancu --- solution/dev/smo/yang-validator/.env | 24 +++++ solution/dev/smo/yang-validator/docker-compose.yml | 62 ++++++++++++ .../smo/yang-validator/odl-aluminium/Dockerfile | 42 +++++++++ .../odl-aluminium/org.apache.karaf.features.cfg | 81 ++++++++++++++++ .../odl-aluminium/org.ops4j.pax.logging.cfg | 104 +++++++++++++++++++++ 5 files changed, 313 insertions(+) create mode 100644 solution/dev/smo/yang-validator/.env create mode 100644 solution/dev/smo/yang-validator/docker-compose.yml create mode 100644 solution/dev/smo/yang-validator/odl-aluminium/Dockerfile create mode 100644 solution/dev/smo/yang-validator/odl-aluminium/org.apache.karaf.features.cfg create mode 100644 solution/dev/smo/yang-validator/odl-aluminium/org.ops4j.pax.logging.cfg diff --git a/solution/dev/smo/yang-validator/.env b/solution/dev/smo/yang-validator/.env new file mode 100644 index 0000000..450fb78 --- /dev/null +++ b/solution/dev/smo/yang-validator/.env @@ -0,0 +1,24 @@ +################################################################################ +# Copyright 2020 highstreet technologies GmbH and others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +ODL_DOCKER_IMAGE_NAME=opendaylight-13-aluminium-sr0 +ODL_DOCKER_IMAGE_TAG=0.13.0 +PORTPREFIX= +ODL_HOME=/opt/opendaylight +LOCAL_SDNR_MOUNT=/var/tmp/ + +NEXUS_REPO=nexus3.o-ran-sc.org:10004 +SIM_BUILD_VERSION=1.0.0 diff --git a/solution/dev/smo/yang-validator/docker-compose.yml b/solution/dev/smo/yang-validator/docker-compose.yml new file mode 100644 index 0000000..2676845 --- /dev/null +++ b/solution/dev/smo/yang-validator/docker-compose.yml @@ -0,0 +1,62 @@ +################################################################################ +# Copyright 2020 highstreet technologies GmbH and others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +################################################################################ + +version: '2.4' +services: + ntsim-ng-o-ran-fh: + image: "${NEXUS_REPO}/o-ran-sc/nts-ng-o-ran-fh:${SIM_BUILD_VERSION}" + container_name: nts-ng-o-ran-fh + ports: + - "::18300:830" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + - "/usr/bin/docker:/usr/bin/docker" + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + networks: + app_net: + + sdnr: + build: + context: ./odl-aluminium + image: ${ODL_DOCKER_IMAGE_NAME}:${ODL_DOCKER_IMAGE_TAG} + container_name: vanilla-odl-container + ports: + - "${PORTPREFIX}8181:8181" + - "${PORTPREFIX}8101:8101" + - "${PORTPREFIX}6666:6666" + environment: + - ODL_HOME=${ODL_HOME} + volumes: + - ${LOCAL_SDNR_MOUNT}/sdnr/logs:${ODL_HOME}/data/log + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + networks: + app_net: + +networks: + app_net: + driver: bridge + ipam: + driver: default + diff --git a/solution/dev/smo/yang-validator/odl-aluminium/Dockerfile b/solution/dev/smo/yang-validator/odl-aluminium/Dockerfile new file mode 100644 index 0000000..e26f57d --- /dev/null +++ b/solution/dev/smo/yang-validator/odl-aluminium/Dockerfile @@ -0,0 +1,42 @@ +################################################################################ +# Copyright 2020 highstreet technologies GmbH and others +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +################################################################################ +# OpenDaylight docker file + +FROM adoptopenjdk/openjdk11:alpine-slim + +ENV ODL_VERSION=0.13.0 + +RUN apk update && \ + apk add bash && \ + apk add wget && \ + mkdir /opt/opendaylight + +WORKDIR /opt + +RUN wget https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/opendaylight/${ODL_VERSION}/opendaylight-${ODL_VERSION}.tar.gz + +RUN tar -xvzf opendaylight-${ODL_VERSION}.tar.gz -C opendaylight --strip-components 1 && \ + rm -rf opendaylight-${ODL_VERSION}.tar.gz + +COPY ./org.apache.karaf.features.cfg /opt/opendaylight/etc/org.apache.karaf.features.cfg +COPY ./org.ops4j.pax.logging.cfg /opt/opendaylight/etc/org.ops4j.pax.logging.cfg + +WORKDIR /opt/opendaylight + +EXPOSE 8181 8101 + +CMD ["./bin/karaf", "server"] diff --git a/solution/dev/smo/yang-validator/odl-aluminium/org.apache.karaf.features.cfg b/solution/dev/smo/yang-validator/odl-aluminium/org.apache.karaf.features.cfg new file mode 100644 index 0000000..a4b6690 --- /dev/null +++ b/solution/dev/smo/yang-validator/odl-aluminium/org.apache.karaf.features.cfg @@ -0,0 +1,81 @@ +################################################################################ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# +# Comma separated list of features repositories to register by default +# +# ODL Aluminium SR0: +featuresRepositories = file:${karaf.home}/etc/c374ac40-09c7-4114-965e-e8f43fb58577.xml + +# +# Comma separated list of features to install at startup +# +# odl-netconf-clustered-topology, +featuresBoot = \ +d213ccb6-5ffb-4499-bdf1-40a7e8a37224, \ +odl-netconf-connector-all, \ +odl-restconf-nb-rfc8040, \ +odl-restconf-nb-bierman02, \ +odl-mdsal-apidocs, \ +odl-netconf-callhome-ssh + +# +# Resource repositories (OBR) that the features resolver can use +# to resolve requirements/capabilities +# +# The format of the resourceRepositories is +# resourceRepositories=[xml:url|json:url],... +# for Instance: +# +#resourceRepositories=xml:http://host/path/to/index.xml +# or +#resourceRepositories=json:http://host/path/to/index.json +# + +# +# Defines if the boot features are started in asynchronous mode (in a dedicated thread) +# +featuresBootAsynchronous=false + +# +# Service requirements enforcement +# +# By default, the feature resolver checks the service requirements/capabilities of +# bundles for new features (xml schema >= 1.3.0) in order to automatically installs +# the required bundles. +# The following flag can have those values: +# - disable: service requirements are completely ignored +# - default: service requirements are ignored for old features +# - enforce: service requirements are always verified +# +#serviceRequirements=default + +# +# Store cfg file for config element in feature +# +#configCfgStore=true + +# +# Configuration of features processing mechanism (overrides, blacklisting, modification of features) +# XML file defines instructions related to features processing +# versions.properties may declare properties to resolve placeholders in XML file +# both files are relative to ${karaf.etc} +# +#featureProcessing=org.apache.karaf.features.xml +#featureProcessingVersions=versions.properties diff --git a/solution/dev/smo/yang-validator/odl-aluminium/org.ops4j.pax.logging.cfg b/solution/dev/smo/yang-validator/odl-aluminium/org.ops4j.pax.logging.cfg new file mode 100644 index 0000000..1c72479 --- /dev/null +++ b/solution/dev/smo/yang-validator/odl-aluminium/org.ops4j.pax.logging.cfg @@ -0,0 +1,104 @@ +################################################################################ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# Common pattern layout for appenders +log4j2.pattern = %d{ISO8601} | %-5p | %-16t | %-32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n + +# Root logger +log4j2.rootLogger.level = INFO +# uncomment to use asynchronous loggers, which require mvn:com.lmax/disruptor/3.3.2 library +#log4j2.rootLogger.type = asyncRoot +#log4j2.rootLogger.includeLocation = false +log4j2.rootLogger.appenderRef.RollingFile.ref = RollingFile +log4j2.rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi +log4j2.rootLogger.appenderRef.Console.ref = Console +log4j2.rootLogger.appenderRef.Console.filter.threshold.type = ThresholdFilter +log4j2.rootLogger.appenderRef.Console.filter.threshold.level = ${karaf.log.console:-OFF} + +# Loggers configuration + +# Spifly logger +log4j2.logger.spifly.name = org.apache.aries.spifly +log4j2.logger.spifly.level = WARN + +# Security audit logger +log4j2.logger.audit.name = org.apache.karaf.jaas.modules.audit +log4j2.logger.audit.level = INFO +log4j2.logger.audit.additivity = false +log4j2.logger.audit.appenderRef.AuditRollingFile.ref = AuditRollingFile + +# Appenders configuration + +# Console appender not used by default (see log4j2.rootLogger.appenderRefs) +log4j2.appender.console.type = Console +log4j2.appender.console.name = Console +log4j2.appender.console.layout.type = PatternLayout +log4j2.appender.console.layout.pattern = ${log4j2.pattern} + +# Rolling file appender +log4j2.appender.rolling.type = RollingRandomAccessFile +log4j2.appender.rolling.name = RollingFile +log4j2.appender.rolling.fileName = ${karaf.data}/log/karaf.log +log4j2.appender.rolling.filePattern = ${karaf.data}/log/karaf.log.%i +# uncomment to not force a disk flush +#log4j2.appender.rolling.immediateFlush = false +log4j2.appender.rolling.append = true +log4j2.appender.rolling.layout.type = PatternLayout +log4j2.appender.rolling.layout.pattern = ${log4j2.pattern} +log4j2.appender.rolling.policies.type = Policies +log4j2.appender.rolling.policies.size.type = SizeBasedTriggeringPolicy +log4j2.appender.rolling.policies.size.size = 64MB +log4j2.appender.rolling.strategy.type = DefaultRolloverStrategy +log4j2.appender.rolling.strategy.max = 7 + +# Audit file appender +log4j2.appender.audit.type = RollingRandomAccessFile +log4j2.appender.audit.name = AuditRollingFile +log4j2.appender.audit.fileName = ${karaf.data}/security/audit.log +log4j2.appender.audit.filePattern = ${karaf.data}/security/audit.log.%i +log4j2.appender.audit.append = true +log4j2.appender.audit.layout.type = PatternLayout +log4j2.appender.audit.layout.pattern = ${log4j2.pattern} +log4j2.appender.audit.policies.type = Policies +log4j2.appender.audit.policies.size.type = SizeBasedTriggeringPolicy +log4j2.appender.audit.policies.size.size = 8MB +log4j2.appender.audit.strategy.type = DefaultRolloverStrategy +log4j2.appender.audit.strategy.max = 7 + +# OSGi appender +log4j2.appender.osgi.type = PaxOsgi +log4j2.appender.osgi.name = PaxOsgi +log4j2.appender.osgi.filter = * +log4j2.logger.odl-netconf.level = TRACE +log4j2.logger.odl-netconf.name = odl-netconf +log4j2.logger.org_opendaylight_netconf.level = DEBUG +log4j2.logger.org_opendaylight_netconf.name = org.opendaylight.netconf +log4j2.logger.org_opendaylight_restconf.level = DEBUG +log4j2.logger.org_opendaylight_restconf.name = org.opendaylight.restconf +log4j2.logger.org_apache_sshd.level = ERROR +log4j2.logger.org_apache_sshd.name = org.apache.sshd + + +# help with identification of maven-related problems with pax-url-aether +#log4j2.logger.aether.name = shaded.org.eclipse.aether +#log4j2.logger.aether.level = TRACE +#log4j2.logger.http-headers.name = shaded.org.apache.http.headers +#log4j2.logger.http-headers.level = DEBUG +#log4j2.logger.maven.name = org.ops4j.pax.url.mvn +#log4j2.logger.maven.level = TRACE -- 2.16.6