Commit d73b0747 authored by Michael Dürre's avatar Michael Dürre

pre-devcontainer-rebuild

parent d67c03a2
...@@ -25,4 +25,5 @@ nfapi_nr_interface_scf ...@@ -25,4 +25,5 @@ nfapi_nr_interface_scf
**/*_3gpp*.yang **/*_3gpp*.yang
**/specification/available-yangs **/specification/available-yangs
/dev **/integration/dcae/externalRepo
\ No newline at end of file /dev
...@@ -2429,12 +2429,13 @@ add_executable(nr-softmodem ...@@ -2429,12 +2429,13 @@ add_executable(nr-softmodem
${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/netconf/utils.c
${OPENAIR_DIR}/common/utils/netconf/http_client.c
${OPENAIR_DIR}/common/utils/netconf/ves.c
${OPENAIR_DIR}/common/utils/netconf/o1config.c
${OPENAIR_DIR}/common/utils/netconf/netconf_session.c ${OPENAIR_DIR}/common/utils/netconf/netconf_session.c
${OPENAIR_DIR}/common/utils/netconf/netconf.c ${OPENAIR_DIR}/common/utils/netconf/netconf.c
${OPENAIR_DIR}/common/utils/netconf/netconf_demos.c
${OPENAIR_DIR}/common/utils/netconf/o1config.c
${OPENAIR_DIR}/common/utils/netconf/utils.c
${OPENAIR_DIR}/common/utils/netconf/ves_demo_alarm.c
${OPENAIR_DIR}/common/utils/netconf/ves.c
${PHY_INTERFACE_DIR}/queue_t.c ${PHY_INTERFACE_DIR}/queue_t.c
${XFORMSINTERFACE_SOURCE} ${XFORMSINTERFACE_SOURCE}
${T_SOURCE} ${T_SOURCE}
......
...@@ -2,20 +2,42 @@ ...@@ -2,20 +2,42 @@
OSBASE="ubuntu22" OSBASE="ubuntu22"
TIMESTAMP=$(date -u +'%Y%m%dT%H%M%SZ') TIMESTAMP=$(date -u +'%Y%m%dT%H%M%SZ')
TIMESTAMP_TAG="$OSBASE-$TIMESTAMP" TIMESTAMP_TAG="$OSBASE-$TIMESTAMP"
ONLY_DEV_BUILD="false" BUILD_RAN_BASE="false"
ALL_STAGES="false" BUILD_RAN_BUILD="false"
BUILD_RAN_DEV="false"
BUILD_RAN_GNB="false"
until [ -z "$1" ] until [ -z "$1" ]
do do
case "$1" in case "$1" in
--all) --all)
ALL_STAGES="true" BUILD_RAN_BASE="true"
BUILD_RAN_BUILD="true"
BUILD_RAN_DEV="true"
BUILD_RAN_GNB="true"
shift
;;
--base)
BUILD_RAN_BASE="true"
shift
;;
--build)
BUILD_RAN_BUILD="true"
shift shift
;; ;;
--dev) --dev)
ONLY_DEV_BUILD="true" BUILD_RAN_DEV="true"
shift shift
;; ;;
--gnb)
BUILD_RAN_GNB="true"
shift
;;
--no-cache) --no-cache)
NO_CACHE="--no-cache" NO_CACHE="--no-cache"
shift shift
...@@ -27,30 +49,32 @@ do ...@@ -27,30 +49,32 @@ do
esac esac
done done
if ! $BUILD_RAN_BUILD && ! $BUILD_RAN_GNB && ! $BUILD_RAN_DEV && ! $BUILD_RAN_GNB; then
BUILD_RAN_BUILD="true"
BUILD_RAN_GNB="true"
fi
if $BUILD_RAN_BASE; then
if $ALL_STAGES; then
docker build $NO_CACHE --target ran-base --tag ran-base:$OSBASE-latest --file docker/Dockerfile.base.$OSBASE . docker build $NO_CACHE --target ran-base --tag ran-base:$OSBASE-latest --file docker/Dockerfile.base.$OSBASE .
if [ ! $? -eq 0 ]; then if [ ! $? -eq 0 ]; then
exit 1 exit 1
fi fi
fi fi
if $BUILD_RAN_BUILD; then
docker build $NO_CACHE --target ran-build --build-arg BASETAG=$OSBASE-latest --tag ran-build:$OSBASE-latest --file docker/Dockerfile.build.$OSBASE . docker build $NO_CACHE --target ran-build --build-arg BASETAG=$OSBASE-latest --tag ran-build:$OSBASE-latest --file docker/Dockerfile.build.$OSBASE .
if [ ! $? -eq 0 ]; then if [ ! $? -eq 0 ]; then
exit 1 exit 1
fi
fi fi
if $ONLY_DEV_BUILD; then if $BUILD_RAN_DEV; then
docker build $NO_CACHE --target ran-dev --build-arg BASETAG=$OSBASE-latest --tag ran-dev:$OSBASE-latest --file docker/Dockerfile.dev.$OSBASE . docker build $NO_CACHE --target ran-dev --build-arg BASETAG=$OSBASE-latest --tag ran-dev:$OSBASE-latest --file docker/Dockerfile.dev.$OSBASE .
if [ ! $? -eq 0 ]; then if [ ! $? -eq 0 ]; then
exit 1 exit 1
fi fi
if ! $ALL_STAGES; then
exit 0
fi
fi fi
if $BUILD_RAN_GNB; then
docker build $NO_CACHE --target oai-gnb --build-arg BASETAG=$OSBASE-latest --tag oai-gnb:$OSBASE-latest --tag oai-gnb:$TIMESTAMP_TAG --file docker/Dockerfile.gNB.ubuntu22 . docker build $NO_CACHE --target oai-gnb --build-arg BASETAG=$OSBASE-latest --tag oai-gnb:$OSBASE-latest --tag oai-gnb:$TIMESTAMP_TAG --file docker/Dockerfile.gNB.ubuntu22 .
if [ ! $? -eq 0 ]; then if [ ! $? -eq 0 ]; then
exit 1 exit 1
fi
fi fi
# Netconf Server for O1 interface
## Specification
For this part please look into the [specification](../../../../specification/README.md) folder.
## Configuration
Example
```
o1Config :
{
nfNodeId = "gnb-test01";
netconfUsername = "netconf";
netconfPassword = "netconf!";
netconfPort = 58300;
netconfHost = "192.168.5.207";
vesUrl = "https://dcae-ves-collector:8443/eventListener/v7";
vesBasicAuthUsername = "sample1";
vesBasicAuthPassword = "sample1";
vesNfVendorName = "OpenAirInterface";
vesNfNamingCode = "OGNB";
vesOamIpv6 = "";
vesFtpServerPort = 21;
vesFtpServerListenAddress = "0.0.0.0";
vesFtpServerUrl = "ftp://netconfr:netconf@gnodeb01-test:21";
demoAlarmingInterval = 30;
};
```
Properties:
| property | type | mandatory | description |
| -------- | ---- | --------- | ----------- |
| nfNodeId | string |true | network function node-id to get mounted via netconf |
| netconfUsername | string | true | username to access netconf server(at the moment hardcoded)|
| netconfPassword | string | true | password to access netconf server(at the moment hardcoded)|
| netconfPort | uint_16 | true | port to listen on for netconf server(at the moment hardcoded to 830).|
| netconfHost | string | true | |
| vesUrl| string | false | url to send VES messages to. If not set, complete VES functionality is disabled |
| vesBasicAuthUsername| string | if vesUrl | basic auth username for the VES collector |
| vesBasicAuthPassword | string | if vesUrl | basic auth password for the VES collector |
| vesNfVendorName | string | if vesUrl | vendor name to be sent in the VES messages |
| vesNfNamingCode | string | if vesUrl | nfNamingCode to be sent in the VES messages |
| vesOamIpv6 | string | false | |
| vesFtpServerPort | uint_16 | false ||
| vesFtpServerListenAddress| string | false | |
| vesFtpServerUrl | string | false | |
| demoAlarmingInterval | unit_16| false | interval in seconds to send and clear a demo alarm sent via VES |
The VES functionality can be disabled by just not setting the ```vesUrl```. With this all of the ```vesXXX``` properties are obsolete.
## Software Architecture
```
|----------------------------------------------------------------------------------------------|
| OAI container | Netopeer2 server | | FTPes-server | |
| |--------------------| |------------------| |
| | | |
| | | |
| |--------------------| | |
| | sysrepo | | |
| | (datastore) | | |
| |--------------------| | |
| gnb.conf | | |
| | | | |
| ------------------------------------------------------------------------------------------ |
| | nr-softmodem | | | |
| | | | | |
| | read-oper- edit-config- | |
| | callbacks callbacks | |
| | ves-client | |
| | | |
| | | |
| | | |
| | | |
| | | |
|----------------------------------------------------------------------------------------------|
```
## Minimal Deployment Architecture
This picture is only showing the directly connected components to the OAI gNodeB. This is NOT a complete deployment since there a some more components needed to make everything work together.
```
smo-network-----|------------------------------------------------------------------------
| | |
|-------------------| |--------------------| |-----------------|
| SDNC | | VES-Collector | | FileCollector |
| | | | | |
|-------------------| |--------------------| |-----------------|
| | |
oam-network-----|-------------------------|----------------------|-------------------
| | |
|--------------------------------------------------------------------|
| | NETCONF-Server | | VES-Client | | FTPes-Server | |
| |----------------| |------------| |--------------| |
| |
| OAI gNodeB |
| |
|--------------------------------------------------------------------|
```
## Integration Deployment And Usage
for this documentation please check the [integration](../../../../integration/README.md) folder.
### PNF Registration
By starting up the gNodeB should automatically sends a pnfRegistration message to the VES-Collector. This message will be received by the SDNC and creates then a NETCONF connection between the itself and the device.
### PNF Alarming
If the ```demoAlarmingInterval``` is set, every n seconds there will be a alarm notification sent via VES to raise and clear the demoAlarm.
### PNF Performance Data
To transmit performance data to the ONAP system there is a ```file-ready``` event sent to the VES-Collector which contains the information of the file to transmit. The will be collected by the File-Collector via FTPes or SFTP.
For demo purpose we have now created a trigger inside which is sending such a file ready event. To do this you have to do the following steps.
* Open the ConfigApp with the gNodeB
```
http://localhost:8080/odlux/index.html#/configuration/{node-id}/_3gpp-common-managed-element:ManagedElement[OAI%20gNodeB]
```
* _3gpp-common-managed-element > Attributes
* click edit on the top right corner
* set the userLabel property to ```pmData``` and click save to trigger the ```file-ready``` event once.
* afterwards you have to reset it to ```disabled``` and back if you want to trigger it again
* up to now the file and its data is hardcoded. But it shows that the workflow is working
This diff is collapsed.
#pragma once #pragma once
#include <sysrepo.h>
int netconf_init(void); int netconf_init(void);
int netconf_free(void); int netconf_free(void);
int netconf_disable_nacm(sr_session_ctx_t *session);
int netconf_demo_populate(void); int netconf_demo_populate(void);
int netconf_demo_alarm_start(void); int netconf_demo_subscribe_edit_change();
int netconf_demo_subscribe_operational();
...@@ -2,6 +2,7 @@ set(NETCONFROOT ${OPENAIR_DIR}/common/utils/netconf ) ...@@ -2,6 +2,7 @@ set(NETCONFROOT ${OPENAIR_DIR}/common/utils/netconf )
set(NETCONFROOTSRV_SOURCE set(NETCONFROOTSRV_SOURCE
${NETCONFROOT}/netconf.c ${NETCONFROOT}/netconf.c
${NETCONFROOT}/netconf_demos.c
${NETCONFROOT}/netconf_session.c ${NETCONFROOT}/netconf_session.c
${NETCONFROOT}/o1config.c ${NETCONFROOT}/o1config.c
${NETCONFROOT}/utils.c ${NETCONFROOT}/utils.c
......
This diff is collapsed.
...@@ -6,4 +6,4 @@ ...@@ -6,4 +6,4 @@
#define netconf_log_error(format, ...) { fprintf(stderr, "\033[1;31m[err/:%5d]\033[0m ", __LINE__); fprintf(stderr, format, ##__VA_ARGS__); fprintf(stderr, "\n"); } #define netconf_log_error(format, ...) { fprintf(stderr, "\033[1;31m[err/:%5d]\033[0m ", __LINE__); fprintf(stderr, format, ##__VA_ARGS__); fprintf(stderr, "\n"); }
// #define netconf_log(format, args...) fprintf(stderr, format, ## args); // #define netconf_log(format, args...) fprintf(stderr, format, ## args);
#define netconf_log(format, ...) { fprintf(stderr, "\033[1m[log/:%5d]\033[0m ", __LINE__); fprintf(stderr, format, ##__VA_ARGS__); fprintf(stderr, "\n"); } #define netconf_log(format, ...) { fprintf(stdout, "\033[1m[log/:%5d]\033[0m ", __LINE__); fprintf(stdout, format, ##__VA_ARGS__); fprintf(stdout, "\n"); }
...@@ -22,7 +22,6 @@ int o1_config_read(o1_config_t* config) { ...@@ -22,7 +22,6 @@ int o1_config_read(o1_config_t* config) {
{"vesBasicAuthPassword", "ves endpoint password to authorize\n", simOpt, strptr:&config->ves_basicauth_password, defstrval:"", TYPE_STRING, 0 }, {"vesBasicAuthPassword", "ves endpoint password to authorize\n", simOpt, strptr:&config->ves_basicauth_password, defstrval:"", TYPE_STRING, 0 },
{"vesNfVendorName", "vendor name information for ves packages\n", simOpt, strptr:&config->ves_nf_vendor_name, defstrval:"OAI", TYPE_STRING, 0 }, {"vesNfVendorName", "vendor name information for ves packages\n", simOpt, strptr:&config->ves_nf_vendor_name, defstrval:"OAI", TYPE_STRING, 0 },
{"vesNfNamingCode", "naming code information for ves packages\n", simOpt, strptr:&config->ves_nf_naming_code, defstrval:"gNodeB", TYPE_STRING, 0 }, {"vesNfNamingCode", "naming code information for ves packages\n", simOpt, strptr:&config->ves_nf_naming_code, defstrval:"gNodeB", TYPE_STRING, 0 },
{"vesOamIpv4", "oam ipv4 information for ves mount package\n", simOpt, strptr:&config->ves_oam_ipv4, defstrval:"", TYPE_STRING, 0 },
{"vesOamIpv6", "oam ipv6 information for ves mount package\n", simOpt, strptr:&config->ves_oam_ipv6, defstrval:"", TYPE_STRING, 0 }, {"vesOamIpv6", "oam ipv6 information for ves mount package\n", simOpt, strptr:&config->ves_oam_ipv6, defstrval:"", TYPE_STRING, 0 },
{"vesFtpServerPort", "ftp server port to serve pm data\n", simOpt, u16ptr:&(config->ves_ftp_server_port), defuintval:21, TYPE_UINT16, 0 }, {"vesFtpServerPort", "ftp server port to serve pm data\n", simOpt, u16ptr:&(config->ves_ftp_server_port), defuintval:21, TYPE_UINT16, 0 },
{"vesFtpServerListenAddress", "ftp listen address to serve pm data\n", simOpt, strptr:&config->ves_ftp_listen_addr, defstrval:"0.0.0.0", TYPE_STRING, 0 }, {"vesFtpServerListenAddress", "ftp listen address to serve pm data\n", simOpt, strptr:&config->ves_ftp_listen_addr, defstrval:"0.0.0.0", TYPE_STRING, 0 },
...@@ -41,7 +40,6 @@ int o1_config_read(o1_config_t* config) { ...@@ -41,7 +40,6 @@ int o1_config_read(o1_config_t* config) {
config->ves_basicauth_password = strdup("sample1"); config->ves_basicauth_password = strdup("sample1");
config->ves_nf_vendor_name = strdup("OpenAirInterface"); config->ves_nf_vendor_name = strdup("OpenAirInterface");
config->ves_nf_naming_code = strdup("OGNB"); config->ves_nf_naming_code = strdup("OGNB");
config->ves_oam_ipv4 = strdup("10.30.40.50");
config->ves_oam_ipv6 = strdup(""); config->ves_oam_ipv6 = strdup("");
config->ves_ftp_server_port = 21; config->ves_ftp_server_port = 21;
config->ves_ftp_listen_addr = strdup("0.0.0.0"); config->ves_ftp_listen_addr = strdup("0.0.0.0");
...@@ -64,7 +62,6 @@ void o1_config_free(o1_config_t* config) { ...@@ -64,7 +62,6 @@ void o1_config_free(o1_config_t* config) {
free(config->ves_basicauth_password); free(config->ves_basicauth_password);
free(config->ves_nf_vendor_name); free(config->ves_nf_vendor_name);
free(config->ves_nf_naming_code); free(config->ves_nf_naming_code);
free(config->ves_oam_ipv4);
free(config->ves_oam_ipv6); free(config->ves_oam_ipv6);
free(config->ves_ftp_listen_addr); free(config->ves_ftp_listen_addr);
} }
...@@ -81,7 +78,6 @@ void o1_config_print(o1_config_t *config) { ...@@ -81,7 +78,6 @@ void o1_config_print(o1_config_t *config) {
netconf_log("ves_password: %s", config-> ves_basicauth_password); netconf_log("ves_password: %s", config-> ves_basicauth_password);
netconf_log("ves_nf_vendor_name: %s", config->ves_nf_vendor_name); netconf_log("ves_nf_vendor_name: %s", config->ves_nf_vendor_name);
netconf_log("ves_nf_naming_code: %s", config->ves_nf_naming_code); netconf_log("ves_nf_naming_code: %s", config->ves_nf_naming_code);
netconf_log("ves_oam_ipv4: %s", config->ves_oam_ipv4);
netconf_log("ves_oam_ipv6: %s", config->ves_oam_ipv6); netconf_log("ves_oam_ipv6: %s", config->ves_oam_ipv6);
netconf_log("ves_ftp_server_port = %d", config->ves_ftp_server_port); netconf_log("ves_ftp_server_port = %d", config->ves_ftp_server_port);
netconf_log("ves_ftp_listen_addr: %s", config->ves_ftp_listen_addr); netconf_log("ves_ftp_listen_addr: %s", config->ves_ftp_listen_addr);
......
...@@ -15,7 +15,6 @@ typedef struct { ...@@ -15,7 +15,6 @@ typedef struct {
char *ves_basicauth_password; char *ves_basicauth_password;
char *ves_nf_vendor_name; char *ves_nf_vendor_name;
char *ves_nf_naming_code; char *ves_nf_naming_code;
char *ves_oam_ipv4;
char *ves_oam_ipv6; char *ves_oam_ipv6;
uint16_t ves_ftp_server_port; uint16_t ves_ftp_server_port;
char *ves_ftp_listen_addr; char *ves_ftp_listen_addr;
......
#pragma once
#include <stdint.h>
#define MAND
#define RO
#define RW
#define KEY
typedef struct oai_alarmRecords_thresholdInfo {
RO MAND char *measurementType;
RO MAND char *direction;
RO char *thresholdLevel;
RO char *thresholdValue;
RO char *hysteresis;
} oai_alarmRecords_thresholdInfo_t;
typedef struct oai_alarmRecords {
RW KEY char *alarmId;
RO MAND char *objectInstance;
RO MAND char *notificationId; //int32_t
RO char *alarmRaisedTime; //yang:date-and-time
RO char *alarmChangedTime; //yang:date-and-time
RO char *alarmClearedTime; //yang:date-and-time
RO char *alarmType; //eventType
RO char *probableCause;
RO char *specificProblem;
RW char *perceivedSeverity; //severity-level
RO char *backedUpStatus;
RO char *backUpObject;
RO char *trendIndication;
RO oai_alarmRecords_thresholdInfo_t *thresholdInfo;
RO char *stateChangeDefinition;
RO char *monitoredAttributes;
RO char *proposedRepairActions;
RO char *additionalText;
// RO char *additionalInformation; <anydata>
RO char *rootCauseIndicator;
RO char *ackTime; //yang:date-and-time
RW char *ackUserId;
RW char *ackSystemId;
RW char *ackState;
RW char *clearUserId;
RW char *clearSystemId;
RO char *serviceUser;
RO char *serviceProvider;
RO char *securityAlarmDetector;
} oai_alarmRecords_t;
typedef struct oai_BWP_ThresholdMonitor {
RW KEY char *id;
RW struct attributes {
RW MAND char *bwpContext;
RW MAND char *isInitialBwp;
RW MAND char *subCarrierSpacing;
RW MAND char *cyclicPrefix;
RW MAND char *startRB;
RW MAND char *numberOfRBs;
};
} oai_BWP_ThresholdMonitor_t;
typedef struct oai_BWP {
RW KEY char *id;
RW struct attributes {
RW MAND char *bwpContext;
RW MAND char *isInitialBwp;
RW MAND char *subCarrierSpacing;
RW MAND char *cyclicPrefix;
RW MAND char *startRB;
RW MAND char *numberOfRBs;
};
RW oai_BWP_ThresholdMonitor_t *ThresholdMonitor;
} oai_BWP_t;
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
#include "utils.h" #include "utils.h"
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/stat.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include "netconf_log.h"
long int get_microseconds_since_epoch(void) { long int get_microseconds_since_epoch(void) {
time_t t = time(0); time_t t = time(0);
...@@ -18,6 +20,28 @@ long int get_microseconds_since_epoch(void) { ...@@ -18,6 +20,28 @@ long int get_microseconds_since_epoch(void) {
return useconds; return useconds;
} }
char *get_netconf_timestamp(void) {
time_t rawtime = time(0);
char *nctime = 0;
if (rawtime == -1) {
netconf_log_error("time() failed");
return 0;
}
else {
struct tm *ptm = gmtime(&rawtime);
if (ptm == 0) {
netconf_log_error("gmtime failed");
}
else {
asprintf(&nctime, "%04d-%02d-%02dT%02d:%02d:%02d.0Z", ptm->tm_year + 1900, ptm->tm_mon + 1,
ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
}
}
return nctime;
}
char *str_replace(const char *orig, const char *rep, const char *with) { char *str_replace(const char *orig, const char *rep, const char *with) {
char *result; // the return string char *result; // the return string
const char *ins; // the next insert point const char *ins; // the next insert point
...@@ -86,3 +110,9 @@ char *get_hostname(void) { ...@@ -86,3 +110,9 @@ char *get_hostname(void) {
gethostname(hostname, 1023); gethostname(hostname, 1023);
return strdup(hostname); return strdup(hostname);
} }
unsigned long int get_file_size(const char *filename) {
struct stat st;
stat(filename, &st);
return st.st_size;
}
#pragma once #pragma once
long int get_microseconds_since_epoch(void); long int get_microseconds_since_epoch(void);
char *get_netconf_timestamp(void);
char *str_replace(const char *orig, const char *rep, const char *with); char *str_replace(const char *orig, const char *rep, const char *with);
char *str_replace_inplace(char *s, const char *rep, const char *with); char *str_replace_inplace(char *s, const char *rep, const char *with);
char *get_hostname(void); char *get_hostname(void);
unsigned long int get_file_size(const char *filename);
This diff is collapsed.
...@@ -35,13 +35,15 @@ typedef struct ves_registration_data { ...@@ -35,13 +35,15 @@ typedef struct ves_registration_data {
typedef struct ves_file_ready { typedef struct ves_file_ready {
char *filename; char *filename;
char *filelocation; char *filelocation;
unsigned long int filesize;
char *expires_on;
} ves_file_ready_t; } ves_file_ready_t;
// //
typedef struct ves_alarm { typedef struct ves_alarm {
char *alarm_name; char *alarm_name;
char *severity; char *severity;
char *alarm_type; char *alarm_type; //TODO: maybe we should think about enum
char *vendor; char *vendor;
char *model; char *model;
} ves_alarm_t; } ves_alarm_t;
...@@ -51,12 +53,21 @@ typedef struct ves_alarm { ...@@ -51,12 +53,21 @@ typedef struct ves_alarm {
#define DOMAIN_PNFALARMING "fault" #define DOMAIN_PNFALARMING "fault"
#define DOMAIN_HEARTBEAT "heartbeat" #define DOMAIN_HEARTBEAT "heartbeat"
#define DOMAIN_PMDATA "measurement" #define DOMAIN_PMDATA "measurement"
#define DOMAIN_STNDDEFINED "stndDefined"
#define EVENTTYPE_PNFREGISTRATION "EventType5G" #define EVENTTYPE_PNFREGISTRATION "EventType5G"
#define EVENTTYPE_PNFALARMING "O_RAN_COMPONENT_Alarms" #define EVENTTYPE_PNFALARMING "O_RAN_COMPONENT_Alarms"
#define EVENTTYPE_PMDATA "Notification-gnb_Nokia-FileReady" #define EVENTTYPE_PMDATA "Notification-gnb_Nokia-FileReady"
#define PRIORITY_PNFREGISTRATION "Low" #define PRIORITY_PNFREGISTRATION "Low"
#define PRIORITY_PNFALARMING "Low" #define PRIORITY_PNFALARMING "Low"
#define PRIORITY_PMDATA "Low" #define PRIORITY_PMDATA "Low"
#define STNDDEF_NAMESPACE_FAULT "3GPP-FaultSupervision"
#define STNDDEF_NAMESPACE_NONE ""
#define VES_ALARM_SEVERITY_CLEARED "CLEARED"
#define VES_ALARM_ALARMTYPE_ALARM "ALARM"
#define VES_ALARM_ALARMTYPE_NONALARM "NON-ALARM"
int ves_init(ves_config_t *config, ves_header_t *header); int ves_init(ves_config_t *config, ves_header_t *header);
void ves_free(); void ves_free();
......
...@@ -53,13 +53,13 @@ static void *ves_demo_alarm_routine(void *arg) { ...@@ -53,13 +53,13 @@ static void *ves_demo_alarm_routine(void *arg) {
}; };
if(alarm_type) { if(alarm_type) {
netconf_log("set alarm"); netconf_log("set alarm");
alarm.severity = "URGENT"; alarm.severity = "MAJOR";
alarm.alarm_type = "ALARM"; alarm.alarm_type = VES_ALARM_ALARMTYPE_ALARM;
} }
else { else {
netconf_log("clear alarm"); netconf_log("clear alarm");
alarm.severity = "NONE"; alarm.severity = VES_ALARM_SEVERITY_CLEARED;
alarm.alarm_type = "NON-ALARM"; alarm.alarm_type = VES_ALARM_ALARMTYPE_NONALARM;
} }
......
...@@ -30,6 +30,11 @@ FROM ran-build:${BASETAG} AS gnb-build ...@@ -30,6 +30,11 @@ FROM ran-build:${BASETAG} AS gnb-build
FROM ran-base:${BASETAG} as ran-dev FROM ran-base:${BASETAG} as ran-dev
RUN apt-get update && \
apt-get install --yes \
openssh-client \
vsftpd
# run dependencies install for netconf # run dependencies install for netconf
RUN ./docker/scripts/netconf_dep_install.sh RUN ./docker/scripts/netconf_dep_install.sh
...@@ -71,6 +76,18 @@ RUN \ ...@@ -71,6 +76,18 @@ RUN \
adduser netconf && \ adduser netconf && \
echo "netconf:netconf!" | chpasswd && \ echo "netconf:netconf!" | chpasswd && \
mkdir -p /home/netconf/.ssh mkdir -p /home/netconf/.ssh
### FTP and SFTP configuration
RUN \
mkdir /ftp && \
chown -R netconf:netconf /ftp && \
mkdir /var/run/vsftpd && \
mkdir /var/run/vsftpd/empty && \
mkdir /run/sshd && \
echo "Match User netconf\n ChrootDirectory /\n X11Forwarding no\n AllowTcpForwarding no\n ForceCommand internal-sftp -d /ftp" >> /etc/ssh/sshd_config
COPY docker/config/vsftpd.conf /etc/vsftpd.conf
COPY docker/config/vsftpd.userlist /etc/vsftpd.userlist
# # Initialize netopeer2 # # Initialize netopeer2
RUN \ RUN \
......
...@@ -60,8 +60,10 @@ RUN apt-get update && \ ...@@ -60,8 +60,10 @@ RUN apt-get update && \
python3-requests \ python3-requests \
libusb-1.0-0 \ libusb-1.0-0 \
# libyang/sysrepo/netopeer2 # libyang/sysrepo/netopeer2
psmisc \
libpcre2-8-0 \ libpcre2-8-0 \
openssh-client && \ openssh-client \
vsftpd && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-gnb/bin WORKDIR /opt/oai-gnb/bin
...@@ -118,6 +120,7 @@ COPY --from=gnb-build \ ...@@ -118,6 +120,7 @@ COPY --from=gnb-build \
COPY --from=gnb-build /usr/local/sbin/netopeer2-server /usr/local/sbin/netopeer2-server COPY --from=gnb-build /usr/local/sbin/netopeer2-server /usr/local/sbin/netopeer2-server
COPY --from=gnb-build \ COPY --from=gnb-build \
/usr/local/lib/libcurl.so \
/usr/local/lib/libnetconf2.so \ /usr/local/lib/libnetconf2.so \
/usr/local/lib/libssh.so \ /usr/local/lib/libssh.so \
/usr/local/lib/libsysrepo.so \ /usr/local/lib/libsysrepo.so \
...@@ -138,11 +141,26 @@ RUN \ ...@@ -138,11 +141,26 @@ RUN \
echo "netconf:netconf!" | chpasswd && \ echo "netconf:netconf!" | chpasswd && \
mkdir -p /home/netconf/.ssh mkdir -p /home/netconf/.ssh
### FTP and SFTP configuration
RUN \
mkdir /ftp && \
chown -R netconf:netconf /ftp && \
mkdir /var/run/vsftpd && \
mkdir /var/run/vsftpd/empty && \
mkdir /run/sshd && \
echo "Match User netconf\n ChrootDirectory /\n X11Forwarding no\n AllowTcpForwarding no\n ForceCommand internal-sftp -d /ftp" >> /etc/ssh/sshd_config
COPY docker/config/vsftpd.conf /etc/vsftpd.conf
COPY docker/config/vsftpd.userlist /etc/vsftpd.userlist
# # Initialize netopeer2 # # Initialize netopeer2
RUN \ RUN \
/usr/local/share/netopeer2/merge_hostkey.sh && \ /usr/local/share/netopeer2/merge_hostkey.sh && \
/usr/local/share/netopeer2/merge_config.sh /usr/local/share/netopeer2/merge_config.sh
COPY docker/scripts/gnb_entrypoint.sh /opt/oai-gnb/bin/entrypoint.sh COPY docker/scripts/gnb_entrypoint.sh /opt/oai-gnb/bin/entrypoint.sh
WORKDIR /opt/oai-gnb WORKDIR /opt/oai-gnb
#EXPOSE 2152/udp # S1U, GTP/UDP #EXPOSE 2152/udp # S1U, GTP/UDP
#EXPOSE 22100/tcp # ? #EXPOSE 22100/tcp # ?
......
listen=NO
listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
pasv_enable=Yes
pasv_min_port=10000
pasv_max_port=11000
user_sub_token=$USER
local_root=/ftp
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
pasv_promiscuous=YES
allow_writeable_chroot=YES
# rsa_cert_file=/home/netconf/.ssh/melacon.server.crt
# rsa_private_key_file=/home/netconf/.ssh/melacon.server.key
# ssl_enable=YES
# allow_anon_ssl=NO
# force_local_data_ssl=YES
# force_local_logins_ssl=YES
# ssl_tlsv1=YES
# ssl_sslv2=NO
# ssl_sslv3=NO
# require_ssl_reuse=NO
# ssl_ciphers=HIGH
\ No newline at end of file
...@@ -73,12 +73,18 @@ elif [[ -v USE_N3XX ]]; then ...@@ -73,12 +73,18 @@ elif [[ -v USE_N3XX ]]; then
fi fi
# enable printing of stack traces on assert # enable printing of stack traces on assert
export gdbStacks=1 export gdbStacks=0
if $ENABLE_NETCONF; then if $ENABLE_NETCONF; then
echo "clearing shared memory for sysrepo"
rm -rf /dev/shm/sr*
if [ $? -eq 0 ]; then
echo "succeeded"
else
echo "failed"
fi
echo "==================================" echo "=================================="
echo "== starting netconf server in background" echo "== starting netconf server in background"
netopeer2-server -d -v2 & netopeer2-server -v2 -d &
fi fi
echo "==================================" echo "=================================="
......
...@@ -527,7 +527,7 @@ int main( int argc, char **argv ) { ...@@ -527,7 +527,7 @@ int main( int argc, char **argv ) {
//netconf //netconf
netconf_init(); netconf_init();
netconf_test();
set_softmodem_sighandler(); set_softmodem_sighandler();
#ifdef DEBUG_CONSOLE #ifdef DEBUG_CONSOLE
...@@ -733,6 +733,7 @@ int main( int argc, char **argv ) { ...@@ -733,6 +733,7 @@ int main( int argc, char **argv ) {
} }
logClean(); logClean();
netconf_free();
printf("Bye.\n"); printf("Bye.\n");
return 0; return 0;
} }
# Integration # Integration
## How to build gNodeB image
We created a script which is doing the same as the instructions inside of the docker folder.
```
./build-gnb-docker.sh --base --build --gnb
```
If the base is already created once, only ```--build``` and ```--gnb``` args are neccessary.
## How to run ## How to run
### Prerequisites ### Prerequisites
...@@ -24,6 +34,8 @@ docker-compose up -d ...@@ -24,6 +34,8 @@ docker-compose up -d
docker-compose -f docker-compose.gnb.yml up -d docker-compose -f docker-compose.gnb.yml up -d
``` ```
depending on if VES is configured or not you have to mount the device manually.
### Go to ODLUX gui ### Go to ODLUX gui
* Open URL in the browser: http://your-deployed-ip-address:8181 * Open URL in the browser: http://your-deployed-ip-address:8181
...@@ -38,6 +50,23 @@ docker-compose -f docker-compose.gnb.yml up -d ...@@ -38,6 +50,23 @@ docker-compose -f docker-compose.gnb.yml up -d
* now the node should get into the connected state * now the node should get into the connected state
## Using ODLUX Gui
By default this is available on ```http://localhost:8080```. Default user credentials are username ```admin``` and password ```admin```. The password is configured in the .env file ```ADMIN_PASSWORD```.
On an already started OAI gNodeB you should already see the an entry in the ConnectApp in state ```Connected```. The node-id is corresponding with the gnb.conf of the device. By right-click on it you can see in the context menu ```Info``` all the supported yang specifications, this device is supporting.
If the gnb.conf property ```demoAlarmingInterval``` is set, you should also see an alarm inside of the FaultApp. There you have also a tab ```Alarm Log``` which shows the complete history of incoming alarms into the SDNC.
HINT: If you want to see Notifications as they are coming into the SDNC you have to enable Notifications. Therefore you have to click on your username on the top right corner and then go to settings. There you can enable and disable it. It is disabled by default to prevent flooding the browser with incoming messages, which can cause some instability.
In the ConfigurationApp you are able to read and write configuration from and to the device. Sadly up to now there is a bug in the opendaylight project which is preventing to access a List of objects in the root structure, which is the way 3GPP has designed their Models. Since we are just implementing one root element this list has now the size of one, we have to access this by url and cannot click through from beginning.
```
http://localhost:8080/odlux/index.html#/configuration/{node-id}/_3gpp-common-managed-element:ManagedElement[OAI%20gNodeB]
```
But from there on you have access to all the containers and leafs inside.
## Troubleshooting ## Troubleshooting
...@@ -56,3 +85,36 @@ docker-compose -f docker-compose.gnb.yml up -d ...@@ -56,3 +85,36 @@ docker-compose -f docker-compose.gnb.yml up -d
less /opt/opendaylight/data/log/karaf.log less /opt/opendaylight/data/log/karaf.log
go to the end of the log (SHIFT+G) and then upwards to search for exceptions/stacktraces (e.g. wrong username or password) go to the end of the log (SHIFT+G) and then upwards to search for exceptions/stacktraces (e.g. wrong username or password)
``` ```
### Node does not even show up after started up
* check the gnb.conf if ```vesUrl``` is correct
* check the VES-Collector if message is coming in
```
$ docker logs -f dcae-ves-collector
```
* there should be a log with something like
```
2023-03-20 13:12:59.697 INFO 28 [nio-8443-exec-5] o.o.d.c.p.MessageRouterHttpStatusMapper : Successfully send event to MR
```
* if not please check the gnb logs
* if yes please make sure that all components of the docker-compose.yml are up running
```
$ docker-compose ps -a
Name Command State Ports
-------------------------------------------------------------------------------------------------------------------------
dcae-dfc java -jar /opt/app/datafil ... Up 8100/tcp, 8433/tcp
dcae-pm-mapper java -jar pm-mapper-1.10.0.jar Up
dcae-ves-collector /bin/sh -c bin/docker-entry.sh Up 8080/tcp, 8443/tcp
dmaap-dr-mariadb docker-entrypoint.sh mysqld Up (healthy) 3306/tcp
dmaap-dr-node sh startup.sh Up 8080/tcp, 8443/tcp
dmaap-dr-prov sh startup.sh Up (healthy) 8080/tcp, 8443/tcp
dmaap-kafka /etc/confluent/docker/run Up 9092/tcp, 9093/tcp
dmaap-message-router sh startup.sh Up 3904/tcp, 3905/tcp
dmaap-zookeeper /etc/confluent/docker/run Up 2181/tcp, 2888/tcp, 3888/tcp
sdnc /bin/sh -c /opt/onap/sdnc/ ... Up 1090/tcp, 1099/tcp, 8181/tcp
sdnc-web /opt/bitnami/scripts/nginx ... Up 0.0.0.0:8080->8080/tcp,:::8080->8080/tcp, 8443/tcp
sdnrdb /tini -- /usr/local/bin/do ... Up 9200/tcp, 9300/tcp
```
{
"destination":"/opt/app/VESCollector/etc/externalRepo",
"repositories":[
{
"url":"https://forge.3gpp.org/rep/sa5/MnS.git",
"branch":"Rel-18"
}
]
}
\ No newline at end of file
{ {
"ves-pnfRegistration": { "ves-syslog": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_PNFREG_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-statechange": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-thresholdCrossingAlert": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-heartbeat": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT/"
}
},
"ves-other": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_OTHER_OUTPUT/"
}
},
"ves-mobileflow": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-sipsignaling": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-voicequality": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-fault": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_FAULT_OUTPUT/"
}
},
"ves-measurement": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT/"
}
}, },
"ves-3gpp-fault-supervision": { "ves-3gpp-fault-supervision": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT/"
}
}, },
"ves-notification": { "ves-3gpp-provisioning": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT/"
}
}, },
"ves-3gpp-heartbeat": { "ves-3gpp-heartbeat": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT/"
}
}, },
"ves-3gpp-performance-assurance": { "ves-3gpp-performance-assurance": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT/"
}
}, },
"ves-3gpp-provisioning": { "ves-syslog-secondary": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
}, },
"ves-fault": { "ves-statechange-secondary": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_FAULT_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
}, },
"ves-heartbeat": { "ves-thresholdCrossingAlert-secondary": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
}, },
"ves-other": { "ves-heartbeat-secondary": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_OTHER_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
}, },
"ves-measurement": { "ves-other-secondary": {
"dmaap_info": {"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT"}, "type": "message_router",
"type": "message_router" "dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-mobileflow-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-sipsignaling-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTSves7_valid_ip_v4.json-DEV"
}
},
"ves-voicequality-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-fault-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-measurement-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-3gpp-fault-supervision-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT"
}
},
"ves-3gpp-provisioning-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT"
}
},
"ves-3gpp-heartbeat-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-3gpp-performance-assurance-secondary": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/DCAE-SE-COLLECTOR-EVENTS-DEV"
}
},
"ves-pnfRegistration": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_PNFREG_OUTPUT/"
}
},
"ves-o1-notify-pnf-registration": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_O1_NOTIFY_PNF_REGISTRATION_OUTPUT/"
}
},
"ves-o-ran-sc-du-hello-world-pm-streaming-oas3": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_O_RAN_SC_HELLO_WORLD_PM_STREAMING_OUTPUT/"
}
},
"ves-file-ready": {
"type": "message_router",
"dmaap_info": {
"location": "mtl5",
"topic_url": "http://dmaap-message-router:3904/events/unauthenticated.VES_FILE_READY_OUTPUT/"
}
} }
} }
\ No newline at end of file
ARG BASEIMAGE=nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.8.0
FROM ubuntu:22.04 AS stage-0
ARG DLREPO=https://forge.3gpp.org/rep/sa5/MnS.git
ARG DLBRANCH=Rel-18
RUN apt update && apt install -y python3 git
COPY install.py /
RUN python3 install.py $DLREPO $DLBRANCH /opt/app/VESCollector/etc/externalRepo
FROM ${BASEIMAGE}
COPY --from=stage-0 --chown=vescollector:vescollector /opt/app/VESCollector/etc/externalRepo /opt/app/VESCollector/etc/externalRepo
#!/usr/bin/python3
import sys
import os
import subprocess
import json
import re
from typing import List
class Installer:
def __init__(self, url, branch, dstFolder) -> None:
self.downloadUrl = url
self.publicUrlFormat = self.createPublicUrlFormat(url, branch)
print(f'fmt={self.publicUrlFormat}')
self.branch = branch
self.baseFolder = dstFolder
self.subfolder = self.createSubFolder(url, branch)
def createPublicUrlFormat(self, url:str, branch:str)->str:
if url.endswith('.git'):
url = url[:-4]
if url.startswith('git@'):
url = 'https://'+url[4:]
fmt=url+'/raw/'+branch+'/{}'
return fmt
def createSubFolder(self, gitUrl:str, branch:str) -> str:
regex = r"^[^\/]+\/\/(.*)$"
matches = re.finditer(regex, gitUrl)
match = next(matches)
name = match.group(1)
if name.endswith('.git'):
name=name[:-4]
tmp:List[str]=[]
hlp1 = name.split('/')
for h in hlp1:
if '.' in h:
hlp2=h.split('.')
for h2 in hlp2:
tmp.append(h2)
else:
tmp.append(h)
return '/'.join(tmp)+'/'+branch
def getDstFolder(self)->str:
return f'{self.baseFolder}/{self.subfolder}'
def exec(self, cmd:str):
output = subprocess.Popen(
cmd, shell=True, stdout=subprocess.PIPE).stdout.read()
return output
def download(self) -> bool:
print(f'try to download repo {self.downloadUrl} to {self.getDstFolder()}')
self.exec(f'git clone --single-branch --branch {self.branch} {self.downloadUrl} {self.getDstFolder()}')
def getFilesFiltered(self, lst:List[str]=None, path=None, root=None, filter=['yaml','yml'])->List[str]:
if lst is None:
lst=[]
if root is None:
root=str(self.getDstFolder())
if path is None:
path=self.getDstFolder()
if os.path.exists(path) and os.path.isdir(path):
# Iterate over all files and directories in the given path
for filename in os.listdir(path):
if filename.startswith("."):
continue
fmatch=False
# Get the absolute path of the file/directory
abs_path = os.path.join(path, filename)
# If it is a directory, recursively call this function on it
if os.path.isdir(abs_path):
self.getFilesFiltered(lst=lst, path=abs_path, root=root, filter=filter )
# If it is a file, print its absolute path
elif os.path.isfile(abs_path):
for fi in filter:
if abs_path.endswith(fi):
fmatch=True
break
if not fmatch:
continue
relpath=abs_path[len(root)+1:]
lst.append(relpath)
return lst
def urlAlreadyInData(self, data:List[dict], pubUrl:str, key='publicURL'):
for item in data:
if key in item and item[key]==pubUrl:
return True
return False
def createSchemaMap(self):
schemaMapFile = f'{self.baseFolder}/schema-map.json'
if os.path.isfile(schemaMapFile):
with open(schemaMapFile) as fp:
data = json.load(fp)
else:
data:List[dict] = []
files = self.getFilesFiltered()
for file in files:
print(file)
pubUrl = self.publicUrlFormat.format(file)
if self.urlAlreadyInData(data,pubUrl):
print(f'entry with url {pubUrl} already exists. ignoring')
continue
data.append({
'publicURL': pubUrl,
'localURL': f'{self.subfolder}/{file}'
})
with open(schemaMapFile,'w') as fp:
json.dump(data,fp)
def printHelp():
print("Installation script for VES additional formats")
print(" usage: ")
print(" install.py DOWNLOAD-REPO BRANCH DESTINATION-FOLDER")
args = sys.argv
args.pop(0)
if len(args)<3:
print(f'bad parameters ${args}')
printHelp()
exit(1)
dlRepo = args.pop(0)
dlBranch = args.pop(0)
dst = args.pop(0)
installer = Installer(dlRepo, dlBranch, dst)
installer.download()
installer.createSchemaMap()
\ No newline at end of file
...@@ -12,7 +12,9 @@ services: ...@@ -12,7 +12,9 @@ services:
- ENABLE_NETCONF=true - ENABLE_NETCONF=true
volumes: volumes:
- /dev:/dev - /dev:/dev
- ./gNodeB/gnb.conf:/opt/oai-gnb/etc/mounted.conf # - ./gNodeB/gnb.conf:/opt/oai-gnb/etc/mounted.conf:ro
- ./gNodeB/gnb.conf:/opt/oai-gnb/etc/gnb.conf
- ./gNodeB/ftp:/ftp
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem"
......
...@@ -89,7 +89,12 @@ services: ...@@ -89,7 +89,12 @@ services:
- ./dcae/pm_mount_config.yaml:${PM_MAPPER_TARGET_CONFIG_PATH} - ./dcae/pm_mount_config.yaml:${PM_MAPPER_TARGET_CONFIG_PATH}
- ./dcae/certs:/opt/app/pm-mapper/etc/certs/ - ./dcae/certs:/opt/app/pm-mapper/etc/certs/
dcae-ves-collector: dcae-ves-collector:
image: ${DCAE_VES_COLLECTOR_IMAGE} # image: ${DCAE_VES_COLLECTOR_IMAGE}
image: ${DCAE_VES_COLLECTOR_IMAGE}-modified
build:
context: ./dcae/ves-image
args:
- BASEIMAGE=${DCAE_VES_COLLECTOR_IMAGE}
container_name: dcae-ves-collector container_name: dcae-ves-collector
environment: environment:
DMAAPHOST: dmaap DMAAPHOST: dmaap
...@@ -112,7 +117,7 @@ services: ...@@ -112,7 +117,7 @@ services:
volumes: volumes:
- ./dcae/collector.properties:/opt/app/VESCollector/etc/collector.properties - ./dcae/collector.properties:/opt/app/VESCollector/etc/collector.properties
- ./dcae/ves-dmaap-config.json:/opt/app/VESCollector/etc/ves-dmaap-config.json - ./dcae/ves-dmaap-config.json:/opt/app/VESCollector/etc/ves-dmaap-config.json
- ./dcae/externalRepo:/opt/app/VESCollector/etc/externalRepo # - ./dcae/externalRepo:/opt/app/VESCollector/etc/externalRepo
dcae-dfc: dcae-dfc:
image: ${DCAE_DFC_IMAGE} image: ${DCAE_DFC_IMAGE}
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Sample PM File. All values are hypothetical but syntactically correct -->
<measCollecFile xmlns="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec">
<fileHeader fileFormatVersion="32.435 v6.1" vendorName="Open Air Interface" dnPrefix="SubNetwork=1">
<fileSender elementType="Element Manager" localDn="OMC_PS=10"/>
<measCollec beginTime="2023-03-20T13:00:00+00:00"/>
</fileHeader>
<measData>
<managedElement localDn="ManagedElement=OAI gNodeB" userLabel="SGSN" swVersion="R30.1.5"/>
<measInfo measInfoId="Category A">
<job jobId="01"/>
<granPeriod endTime="2023-03-20T13:15:00+00:00" duration="PT900S"/>
<repPeriod duration="PT1800S"/>
<measTypes>MM.AttGprsAttach MM.SuccGprsAttach MM. AbortedGprsAttach MM.AttIntraSgsnRaUpdate</measTypes>
<measValue measObjLdn="SgsnFunction=1">
<measResults>10 20 30 40</measResults>
</measValue>
</measInfo>
<measInfo measInfoId="Category B">
<job jobId="02"/>
<granPeriod endTime="2023-03-20T13:15:00+00:00" duration="PT900S"/>
<repPeriod duration="PT1800S"/>
<measTypes>MM.AttCombiAttach MM.SuccCombiAttach MM. MM.AbortedCombiAttachMM.AttCombiDetachMs</measTypes>
<measValue measObjLdn="SgsnFunction=2">
<measResults>10 20 30 40</measResults>
</measValue>
</measInfo>
<measInfo measInfoId="Category C">
<job jobId="03"/>
<granPeriod endTime="2023-03-20T13:15:00+00:00" duration="PT1800S"/>
<repPeriod duration="PT900S"/>
<measTypes>MM.AttPsPagingProcIu MM.SuccPsPagingProcIu</measTypes>
<measValue measObjLdn="SgsnFunction=3">
<measResults>25 25</measResults>
</measValue>
</measInfo>
</measData>
<fileFooter>
<measCollec endTime="2023-03-20T13:15:00+00:00"/>
</fileFooter>
</measCollecFile>
...@@ -274,7 +274,7 @@ o1Config : ...@@ -274,7 +274,7 @@ o1Config :
vesOamIpv6 = ""; vesOamIpv6 = "";
vesFtpServerPort = 21; vesFtpServerPort = 21;
vesFtpServerListenAddress = "0.0.0.0"; vesFtpServerListenAddress = "0.0.0.0";
demoAlarmingInterval = 0; demoAlarmingInterval = 30;
}; };
log_config : log_config :
......
set -o xtrace
$GATEWAY_IP=
echo "Setup data router"
docker exec -i datarouter-prov sh -c "curl -X PUT http://dmaap-dr-prov:8080/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$GATEWAY_IP -v"
docker exec -i datarouter-prov sh -c "curl -X PUT http://dmaap-dr-prov:8080/internal/api/NODES?val=dmaap-dr-node\|$GATEWAY_IP -v"
echo "Create data router feed for pmmapper"
curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @./pm-bulk/createFeed.json --post301 --location-trusted -k http://localhost:$DMAAP_DR_PROV_PORT_2
echo "Subscriber pmmaper to data-router feed"
curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @./pm-bulk/addSubscriber.json --post301 --location-trusted -k http://localhost:$DMAAP_DR_PROV_PORT_2/subscribe/1
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment