Initial integration version of the RIC Subscription Manager
[ric-plt/submgr.git] / README.md
1 # Subscription Manager
2
3 ## Table of contents
4 * [Introduction](#introduction)
5 * [Release notes](#release-notes)
6 * [Prerequisites](#prerequisites)
7 * [Project folders structure](#project-folders-structure)
8 * [Installation guide](#installation-guide)
9   * [Compiling code](#compiling-code)
10   * [Building docker container](#building-docker-container)
11   * [Installing Routing Manager](#installing-routing-manager)
12   * [Testing and Troubleshoting](#testing-and-troubleshoting)
13 * [Upcoming changes](#upcoming-changes)
14 * [License](#license)
15
16 ## Introduction
17 __Subscription Manager__ is a basic platform service of RIC. It is responsible to serve, coordinate and manage xApps' subscriptions.
18
19 Submgr acts as an anchor point for subscription related internal messaging, i.e. every xApp sends its subscription related messages to Submgr. Submgr invokes Routing Manager (Rtmgr) to create or tear down the subscription related routes, and the appropriate E2 Termination to signal the subscription related event also towards the RAN.
20
21 The solution base on the [xapp-frame](https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/xapp-frame) project which provides common HttpREST, RMR and SDL interfaces.
22
23 Current implementation provides the following functionalities:
24 * Handling RIC_SUB_REQ and RIC_SUB_RESP type RMR messages 
25 * Generating New subscription ID and forwarding subscription request to E2 termination
26 * Receiving Subscription response and sendig it back to the subscriber
27   
28 ## Release notes
29 Check the separated `RELNOTES` file.
30
31 ## Prerequisites
32 * Healthy kubernetes cluster
33 * Access to the common docker registry
34
35 ## Project folder structure
36 * /build: contains build tools (scripts, Dockerfiles, etc.)
37 * /manifest: contains deployment files (Kubernetes manifests, Helm chart)
38 * /cmd: contains go project's main file
39 * /pkg: contains go project's internal packages
40 * /config: contains default configuration file for the service
41 * /test: contains CI/CD testing files (scripts, mocks, manifests)
42
43 ## Installation guide
44
45 ### Compiling code
46 Enter the project root and execute `./build.sh` script.
47 The build script has two main phases. First is the code compilation, where it creates a temporary container for downloading all dependencies then compiles the code. In the second phase it builds the production ready container and taggs it to `submgr:builder`
48
49 **NOTE:** The script puts a copy of the binary into the `./bin` folder for further use cases
50
51 ### Installing Subscription Manager
52 #### Preparing environment
53 Tag the `submgr` container according to the project release and push it to a registry accessible from all minions of the Kubernetes cluster.
54 Edit the container image section of `submgr-dep.yaml` file according to the `submgr` image tag.
55
56 #### Deploying Subscription Manager 
57 Issue the `kubectl create -f {manifest.yaml}` command in the following order
58   1. `manifests/namespace.yaml`: creates the `example` namespace for routing-manager resources
59   2. `manifests/submgr/submgr-dep.yaml`: instantiates the `submgr` deployment in the `example` namespace
60   3. `manifests/submgr/submgr-svc.yaml`: creates the `submgr` service in `example` namespace
61
62 ### Testing and Troubleshoting
63 Subscription Manager's behaviour can be tested using the stub xApp (called RCO) and the stub E2 Termination (called E2T) on the following way.
64
65   1. [Compile](#compiling-code) and [Installing subscription manager](#installing-subscription-manager)
66   2  Enter `./test/dbaas` folder and issue `kubectl apply -f ./manifests`
67   3. Enter `./test/e2t/` folder and run `build.sh`. After docker image successfully built, issue `kubectl apply -f ./manifests`
68   4. Enter `./test/rco/` folder and run `build.sh`. After docker image successfully built, issue `kubectl apply -f ./manifests`
69   5. Configure RMR routes accordingly
70
71 Test scenario:
72   1. RCO alternately sends Subscription Request (12010) and other (10000) type of messages towards SUBMGR. (non ASN1 code/decode)
73   2. SUBMGR receives RCO's subscription request and generates a new ID for the given request and puts it in the header of RMR messages to be forwareded to E2T
74   3. E2T receives the Subscription Request message and sends a Subscription Response to SUBMGR
75   4. SUBMGR accepts the Subscirption Response and forwards it to RCO
76
77
78 ## Configuration and Troubleshooting
79 Basic configuration file provided in `./config/` folder. Consult xapp-frame project documentation for custom configuration settings.
80
81 ## Upcoming changes
82 [] ASN1 support
83
84 ## License
85 This project is licensed under the Apache License, Version 2.0 - see the [LICENSE](LICENSE)
86