Merge "Create a script to generate a Topology"
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Thu, 24 Feb 2022 09:08:35 +0000 (09:08 +0000)
committerGerrit Code Review <gerrit@o-ran-sc.org>
Thu, 24 Feb 2022 09:08:35 +0000 (09:08 +0000)
14 files changed:
solution/integration/README.md
solution/integration/network/config.py
solution/integration/network/docker-compose.yml
solution/integration/network/ntsim-ng-o-du/o-ran-sc-du-hello-world-operational.xml
solution/integration/network/ntsim-ng-o-du/o-ran-sc-du-hello-world-running.xml
solution/integration/smo/common/.env
solution/integration/smo/common/docker-compose.yml
solution/integration/smo/common/identity/config.py
solution/integration/smo/common/identity/o-ran-sc-realm.json
solution/integration/smo/non-rt-ric/.env
solution/integration/smo/oam/.env
solution/integration/smo/oam/docker-compose.yml
solution/integration/smo/oam/sdnr/oauth-aaa-app-config.xml [new file with mode: 0644]
solution/integration/smo/oam/sdnr/oauth-provider.config.json

index 18085e4..768f5b3 100644 (file)
@@ -30,16 +30,18 @@ for developer test or demo purposes
     ... representing an KeyCloak based identity service for centralized user
     management. Please note that the implementation does not support IPv6.
     Therefore, its own network is required called 'DMZ'.
+    In this configuration the external https port is 8463.
 
   * **SDN-R** single node instance
 
     ... representing the NetConf consumer on the Service Management and
     Orchestration framework (SMO) for the O1 interface based on
     ODL-Silicon/ONAP-Istanbul
+    SDN-R comes with is own web-portal the external port is 8463.
 
   * **VES collector**
 
-    ... representing the VES (REST) provider at SMO for all kind of events.
+    ... representing the VES (REST) provider at SMO for all kind of events. In this configuration the external https port is 8443.
 
   * **DMaaP**
     ... representing SMO DMaaP component, includes message-router
@@ -51,7 +53,7 @@ for developer test or demo purposes
 
   * **Non-RT-RIC**
     ... representing all the components of Non-RT-RIC, includes Non-RT-RIC Control Panel, Non-RT-RIC (Spring Cloud) Service Gateway, A1 Policy Management Services,
-    Enrichment Data Coordinator, Non-RT-RIC App Catalogue, "Helloworld" O-RU Fronthaul Recovery use-case, Near-RT RIC A1 Simulator etc.
+    Enrichment Data Coordinator, Non-RT-RIC App Catalogue, "HelloWorld" O-RU Fronthaul Recovery use-case, Near-RT RIC A1 Simulator etc.
 
 ## Prerequisites
 
@@ -60,7 +62,7 @@ $ cat /etc/os-release | grep PRETTY_NAME
 PRETTY_NAME="Ubuntu 20.04.2 LTS"
 
 $ docker --version
-Docker version 20.10.2, build 20.10.2-0ubuntu1~20.04.2
+Docker version 20.10.7, build 20.10.7-0ubuntu1~20.04.2
 
 $ docker-compose version
 docker-compose version 1.29.1, build c34c88b2
@@ -68,6 +70,7 @@ docker-py version: 5.0.0
 CPython version: 3.7.10
 OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019
 
+
 $ git --version
 git version 2.25.1
 
@@ -88,6 +91,13 @@ $ cat /etc/hosts
 <deployment-system-ipv4>   identity <your-system>
 ```
 
+It is beneficial (but not mandatory) adding the following line add the
+end of your ~/.bashrc file. I will suppress warnings when python script
+do not verify self signed certificates for HTTPS communication. 
+```
+export PYTHONWARNINGS="ignore:Unverified HTTPS request"  
+```
+
 ## Expected Folder Structure
 
 ```
@@ -140,6 +150,12 @@ nano smo/oam/.env
 nano network/.env
 ```
 
+The tested configuration uses the following external https ports:
+
+ * 8443 for the ves-collector
+ * 8453 for web access to ODLUX (SDNC_WEB_PORT)
+ * 8463 for the keyclock web administrator user interface. 
+
 #### Startup solution
 
 Please note that it is necessary to configure first the identity service,
@@ -199,7 +215,7 @@ script `preparePmsData.sh` sends http requests to policy-agent service, and crea
 bash prepareEcsData.sh
 ```
 
-script `prepareEcsData.sh` sends http requests to ecs service, and creates data accordingly.
+script `prepareIcsData.sh` sends http requests to ics service, and creates data accordingly.
 
 Afterwards, open webpage:
 <http://localhost:8182/>
index f1fd0f3..30c4a39 100644 (file)
@@ -25,7 +25,7 @@ import subprocess
 dockerFilter = subprocess.check_output("docker ps --format '{{.Names}}'", shell=True)
 containers = dockerFilter.splitlines()
 
-mapping = dict({"ntsim-ng-o-ru": "highstreet-O-RU", "ntsim-ng-o-du": "highstreet-O-DU"}) 
+mapping = dict({"ntsim-ng-o-ru": "O-RU", "ntsim-ng-o-du": "O-DU"})
 # base = 'https://sdnc-web:8453'
 base = 'https://localhost:8453'
 username = 'admin'
index 8e0921d..711a915 100755 (executable)
@@ -64,7 +64,7 @@ services:
     <<: *common_nf
     image: "${NEXUS3_DOCKER_REPO}nts-ng-o-ran-du:${NTS_BUILD_VERSION}"
     container_name: ntsim-ng-o-du-1122
-    hostname: highstreet-O-DU-1122
+    hostname: O-DU-1122
     volumes:
         - ./ntsim-ng-o-du/config.json:/opt/dev/ntsim-ng/config/config.json
         - ./ntsim-ng-o-du/o-ran-sc-du-hello-world-running.xml:/opt/dev/deploy/data/o-ran-sc-du-hello-world-running.xml
@@ -77,7 +77,7 @@ services:
     <<: *common_nf
     image: "${NEXUS3_DOCKER_REPO}nts-ng-o-ran-ru-fh:${NTS_BUILD_VERSION}"
     container_name: ntsim-ng-o-ru-fh-11221
-    hostname: highstreet-O-RU-11221
+    hostname: O-RU-11221
     volumes:
         - ./ntsim-ng-o-ru/ntsim-ng-o-ru-fh-1/config.json:/opt/dev/ntsim-ng/config/config.json
         - ./ntsim-ng-o-ru/ntsim-ng-o-ru-fh-1/ietf-hardware-operational.json:/opt/dev/deploy/data/ietf-hardware-operational.json
@@ -92,7 +92,7 @@ services:
     <<: *common_nf
     image: "${NEXUS3_DOCKER_REPO}nts-ng-o-ran-ru-fh:${NTS_BUILD_VERSION}"
     container_name: ntsim-ng-o-ru-fh-11222
-    hostname: highstreet-O-RU-11222
+    hostname: O-RU-11222
     volumes:
         - ./ntsim-ng-o-ru/ntsim-ng-o-ru-fh-2/config.json:/opt/dev/ntsim-ng/config/config.json
         - ./ntsim-ng-o-ru/ntsim-ng-o-ru-fh-2/ietf-hardware-operational.json:/opt/dev/deploy/data/ietf-hardware-operational.json
@@ -107,7 +107,7 @@ services:
     <<: *common_nf
     image: "${NEXUS3_DOCKER_REPO}nts-ng-o-ran-ru-fh:${NTS_BUILD_VERSION}"
     container_name: ntsim-ng-o-ru-fh-11223
-    hostname: highstreet-O-RU-11223
+    hostname: O-RU-11223
     volumes:
         - ./ntsim-ng-o-ru/ntsim-ng-o-ru-fh-3/config.json:/opt/dev/ntsim-ng/config/config.json
         - ./ntsim-ng-o-ru/ntsim-ng-o-ru-fh-3/ietf-hardware-operational.json:/opt/dev/deploy/data/ietf-hardware-operational.json
@@ -122,7 +122,7 @@ services:
     <<: *common_nf
     image: "${NEXUS3_DOCKER_REPO}smo-nts-ng-topology-server:${NTS_BUILD_VERSION}"
     container_name: ntsim-ng-topology-server
-    hostname: highstreet-TAPI-topology-server
+    hostname: TAPI-topology-server
     volumes:
         - ./ntsim-ng-topology-server/config.json:/opt/dev/ntsim-ng/config/config.json
         - ./ntsim-ng-topology-server/tapi-common-operational.xml:/opt/dev/deploy/data/tapi-common-operational.xml
@@ -131,7 +131,7 @@ services:
         <<: *common_env
         <<: *topo_env
         SSH_CONNECTIONS: 1
-        TLS_CONNECTIONS: 0    
+        TLS_CONNECTIONS: 0
 networks:
     default:
         external:
index 0bc12be..503cd79 100644 (file)
@@ -6,7 +6,7 @@
     <distinguished-name-prefix>CN=KarenBerge,CN=admin,DC=corp,DC=Fabrikam,DC=COM</distinguished-name-prefix>
     <location-name>address name</location-name>
     <distributed-unit-functions>
-      <id>O-DU-1211</id>
+      <id>O-DU-1122</id>
       <administrative-state>locked</administrative-state>
       <operational-state>enabled</operational-state>
       <user-label>o-du-1</user-label>
index 2d7baf0..a6ca63a 100644 (file)
@@ -4,7 +4,7 @@
     <user-label>nf1</user-label>
     <distinguished-name-prefix>CN=KarenBerge,CN=admin,DC=corp,DC=Fabrikam,DC=COM</distinguished-name-prefix>
     <distributed-unit-functions>
-      <id>O-DU-1211</id>
+      <id>O-DU-1122</id>
       <administrative-state>unlocked</administrative-state>
       <user-label>o-du-1</user-label>
       <cell>
index ae91017..f0168b0 100644 (file)
@@ -29,8 +29,8 @@ NETWORK_GATEWAY_SMO=2001:db8:1:40::1
 
 # Identity server
 IDENTITY_IMAGE=quay.io/keycloak/keycloak:12.0.4
-IDENTITY_PORT=8081
-IDENTITY_PROVIDER_URL=http://identity:8081
+IDENTITY_PORT=8463
+IDENTITY_PROVIDER_URL=https://identity:8463
 
 # Topology server
 TOPOLOGY_IMAGE=docker.io/hightec/smo-topology-api-v2:2.0.2-SNAPSHOT-20210315T160448Z
index e3088fd..0e85bf9 100755 (executable)
@@ -19,11 +19,12 @@ services:
     image: ${IDENTITY_IMAGE}
     container_name: identity
     ports: 
-      - ${IDENTITY_PORT}:${IDENTITY_PORT}
+      - ${IDENTITY_PORT}:8443
     environment: 
       - KEYCLOAK_USER=${ADMIN_USERNAME}
       - KEYCLOAK_PASSWORD=${ADMIN_PASSWORD}
-      - JAVA_OPTS=-Djboss.http.port=${IDENTITY_PORT}
+      - JAVA_OPTS=-Djboss.bind.address.private=[::1] -Djboss.bind.address=[::1] -Djava.net.preferIPv6Addresses=true -Djava.net.preferIPv4Stack=false
+      - DB_VENDOR=h2
     networks:
       dmz:
               
index 649026c..9c1ec28 100644 (file)
@@ -24,7 +24,7 @@ import getpass
 
 # global configurations
 # TODO: read from ../.env
-base = 'http://localhost:8081'
+base = 'https://identity:8463'
 username = 'admin'
 password = 'Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U'
 realmFile = os.path.dirname(os.path.abspath(__file__)) + '/o-ran-sc-realm.json'
@@ -54,7 +54,7 @@ def getToken():
       raise SystemExit(e)
 
     if response.status_code >= 200 and response.status_code < 300:
-      print('Got tocken!')
+      print('Got token!')
       return response.json()['access_token']
     else:
       sys.exit('Getting token failed.')
index c7621d7..97d7b30 100644 (file)
       "clientAuthenticatorType": "client-secret",
       "secret": "2a64fdca-c205-4b52-9f58-195ccc142ddb",
       "redirectUris": [
-        "http://localhost:8081/*",
         "https://sdnc-web:8453/*"
       ],
       "webOrigins": [],
   },
   "keycloakVersion": "12.0.4",
   "userManagedAccessAllowed": false
-}
+}
\ No newline at end of file
index ee2b2f8..f9e6b2d 100644 (file)
 #
 
 #PMS
-PMS_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-policy-agent"
-PMS_IMAGE_TAG="2.2.0"
+PMS_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-a1-policy-management-service"
+PMS_IMAGE_TAG="2.3.1"
 
 #A1_SIM
 A1_SIM_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/a1-simulator"
-A1_SIM_IMAGE_TAG="2.1.0"
+A1_SIM_IMAGE_TAG="2.2.0"
 
 #RAPP
 RAPP_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-r-app-catalogue"
-RAPP_IMAGE_TAG="1.0.0"
+RAPP_IMAGE_TAG="1.0.2"
 
 #CONTROL_PANEL
 CONTROL_PANEL_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-controlpanel"
-CONTROL_PANEL_IMAGE_TAG="2.2.0"
+CONTROL_PANEL_IMAGE_TAG="2.3.0"
 
 #GATEWAY
 NONRTRIC_GATEWAY_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-gateway"
@@ -37,7 +37,7 @@ NONRTRIC_GATEWAY_IMAGE_TAG="1.0.0"
 
 #ICS
 ICS_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-information-coordinator-service"
-ICS_IMAGE_TAG="1.2.0"
+ICS_IMAGE_TAG="1.2.1"
 
 #PRODUCER
 PRODUCER_IMAGE_BASE="eexit/mirror-http-server"
@@ -45,11 +45,11 @@ PRODUCER_IMAGE_TAG="latest"
 
 #ORU
 ORU_APP_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-o-ru-closed-loop-recovery"
-ORU_APP_IMAGE_TAG="1.0.0"
+ORU_APP_IMAGE_TAG="1.0.1"
 
 #ODU
 ODU_APP_IMAGE_BASE="nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-o-du-slice-assurance"
-ODU_APP_IMAGE_TAG="1.0.0"
+ODU_APP_IMAGE_TAG="1.0.1"
 
 #DB
 DB_IMAGE_BASE="mariadb"
@@ -57,4 +57,4 @@ DB_IMAGE_TAG="10.5"
 
 #A1CONTROLLER
 A1CONTROLLER_IMAGE_BASE="nexus3.onap.org:10002/onap/sdnc-image"
-A1CONTROLLER_IMAGE_TAG="2.1.2"
\ No newline at end of file
+A1CONTROLLER_IMAGE_TAG="2.1.6"
\ No newline at end of file
index c21df2b..d049b01 100644 (file)
@@ -28,7 +28,7 @@ NETWORK_SUBNET_OAM_IPv6=2001:db8:1:50::/96
 NETWORK_GATEWAY_OAM_IPv6=2001:db8:1:50::1
 
 # Identity server
-IDENTITY_PROVIDER_URL=http://identity:8081
+IDENTITY_PROVIDER_URL=https://identity:8463
 
 # SDN Controller
 SDNC_IMAGE=nexus3.onap.org:10001/onap/sdnc-image:2.2.3
index c73471a..2929fd3 100755 (executable)
@@ -66,6 +66,7 @@ services:
       - IDENTITY_PROVIDER_URL=${IDENTITY_PROVIDER_URL}
       - SDNC_WEB_URL=https://sdnc-web:${SDNC_WEB_PORT}
     volumes:
+      - ./sdnr/oauth-aaa-app-config.xml:/opt/opendaylight/current/system/org/opendaylight/aaa/aaa-shiro/0.13.3/aaa-shiro-0.13.3-aaa-app-config.xml
       - ./sdnr/oauth-provider.config.json:/opt/opendaylight/etc/oauth-provider.config.json
       - ./sdnr/devicemanager.properties:/opt/opendaylight/etc/devicemanager.properties
       - ./sdnr/mountpoint-registrar.properties:/opt/opendaylight/etc/mountpoint-registrar.properties
diff --git a/solution/integration/smo/oam/sdnr/oauth-aaa-app-config.xml b/solution/integration/smo/oam/sdnr/oauth-aaa-app-config.xml
new file mode 100644 (file)
index 0000000..28a79f6
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" ?>
+<!--
+  ~ ============LICENSE_START=======================================================
+  ~ ONAP : ccsdk features
+  ~ ================================================================================
+  ~ Copyright (C) 2021 highstreet technologies GmbH Intellectual Property.
+  ~ All rights reserved.
+  ~ ================================================================================
+  ~ 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.
+  ~ ============LICENSE_END=======================================================
+  ~
+  -->
+
+<shiro-configuration xmlns="urn:opendaylight:aaa:app:config">
+
+
+    <main>
+        <pair-key>tokenAuthRealm</pair-key>
+        <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.OAuth2Realm</pair-value>
+    </main>
+
+    <main>
+        <pair-key>securityManager.realms</pair-key>
+        <pair-value>$tokenAuthRealm</pair-value>
+    </main>
+    <!-- Used to support OAuth2 use case. -->
+    <main>
+        <pair-key>authcBasic</pair-key>
+        <pair-value>org.opendaylight.aaa.shiro.filters.ODLHttpAuthenticationFilter</pair-value>
+    </main>
+    <main>
+        <pair-key>anyroles</pair-key>
+        <pair-value>org.opendaylight.aaa.shiro.filters.AnyRoleHttpAuthenticationFilter</pair-value>
+    </main>
+    <main>
+        <pair-key>authcBearer</pair-key>
+        <pair-value>org.opendaylight.aaa.shiro.filters.ODLHttpAuthenticationFilter2</pair-value>
+    </main>
+
+    <!-- in order to track AAA challenge attempts -->
+    <main>
+        <pair-key>accountingListener</pair-key>
+        <pair-value>org.opendaylight.aaa.shiro.filters.AuthenticationListener</pair-value>
+    </main>
+    <main>
+        <pair-key>securityManager.authenticator.authenticationListeners</pair-key>
+        <pair-value>$accountingListener</pair-value>
+    </main>
+
+    <!-- Model based authorization scheme supporting RBAC for REST endpoints -->
+    <main>
+        <pair-key>dynamicAuthorization</pair-key>
+        <pair-value>org.opendaylight.aaa.shiro.realm.MDSALDynamicAuthorizationFilter</pair-value>
+    </main>
+
+
+    <urls>
+        <pair-key>/**/operations/cluster-admin**</pair-key>
+        <pair-value>authcBearer, roles[admin]</pair-value>
+    </urls>
+    <urls>
+        <pair-key>/**/v1/**</pair-key>
+        <pair-value>authcBearer, roles[admin]</pair-value>
+    </urls>
+    <urls>
+        <pair-key>/**/config/aaa*/**</pair-key>
+        <pair-value>authcBearer, roles[admin]</pair-value>
+    </urls>
+     <urls>
+        <pair-key>/oauth/**</pair-key>
+        <pair-value>anon</pair-value>
+    </urls>
+    <urls>
+        <pair-key>/odlux/**</pair-key>
+        <pair-value>anon</pair-value>
+    </urls>
+    <urls>
+        <pair-key>/apidoc/**</pair-key>
+        <pair-value>authcBasic</pair-value>
+    </urls>
+    <urls>
+        <pair-key>/rests/**</pair-key>
+        <pair-value>authcBearer, anyroles["admin,provision"]</pair-value>
+    </urls>
+    <urls>
+        <pair-key>/**</pair-key>
+        <pair-value>authcBearer, anyroles["admin,provision"]</pair-value>
+    </urls>
+</shiro-configuration>
index 9f608f5..7f17f68 100644 (file)
@@ -1,23 +1,24 @@
 {
-       "tokenSecret": "my-secret",
-       "tokenIssuer": "ONAP-SDNC",
-       "publicUrl": "${SDNC_WEB_URL}",
-       "redirectUri": "/odlux/index.html#/oauth?token=",
-       "supportOdlUsers": "true",
-       "providers": [
-               {
-                       "id": "identity",
-                       "type": "KEYCLOAK",
-                       "url": "http://identity:8081",
-                       "clientId": "odlux.app",
-                       "secret": "2a64fdca-c205-4b52-9f58-195ccc142ddb",
-                       "scope": "openid",
-                       "title": "ONAP-IDENTITY",
-                       "roleMapping": {
-                               "administration": "admin"
-                       },
-                       "realmName": "onap",
-            "trustAll": "true"
+  "tokenSecret": "my-secret",
+  "tokenIssuer": "ONAP-SDNC",
+  "publicUrl": "https://sdnc-web:8453",
+  "redirectUri": "/odlux/index.html#/oauth?token=",
+  "supportOdlUsers": "true",
+  "providers": [
+    {
+      "id": "identity",
+      "type": "KEYCLOAK",
+      "url": "https://identity:8463",
+      "internalUrl": "https://identity:8443",
+      "clientId": "odlux.app",
+      "secret": "2a64fdca-c205-4b52-9f58-195ccc142ddb",
+      "scope": "openid",
+      "title": "ONAP-IDENTITY",
+      "roleMapping": {
+        "administration": "admin"
+      },
+      "realmName": "onap",
+      "trustAll": "true"
                }
        ]
-}
+}
\ No newline at end of file